Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcParmList.cxx
Go to the documentation of this file.
1
41#define INCLUDESTR "#include"
42
43#include "TObjArray.h"
44#include "TObjString.h"
45#include "TSystem.h"
46
47#include "THcParmList.h"
48#include "THaVar.h"
49#include "THaFormula.h"
50
51#include "TMath.h"
52
53/* #incluce <algorithm> include <fstream> include <cstring> */
54#include <iostream>
55#include <fstream>
56#include <cassert>
57#include <cstdlib>
58#include <stdexcept>
59#include <memory>
60
61using namespace std;
62Int_t fDebug = 1; // Keep this at one while we're working on the code
63
64#if __cplusplus < 201103L
65# define SMART_PTR auto_ptr
66#else
67# define SMART_PTR unique_ptr
68#endif
69
71
72
74{
75 TextList = new Podd::Textvars;
76}
77
78inline static bool IsComment( const string& s, string::size_type pos )
79{
80 return ( pos != string::npos && pos < s.length() &&
81 (s[pos] == '#' || s[pos] == ';' || s.substr(pos,2) == "//") );
82}
83
84void THcParmList::Load( const char* fname, Int_t RunNumber )
85{
124 static const char* const whtspc = " \t";
125
126 ifstream ifiles[100]; // Should use stack instead
127
128 Int_t nfiles=0;
129 ifiles[nfiles].open(fname);
130 if(ifiles[nfiles].is_open()) {
131 cout << "Opening parameter file: [" << nfiles << "] " << fname << endl;
132 nfiles++;
133 }
134
135 if(!nfiles) {
136 static const char* const here = "THcParmList::LoadFromFile";
137 Error (here, "error opening parameter file %s",fname);
138 return; // Need a success argument returned
139 }
140
141 string line;
142 char varname[100];
143 Int_t InRunRange;
144 Int_t currentindex = 0;
145 Int_t linecount=0; // Count of non comment/blank lines
146
147 varname[0] = '\0';
148
149 if(RunNumber > 0) {
150 InRunRange = 0; // Wait until run number range matching RunNumber is found
151 cout << "Reading Parameters for run " << RunNumber << endl;
152 } else {
153 InRunRange = 1; // Interpret all lines
154 }
155
156 while(nfiles) {
157 string current_comment;
158 // EJB_Note: existing_comment is never used.
159 // string existing_comment("");
160 string::size_type start, pos = 0;
161
162 if(!getline(ifiles[nfiles-1],line)) {
163 ifiles[nfiles-1].close();
164 nfiles--;
165 // cout << nfiles << ": " << "Closed" << endl;
166 continue;
167 }
168 // Look for include statement
169 if(line.compare(0,strlen(INCLUDESTR),INCLUDESTR)==0) {
170 line.erase(0,strlen(INCLUDESTR));
171 pos = line.find_first_not_of(whtspc);
172 // Strip leading white space
173 if(pos != string::npos && pos > 0 && pos < line.length()) {
174 line.erase(0,pos);
175 }
176 char quotechar=line[0];
177 if(quotechar == '"' || quotechar == '\'') {
178 line.erase(0,1);
179 line.erase(line.find_first_of(quotechar));
180 } else {
181 line.erase(line.find_first_of(whtspc));
182 }
183 // cout << line << endl;
184 ifiles[nfiles].open(line.c_str());
185 if(ifiles[nfiles].is_open()) {
186 cout << "Opening parameter file: [" << nfiles << "] " << line << endl;
187 nfiles++;
188 }
189 continue;
190 }
191
192 // Blank line or comment?
193 if( line.empty()
194 || (start = line.find_first_not_of( whtspc )) == string::npos
195 || IsComment(line, start) )
196 continue;
197
198 // Get rid of trailing comments and leading and trailing whitespace
199 // Need to save the comment and put it in the thVar
200
201 while( (pos = line.find_first_of("#;/", pos+1)) != string::npos ) {
202 if( IsComment(line, pos) ) {
203 current_comment.assign(line,pos+1,line.length());
204 line.erase(pos); // Strip off comment
205 // Strip leading white space from comment
206 //cout << "CommentA: " << current_comment << endl;
207 pos = current_comment.find_first_not_of(whtspc);
208 if(pos!=string::npos && pos > 0 && pos < current_comment.length()) {
209 current_comment.erase(0,pos);
210 }
211 //cout << "CommentB: " << current_comment << endl;
212 break;
213 }
214 }
215 pos = line.find_last_not_of( whtspc );
216 assert( pos != string::npos );
217 if( pos != string::npos && ++pos < line.length() )
218 line.erase(pos);
219 pos = line.find_first_not_of(whtspc);
220 // Strip leading white space
221 if(pos != string::npos && pos > 0 && pos < line.length()) {
222 line.erase(0,pos);
223 }
224 // Ignore begin and end statements
225 if(line.compare(0,5,"begin")==0 ||
226 line.compare(0,3,"end")==0) {
227 cout << "Skipping: " << line << endl;
228 continue;
229 }
230
231 // Get rid of all white space not in quotes
232 // Step through one char at a time
233 pos = 0;
234 int inquote=0;
235 char quotechar=' ';
236 // cout << "Unstripped line: |" << line << "|" << endl;
237 while(pos<line.length()) {
238 if(inquote) {
239 if(line[pos++] == quotechar) { // Possibly end of quoted string
240 if(line[pos] == quotechar) { // Protected quote
241 pos++; // Skip the protected quote
242 } else { // End of quoted string
243 inquote = 0;
244 quotechar = ' ';
245 pos++;
246 }
247 }
248 } else {
249 if(line[pos] == ' ' || line[pos] == '\t') {
250 line.erase(pos,1);
251 } else if(line[pos] == '"' || line[pos] == '\'') {
252 quotechar = line[pos++];\
253 inquote = 1;
254 } else {
255 pos++;
256 }
257 }
258 }
259 // cout << "Stripped line: |" << line << "|" << endl;
260
261 // Need to do something to bug out if line is empty
262
263 // If in Engine database mode, check if line is a number range AAAA-BBBB
264 linecount++;
265 // If RunNumber>0 and first line we encounter is not a run range, need to
266 // print an error
267 if(RunNumber>0 && nfiles==1) {
268 if(line.find_first_not_of("0123456789-,")==string::npos) { // Interpret as runnum range
269 // Interpret line as a list of comma separated run numbers or ranges
270 TString runnums(line.c_str());
271 SMART_PTR<TObjArray> runnumarr( runnums.Tokenize(",") );
272 Int_t nranges=runnumarr->GetLast()+1;
273
274 InRunRange = 0;
275 Int_t ind;
276 for(Int_t i=0;i<nranges;i++) {
277 TString runstr = ((TObjString *)runnumarr->At(i))->GetString();
278 if(runstr.IsDec()) { // A single run number
279 if(RunNumber == runstr.Atoi()) {
280 InRunRange = 1;
281 break;
282 }
283 } else if ((ind=runstr.First('-'))>=0) { // A run range
284 TString start=runstr(0,ind);
285 TString end=runstr(ind+1,runstr.Length());
286 if(start.IsDec() && end.IsDec()) {
287 if((RunNumber >= start.Atoi()) && (RunNumber <= end.Atoi())) {
288 InRunRange = 1;
289 break;
290 }
291 }
292 }
293 }
294 continue; // Skip to next line
295 } else {
296 if(linecount==1) {
297 cout << "WARNING: THcParmList::Load in database mode but first line is not" << endl;
298 cout << " a run number or run number range. Parameter definitions" << endl;
299 cout << " will be ignored until a run number or range is specified." << endl;
300 }
301 }
302 }
303
304 if(!InRunRange) continue;
305
306 // Interpret left of = as var name
307 Int_t valuestartpos=0; // Stays zero if no = found
308 Int_t ttype = 0; // Are any of the values floating point?
309 if((pos=line.find_first_of('='))!=string::npos) {
310 strcpy(varname, (line.substr(0,pos)).c_str());
311 valuestartpos = pos+1;
312 currentindex = 0;
313 }
314
315 // If first char after = is a quote, then this is a string assignment
316 if(line[valuestartpos] == '"' || line[valuestartpos] == '\'') {
317 quotechar = line[valuestartpos++];
318 // Scan until end of line or terminating quote
319 // valuestartpos++;
320 pos = valuestartpos;
321 while(pos<line.length()) {
322 if(line[pos++] == quotechar) { // Possibly end of quoted string
323 if(line[pos] == quotechar) { // Protected quote
324 pos++;
325 } else {
326 pos--;
327 break;
328 }
329 }
330 }
331 if(TextList) {
332 // Should check that a numerical assignment doesn't exist, but for
333 // now, the same variable name can be used for strings and numbers
334 string varnames(varname);
335 AddString(varnames, line.substr(valuestartpos,pos-valuestartpos));
336 }
337 continue;
338 }
339
340 TString values((line.substr(valuestartpos)).c_str());
341 TObjArray *vararr = values.Tokenize(",");
342 Int_t nvals = vararr->GetLast()+1;
343
344 Int_t* ip=nullptr;
345 Double_t* fp=nullptr;
346 // or expressions
347 for(Int_t i=0;(ttype==0&&i<nvals);i++) {
348 TString valstr = ((TObjString *)vararr->At(i))->GetString();
349 if(valstr.IsFloat()) { // Is a number
350 if(valstr.Contains(".") || valstr.Contains("e",TString::kIgnoreCase)) {
351 ttype = 1;
352 break;
353 }
354 } else {
355 ttype = 2; // Force float if expression or Var
356 break;
357 }
358 }
359
360 // New pseudo code
361 // currentindex = where next item goes
362 // nvals = number of new items on line
363 // newlength = curentindex+nvals
364
365 // if (variable already exists) (valuestartpos is 0 or a find succeeded)
366 // get existinglegnth
367 // if (existinglength > newlength && type doesn't change) {
368 // copy nvals values directly into array
369 // else
370 // make new longer array of length max(existinglength, newlength)
371 // copy existinglength values into longer array changing type if needed
372 // delete old varname
373 // recreate varname of proper length
374 // else (variable doesn't exist)
375 // make array of newlength
376 // create varname
377 //
378 // There is some code duplication here. Refactor later
379
380 Int_t newlength = currentindex + nvals;
381 THaVar* existingvar=Find(varname);
382 if(existingvar) {
383 string existingcomment;
384 existingcomment.assign(existingvar->GetTitle());
385 if(!existingcomment.empty()) {
386 current_comment.assign(existingcomment);
387 }
388 Int_t existingtype=existingvar->GetType();
389 Int_t existinglength=existingvar->GetLen();
390 if(newlength > existinglength ||
391 (existingtype == kInt && ttype > 0)) { // Length or type change needed
392 if(newlength < existinglength) newlength = existinglength;
393 Int_t newtype=-1;
394 if(ttype>0 || existingtype == kDouble) {
395 newtype = kDouble;
396 fp = new Double_t[newlength];
397 if(existingtype == kDouble) {
398 Double_t* existingp= (Double_t*) existingvar->GetValuePointer();
399 for(Int_t i=0;i<existinglength;i++) {
400 fp[i] = existingp[i];
401 }
402 } else if(existingtype == kInt) {
403 Int_t* existingp= (Int_t*) existingvar->GetValuePointer();
404 for(Int_t i=0;i<existinglength;i++) {
405 fp[i] = existingp[i];
406 }
407 } else {
408 cout << "Whoops!" << endl;
409 }
410 } else if(existingtype == kInt) { // Stays int
411 newtype = kInt;
412 ip = new Int_t[newlength];
413 Int_t* existingp= (Int_t*) existingvar->GetValuePointer();
414 for(Int_t i=0;i<existinglength;i++) {
415 ip[i] = existingp[i];
416 }
417 } else {
418 cout << "Whoops!" << endl;
419 }
420 // Now copy new values in
421 for(Int_t i=0;i<nvals;i++) {
422 TString valstr = ((TObjString *)vararr->At(i))->GetString();
423 if(newtype == kInt) {
424 ip[currentindex+i] = valstr.Atoi();
425 } else {
426 if(valstr.IsFloat()) {
427 fp[currentindex+i] = valstr.Atof();
428 } else {
429 THaFormula* formula = new THaFormula
430 ("temp",valstr.Data(), false, this, nullptr);
431 fp[currentindex+i] = formula->Eval();
432 delete formula;
433 }
434 }
435 }
436 currentindex += nvals;
437 // Remove old variable and recreate
438 if(existingtype == kDouble) {
439 delete [] (Double_t*) existingvar->GetValuePointer();
440 } else if (existingtype == kInt) {
441 delete [] (Int_t*) existingvar->GetValuePointer();
442 }
443 RemoveName(varname);
444 size_t buflen = strlen(varname) + 20;
445 char *arrayname=new char [buflen];
446 snprintf(arrayname,buflen,"%s[%d]",varname,newlength);
447 if(newtype == kInt) {
448 Define(arrayname, current_comment.c_str(), *ip);
449 } else {
450 Define(arrayname, current_comment.c_str(), *fp);
451 }
452 delete[] arrayname;
453 } else {
454 // Existing array long enough and of right type, just copy to it.
455 if(ttype == 0 && existingtype == kInt) {
456 Int_t* existingp= (Int_t*) existingvar->GetValuePointer();
457 for(Int_t i=0;i<nvals;i++) {
458 TString valstr = ((TObjString *)vararr->At(i))->GetString();
459 existingp[currentindex+i] = valstr.Atoi();
460 }
461 } else {
462 Double_t* existingp= (Double_t*) existingvar->GetValuePointer();
463 for(Int_t i=0;i<nvals;i++) {
464 TString valstr = ((TObjString *)vararr->At(i))->GetString();
465 if(valstr.IsFloat()) {
466 existingp[currentindex+i] = valstr.Atof();
467 } else {
468 THaFormula* formula = new THaFormula
469 ("temp",valstr.Data(), false, this, nullptr);
470 existingp[currentindex+i] = formula->Eval();
471 delete formula;
472 }
473 }
474 }
475 currentindex += nvals;
476 }
477 } else {
478 if(currentindex !=0) {
479 cout << "currentindex=" << currentindex << " shouldn't be!" << endl;
480 }
481 if(ttype==0) {
482 ip = new Int_t[nvals];
483 } else {
484 fp = new Double_t[nvals];
485 }
486 for(Int_t i=0;i<nvals;i++) {
487 TString valstr = ((TObjString *)vararr->At(i))->GetString();
488 if(ttype==0) {
489 ip[i] = valstr.Atoi();
490 } else {
491 if(valstr.IsFloat()) {
492 fp[i] = valstr.Atof();
493 } else {
494 THaFormula* formula = new THaFormula
495 ("temp",valstr.Data(), false, this, nullptr);
496 fp[i] = formula->Eval();
497 delete formula;
498 }
499 }
500 }
501 currentindex = nvals;
502
503 size_t buflen = strlen(varname)+20;
504 char *arrayname=new char [buflen];
505 snprintf(arrayname,buflen,"%s[%d]",varname,nvals);
506 if(ttype==0) {
507 Define(arrayname, current_comment.c_str(), *ip);
508 } else {
509 Define(arrayname, current_comment.c_str(), *fp);
510 }
511 delete[] arrayname;
512 }
513
514 delete vararr; // Discard result of Tokenize
515
516 // cout << line << endl;
517
518 }
519}
520
521//_____________________________________________________________________________
522Int_t THcParmList::LoadParmValues(const DBRequest* list, const char* prefix)
523{
548 const DBRequest *ti = list;
549 Int_t cnt=0;
550 Int_t this_cnt=0;
551
552 if( !prefix ) prefix = "";
553
554 while ( ti && ti->name ) {
555 string keystr(prefix); keystr.append(ti->name);
556 const char* key = keystr.c_str();
557 // cout <<"Now at "<<ti->name<<endl;
558 this_cnt = 0;
559 if(this->Find(key)) {
560 VarType ty = this->Find(key)->GetType();
561 if (ti->nelem>1) {
562 // it is an array, use the appropriateinterface
563 switch (ti->type) {
564 case (kDouble) :
565 this_cnt = GetArray(key,static_cast<Double_t*>(ti->var),ti->nelem);
566 break;
567 case (kInt) :
568 this_cnt = GetArray(key,static_cast<Int_t*>(ti->var),ti->nelem);
569 break;
570 default:
571 Error("THcParmList","Invalid type to read %s",key);
572 break;
573 }
574
575 } else {
576 switch (ti->type) {
577 case (kDouble) :
578 if(ty == kInt) {
579 *static_cast<Double_t*>(ti->var)=*(Int_t *)this->Find(key)->GetValuePointer();
580 } else if (ty == kDouble) {
581 *static_cast<Double_t*>(ti->var)=*(Double_t *)this->Find(key)->GetValuePointer();
582 } else {
583 cout << "*** ERROR!!! Type Mismatch " << key << endl;
584 }
585 this_cnt=1;
586
587 break;
588 case (kInt) :
589 if(ty == kInt) {
590 *static_cast<Int_t*>(ti->var)=*(Int_t *)this->Find(key)->GetValuePointer();
591 } else if (ty == kDouble) {
592 *static_cast<Int_t*>(ti->var)=TMath::Nint(*(Double_t *)this->Find(key)->GetValuePointer());
593 cout << "*** WARNING!!! Rounded " << key << " to nearest integer " << endl;
594 } else {
595 cout << "*** ERROR!!! Type Mismatch " << key << endl;
596 }
597 this_cnt=1;
598 break;
599 default:
600 Error("THcParmList","Invalid type to read %s",key);
601 break;
602 }
603 }
604 } else { // See if it is a text variable
605 const char* value = GetString(key);
606 if(value) {
607 this_cnt = 1;
608 if(ti->type == kString) {
609 *((string*)ti->var) = string(value);
610 } else if (ti->type == kTString) {
611 *((TString*)ti->var) = (TString) value;
612 } else {
613 Error("THcParmList","No conversion for strings: %s",key);
614 }
615 }
616 }
617 if (this_cnt<=0) {
618 if ( !ti->optional ) {
619 string msg = string("Could not find `") + key + "` in database!";
620 throw std::runtime_error("<THcParmList::LoadParmValues>: " + msg);
621 }
622 }
623 cnt += this_cnt;
624 ti++;
625 }
626 return cnt;
627}
628
629// READING AN ARRAY INTO A C-style ARRAY
630//_____________________________________________________________________________
631Int_t THcParmList::GetArray(const char* attr, Int_t* array, Int_t size)
632{
633 return ReadArray(attr,array,size);
634}
635//_____________________________________________________________________________
636Int_t THcParmList::GetArray(const char* attr, Double_t* array, Int_t size)
637{
638 return ReadArray(attr,array,size);
639}
640
641//_____________________________________________________________________________
642template<class T>
643Int_t THcParmList::ReadArray(const char* attrC, T* array, Int_t size)
644{
649 Int_t cnt=0;
650
651 THaVar *var = Find(attrC);
652 if(!var) return(cnt);
653 VarType ty = var->GetType();
654 if( ty != kInt && ty != kDouble) {
655 cout << "*** ERROR: " << attrC << " has unsupported type " << ty << endl;
656 return(cnt);
657 }
658 Int_t sz = var->GetLen();
659 const void *vp = var->GetValuePointer();
660 if(size > sz) {
661 cout << "*** ERROR: requested " << size << " elements of " << attrC <<
662 " which has only " << sz << " elements" << endl;
663 cout << "Cannot continue. Must fix database. Terminating program." << endl;
664 //FIXME: probably should make this an exception to be caught in LoadParmValues
665 exit(EXIT_FAILURE);
666 } else if(size < sz) {
667 cout << "*** WARNING: requested " << size << " elements of " << attrC <<
668 " which has length " << sz << endl;
669 }
670 if(size<sz) sz = size;
671 Int_t donint = 0;
672 if(ty == kDouble && typeid(array[0]) == typeid(Int_t)) {
673 donint = 1; // Use nint when putting doubles in nint
674 cout << "*** WARNING!!! Rounded " << attrC << " elements to nearest integer " << endl;
675 }
676 for(cnt=0;cnt<sz;cnt++) {
677 if(ty == kInt) {
678 array[cnt] = ((Int_t*)vp)[cnt];
679 } else
680 if(donint) {
681 array[cnt] = TMath::Nint(((Double_t*)vp)[cnt]);
682 } else {
683 array[cnt] = ((Double_t*)vp)[cnt];
684 }
685 }
686 return(cnt);
687}
688
689//_____________________________________________________________________________
690void THcParmList::PrintFull( Option_t* option ) const
691{
693 TextList->Print();
694}
695#ifdef WITH_CCDB
696//_____________________________________________________________________________
697Int_t THcParmList::OpenCCDB(Int_t runnum)
698{
699 // Use the Environment variable "CCDB_CONNECTION" as the
700 // connection string
701 const char* connection_string = gSystem->Getenv("CCDB_CONNECTION");
702
703 return(OpenCCDB(runnum,connection_string));
704}
705Int_t THcParmList::OpenCCDB(Int_t runnum, const char* connection_string)
706{
707 // Connect to a CCDB database pointed to by connection_string
708
709 std::string s (connection_string);
710 CCDB_obj = new SQLiteCalibration(runnum);
711 Int_t result = CCDB_obj->Connect(s);
712 if(!result) return -1; // Need some error codes
713 cout << "Opened " << s << " for run " << runnum << endl;
714 return 0;
715}
716Int_t THcParmList::CloseCCDB()
717{
718 delete CCDB_obj;
719 return(0);
720}
721Int_t THcParmList::LoadCCDBDirectory(const char* directory,
722 const char* prefix)
723{
724 // Load all parameters in directory
725 // Prepend prefix onto the name of each
726
727 std::string dirname (directory);
728
729 if(dirname[dirname.length()-1]!='/') {
730 dirname.append("/");
731 }
732 Int_t dirlen=dirname.length();
733
734 vector<string> namepaths;
735 CCDB_obj->GetListOfNamepaths(namepaths);
736 for(UInt_t iname=0;iname<namepaths.size();iname++) {
737 std::string varname (namepaths[iname]);
738 if(varname.compare(0,dirlen,dirname) == 0) {
739 varname.replace(0,dirlen,prefix);
740 // cout << namepaths[iname] << " -> " << varname << endl;
741
742 // To what extent is there duplication here with Load() method?
743
744 // Retrieve assignment
745 Assignment* assignment = CCDB_obj->GetAssignment(namepaths[iname], true);
746 ConstantsTypeColumn::ColumnTypes ccdbtype=assignment->GetValueType(0);
747 Int_t ccdbncolumns=assignment->GetColumnsCount();
748 Int_t ccdbnrows=assignment->GetRowsCount();
749 std::string title = assignment->GetTypeTable()->GetComment();
750
751 // Only load single column tables
752 if(ccdbncolumns == 1) {
753
754 THaVar* existingvar=Find(varname.c_str());
755 // Need to append [size] to end of varname
756 char sizestring[20];
757 sprintf(sizestring,"[%d]",ccdbnrows);
758 std::string size_str (sizestring);
759 std::string varnamearray (varname);
760 varnamearray.append(size_str);
761
762 // Select data type
763 if(ccdbtype==ConstantsTypeColumn::cIntColumn) {
764 vector<vector<int> > data;
765 CCDB_obj->GetCalib(data, namepaths[iname]);
766
767 if(existingvar) {
768 RemoveName(varname.c_str());
769 }
770
771 Int_t* ip = new Int_t[data.size()];
772 for(UInt_t row=0;row<data.size(); row++) {
773 ip[row] = data[row][0];
774 }
775 Define(varnamearray.c_str(), title.c_str(), *ip);
776
777 } else if (ccdbtype==ConstantsTypeColumn::cDoubleColumn) {
778 vector<vector<double> > data;
779 CCDB_obj->GetCalib(data, namepaths[iname]);
780
781 if(existingvar) {
782 RemoveName(varname.c_str());
783 }
784
785 Double_t* fp = new Double_t[data.size()];
786 for(UInt_t row=0;row<data.size(); row++) {
787 fp[row] = data[row][0];
788 }
789 Define(varnamearray.c_str(), title.c_str(), *fp);
790 } else if (ccdbtype==ConstantsTypeColumn::cStringColumn) {
791 if(ccdbnrows > 1) {
792 cout << namepaths[iname] << ": Only first element of CCDB string array loaded." << endl;
793 }
794 vector<vector<string> > data;
795 CCDB_obj->GetCalib(data, namepaths[iname]);
796 AddString(varname, data[0][0]);
797 } else {
798 cout << namepaths[iname] << ": Unsupported CCDB data type: " << ccdbtype << endl;
799 }
800 } else {
801 cout << namepaths[iname] << ": Multicolumn CCDB variables not supported" << endl;
802 }
803 }
804 }
805 return 0;
806}
807
808#endif
int Int_t
unsigned int UInt_t
size_t size(const MatrixT &matrix)
double Double_t
const char Option_t
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
ClassImp(VDC::AnalyticTTDConv) using namespace std
string::size_type pos
static bool IsComment(const string &s, string::size_type pos)
#define INCLUDESTR
Int_t fDebug
R__EXTERN TSystem * gSystem
#define snprintf
TIter end() const
virtual Double_t Eval()
virtual Int_t RemoveName(const char *name)
virtual void PrintFull(Option_t *opt="") const
THaVar * Define(const char *name, const Byte_t &var, const Int_t *count=nullptr)
virtual THaVar * Find(const char *name) const
VarType GetType() const
Int_t GetLen() const
const void * GetValuePointer() const
A list parameters and their values.
Definition THcParmList.h:27
Int_t ReadArray(const char *attrC, T *array, Int_t size)
Dictionary of string parameters.
Podd::Textvars * TextList
Definition THcParmList.h:64
Int_t GetArray(const char *attr, Int_t *array, Int_t size)
Read in a set of Int_t's in to a C-style array.
const char * GetString(const std::string &name) const
Definition THcParmList.h:38
virtual void Load(const char *fname, Int_t RunNumber=0)
Load the parameter cache by reading a CTP style parameter file.
Int_t AddString(const std::string &name, const std::string &value)
Definition THcParmList.h:42
virtual void PrintFull(Option_t *opt="") const
Print all the numeric parameter desciptions and value and text parameters.
Int_t LoadParmValues(const DBRequest *list, const char *prefix="")
Retrieve parameter values from the parameter cache.
const char * GetTitle() const override
TObject * At(Int_t idx) const override
Int_t GetLast() const override
virtual void Error(const char *method, const char *msgfmt,...) const
Ssiz_t Length() const
Bool_t IsDec() const
Int_t Atoi() const
Double_t Atof() const
Bool_t IsFloat() const
Ssiz_t First(char c) const
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual const char * Getenv(const char *env)
TLine * line
start
end
Int_t Nint(T x)
STL namespace.
const char * cnt