1 #ifndef OutputManager_h 2 #define OutputManager_h 13 #include <TLorentzVector.h> 16 #include "BasicTypes.hxx" 17 #include "TreeManager.hxx" 18 #include "DocStringManager.hxx" 21 const UInt_t NMAXSPECIALTREES = 20;
24 const UInt_t MAXVECTORSIZE=100;
27 const UInt_t NMAXTREEVARS = 1000;
32 OutOfBounds() : std::runtime_error(
"OutOfBounds") {}
47 void Ini(Float_t val){
48 for (UInt_t i = 0; i<num_rows(); i++) _m[i]=val;
51 void Fill(
int i, Float_t val){
57 Float_t GetValue(
int i)
const{
62 float* GetAddress(){
return _m;}
63 size_t num_rows(){
return _n1;}
75 _m =
new float[n1*n2];
83 void Ini(Float_t val){
84 for (UInt_t i = 0; i<num_rows(); i++)
85 for (UInt_t j = 0; j<num_cols(); j++)
89 void Fill(
int i,
int j, Float_t val){
95 Float_t GetValue(
int i,
int j)
const{
101 float* GetAddress(){
return _m;}
102 size_t num_rows(){
return _n1;}
103 size_t num_cols(){
return _n2;}
118 _m =
new float[n1*n2*n3];
127 void Ini(Float_t val){
128 for (UInt_t i = 0; i<num_rows1(); i++)
129 for (UInt_t j = 0; j<num_rows2(); j++)
130 for (UInt_t k = 0; k<num_rows3(); k++)
131 _m[i*_n3*_n2 + j*_n3 + k]=val;
134 void Fill(
int i,
int j,
int k, Float_t val){
138 _m[i*_n3*_n2 + j*_n3 + k]=val;
140 Float_t GetValue(
int i,
int j,
int k)
const{
144 return _m[i*_n3*_n2 + j*_n3 + k];
146 float* GetAddress(){
return _m;}
147 size_t num_rows1(){
return _n1;}
148 size_t num_rows2(){
return _n2;}
149 size_t num_rows3(){
return _n3;}
171 void Ini(Double_t val){
172 for (UInt_t i = 0; i<num_rows(); i++) _m[i]=val;
175 void Fill(
int i,
double val){
179 double GetValue(
int i)
const{
183 double* GetAddress(){
return _m;}
184 size_t num_rows(){
return _n1;}
196 _m =
new double[n1*n2];
204 void Ini(Double_t val){
205 for (UInt_t i = 0; i<num_rows(); i++)
206 for (UInt_t j = 0; j<num_cols(); j++)
210 void Fill(
int i,
int j,
double val){
215 double GetValue(
int i,
int j)
const{
220 double* GetAddress(){
return _m;}
221 size_t num_rows(){
return _n1;}
222 size_t num_cols(){
return _n2;}
237 _m =
new double[n1*n2*n3];
246 void Ini(Double_t val){
247 for (UInt_t i = 0; i<num_rows1(); i++)
248 for (UInt_t j = 0; j<num_rows2(); j++)
249 for (UInt_t k = 0; k<num_rows3(); k++)
250 _m[i*_n3*_n2 + j*_n3 + k]=val;
253 void Fill(
int i,
int j,
int k,
double val){
257 _m[i*_n3*_n2 + j*_n3 + k]=val;
259 double GetValue(
int i,
int j,
int k)
const{
263 return _m[i*_n3*_n2 + j*_n3 + k];
265 double* GetAddress(){
return _m;}
266 size_t num_rows1(){
return _n1;}
267 size_t num_rows2(){
return _n2;}
268 size_t num_rows3(){
return _n3;}
291 for (UInt_t i = 0; i<num_rows(); i++) _m[i]=val;
294 void Fill(
int i,
int val){
298 int GetValue(
int i)
const{
302 int* GetAddress(){
return _m;}
303 size_t num_rows(){
return _n1;}
325 for (UInt_t i = 0; i<num_rows(); i++)
326 for (UInt_t j = 0; j<num_cols(); j++)
330 void Fill(
int i,
int j,
int val){
335 int GetValue(
int i,
int j)
const{
340 int* GetAddress(){
return _m;}
341 size_t num_rows(){
return _n1;}
342 size_t num_cols(){
return _n2;}
355 _m =
new int[n1*n2*n3];
365 for (UInt_t i = 0; i<num_rows1(); i++)
366 for (UInt_t j = 0; j<num_rows2(); j++)
367 for (UInt_t k = 0; k<num_rows3(); k++)
368 _m[i*_n3*_n2 + j*_n3 + k]=val;
371 void Fill(
int i,
int j,
int k,
int val){
375 _m[i*_n3*_n2 + j*_n3 + k]=val;
377 int GetValue(
int i,
int j,
int k)
const{
381 return _m[i*_n3*_n2 + j*_n3 + k];
383 int* GetAddress(){
return _m;}
384 size_t num_rows1(){
return _n1;}
385 size_t num_rows2(){
return _n2;}
386 size_t num_rows3(){
return _n3;}
405 void Fill(
const std::string& var){
406 strcpy(_m, var.c_str());
408 char* GetAddress(){
return _m;}
425 for (
int i=0; i<n1; i++) _m[i] =
"";
432 void Fill(
int i,
const char* val){
437 std::vector<std::string>* GetAddress(){
440 size_t num_rows(){
return _n1;}
443 std::vector<std::string> _m;
448 #pragma link C++ class std::vector<char_vector>+; 457 for (
int i=0; i<n2; i++)
466 void Fill(
int i,
int j,
const char* val){
472 std::vector<char_vector>* GetAddress(){
return &_m;}
473 size_t num_rows(){
return _n1;}
474 size_t num_cols(){
return _n2;}
477 std::vector<char_vector> _m;
492 virtual bool Initialize();
493 virtual bool InitializeEntry();
494 virtual void Finalize();
496 void InitializeTrees(
bool iniVars=
true);
497 void InitializeTree(Int_t tree_index,
bool iniVars=
true);
498 void InitializeTree(){InitializeTree(GetCurrentTree());}
500 std::string GetString(
int a);
501 std::string GetSize(
const std::string& counter_name,
unsigned int size);
504 const std::string&
GetVarName(Int_t tree_index, Int_t var_index)
const {
return _tree_vars_all_vars[tree_index][var_index];}
506 const std::string& GetVarName(Int_t var_index)
const {
return _tree_vars_all_vars[GetCurrentTree()][var_index];}
509 const std::string&
GetCounterName(Int_t tree_index, Int_t counter_index)
const {
return _tree_vars_all_counters[tree_index][counter_index];}
511 const std::string& GetCounterName(Int_t counter_index)
const {
return _tree_vars_all_counters[GetCurrentTree()][counter_index];}
517 void AddCounter(Int_t tree_index, Int_t index, Int_t counter_index,
const std::string& counter_name,
int size=-1);
518 void AddCounter(Int_t tree_index, Int_t counter_index,
const std::string& counter_name,
int size=-1);
520 void InitializeCounter(Int_t tree_name, Int_t counter_index);
521 void InitializeCounter(Int_t counter_index);
523 void ResizeCounter(Int_t tree_index, Int_t counter_index, Int_t size);
524 void ResizeCounter(Int_t counter_index,
int size);
526 bool HasCounter(Int_t tree_name, Int_t counter_index);
528 bool CheckCounterType(Int_t counter_index, Int_t indx, Int_t var_index);
530 void IncrementCounter(Int_t counter_index){_tree_vars_counter[_current_tree][counter_index]++;}
532 void IncrementCounterForVar(Int_t index){IncrementCounter(GetCounterIndexForVar(index));}
534 Int_t GetCounterIndexForVar(Int_t index){
return _link_var_to_counter[_current_tree][index];}
537 Int_t GetCounterValue(Int_t counter_index){
return _tree_vars_counter[_current_tree][counter_index];}
538 Int_t GetCounterValue(Int_t tree_index, Int_t counter_index){
return _tree_vars_counter[tree_index][counter_index];}
539 Int_t GetCounterValueForVar(Int_t index){
return GetCounterValue(GetCounterIndexForVar(index));}
540 Int_t GetCounterValueForVar(Int_t tree_index, Int_t index){
return GetCounterValue(tree_index,GetCounterIndexForVar(index));}
542 bool GetFirstIndexFromCounter(Int_t index, Int_t& indx1);
546 void DeleteVar(Int_t tree_index, Int_t index);
550 void AddVar( Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc,
double ini=-9999);
553 void AddVar(Int_t tree_index, Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc,
double ini=-9999);
556 void AddVectorVar( Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc, Int_t counter_index,
const std::string& counter_name, Int_t size= -MAXVECTORSIZE);
559 void AddVectorVar(Int_t tree_index, Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc, Int_t counter_index,
const std::string& counter_name, Int_t size= -MAXVECTORSIZE);
562 void AddVectorVar( Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc,
const int size);
565 void AddVectorVar(Int_t tree_index, Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc,
const int size);
568 void AddMatrixVar( Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc, Int_t counter_index,
const std::string& counter_name,
int size1=-MAXVECTORSIZE,
int size2=-1);
571 void AddMatrixVar(Int_t tree_index, Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc, Int_t counter_index,
const std::string& counter_name,
int size1=-MAXVECTORSIZE,
int size2=-1);
574 void AddMatrixVar( Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc,
int size1=-MAXVECTORSIZE,
int size2=-1);
577 void AddMatrixVar(Int_t tree_index, Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc,
int size1=-MAXVECTORSIZE,
int size2=-1);
580 void Add3DMatrixVar( Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc, Int_t counter_index,
const std::string& counter_name,
581 int size1=-MAXVECTORSIZE,
int size2=-1,
int size3=-1);
583 void Add3DMatrixVar(Int_t tree_index, Int_t index,
const std::string& name,
const std::string& type,
const std::string& doc, Int_t counter_index,
const std::string& counter_name,
584 int size1=-MAXVECTORSIZE,
int size2=-1,
int size3=-1);
587 void AddToyVar( Int_t index,
const std::string& name,
const std::string& type,
const std::string& docstring);
590 void AddToyVar( Int_t tree_index, Int_t index,
const std::string& name,
const std::string& type,
const std::string& docstring);
593 void AddToyVectorVar( Int_t index,
const std::string& name,
const std::string& type,
const std::string& docstring,
int ncomp);
596 void AddToyVectorVar(Int_t tree_index, Int_t index,
const std::string& name,
const std::string& type,
const std::string& docstring,
int ncomp);
600 void AddToyMatrixVar( Int_t index,
const std::string& name,
const std::string& type,
const std::string& docstring,
int ncomp1,
int ncomp2);
603 void AddToyMatrixVar(Int_t tree_index, Int_t index,
const std::string& name,
const std::string& type,
const std::string& docstring,
int ncomp1,
int ncomp2);
609 void InitializeVar(Int_t index, Double_t ini);
610 void InitializeVectorVar(Int_t index, Double_t ini);
611 void InitializeMatrixVar(Int_t index, Double_t ini);
614 void FillVar(Int_t index, Float_t var);
615 void FillVar(Int_t index, Double_t var);
616 void FillVar(Int_t index, Int_t var);
617 void FillVar(Int_t index,
const std::string& var);
620 Float_t GetVarValueF(Int_t index);
621 Double_t GetVarValueD(Int_t index);
622 Int_t GetVarValueI(Int_t index);
625 void FillVectorVar(Int_t index, Float_t var, Int_t indx=-1);
626 void FillVectorVar(Int_t index, Int_t var, Int_t indx=-1);
627 void FillVectorVar(Int_t index, Double_t var, Int_t indx=-1);
628 void FillVectorVar(Int_t index,
const std::string& var, Int_t indx=-1);
631 void FillVectorVarFromArray(Int_t index,
const Double_t var[], UInt_t size) {
for (UInt_t i=0;i<size;i++) FillVectorVar(index,(Double_t)var[i] ,i);}
632 void FillVectorVarFromArray(Int_t index,
const Float_t var[], UInt_t size) {
for (UInt_t i=0;i<size;i++) FillVectorVar(index,(Float_t)var[i] ,i);}
633 void FillVectorVarFromArray(Int_t index,
const Int_t var[], UInt_t size) {
for (UInt_t i=0;i<size;i++) FillVectorVar(index,(Int_t)var[i] ,i);}
634 void FillVectorVarFromArray(Int_t index,
const std::string var[], UInt_t size) {
for (UInt_t i=0;i<size;i++) FillVectorVar(index,(
const std::string)var[i],i);}
637 Float_t
GetVectorVarValueF(Int_t index, Int_t i1){
return _tree_vars_float_vector [GetCurrentTree()][index]->GetValue(i1);}
638 Double_t GetVectorVarValueD(Int_t index, Int_t i1){
return _tree_vars_double_vector[GetCurrentTree()][index]->GetValue(i1);}
639 Int_t GetVectorVarValueI(Int_t index, Int_t i1){
return _tree_vars_int_vector [GetCurrentTree()][index]->GetValue(i1);}
642 void FillMatrixVar(Int_t index, Float_t var, Int_t indx1, Int_t indx2);
643 void FillMatrixVar(Int_t index, Int_t var, Int_t indx1, Int_t indx2);
644 void FillMatrixVar(Int_t index, Double_t var, Int_t indx1, Int_t indx2);
647 void FillMatrixVarFromArray(Int_t index,
const Double_t var[], Int_t indx1, UInt_t size) {
for (UInt_t i=0;i<size;i++) FillMatrixVar(index,(Double_t)var[i],indx1,i);}
648 void FillMatrixVarFromArray(Int_t index,
const Float_t var[], Int_t indx1, UInt_t size) {
for (UInt_t i=0;i<size;i++) FillMatrixVar(index,(Float_t)var[i] ,indx1,i);}
649 void FillMatrixVarFromArray(Int_t index,
const Int_t var[], Int_t indx1, UInt_t size) {
for (UInt_t i=0;i<size;i++) FillMatrixVar(index,(Int_t)var[i] ,indx1,i);}
652 void FillMatrixVarFromArray(Int_t index,
const Double_t var[], UInt_t size) {
for (UInt_t i=0;i<size;i++) FillMatrixVar(index,(Double_t)var[i],-1,i);}
653 void FillMatrixVarFromArray(Int_t index,
const Float_t var[], UInt_t size) {
for (UInt_t i=0;i<size;i++) FillMatrixVar(index,(Float_t)var[i] ,-1,i);}
654 void FillMatrixVarFromArray(Int_t index,
const Int_t var[], UInt_t size) {
for (UInt_t i=0;i<size;i++) FillMatrixVar(index,(Int_t)var[i] ,-1,i);}
657 Float_t
GetMatrixVarValueF(Int_t index, Int_t i1, Int_t i2){
return _tree_vars_float_matrix [GetCurrentTree()][index]->GetValue(i1,i2);}
658 Double_t GetMatrixVarValueD(Int_t index, Int_t i1, Int_t i2){
return _tree_vars_double_matrix[GetCurrentTree()][index]->GetValue(i1,i2);}
659 Int_t GetMatrixVarValueI(Int_t index, Int_t i1, Int_t i2){
return _tree_vars_int_matrix [GetCurrentTree()][index]->GetValue(i1,i2);}
662 void Fill3DMatrixVar(Int_t index, Float_t var, Int_t indx1, Int_t indx2, Int_t indx3);
663 void Fill3DMatrixVar(Int_t index, Int_t var, Int_t indx1, Int_t indx2, Int_t indx3);
664 void Fill3DMatrixVar(Int_t index, Double_t var, Int_t indx1, Int_t indx2, Int_t indx3);
667 void Fill3DMatrixVarFromArray(Int_t index,
const Double_t var[], Int_t indx1, Int_t indx2, UInt_t size) {
for (UInt_t i=0;i<size;i++) Fill3DMatrixVar(index,(Double_t)var[i],indx1,indx2,i);}
668 void Fill3DMatrixVarFromArray(Int_t index,
const Float_t var[], Int_t indx1, Int_t indx2, UInt_t size) {
for (UInt_t i=0;i<size;i++) Fill3DMatrixVar(index,(Float_t)var[i] ,indx1,indx2,i);}
669 void Fill3DMatrixVarFromArray(Int_t index,
const Int_t var[], Int_t indx1, Int_t indx2, UInt_t size) {
for (UInt_t i=0;i<size;i++) Fill3DMatrixVar(index,(Int_t)var[i] ,indx1,indx2,i);}
672 void FillToyVar(Int_t index, Int_t var);
673 void FillToyVar(Int_t index, Float_t var);
674 void FillToyVar(Int_t index, Double_t var);
677 Float_t
GetToyVarValueF(Int_t index){
return GetVectorVarValueF(index, GetToyIndex());}
678 Double_t GetToyVarValueD(Int_t index){
return GetVectorVarValueD(index, GetToyIndex());}
679 Int_t GetToyVarValueI(Int_t index){
return GetVectorVarValueI(index, GetToyIndex());}
682 void FillToyVectorVar(Int_t index, Int_t var, Int_t comp);
683 void FillToyVectorVar(Int_t index, Float_t var, Int_t comp);
684 void FillToyVectorVar(Int_t index, Double_t var, Int_t comp);
688 Double_t GetToyVectorVarValueD(Int_t index, Int_t i1){
return GetMatrixVarValueD(index, GetToyIndex(), i1);}
689 Int_t GetToyVectorVarValueI(Int_t index, Int_t i1){
return GetMatrixVarValueI(index, GetToyIndex(), i1);}
692 void FillToyMatrixVar(Int_t index, Int_t var, Int_t comp1, Int_t comp2);
693 void FillToyMatrixVar(Int_t index, Float_t var, Int_t comp1, Int_t comp2);
694 void FillToyMatrixVar(Int_t index, Double_t var, Int_t comp1, Int_t comp2);
701 void InitializeAnalysisVar(Int_t index, Double_t ini);
702 void InitializeAnalysisVectorVar(Int_t index, Double_t ini);
707 void FillTree(Int_t tree_index);
713 void WriteTree(
const std::string& file,
const std::string& conf);
716 void WriteTrees(
const std::string& file);
719 void AddTreeWithName(Int_t tree_index,
const std::string& tree_name, TTree* tree=NULL);
722 bool OpenOutputFile(
const std::string& file);
725 void CloseOutputFile();
729 bool ValidateVarNameAndIndex(Int_t tree_index, Int_t var_index,
const std::string& var_name);
734 bool IsSpecialTree(Int_t tree_index);
740 Int_t GetToyIndex(){
return _toy_index;}
743 void SetNToys(Int_t tree_index,
int ntoys);
746 UInt_t
GetNToys(Int_t tree_index){
return GetCounterValue(tree_index,NTOYS);}
752 void AddToyWeight(Double_t w){_toyWeights.push_back(w);}
754 void FillMicroTrees();
757 void SetFillSingleTree(Int_t tree_index){_single_tree_fill=tree_index;}
759 void SetFillAllTrees(){_single_tree_fill=-1;}
762 void CheckVariableType(Int_t index,
const std::string& dim,
const std::string& type, Bool_t exist);
771 std::string _default_docstring;
775 std::vector<Double_t> _toyWeights;
781 Int_t _single_tree_fill;
803 std::vector< std::vector< Float_t > > _tree_vars_float;
804 std::vector< std::vector< Double_t > > _tree_vars_double;
805 std::vector< std::vector< achar > > _tree_vars_char;
809 std::vector< std::vector< float_vector* > > _tree_vars_float_vector;
810 std::vector< std::vector< double_vector* > > _tree_vars_double_vector;
811 std::vector< std::vector< char_vector* > > _tree_vars_char_vector;
815 std::vector< std::vector< float_matrix* > > _tree_vars_float_matrix;
816 std::vector< std::vector< double_matrix* > > _tree_vars_double_matrix;
817 std::vector< std::vector< char_matrix* > > _tree_vars_char_matrix;
821 std::vector< std::vector< float_3Dmatrix* > > _tree_vars_float_3Dmatrix;
822 std::vector< std::vector< double_3Dmatrix* > > _tree_vars_double_3Dmatrix;
830 std::vector< std::vector< Int_t > > _tree_vars_used_float;
831 std::vector< std::vector< Int_t > > _tree_vars_used_double;
832 std::vector< std::vector< Int_t > > _tree_vars_used_char;
836 std::vector< std::vector< Int_t > > _tree_vars_used_float_vector;
837 std::vector< std::vector< Int_t > > _tree_vars_used_double_vector;
838 std::vector< std::vector< Int_t > > _tree_vars_used_char_vector;
842 std::vector< std::vector< Int_t > > _tree_vars_used_float_matrix;
843 std::vector< std::vector< Int_t > > _tree_vars_used_double_matrix;
844 std::vector< std::vector< Int_t > > _tree_vars_used_char_matrix;
848 std::vector< std::vector< Int_t > > _tree_vars_used_float_3Dmatrix;
849 std::vector< std::vector< Int_t > > _tree_vars_used_double_3Dmatrix;
855 std::vector< std::vector< Bool_t > > _tree_vars_exist_float;
856 std::vector< std::vector< Bool_t > > _tree_vars_exist_double;
857 std::vector< std::vector< Bool_t > > _tree_vars_exist_char;
861 std::vector< std::vector< Bool_t > > _tree_vars_exist_float_vector;
862 std::vector< std::vector< Bool_t > > _tree_vars_exist_double_vector;
863 std::vector< std::vector< Bool_t > > _tree_vars_exist_char_vector;
867 std::vector< std::vector< Bool_t > > _tree_vars_exist_float_matrix;
868 std::vector< std::vector< Bool_t > > _tree_vars_exist_double_matrix;
869 std::vector< std::vector< Bool_t > > _tree_vars_exist_char_matrix;
873 std::vector< std::vector< Bool_t > > _tree_vars_exist_float_3Dmatrix;
874 std::vector< std::vector< Bool_t > > _tree_vars_exist_double_3Dmatrix;
879 enum enumStandardMicroTrees_OutputManager{
883 enumStandardMicroTreesLast_OutputManager
886 enum enumSpecialTrees{
899 #define AddVarF(out, name, doc) out.AddVar(name,#name,"F",doc,-9999); 900 #define AddVarI(out, name, doc) out.AddVar(name,#name,"I",doc,-9999); 901 #define AddVarC(out, name, doc) out.AddVar(name,#name,"C",doc,-9999); 902 #define AddVarD(out, name, doc) out.AddVar(name,#name,"D",doc,-9999); 904 #define AddVarAndIniF(out, name, doc, ini) out.AddVar(name,#name,"F",doc,ini); 905 #define AddVarAndIniI(out, name, doc, ini) out.AddVar(name,#name,"I",doc,ini); 906 #define AddVarAnaIniC(out, name, doc, ini) out.AddVar(name,#name,"C",doc,ini); 907 #define AddVarAndIniD(out, name, doc, ini) out.AddVar(name,#name,"D",doc,ini); 909 #define AddVarVF(out, name, doc, count) out.AddVectorVar(name,#name,"F",doc,count,#count); 910 #define AddVarVI(out, name, doc, count) out.AddVectorVar(name,#name,"I",doc,count,#count); 911 #define AddVarVC(out, name, doc, count) out.AddVectorVar(name,#name,"C",doc,count,#count); 912 #define AddVarVD(out, name, doc, count) out.AddVectorVar(name,#name,"D",doc,count,#count); 914 #define AddVarMaxSizeVF(out, name, doc, count,size) out.AddVectorVar(name,#name,"F",doc,count,#count,-size); 915 #define AddVarMaxSizeVI(out, name, doc, count,size) out.AddVectorVar(name,#name,"I",doc,count,#count,-size); 916 #define AddVarMaxSizeVC(out, name, doc, count,size) out.AddVectorVar(name,#name,"C",doc,count,#count,-size); 917 #define AddVarMaxSizeVD(out, name, doc, count,size) out.AddVectorVar(name,#name,"D",doc,count,#count,-size); 919 #define AddVarFixVF(out, name, doc, size) out.AddVectorVar(name,#name,"F",doc,size); 920 #define AddVarFixVI(out, name, doc, size) out.AddVectorVar(name,#name,"I",doc,size); 921 #define AddVarFixVC(out, name, doc, size) out.AddVectorVar(name,#name,"C",doc,size); 922 #define AddVarFixVD(out, name, doc, size) out.AddVectorVar(name,#name,"D",doc,size); 924 #define AddVarMF(out, name, doc, count,size1,size2) out.AddMatrixVar(name,#name,"F",doc,count,#count,size1,size2); 925 #define AddVarMI(out, name, doc, count,size1,size2) out.AddMatrixVar(name,#name,"I",doc,count,#count,size1,size2); 926 #define AddVarMC(out, name, doc, count,size1,size2) out.AddMatrixVar(name,#name,"C",doc,count,#count,size1,size2); 927 #define AddVarMD(out, name, doc, count,size1,size2) out.AddMatrixVar(name,#name,"D",doc,count,#count,size1,size2); 930 #define AddVarFixMF(out, name, doc, size1,size2) out.AddMatrixVar(name,#name,"F",doc,size1,size2); 931 #define AddVarFixMI(out, name, doc, size1,size2) out.AddMatrixVar(name,#name,"I",doc,size1,size2); 932 #define AddVarFixMC(out, name, doc, size1,size2) out.AddMatrixVar(name,#name,"C",doc,size1,size2); 933 #define AddVarFixMD(out, name, doc, size1,size2) out.AddMatrixVar(name,#name,"D",doc,size1,size2); 936 #define AddVar3VF(out, name, doc) out.AddVectorVar(name,#name,"F",doc,3); 937 #define AddVar3VD(out, name, doc) out.AddVectorVar(name,#name,"D",doc,3); 939 #define AddVar4VF(out, name, doc) out.AddVectorVar(name,#name,"F",doc,4); 940 #define AddVar4VD(out, name, doc) out.AddVectorVar(name,#name,"D",doc,4); 942 #define AddVar3MF(out, name, doc, count) out.AddMatrixVar(name,#name,"F",doc,count,#count,-MAXVECTORSIZE,3); 943 #define AddVar3MD(out, name, doc, count) out.AddMatrixVar(name,#name,"D",doc,count,#count,-MAXVECTORSIZE,3); 945 #define AddVar4MF(out, name, doc, count) out.AddMatrixVar(name,#name,"F",doc,count,#count,-MAXVECTORSIZE,4); 946 #define AddVar4MD(out, name, doc, count) out.AddMatrixVar(name,#name,"D",doc,count,#count,-MAXVECTORSIZE,4); 949 #define AddToyVarF(out, name, doc) out.AddToyVar(name,#name,"F",doc); 950 #define AddToyVarI(out, name, doc) out.AddToyVar(name,#name,"I",doc); 951 #define AddToyVarC(out, name, doc) out.AddToyVar(name,#name,"C",doc); 952 #define AddToyVarD(out, name, doc) out.AddToyVar(name,#name,"D",doc); 954 #define AddToyVarVF(out, name, doc, size) out.AddToyVectorVar(name,#name,"F",doc,size); 955 #define AddToyVarVI(out, name, doc, size) out.AddToyVectorVar(name,#name,"I",doc,size); 956 #define AddToyVarVD(out, name, doc, size) out.AddToyVectorVar(name,#name,"D",doc,size); 959 #define AddTree(out, name, tree) out.AddTreeWithName(name,#name,tree); std::vector< std::vector< int_3Dmatrix *> > _tree_vars_int_3Dmatrix
3D matrix variables (3 indices)
Float_t GetToyVarValueF(Int_t index)
Get the value of a var already filled (so to be used in another package)
std::vector< std::vector< Int_t > > _tree_vars_counter
The counter it self.
void FillMatrixVarFromArray(Int_t index, const Double_t var[], UInt_t size)
Fill a matrix variable from array.
const std::string & GetVarName(Int_t tree_index, Int_t var_index) const
Returns the variable name.
std::vector< std::vector< Int_t > > _tree_vars_used_counter
The counter it self.
std::vector< std::vector< int_matrix *> > _tree_vars_int_matrix
Matrix variables (2 indices)
Float_t GetToyVectorVarValueF(Int_t index, Int_t i1)
Get the value of a var already filled (so to be used in another package)
std::vector< std::vector< Int_t > > _link_var_to_counter
Correspondece between a variable index and the counter index.
void Fill3DMatrixVarFromArray(Int_t index, const Double_t var[], Int_t indx1, Int_t indx2, UInt_t size)
Fill a 3D matrix variable from array.
int _toy_index
current toy experiment index
void FillMatrixVarFromArray(Int_t index, const Double_t var[], Int_t indx1, UInt_t size)
Fill a matrix variable from array.
Exception for if we try to fill outside the size of float_vector etc.
std::vector< std::vector< Int_t > > _tree_vars_used_int_matrix
Matrix variables (2 indices)
void FillTree()
Fill the current tree.
Float_t GetMatrixVarValueF(Int_t index, Int_t i1, Int_t i2)
Get the value of a var already filled (so to be used in another package)
std::vector< std::vector< Int_t > > _tree_vars_used_int
Single variables.
std::vector< std::vector< std::string > > _tree_vars_all_counters
The names of all counters added.
std::vector< std::vector< Int_t > > _tree_vars_counter_size
The size of the counter: 0 for variable size vectors, >0 for fix size vectors.
UInt_t GetNToys(Int_t tree_index)
Get the number of toys for a given tree.
UInt_t GetNToys()
Get the number of toys for the current tree.
Float_t GetVectorVarValueF(Int_t index, Int_t i1)
Get the value of a var already filled (so to be used in another package)
std::vector< std::vector< int_vector *> > _tree_vars_int_vector
Vector variables (1 index)
std::vector< std::vector< Int_t > > _tree_vars_used_int_3Dmatrix
3D matrix variables (3 indices)
const std::string & GetCounterName(Int_t tree_index, Int_t counter_index) const
Returns the counter name.
std::vector< std::vector< std::string > > _tree_vars_all_vars
The names of all variables added.
void SetToyIndex(Int_t index)
Set and gets the index of the current toy experiment.
std::vector< std::vector< Bool_t > > _tree_vars_exist_int
–— Vectors containing whether a given index is used or not
std::vector< std::vector< Bool_t > > _tree_vars_exist_int_vector
Vector variables (1 index)
std::vector< std::vector< Int_t > > _tree_vars_used_int_vector
Vector variables (1 index)
std::vector< std::vector< Int_t > > _tree_vars_int
Single variables.
void FillVectorVarFromArray(Int_t index, const Double_t var[], UInt_t size)
Fill a vector variable from array.
std::vector< std::vector< Bool_t > > _tree_vars_exist_int_matrix
Matrix variables (2 indices)
std::vector< std::vector< Bool_t > > _tree_vars_exist_int_3Dmatrix
3D matrix variables (3 indices)