Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaVform.cxx
Go to the documentation of this file.
1//*-- Author : Robert Michaels, April 2003
2
3// Vector formulas, and much more.
4// This object inherits from THaFormula to be able to use its
5// parsing capabilities. This object is either a
6// 1. Scaler formula
7// 2. Vector formula which can involve fixed size arrays.
8// 3. Variable sized array
9// 4. An "eye" variable ("[I]") used by THaVhist
10// 5. A cut, either vector or scaler.
11// The usage instructions are explained in documentation
12// about THaOutput.
13
14
15#include "THaVform.h"
16#include "THaString.h"
17#include "THaVarList.h"
18#include "THaCut.h"
19#include "TTree.h"
20
21#include <iostream>
22#include <cassert>
23
24using namespace std;
25using namespace THaString;
26
27//_____________________________________________________________________________
28THaVform::THaVform( const char *type, const char* name, const char* formula,
29 const THaVarList* vlst, const THaCutList* clst )
30 : THaFormula(), fNvar(0), fObjSize(0), fEyeOffset(0), fData(0.0),
31 fType(kUnknown), fDebug(0), fVarPtr(nullptr), fOdata(nullptr),
32 fPrefix(kNoPrefix)
33{
35 SetList(vlst);
36 SetCutList(clst);
37 string stemp1 = StripPrefix(formula);
38 SetTitle(stemp1.c_str());
39
40 if( type && *type ) {
41 if( !CmpNoCase(type, "cut") )
42 fType = kCut;
43 else if( !CmpNoCase(type, "formula") )
44 fType = kForm;
45 else if( !CmpNoCase(type, "eye") )
46 fType = kEye;
47 else if( !CmpNoCase(type, "vararray") )
49 }
50
51 // Call THaFormula's Compile() unless it's an "eye"
52 if (IsEye()) return;
53 Compile();
54}
55
56//_____________________________________________________________________________
58 THaFormula(rhs), fNvar(rhs.fNvar), fObjSize(rhs.fObjSize),
59 fEyeOffset(rhs.fEyeOffset), fData(rhs.fData),
60 fType(rhs.fType), fDebug(rhs.fDebug), fAndStr(rhs.fAndStr), fOrStr(rhs.fOrStr),
61 fSumStr(rhs.fSumStr), fVarName(rhs.fVarName), fVarStat(rhs.fVarStat),
62 fSarray(rhs.fSarray), fVectSform(rhs.fVectSform), fStitle(rhs.fStitle),
63 fVarPtr(rhs.fVarPtr), fOdata(nullptr), fPrefix(rhs.fPrefix)
64{
65 // Copy ctor
66
67 for( const auto* theCut : rhs.fCut ) {
68 if( theCut ) {
69 //FIXME: do we really need to make copies?
70 // The more formulas, the more stuff to evaluate...
71 fCut.push_back(new THaCut(*theCut));
72 }
73 }
74 for( const auto* theForm : rhs.fFormula ) {
75 if( theForm ) {
76 //FIXME: do we really need to make copies?
77 fFormula.push_back(new THaFormula(*theForm));
78 }
79 }
80 if( rhs.fOdata )
81 fOdata = new THaOdata(*rhs.fOdata);
82}
83
84//_____________________________________________________________________________
89
90//_____________________________________________________________________________
92{
93 if( &fv != this ) {
94 Uncreate();
95 Create(fv);
96 }
97 return *this;
98}
99
100//_____________________________________________________________________________
102{
104 fNvar = rhs.fNvar;
105 fObjSize = rhs.fObjSize;
107 fData = rhs.fData;
108 fType = rhs.fType;
109 fDebug = rhs.fDebug;
110 fAndStr = rhs.fAndStr;
111 fOrStr = rhs.fOrStr;
112 fSumStr = rhs.fSumStr;
113 fVarName = rhs.fVarName;
114 fVarStat = rhs.fVarStat;
115
116 for( const auto* itf : rhs.fFormula ) {
117 if( itf ) {
118 //FIXME: do we really need to make copies?
119 fFormula.push_back(new THaFormula(*itf));
120 }
121 }
122 for( const auto* itc : rhs.fCut ) {
123 if( itc ) {
124 //FIXME: do we really need to make copies?
125 fCut.push_back(new THaCut(*itc));
126 }
127 }
128
129 fSarray = rhs.fSarray;
131 fStitle = rhs.fStitle;
132 fVarPtr = rhs.fVarPtr;
133 delete fOdata; fOdata = nullptr;
134 if( rhs.fOdata )
135 fOdata = new THaOdata(*rhs.fOdata);
136 fPrefix = rhs.fPrefix;
137}
138
139//_____________________________________________________________________________
141{
142 delete fOdata;
143 fOdata = nullptr;
144 for( auto& itc : fCut ) delete itc;
145 for( auto& itf : fFormula ) delete itf;
146 fCut.clear();
147 fFormula.clear();
148}
149
150//_____________________________________________________________________________
152{
153 // Long printout for debugging.
154 ShortPrint();
155 cout << "Num of variables " << fNvar << endl;
156 cout << "Object size " << fObjSize << endl;
157 for( Int_t i = 0; i < fNvar; ++i ) {
158 cout << "Var # " << i << " name = " <<
159 fVarName[i] << " stat = " << fVarStat[i] << endl;
160 }
161 for( const auto* itf : fFormula ) {
162 cout << "Formula full printout --> " << endl;
163 itf->Print(kPRINTFULL);
164 }
165 for( const auto* itc : fCut ) {
166 cout << "Cut full printout --> " << endl;
167 itc->Print(kPRINTFULL);
168 }
169}
170
171//_____________________________________________________________________________
173{
174 // Short printout for self identification.
175 cout << "Print of ";
176 if (IsVarray()) cout << " variable sized array: ";
177 if (IsFormula()) cout << " formula: ";
178 if (IsCut()) cout << " cut: ";
179 if (IsEye()) cout << " [I]-var: ";
180 cout << GetName() << " = " << GetTitle()<<endl;
181}
182
183//_____________________________________________________________________________
185{
186 // Gives friendly explanation of the usage errors.
187 // The possibilities are only bounded by human imagination.
188
189 cout << "THaVform::Explanation of error status -->"<<endl;
190
191 switch(err) {
192
193 case kOK:
194 cout << "No error.";
195 break;
196
197 case kIllVar:
198 cout << "If you make a formula of a variable sized array"<<endl;
199 cout << "like L.vdc.v1.wire, then the formula string must"<<endl;
200 cout << "ONLY contain that variable, no brackets, NOTHING else."<<endl;
201 cout << "Data appears in Tree same as for a variable"<<endl;
202 cout << "However, e.g. '2*L.vdc.v1.wire' is undefined."<<endl;
203 break;
204
205 case kIllTyp :
206 cout << "Illegal type of THaVform"<<endl;
207 cout << "Only options at present are "<<endl;
208 cout << "'formula', 'cut', 'eye'"<<endl;
209 break;
210
211 case kNoGlo :
212 cout << "There are no global variables defined !!"<<endl;
213 break;
214
215 case kIllMix :
216 cout << "You CANNOT have a formula that mixes"<<endl;
217 cout << "variable sized and fixed sized arrays."<<endl;
218 cout << "Note: Formula can only defined by fixed sized arrays"<<endl;
219 cout << "like L.s1.lt. So e.g. '2*L.s1.lt - 500' is ok."<<endl;
220 break;
221
222 case kArrZer :
223 cout << "Attempting to use a variable with pointer = 0."<<endl;
224 cout << "The variables must be defined in the code."<<endl;
225 cout << "Try 'gHaVars->Print()' to verify names."<<endl;
226 break;
227
228 case kArrSiz :
229 cout << "Your formula uses variables of different sizes."<<endl;
230 cout << "This is not meaningful."<<endl;
231 break;
232
233 case kUnkPre :
234 cout << "Unknown prefix."<<endl;
235 cout << "The presently supported prefixes are "<<endl;
236 cout << "'SUM:', 'AND:', and 'OR:' "<<endl;
237 cout << "(case insensitive)"<<endl;
238 break;
239
240 case kIllPre :
241 cout << "Illegal usage of prefix."<<endl;
242 cout << "'SUM:' can be used with formula and cuts."<<endl;
243 cout << "'AND:', and 'OR:' can only be used with cuts."<<endl;
244 break;
245
246 default:
247 cout << "Unknown error !!"<<endl;
248
249 }
250
251}
252
253
254//_____________________________________________________________________________
255vector<string> THaVform::GetVars() const
256{
257 // Get names of variable that are used by this formula.
258 return fVarName;
259}
260
261
262//_____________________________________________________________________________
264{
265 // Initialize the variables of this Vform.
266 // For explanation of return status see "ExplainErr"
267
268 fObjSize = 0;
269 fSarray.clear();
270
271 if (IsEye()) return 0;
272
273 fStitle = GetTitle();
274 Int_t status = 0;
275
276 for( Int_t i = 0; i < fNvar; ++i ) {
277 if( fVarStat[i] == kVAType ) { // This obj is a var. sized array.
278 if( StripBracket(fStitle) == fVarName[i] ) {
279 status = 0;
280 fVarPtr = fVarList->Find(fVarName[i].c_str());
281 if( fVarPtr ) {
284 if( fPrefix == kNoPrefix ) {
285 delete fOdata;
286 fOdata = new THaOdata();
287 } else {
288 fObjSize = 1;
289 }
290 }
291 } else {
292 status = kIllVar;
293 }
294 return status;
295 }
296 }
297
298 if (!IsCut() && !IsFormula()) return kIllTyp;
299 if (!fVarList) return kNoGlo;
300
301// Check that all fixed arrays have the same size.
302
303 for( Int_t i = 0; i < fNvar; ++i ) {
304
305 if( fVarStat[i] == kVAType ) {
306 cout << "ERROR:THaVform:: Cannot mix variable arrays with ";
307 cout << "other variables or formula."<<endl;
308 return kIllMix;
309 }
310 if (fVarStat[i] != kFAType ) continue;
311 auto* pvar1 = fVarList->Find(fVarName[i].c_str());
312 fVarPtr = pvar1; // Store one pointer to be able to get the size
313 // later since it may change. This works since all
314 // elements were verified to be the same size.
315 if (i == fNvar) continue;
316 for( Int_t j = i + 1; j < fNvar; ++j ) {
317 if( fVarStat[j] != kFAType )
318 continue;
319 const auto* pvar2 = fVarList->Find(fVarName[j].c_str());
320 if (!pvar1 || !pvar2) {
321 status = kArrZer;
322 cout << "THaVform:ERROR: Trying to use zero pointer."<<endl;
323 continue;
324 }
325 if( !(pvar1->HasSameSize(pvar2)) ) {
326 cout << "THaVform::ERROR: Var "<<fVarName[i]<<" and ";
327 cout << fVarName[j]<<" have different sizes "<<endl;
328 status = kArrSiz;
329 }
330 }
331 }
332 if( status != 0 )
333 return status;
334
335 for( Int_t i = 0; i < fNvar; ++i ) {
336 if( fVarStat[i] == kFAType ) fSarray.push_back(fVarName[i]);
337 }
338
339 Int_t varsize = 1;
340 if (fVarPtr) varsize = fVarPtr->GetLen();
341
342 status = MakeFormula(0, varsize);
343
344 if (status != 0) return status;
345
346 if (fVarPtr) {
348 if (fPrefix == kNoPrefix) {
349 delete fOdata;
350 fOdata = new THaOdata();
351 } else {
352 fObjSize = 1;
353 }
354 } else {
355 fObjSize = 1;
356 }
357
358 return status;
359
360}
361
362//_____________________________________________________________________________
364{
365// Store one pointer to be able to get the size.
366// (see explanation in Init). Also recompile the
367// THaCut's and THaFormula's to reattach to variables.
368 for (Int_t i = 0; i < fNvar; ++i) {
369 if (fVarStat[i] != kFAType ) continue;
370 fVarPtr = fVarList->Find(fVarName[i].c_str());
371 break;
372 }
373 for( auto& itc : fCut ) itc->Compile();
374 for( auto& itf : fFormula ) itf->Compile();
375}
376
377
378//_____________________________________________________________________________
380{ // Make the vector formula (fVectSform) from index flo to fhi.
381 // Return status :
382 // 0 = ok
383 // kUnkPre = tried to use an unknown prefix ("OR:", etc)
384 // kIllPre = ambiguity of whether this is a cut.
385
386 Int_t status = 0;
387
388 if (flo < 0) flo = 0;
389 if (flo >= fhi) return 0;
390 if (fhi > fgVFORM_HUGE) {
391 // fSize cannot be infinite.
392 // The following probably indicates a usage error.
393 cout << "THaVform::WARNING: Asking for a too-huge";
394 cout << " number of formulas !!" << endl;
395 cout << "Truncating at " << fgVFORM_HUGE << endl;
396 fhi = fgVFORM_HUGE;
397 }
398 if (fhi > (long)fVectSform.size()) GetForm(fhi);
399 // and if the above line doesn't repair fhi...
400 if (fhi > (long)fVectSform.size()) return 0;
401
402 if (fPrefix == kNoPrefix) {
403
404 for (Int_t i = flo; i < fhi; ++i) {
405 string cname = Form("%s-%d",GetName(),i);
406 //FIXME: avoid duplicate cuts/formulas
407 if (IsCut()) {
408 fCut.push_back(new THaCut(cname.c_str(),fVectSform[i].c_str(),
409 "thavcut"));
410 } else if (IsFormula()) {
411 fFormula.push_back(new THaFormula(cname.c_str(),
412 fVectSform[i].c_str()));
413 }
414 }
415
416 } else { // The formula had a prefix like "OR:"
417 // This THaVform is therefore a scaler.
418
419 string soper;
420 int iscut=0;
421 switch (fPrefix) {
422
423 case kAnd:
424 soper = "&&";
425 iscut = 1;
426 break;
427
428 case kOr:
429 soper = "||";
430 iscut = 1;
431 break;
432
433 case kSum:
434 soper = "+";
435 iscut = 0;
436 break;
437
438 default:
439 status = kUnkPre;
440 cout << "THaVform:ERROR:: Unknown prefix"<<endl;
441 }
442 if (status != 0) return status;
443
444 if (iscut && !IsCut()) {
445 status = kIllPre;
446 cout << "THaVform:ERROR:: Illegal prefix -- "<<endl;
447 cout << "OR:, AND: works only with cuts."<<endl;
448 cout << "SUM: works only with both cuts and formulas."<<endl;
449 return status;
450 }
451
452 string sform;
453 for (Int_t i = 0; i < fhi; ++i) {
454 sform += fVectSform[i];
455 if (i < (long)fVectSform.size()-1) sform += soper;
456 }
457
458 string cname(GetName());
459
460 if (IsCut()) {
461 if( !fCut.empty() ) { // drop what was there before
462 for( auto& itc : fCut ) delete itc;
463 fCut.clear();
464 }
465 cname += "cut";
466 //FIXME: avoid duplicate cuts/formulas
467 fCut.push_back(new THaCut(cname.c_str(),sform.c_str(),
468 "thavsform"));
469 } else if (IsFormula()) {
470 if( !fFormula.empty() ) { // drop what was there before
471 for( auto& itf : fFormula )
472 delete itf;
473 fFormula.clear();
474 }
475 cname += "form";
476 //FIXME: avoid duplicate cuts/formulas
477 fFormula.push_back(new THaFormula(cname.c_str(),sform.c_str()));
478 }
479
480 }
481
482 return status;
483}
484
485//_____________________________________________________________________________
486string THaVform::StripPrefix(const char* expr)
487{
488 fAndStr = "AND:";
489 fOrStr = "OR:";
490 fSumStr = "SUM:";
491 const vector<string> sprefix{ fAndStr, fOrStr, fSumStr };
492 static const vector<Int_t> ipflg{ kAnd, kOr, kSum };
493// If we ever invent new prefixes, add them here...
494
495 string stitle = string(expr);
496
498 string result = stitle;
499 for (string::size_type i = 0; i < sprefix.size(); ++i) {
500 auto pos1 = stitle.find(ToUpper(sprefix[i]),0);
501 auto pos2 = stitle.find(ToLower(sprefix[i]),0);
502 auto pos = string::npos;
503 if (pos1 != string::npos) pos = pos1;
504 if (pos2 != string::npos) pos = pos2;
505 if (pos != string::npos) {
506 if (fPrefix != kNoPrefix) {
507 cerr << "THaVform:ERROR:: Cannot have >1 prefix."<<endl;
508 }
509 fPrefix = ipflg[i];
510 pos = pos + sprefix[i].length();
511 result = stitle.substr(pos,pos+stitle.length());
512 }
513 }
514
515// If the variable is like "L.s1.lt[I]" strip the [I]
516// from the end since it is implicit
517 const string eye = "[I]";
518 string stemp = result;
519 auto pos1 = result.find(ToUpper(eye),0);
520 auto pos2 = result.find(ToLower(eye),0);
521 auto pos = string::npos;
522 if (pos1 != string::npos) pos = pos1;
523 if (pos2 != string::npos) pos = pos2;
524 if (pos != string::npos) result = stemp.substr(0,pos);
525 return result;
526}
527
528//_____________________________________________________________________________
529string THaVform::StripBracket(const string& var) const
530{
531// If the string contains "[anything]", we strip
532// it away.
533 string result;
534 auto pos1 = var.find('[',0);
535 auto pos2 = var.find(']',0);
536 if( (pos1 != string::npos) &&
537 (pos2 != string::npos) && pos2 > pos1 ) {
538 result = var.substr(0,pos1);
539 result += var.substr(pos2+1,var.length());
540 } else {
541 result = var;
542 }
543 return result;
544}
545
546//_____________________________________________________________________________
548{
549 if (IsEye()) return 0;
550 string mydata = string(GetName());
551 if (fOdata) {
552 fOdata->AddBranches(tree, mydata);
553 } else {
554 assert(!IsVarray() && fObjSize == 1);
555 string tinfo;
556 tinfo = mydata + "/D";
557 tree->Branch(mydata.c_str(), &fData, tinfo.c_str(), 4000);
558 }
559 return 0;
560
561}
562
563//_____________________________________________________________________________
565{
566// Process this THaVform. Must be done once per event.
567// fData is the data of 1st element which is relevant
568// if this is a scaler. Otherwise fOdata is vector data.
569
570 if (fOdata) fOdata->Clear();
571 fData = 0;
572
573 switch (fType) {
574
575 case kForm:
576 if (!fFormula.empty()) {
577 THaFormula* theFormula = fFormula[0];
578 if ( !theFormula->IsError() ) {
579 //FIXME: use cached result
580 fData = theFormula->Eval();
581 }
582 }
583 if( fOdata != nullptr ) {
584 vector<THaFormula*>::size_type i = fFormula.size();
585 while( i-- > 0 ) {
586 THaFormula* theFormula = fFormula[i];
587 if ( !theFormula->IsError()) {
588 //FIXME: use cached result?
589 fOdata->Fill(i,theFormula->Eval());
590 }
591 }
592 }
593 return 0;
594
595 case kVarArray:
596 switch (fPrefix) {
597
598 case kNoPrefix:
599 // Standard case first
600 if (fOdata) {
602 // Fill array in reverse order so that fOdata is resized just once
603 Int_t i = fObjSize;
604 Bool_t first = true;
605 while( i-- > 0 ) {
606 // FIXME: for better efficiency, should use pointer to data and
607 // Fill(int n,double* data) method in case of a contiguous array
608 if (fOdata->Fill(i,fVarPtr->GetValue(i)) != 1 && first ) {
609 cout << "THaVform::ERROR: storing too much";
610 cout << " variable sized data: ";
611 cout << fVarPtr->GetName() <<" "<<fVarPtr->GetLen()<<endl;
612 first = false;
613 }
614 }
615 }
616 break;
617
618 case kAnd:
619 case kOr:
620 break; // nonsense for a variable sized array
621
622 case kSum:
623 {
624 Int_t i = fVarPtr->GetLen();
625 while( i-- > 0 )
626 fData += fVarPtr->GetValue(i);
627 fObjSize = 1;
628 }
629 break;
630
631 default:
632 break;
633 }
634 return 0;
635
636 case kCut:
637 if (!fCut.empty()) {
638 THaCut* theCut = fCut[0];
639 if (!theCut->IsError()) {
640 //FIXME: use cached result?
641 // if (theCut->Result()) fData = 1.0;
642 if (theCut->EvalCut()) fData = 1.0;
643 }
644 }
645 if( fOdata ) {
646 vector<THaCut*>::size_type i = fCut.size();
647 while( i-- > 0 ) {
648 THaCut* theCut = fCut[i];
649 if ( !theCut->IsError() )
650 //FIXME: use cached result?
651 // fOdata->Fill( i, ((theCut->GetResult()) ? 1.0 : 0.0) ); // 1 = true
652 fOdata->Fill( i, ((theCut->EvalCut()) ? 1.0 : 0.0) ); // 1 = true
653 }
654 }
655 return 0;
656
657 case kEye:
658 return 0;
659
660 default:
661 return -1;
662
663 }
664}
665
666
667//_____________________________________________________________________________
669{
670 // We use the parsing functionality of THaFormula to
671 // tell if the variables are global variables and, if so,
672 // if they are arrays or elements of arrays.
673
674 if (fDebug) cout << "THaVform::DefinedGlob for name = " << name << endl;
675
677 if( ret < 0 )
678 return ret;
679
680 // Retrieve some of the results of the THaFormula parser
681 FVarDef_t& def = fVarDef[ret];
682 const auto* gvar = static_cast<const THaVar*>( def.obj );
683 // This makes a certain assumption about the array syntax defined by ROOT
684 // and THaArrayString, but in the interest of performance we don't create
685 // a full THaArrayString here just to find out if it is an array element
686 Bool_t var_is_array = name.Contains("[");
687
688 fVarName.emplace_back(name.Data());
689 FAr stat = kScaler;
690 if( gvar->IsArray() ) {
691
692 if( var_is_array ) {
693 stat = kAElem;
694 } else {
695 stat = kFAType;
696 }
697 if (gvar->GetLen() == 0) {
698 stat = kVAType;
699 }
700
701 }
702 fVarStat.push_back(stat);
703
704 if (fDebug) {
705 if (gvar->IsArray()) cout << "gvar is array"<<endl;
706 if (gvar->IsBasic()) cout << "gvar is basic"<<endl;
707 if (gvar->IsPointerArray()) cout << "gvar is pointer array"<<endl;
708 cout << "Here is gvar print "<<endl;
709 gvar->Print();
710 cout << "end of gvar print "<<endl<<endl;
711 cout << "length of var "<< gvar->GetLen()<<endl;
712 cout << "fVarStat "<<fVarStat[fNvar]<<endl;
713 }
714
715 ++fNvar;
716
717 return ret;
718}
719
720
721//_____________________________________________________________________________
723{
724 const string open_brack="[";
725 const string close_brack="]";
726
727 for (int idx = 0; idx < size; ++idx) {
728 string acopy = fStitle;
729 string aline = acopy;
730 const int LEN = 16;
731 char num[LEN];
732 snprintf(num,LEN,"%d",idx);
733 for( const auto& sb : fSarray ) {
734 vector<string::size_type> ipos;
735 string::size_type pos1 = 0;
736 string::size_type pos = 0;
737 aline.clear();
738 while( pos != string::npos ) {
739 pos = acopy.find(sb, pos1);
740 pos1 = pos + sb.length();
741 auto pos2 = acopy.find(open_brack, pos1);
742 if( pos != string::npos &&
743 (pos2 == string::npos || pos2 > pos1))
744 ipos.push_back(pos1);
745 }
746 if( ipos.empty() ) continue;
747// Found at least one array,
748// now build fSarray for [0], [1], ... size
749 if (idx == 0) fVectSform.clear();
750 pos = 0;
751 for( auto ipo : ipos ) {
752 aline.append(acopy.substr(pos, ipo));
753 aline.append(open_brack).append(num).append(close_brack);
754 pos = ipo;
755 }
756 aline.append(acopy.substr(ipos[ipos.size()-1],acopy.length()));
757 acopy = aline;
758 }
759 if( aline.length() > 0 )
760 fVectSform.push_back(aline);
761 }
762
763}
764
765
int Int_t
size_t size(const MatrixT &matrix)
bool Bool_t
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 char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
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 Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
TString ToUpper(const TString &s)
TString ToLower(const TString &s)
char * Form(const char *fmt,...)
kUnknown
#define snprintf
Bool_t EvalCut()
Definition THaCut.h:31
virtual Int_t Compile(const char *expression="")
virtual Double_t Eval()
std::vector< FVarDef_t > fVarDef
Definition THaFormula.h:86
Bool_t IsError() const
Definition THaFormula.h:53
const THaVarList * fVarList
Definition THaFormula.h:87
void SetList(const THaVarList *lst)
Definition THaFormula.h:56
void SetCutList(const THaCutList *lst)
Definition THaFormula.h:57
virtual Int_t DefinedGlobalVariable(TString &variable)
THaFormula & operator=(const THaFormula &rhs)
static const Option_t *const kPRINTFULL
Definition THaFormula.h:24
void Clear(Option_t *="")
Definition THaOutput.h:35
void AddBranches(TTree *T, std::string name)
Int_t Fill(Int_t i, Double_t dat)
Definition THaOutput.h:37
virtual THaVar * Find(const char *name) const
Double_t GetValue(Int_t i=0) const
Definition THaVar.h:48
Int_t GetLen() const
Definition THaVar.h:39
Int_t fNvar
Definition THaVform.h:79
Double_t fData
Definition THaVform.h:80
Int_t fObjSize
Definition THaVform.h:79
Int_t fPrefix
Definition THaVform.h:103
THaVform & operator=(const THaVform &vform)
Definition THaVform.cxx:91
@ kIllTyp
Definition THaVform.h:77
@ kArrZer
Definition THaVform.h:78
@ kIllPre
Definition THaVform.h:78
@ kIllVar
Definition THaVform.h:77
@ kUnkPre
Definition THaVform.h:78
@ kArrSiz
Definition THaVform.h:78
@ kIllMix
Definition THaVform.h:78
Int_t fEyeOffset
Definition THaVform.h:79
virtual ~THaVform()
Definition THaVform.cxx:85
Int_t MakeFormula(Int_t flo, Int_t fhi)
Definition THaVform.cxx:379
Bool_t IsVarray() const
Definition THaVform.h:64
@ kVAType
Definition THaVform.h:75
@ kScaler
Definition THaVform.h:75
@ kFAType
Definition THaVform.h:75
std::string fSumStr
Definition THaVform.h:85
void ShortPrint() const
Definition THaVform.cxx:172
Int_t fDebug
Definition THaVform.h:83
FTy fType
Definition THaVform.h:81
Bool_t IsCut() const
Definition THaVform.h:65
@ kVarArray
Definition THaVform.h:74
Int_t DefinedGlobalVariable(TString &variable)
Definition THaVform.cxx:668
std::string fAndStr
Definition THaVform.h:85
void ErrPrint(Int_t status) const
Definition THaVform.cxx:184
void ReAttach()
Definition THaVform.cxx:363
Int_t Process()
Definition THaVform.cxx:564
THaVar * fVarPtr
Definition THaVform.h:101
@ kNoPrefix
Definition THaVform.h:76
std::vector< std::string > fVectSform
Definition THaVform.h:99
void Create(const THaVform &vf)
Definition THaVform.cxx:101
std::string StripBracket(const std::string &var) const
Definition THaVform.cxx:529
void GetForm(Int_t size)
Definition THaVform.cxx:722
static const Int_t fgVFORM_HUGE
Definition THaVform.h:84
THaOdata * fOdata
Definition THaVform.h:102
std::vector< std::string > fVarName
Definition THaVform.h:94
std::vector< THaFormula * > fFormula
Definition THaVform.h:96
Int_t SetOutput(TTree *tree)
Definition THaVform.cxx:547
std::vector< std::string > fSarray
Definition THaVform.h:98
Bool_t IsEye() const
Definition THaVform.h:66
std::vector< THaCut * > fCut
Definition THaVform.h:97
std::string StripPrefix(const char *formula)
Definition THaVform.cxx:486
std::string fStitle
Definition THaVform.h:100
void LongPrint() const
Definition THaVform.cxx:151
std::vector< std::string > GetVars() const
Definition THaVform.cxx:255
THaVform()
Definition THaVform.h:28
Int_t Init()
Definition THaVform.cxx:263
std::vector< Int_t > fVarStat
Definition THaVform.h:95
std::string fOrStr
Definition THaVform.h:85
void Uncreate()
Definition THaVform.cxx:140
Bool_t IsFormula() const
Definition THaVform.h:63
virtual void SetTitle(const char *title="")
const char * GetName() const override
const char * GetTitle() const override
virtual void SetName(const char *name)
int CmpNoCase(const string &r, const string &s)
Definition THaString.cxx:19
STL namespace.
ClassImp(TPyArg)