HighLAND
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
CreateFlatTree Class Reference
Inheritance diagram for CreateFlatTree:
SimpleLoopBase OutputManager TreeManager

Public Member Functions

 CreateFlatTree (int argc, char *argv[])
 
- Public Member Functions inherited from SimpleLoopBase
 SimpleLoopBase (int argc, char *argv[])
 
void Loop (int nmax=0, int imin=0)
 
void Execute ()
 
- Public Member Functions inherited from OutputManager
virtual bool InitializeEntry ()
 
void InitializeTrees (bool iniVars=true)
 
void InitializeTree (Int_t tree_index, bool iniVars=true)
 
void InitializeTree ()
 
std::string GetString (int a)
 
std::string GetSize (const std::string &counter_name, unsigned int size)
 
const std::string & GetVarName (Int_t tree_index, Int_t var_index) const
 Returns the variable name.
 
const std::string & GetVarName (Int_t var_index) const
 
const std::string & GetCounterName (Int_t tree_index, Int_t counter_index) const
 Returns the counter name.
 
const std::string & GetCounterName (Int_t counter_index) const
 
void AddCounter (Int_t tree_index, Int_t index, Int_t counter_index, const std::string &counter_name, int size=-1)
 
void AddCounter (Int_t tree_index, Int_t counter_index, const std::string &counter_name, int size=-1)
 
void InitializeCounter (Int_t tree_name, Int_t counter_index)
 
void InitializeCounter (Int_t counter_index)
 
void ResizeCounter (Int_t tree_index, Int_t counter_index, Int_t size)
 
void ResizeCounter (Int_t counter_index, int size)
 
bool HasCounter (Int_t tree_name, Int_t counter_index)
 
bool CheckCounterType (Int_t counter_index, Int_t indx, Int_t var_index)
 
void IncrementCounter (Int_t counter_index)
 
void IncrementCounterForVar (Int_t index)
 
Int_t GetCounterIndexForVar (Int_t index)
 
Int_t GetCounterValue (Int_t counter_index)
 
Int_t GetCounterValue (Int_t tree_index, Int_t counter_index)
 
Int_t GetCounterValueForVar (Int_t index)
 
Int_t GetCounterValueForVar (Int_t tree_index, Int_t index)
 
bool GetFirstIndexFromCounter (Int_t index, Int_t &indx1)
 
void DeleteVar (Int_t tree_index, Int_t index)
 
void AddVar (Int_t index, const std::string &name, const std::string &type, const std::string &doc, double ini=-9999)
 Add a single variable to all trees.
 
void AddVar (Int_t tree_index, Int_t index, const std::string &name, const std::string &type, const std::string &doc, double ini=-9999)
 Add a single variable to a specific tree.
 
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)
 Add a vector variable to all trees.
 
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)
 Add a vector variable to a specific tree.
 
void AddVectorVar (Int_t index, const std::string &name, const std::string &type, const std::string &doc, const int size)
 Add a vector variable to all trees.
 
void AddVectorVar (Int_t tree_index, Int_t index, const std::string &name, const std::string &type, const std::string &doc, const int size)
 Add a vector variable to a specific tree.
 
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)
 Add a matrix variable to all trees.
 
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)
 Add a matrix variable to a specific tree.
 
void AddMatrixVar (Int_t index, const std::string &name, const std::string &type, const std::string &doc, int size1=-MAXVECTORSIZE, int size2=-1)
 Add a matrix variable to all trees.
 
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)
 Add a matrix variable to a specific tree.
 
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, int size1=-MAXVECTORSIZE, int size2=-1, int size3=-1)
 Add a 3D matrix variable to all trees.
 
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, int size1=-MAXVECTORSIZE, int size2=-1, int size3=-1)
 Add a 3D matrix variable to a specific tree.
 
void AddToyVar (Int_t index, const std::string &name, const std::string &type, const std::string &docstring)
 Add a single analysis variable to all trees.
 
void AddToyVar (Int_t tree_index, Int_t index, const std::string &name, const std::string &type, const std::string &docstring)
 Add a single analysis variable to a specific tree.
 
void AddToyVectorVar (Int_t index, const std::string &name, const std::string &type, const std::string &docstring, int ncomp)
 Add a vector analysis variable to all trees.
 
void AddToyVectorVar (Int_t tree_index, Int_t index, const std::string &name, const std::string &type, const std::string &docstring, int ncomp)
 Add a vector analysis variable to a specific tree.
 
void AddToyMatrixVar (Int_t index, const std::string &name, const std::string &type, const std::string &docstring, int ncomp1, int ncomp2)
 Add a matrix analysis variable to all trees.
 
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)
 Add a matrix analysis variable to a specific tree.
 
void InitializeVar (Int_t index, Double_t ini)
 
void InitializeVectorVar (Int_t index, Double_t ini)
 
void InitializeMatrixVar (Int_t index, Double_t ini)
 
void FillVar (Int_t index, Float_t var)
 Fill a single variable.
 
void FillVar (Int_t index, Double_t var)
 
void FillVar (Int_t index, Int_t var)
 
void FillVar (Int_t index, const std::string &var)
 
Float_t GetVarValueF (Int_t index)
 Get the value of a var already filled (so to be used in another package)
 
Double_t GetVarValueD (Int_t index)
 
Int_t GetVarValueI (Int_t index)
 
void FillVectorVar (Int_t index, Float_t var, Int_t indx=-1)
 Fill a vector variable.
 
void FillVectorVar (Int_t index, Int_t var, Int_t indx=-1)
 
void FillVectorVar (Int_t index, Double_t var, Int_t indx=-1)
 
void FillVectorVar (Int_t index, const std::string &var, Int_t indx=-1)
 
void FillVectorVarFromArray (Int_t index, const Double_t var[], UInt_t size)
 Fill a vector variable from array.
 
void FillVectorVarFromArray (Int_t index, const Float_t var[], UInt_t size)
 
void FillVectorVarFromArray (Int_t index, const Int_t var[], UInt_t size)
 
void FillVectorVarFromArray (Int_t index, const std::string var[], UInt_t size)
 
Float_t GetVectorVarValueF (Int_t index, Int_t i1)
 Get the value of a var already filled (so to be used in another package)
 
Double_t GetVectorVarValueD (Int_t index, Int_t i1)
 
Int_t GetVectorVarValueI (Int_t index, Int_t i1)
 
void FillMatrixVar (Int_t index, Float_t var, Int_t indx1, Int_t indx2)
 Fill a matrix variable.
 
void FillMatrixVar (Int_t index, Int_t var, Int_t indx1, Int_t indx2)
 
void FillMatrixVar (Int_t index, Double_t var, Int_t indx1, Int_t indx2)
 
void FillMatrixVarFromArray (Int_t index, const Double_t var[], Int_t indx1, UInt_t size)
 Fill a matrix variable from array.
 
void FillMatrixVarFromArray (Int_t index, const Float_t var[], Int_t indx1, UInt_t size)
 
void FillMatrixVarFromArray (Int_t index, const Int_t var[], Int_t indx1, UInt_t size)
 
void FillMatrixVarFromArray (Int_t index, const Double_t var[], UInt_t size)
 Fill a matrix variable from array.
 
void FillMatrixVarFromArray (Int_t index, const Float_t var[], UInt_t size)
 
void FillMatrixVarFromArray (Int_t index, const Int_t var[], UInt_t size)
 
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)
 
Double_t GetMatrixVarValueD (Int_t index, Int_t i1, Int_t i2)
 
Int_t GetMatrixVarValueI (Int_t index, Int_t i1, Int_t i2)
 
void Fill3DMatrixVar (Int_t index, Float_t var, Int_t indx1, Int_t indx2, Int_t indx3)
 Fill a 3D matrix variable.
 
void Fill3DMatrixVar (Int_t index, Int_t var, Int_t indx1, Int_t indx2, Int_t indx3)
 
void Fill3DMatrixVar (Int_t index, Double_t var, Int_t indx1, Int_t indx2, Int_t indx3)
 
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.
 
void Fill3DMatrixVarFromArray (Int_t index, const Float_t var[], Int_t indx1, Int_t indx2, UInt_t size)
 
void Fill3DMatrixVarFromArray (Int_t index, const Int_t var[], Int_t indx1, Int_t indx2, UInt_t size)
 
void FillToyVar (Int_t index, Int_t var)
 Fill a single analysis variable.
 
void FillToyVar (Int_t index, Float_t var)
 
void FillToyVar (Int_t index, Double_t var)
 
Float_t GetToyVarValueF (Int_t index)
 Get the value of a var already filled (so to be used in another package)
 
Double_t GetToyVarValueD (Int_t index)
 
Int_t GetToyVarValueI (Int_t index)
 
void FillToyVectorVar (Int_t index, Int_t var, Int_t comp)
 Fill a vector analysis variable.
 
void FillToyVectorVar (Int_t index, Float_t var, Int_t comp)
 
void FillToyVectorVar (Int_t index, Double_t var, Int_t comp)
 
Float_t GetToyVectorVarValueF (Int_t index, Int_t i1)
 Get the value of a var already filled (so to be used in another package)
 
Double_t GetToyVectorVarValueD (Int_t index, Int_t i1)
 
Int_t GetToyVectorVarValueI (Int_t index, Int_t i1)
 
void FillToyMatrixVar (Int_t index, Int_t var, Int_t comp1, Int_t comp2)
 Fill a matrix analysis variable.
 
void FillToyMatrixVar (Int_t index, Float_t var, Int_t comp1, Int_t comp2)
 
void FillToyMatrixVar (Int_t index, Double_t var, Int_t comp1, Int_t comp2)
 
void InitializeAnalysisVar (Int_t index, Double_t ini)
 
void InitializeAnalysisVectorVar (Int_t index, Double_t ini)
 
void FillTree (Int_t tree_index)
 Fill a specific tree.
 
void FillTree ()
 Fill the current tree.
 
void WriteTree (const std::string &file, const std::string &conf)
 Write a specific tree into a file.
 
void WriteTrees (const std::string &file)
 Write all trees into a file.
 
void AddTreeWithName (Int_t tree_index, const std::string &tree_name, TTree *tree=NULL)
 Add a tree provided its index and name.
 
bool OpenOutputFile (const std::string &file)
 open the output file
 
void CloseOutputFile ()
 close the output file
 
bool ValidateVarNameAndIndex (Int_t tree_index, Int_t var_index, const std::string &var_name)
 
bool IsSpecialTree (Int_t tree_index)
 
void SetToyIndex (Int_t index)
 Set and gets the index of the current toy experiment.
 
Int_t GetToyIndex ()
 
void SetNToys (Int_t tree_index, int ntoys)
 Sets and gets the number of toy experiments for a given configuration.
 
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.
 
void AddToyWeight (Double_t w)
 
void FillMicroTrees ()
 
void SetFillSingleTree (Int_t tree_index)
 
void SetFillAllTrees ()
 
void CheckVariableType (Int_t index, const std::string &dim, const std::string &type, Bool_t exist)
 
void SetDocStringManager (DocStringManager *doc)
 
DocStringManagerdocstrings ()
 
- Public Member Functions inherited from TreeManager
std::vector< TTree *> & GetTrees ()
 Returns the map of trees.
 
TTree * GetTree (Int_t index)
 Returns the a tree with a given index.
 
TTree * GetTree (const std::string &name)
 Returns the a tree with a given name.
 
TTree * GetTree ()
 Returns the a tree set as current.
 
void ReadTree (const std::string &file, Int_t index)
 Read a tree from a file provided the index.
 
void ReadTree (const std::string &file, const std::string &name)
 Read a tree from a file provided the name.
 
void ReadFile (const std::string &file)
 Read all trees from a file.
 
Int_t GetTreeIndex (const std::string &tree_name)
 Retuns the tree index provided the name.
 
std::string GetTreeName (Int_t index)
 Retuns the tree name provided the index.
 
Int_t GetCurrentTree () const
 Retuns the current tree index.
 
std::string GetCurrentTreeName ()
 Retuns the current tree name.
 
void SetCurrentTree (Int_t index)
 Sets the current tree provided the index.
 
void SetCurrentTree (const std::string &tree_name)
 Sets the current tree provided the name.
 
bool HasTree (Int_t index)
 Check the existence of a tree provided the index.
 
bool HasTree (const std::string &tree_name)
 Check the existence of a tree provided the name.
 

Protected Types

enum  flatTreeVars { sPOTSincePreviousSpill = TreeVars::TreeVarsLast+1 }
 
enum  flatTreeIndex { flattree = OutputManager::enumSpecialTreesLast+1 }
 

Protected Member Functions

virtual bool Initialize ()
 
virtual bool InitializeSpill ()
 
virtual void DefineOutputTree ()
 Define the tree that should be written to the output file.
 
virtual void FinalizeSpill ()
 Finalize each spill, including cleaning up data read from the input file.
 
virtual void Finalize ()
 
virtual bool Process ()
 
virtual void FillSpillVariables ()
 
virtual bool CheckTruthFillFlatTree (const AnaSpill &spill)
 
virtual bool CheckReconFillFlatTree (const AnaBunch &bunch)
 
virtual bool CheckReconFillFlatTreeOutOfBunch (const AnaBunch &bunch)
 
virtual bool CheckTrueVertexReaction (const AnaTrueVertex &vtx)
 
virtual bool CheckTrueVertexDetector (unsigned long det)
 
virtual void CreateListOfTrueParticlesToSave ()
 
virtual AnaTrueParticleBGetTrueParticleByID (int ID)
 
virtual void FillFlatTree ()
 
virtual void DefineSpill (AnaSpillIO *spill)
 
virtual void DefineTrueVertex (AnaTrueVertexIO *trueVertex)
 
virtual void DefineTrueParticle (AnaTrueParticleIO *trueParticle)
 
virtual void DefineFgdTimeBin (AnaFgdTimeBinIO *fgdTimeBin)
 
virtual void DefineBunch (AnaBunchIO *bunch)
 
virtual void DefineTrack (AnaTrackIO *track)
 
virtual void DefineVertex (AnaVertexIO *vertex)
 
virtual void DefineTPCParticle (AnaTPCParticleIO *tpc)
 
virtual void DefineFGDParticle (AnaFGDParticleIO *fgd)
 
virtual void DefineECALParticle (AnaECALParticleIO *ecal)
 
virtual void DefineSMRDParticle (AnaSMRDParticleIO *smrd)
 
virtual void DefineP0DParticle (AnaP0DParticleIO *p0d)
 
virtual void DefineTrackerTrack (AnaTrackerTrackIO *tracker)
 
virtual void DefineTECALReconObject (AnaTECALReconObjectIO *tecal)
 
virtual void DefineTECALUnmatchedObject (AnaTECALUnmatchedObjectIO *tecal)
 
virtual void DefineP0DReconVertex (AnaP0DReconVertexIO *p0dVertex)
 
virtual void DefineP0DReconParticle (AnaP0DReconParticleIO *p0dParticle)
 
virtual void WriteTrueParticle (AnaTrueParticleIO *trueParticle, int trueVertexIndex)
 
virtual void WriteVertex (AnaVertexIO *vertex, const std::vector< int > trueVertexIndices)
 
virtual void WriteTrueVertex (AnaTrueVertexIO *trueVertex)
 
virtual void WriteFgdTimeBin (AnaFgdTimeBinIO *fgdTimeBin)
 
virtual void WriteBunch (AnaBunchIO *bunch)
 
virtual void WriteTrack (AnaTrackIO *track)
 
virtual void WriteTPCParticle (AnaTPCParticleIO *tpc)
 
virtual void WriteFGDParticle (AnaFGDParticleIO *fgd)
 
virtual void WriteECALParticle (AnaECALParticleIO *ecal)
 
virtual void WriteSMRDParticle (AnaSMRDParticleIO *smrd)
 
virtual void WriteP0DParticle (AnaP0DParticleIO *p0d)
 
virtual void WriteTrackerTrack (AnaTrackerTrackIO *tracker, int j)
 
virtual void WriteTECALReconObject (AnaTECALReconObjectIO *tecal)
 
virtual void WriteTECALUnmatchedObject (AnaTECALUnmatchedObjectIO *tecal)
 
virtual void WriteP0DReconVertex (AnaP0DReconVertexIO *p0dVertex)
 
virtual void WriteP0DReconParticle (AnaP0DReconParticleIO *p0dParticle)
 
virtual int FindTrueVertexIndex (AnaTrueVertexB *vertex)
 
bool CheckWriteSegment (SubDetId::SubDetEnum det, const AnaParticleB &seg)
 
void ResetCheckWriteSegment ()
 
- Protected Member Functions inherited from SimpleLoopBase
void PrintUsage (const std::string &programName)
 Print the program's usage statement.
 
HighlandInputManagerinput ()
 
void FillConfigTree ()
 Fill the "config" tree, which includes details of the analysis cuts etc.
 

Protected Attributes

RooTrackerVtxManager _rooVtxManager
 
bool _saveTruthWithRecon
 
bool _saveRoo
 
bool _saveTPCInfo
 
bool _saveFGDInfo
 
bool _saveECALInfo
 
bool _saveP0DInfo
 
bool _saveSMRDInfo
 
bool _saveTrackerInfo
 
bool _saveReconDirTECALInfo
 
bool _saveReconDirPECALInfo
 
bool _saveReconDirP0DInfo
 
bool _saveReconDirFGDOnlyInfo
 
bool _useTPC1
 
bool _useTPC2
 
bool _useTPC3
 
bool _useFGD1
 
bool _useFGD2
 
bool _useP0D
 
bool _useDsECal
 
bool _useTrECal
 
bool _useP0DECal
 
bool _useSMRD
 
bool _useTPC1outOfBunch
 
bool _useTPC2outOfBunch
 
bool _useTPC3outOfBunch
 
bool _useFGD1outOfBunch
 
bool _useFGD2outOfBunch
 
bool _useP0DoutOfBunch
 
bool _useDsECaloutOfBunch
 
bool _useTrECaloutOfBunch
 
bool _useP0DECaloutOfBunch
 
bool _useSMRDoutOfBunch
 
bool _saveTrueNuNC
 
bool _saveTrueAntiNuNC
 
bool _saveTrueNumuCC
 
bool _saveTrueAntiNumuCC
 
bool _saveTrueNueCC
 
bool _saveTrueAntiNueCC
 
double _POTSincePreviousSpill
 
bool _spill_filled
 
std::set< int > _trueParticleIDs
 
std::vector< SubDetId::SubDetEnum_saveTrueVertexInDet
 
std::vector< AnaTrueVertex * > _savedTrueVertices
 
Int_t _max_nodes [10]
 
- Protected Attributes inherited from SimpleLoopBase
Long64_t _entry
 The current entry in the file.
 
std::string _inputFileName
 Input file name, as specified by the user.
 
std::string _inputFileType
 
std::string _outputFileName
 The output file name, as specified by the user.
 
bool _cosmicMode
 
bool _versionCheck
 Check version compatibility between nd280AnalysisTools compilation and oaAnalysis file.
 
MemoryUsage _memory
 Memory logging.
 
CorrectionManager _corrections
 Correction manager.
 
DocStringManager _docStrings
 DocStrings manager.
 
- Protected Attributes inherited from OutputManager
std::string _default_docstring
 
DocStringManager_doc
 
std::vector< Double_t > _toyWeights
 
int _toy_index
 current toy experiment index
 
Int_t _single_tree_fill
 
std::vector< std::vector< std::string > > _tree_vars_all_vars
 The names of all variables added.
 
std::vector< std::vector< std::string > > _tree_vars_all_counters
 The names of all counters added.
 
std::vector< std::vector< Int_t > > _link_var_to_counter
 Correspondece between a variable index and the counter index.
 
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.
 
std::vector< std::vector< Int_t > > _tree_vars_counter
 The counter it self.
 
std::vector< std::vector< Int_t > > _tree_vars_int
 Single variables.
 
std::vector< std::vector< Float_t > > _tree_vars_float
 
std::vector< std::vector< Double_t > > _tree_vars_double
 
std::vector< std::vector< achar > > _tree_vars_char
 
std::vector< std::vector< int_vector *> > _tree_vars_int_vector
 Vector variables (1 index)
 
std::vector< std::vector< float_vector *> > _tree_vars_float_vector
 
std::vector< std::vector< double_vector *> > _tree_vars_double_vector
 
std::vector< std::vector< char_vector *> > _tree_vars_char_vector
 
std::vector< std::vector< int_matrix *> > _tree_vars_int_matrix
 Matrix variables (2 indices)
 
std::vector< std::vector< float_matrix *> > _tree_vars_float_matrix
 
std::vector< std::vector< double_matrix *> > _tree_vars_double_matrix
 
std::vector< std::vector< char_matrix *> > _tree_vars_char_matrix
 
std::vector< std::vector< int_3Dmatrix *> > _tree_vars_int_3Dmatrix
 3D matrix variables (3 indices)
 
std::vector< std::vector< float_3Dmatrix *> > _tree_vars_float_3Dmatrix
 
std::vector< std::vector< double_3Dmatrix *> > _tree_vars_double_3Dmatrix
 
std::vector< std::vector< Int_t > > _tree_vars_used_counter
 The counter it self.
 
std::vector< std::vector< Int_t > > _tree_vars_used_int
 Single variables.
 
std::vector< std::vector< Int_t > > _tree_vars_used_float
 
std::vector< std::vector< Int_t > > _tree_vars_used_double
 
std::vector< std::vector< Int_t > > _tree_vars_used_char
 
std::vector< std::vector< Int_t > > _tree_vars_used_int_vector
 Vector variables (1 index)
 
std::vector< std::vector< Int_t > > _tree_vars_used_float_vector
 
std::vector< std::vector< Int_t > > _tree_vars_used_double_vector
 
std::vector< std::vector< Int_t > > _tree_vars_used_char_vector
 
std::vector< std::vector< Int_t > > _tree_vars_used_int_matrix
 Matrix variables (2 indices)
 
std::vector< std::vector< Int_t > > _tree_vars_used_float_matrix
 
std::vector< std::vector< Int_t > > _tree_vars_used_double_matrix
 
std::vector< std::vector< Int_t > > _tree_vars_used_char_matrix
 
std::vector< std::vector< Int_t > > _tree_vars_used_int_3Dmatrix
 3D matrix variables (3 indices)
 
std::vector< std::vector< Int_t > > _tree_vars_used_float_3Dmatrix
 
std::vector< std::vector< Int_t > > _tree_vars_used_double_3Dmatrix
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_int
 –— Vectors containing whether a given index is used or not More...
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_float
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_double
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_char
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_int_vector
 Vector variables (1 index)
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_float_vector
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_double_vector
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_char_vector
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_int_matrix
 Matrix variables (2 indices)
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_float_matrix
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_double_matrix
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_char_matrix
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_int_3Dmatrix
 3D matrix variables (3 indices)
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_float_3Dmatrix
 
std::vector< std::vector< Bool_t > > _tree_vars_exist_double_3Dmatrix
 
- Protected Attributes inherited from TreeManager
TFile * _file
 Root input or output file.
 
std::vector< TTree *> _trees
 Vector of trees.
 
std::vector< TTree *> _trees_nonull
 Vector of non NULL trees.
 
std::vector< Int_t > _trees_indices
 Vector of indices for the non NULL TTree in previous vector.
 
Int_t _current_tree
 The current tree.
 

Additional Inherited Members

- Public Types inherited from OutputManager
enum  enumStandardMicroTrees_OutputManager { NTOYS =0, toy_weight, toy_index, enumStandardMicroTreesLast_OutputManager }
 
enum  enumSpecialTrees {
  config =0, header, truth, NRooTrackerVtx,
  GRooTrackerVtx, RooTrackerVtx, enumSpecialTreesLast
}
 

Detailed Description

Definition at line 10 of file CreateFlatTree.hxx.

Member Function Documentation

§ Finalize()

void CreateFlatTree::Finalize ( )
protectedvirtual

Tidy up, including closing the output file. Called after all spills have beem read.

Reimplemented from SimpleLoopBase.

Definition at line 582 of file CreateFlatTree.cxx.

582  {
583 //********************************************************************
584 
585  if (_spill_filled) return;
586 
587  // Fill the info for th last processed spill such that we keep track of the total POT since the last saved entry.
588 
589  InitializeTree(GetCurrentTree());
590 
591  // Summary info for the spill + Beam + DQ
592  // input().GetSpill().Write(*this, "s");
593 
594  // Fill the flattree
595  FillFlatTree();
596 }
Int_t GetCurrentTree() const
Retuns the current tree index.
Definition: TreeManager.hxx:52

§ Initialize()

bool CreateFlatTree::Initialize ( )
protectedvirtual

Initialize the input manager etc, and calls the derived version of the function. Called before any spills are read.

Reimplemented from SimpleLoopBase.

Definition at line 59 of file CreateFlatTree.cxx.

59  {
60 //********************************************************************
61  // save only true tracks and vertices with recon association
62  _saveTruthWithRecon = (bool)ND::params().GetParameterI("highlandIO.FlatTree.SaveTruthWithReconAssociation");
63  _saveRoo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.SaveRooTracker");
64 
65  _saveTPCInfo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.SaveTPCInfo");
66  _saveFGDInfo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.SaveFGDInfo");
67  _saveECALInfo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.SaveECALInfo");
68  _saveP0DInfo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.SaveP0DInfo");
69  _saveSMRDInfo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.SaveSMRDInfo");
70  _saveTrackerInfo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.SaveTrackerInfo");
71 
72  // save info from the local reconstruction to the flat tree?
73  _saveReconDirFGDOnlyInfo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseReconDirFGDOnly" );
74  _saveReconDirP0DInfo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseReconDirP0D" );
75  _saveReconDirPECALInfo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseReconDirP0DECal" );
76  _saveReconDirTECALInfo = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseReconDirTrackerECal");
77 
78  _useTPC1 = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseTPC1");
79  _useTPC2 = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseTPC2");
80  _useTPC3 = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseTPC3");
81  _useFGD1 = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseFGD1");
82  _useFGD2 = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseFGD2");
83  _useP0D = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseP0D");
84  _useDsECal = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseDsECal");
85  _useTrECal = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseTrECal");
86  _useP0DECal = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseP0DECal");
87  _useSMRD = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseSMRD");
88 
89  _useTPC1outOfBunch = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseTPC1outOfBunch");
90  _useTPC2outOfBunch = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseTPC2outOfBunch");
91  _useTPC3outOfBunch = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseTPC3outOfBunch");
92  _useFGD1outOfBunch = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseFGD1outOfBunch");
93  _useFGD2outOfBunch = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseFGD2outOfBunch");
94  _useP0DoutOfBunch = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseP0DoutOfBunch");
95  _useDsECaloutOfBunch = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseDsECaloutOfBunch");
96  _useTrECaloutOfBunch = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseTrECaloutOfBunch");
97  _useP0DECaloutOfBunch = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseP0DECaloutOfBunch");
98  _useSMRDoutOfBunch = (bool)ND::params().GetParameterI("highlandIO.FlatTree.UseSMRDoutOfBunch");
99 
100  _saveTrueNuNC = (bool)ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.NuNC");
101  _saveTrueAntiNuNC = (bool)ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.AntiNuNC");
102  _saveTrueNumuCC = (bool)ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.NumuCC");
103  _saveTrueAntiNumuCC = (bool)ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.AntiNumuCC");
104  _saveTrueNueCC = (bool)ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.NueCC");
105  _saveTrueAntiNueCC = (bool)ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.AntiNueCC");
106 
107 
108  if (ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.TPC1")) _saveTrueVertexInDet.push_back(SubDetId::kTPC1);
109  if (ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.TPC2")) _saveTrueVertexInDet.push_back(SubDetId::kTPC2);
110  if (ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.TPC3")) _saveTrueVertexInDet.push_back(SubDetId::kTPC3);
111  if (ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.FGD1")) _saveTrueVertexInDet.push_back(SubDetId::kFGD1);
112  if (ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.FGD2")) _saveTrueVertexInDet.push_back(SubDetId::kFGD2);
113  if (ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.P0D")) _saveTrueVertexInDet.push_back(SubDetId::kP0D);
114  if (ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.DsECal")) _saveTrueVertexInDet.push_back(SubDetId::kDSECAL);
115  if (ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.TrECal")) _saveTrueVertexInDet.push_back(SubDetId::kTECAL);
116  if (ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.P0DECal")) _saveTrueVertexInDet.push_back(SubDetId::kPECAL);
117  if (ND::params().GetParameterI("highlandIO.FlatTree.TrueVertex.SMRD")) _saveTrueVertexInDet.push_back(SubDetId::kSMRD);
118 
119 
120  // Check software version compatibility between nd280AnalysisTools and current file
121  if (_versionCheck){
122  if(!ND::versioning().CheckVersionCompatibility(input().GetSoftwareVersion(),anaUtils::GetProductionIdFromND280AnalysisTools())) return false;
123  }
124 
125  // Select the production based on the software version of the input file. This will be used to select the appropriate corrections,
126  // bunching, systematics, etc. Assume production 5 when no software version exists
127  versionUtils::prod6_bunching = false;
128  versionUtils::prod6_corrections = false;
129  versionUtils::prod6_systematics = false;
130  if (_versionCheck){
131  if (ND::versioning().GetProduction(input().GetSoftwareVersion()) >= ProdId::PROD6PRE){
132  versionUtils::prod6_bunching = true;
133  versionUtils::prod6_corrections = true;
134  versionUtils::prod6_systematics = true;
135  }
136  }
137 
138  // Dump the production used for corrections, bunching, systematics, etc
139  versionUtils::DumpProductions();
140 
141  _POTSincePreviousSpill = 0;
142  _spill_filled = false;
143 
144 
145  // Enable any corrections that have to be done while the flat tree is being created.
146  // Ignore right ECal for runs 3 and 4 as part of it is broken.
147  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableIgnoreRightECalCorrection")){
148  _corrections.AddCorrection(CorrId::kRightECalRun3And4Corr, "ignorerightecal_corr", new IgnoreRightECalRuns3and4Correction());
149  }
150 
151  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableDQCorrection")) {
152  // Correct the data quality in periods when a FGD FEB wasn't working.
153  _corrections.AddCorrection(CorrId::kDQCorr, "dq_corr", new DataQualityCorrection());
154  }
155 
156 
157 #if !VERSION_HAS_OFFICIAL_POT
158  // Only need this correction for P5 files.
159 
160  if (ND::params().GetParameterI("highlandIO.FlatTree.EnablePOTCorrection")) {
161  // Use CT4 for MR44 POT accounting, as CT5 wasn't working properly.
162  _corrections.AddCorrection(CorrId::kCT4POTCorr, "ct4pot_corr", new CT4POTCorrection());
163  }
164 #endif
165 
166  // Change the main fit momentum by the muon alternate momentum, but only for P5
167 #if !VERSION_HAS_EQUIVALENT_MAIN_AND_ALT_FITS
168  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableUseMuonAltMomCorrection")) {
169  _corrections.AddCorrection(CorrId:: kGlobalAltMomCorr, "altmom_corr", new UseGlobalAltMomCorrection(UseGlobalAltMomCorrection::kMuon));
170  }
171 #endif
172 
173 
174  if (ND::params().GetParameterI("highlandIO.FlatTree.EnablePileUpCorrection")){
175  _corrections.AddCorrection(CorrId::kPileUpCorr, "pileup_corr", new PileUpCorrection());
176  }
177  // Apply the TPC dE/dx correction in all configurations
178  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableTPCdEdxDataCorrection")){
179  _corrections.AddCorrection(CorrId::kTPCdEdxDataCorr, "tpcdedx_data_corr", new TPCdEdxDataCorrection());
180  }
181  // Apply the TPC dE/dx correction in all configurations
182  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableTPCdEdxMCCorrection")){
183  _corrections.AddCorrection(CorrId::kTPCdEdxMCCorr, "tpcdedx_mc_corr", new TPCdEdxMCCorrection());
184  }
185  // Apply the TPC expected dE/dx correction in all configurations
186  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableTPCExpecteddEdxCorrection")){
187  _corrections.AddCorrection(CorrId::kTPCdEdxExpCorr, "tpcexpecteddedx_corr", new TPCExpecteddEdxCorrection());
188  }
189 
190  // Apply the TPC PID correction based on pull params smearing
191  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableTPCPIDPullMCCorrection")){
192  _corrections.AddCorrection(CorrId::kTPCPIDPullMCCorr, "tpc_pid_pull_mc_corr", new TPCPIDPullMCCorrection());
193  }
194 
195  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableMomResolMCCorrection")){
196  _corrections.AddCorrection(CorrId::kMomResolMCCorr, "mom_resol_mc_corr", new MomResolMCCorrection());
197  }
198 
199  // Need to be called before the ToF in order to correctly flip a track if required
200  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableFlipKinematicsCorrection")){
201  _corrections.AddCorrection(CorrId::kFlipKinCorr, "flipkinematics_corr", new FlipKinematicsCorrection());
202  }
203 
204  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableToFCorrection")){
205  _corrections.AddCorrection(CorrId::kToFCorr, "tof_corr", new ToFCorrection());
206  }
207 
208 
209  if (ND::params().GetParameterI("highlandIO.FlatTree.EnableMomRangeCorrection")){
210  _corrections.AddCorrection(CorrId::kMomRangeCorr, "momrange_corr", new MomRangeCorrection());
211  }
212 
213 
214  return true;
215 }
void AddCorrection(Int_t index, const std::string &name, CorrectionBase *corr)
CorrectionManager _corrections
Correction manager.
This class defines a correction that affects the reconstructed TPC Momentum of an.
ProdId_h GetProductionIdFromND280AnalysisTools()
Get Production Id from nd280AnalysisTools.
bool _versionCheck
Check version compatibility between nd280AnalysisTools compilation and oaAnalysis file...

§ InitializeSpill()

virtual bool CreateFlatTree::InitializeSpill ( )
inlineprotectedvirtual

Initialize each spill, including reading it from the input file. Called before Process().

Reimplemented from SimpleLoopBase.

Definition at line 20 of file CreateFlatTree.hxx.

20 {return _rooVtxManager.InitializeEntry();}

§ Process()

bool CreateFlatTree::Process ( )
protectedvirtual

The main function that should be overridden in the derived class. Called once for each spill, after it has been read in from the input file. The current spill can be accessed using ND::input().GetSpill().

Implements SimpleLoopBase.

Definition at line 319 of file CreateFlatTree.cxx.

319  {
320 //********************************************************************
321 
322  _spill_filled=false;
323 
324  // Set the tree to fill
325  SetFillSingleTree(flattree);
326  SetCurrentTree(flattree);
327 
328  AnaSpill& spill = *static_cast<AnaSpill*>(&input().GetCorrectedSpill());
329 
330  // Accumulate POT since previous spill saved
331  _POTSincePreviousSpill += static_cast<const AnaBeam*>(spill.Beam)->POT;
332 
333  // Analyse OutOfBunch for first for having AnaTrack when associating vertex constituents
334  std::vector<AnaBunchC*> outplusbunches;
335  outplusbunches.push_back(spill.OutOfBunch);
336  for (unsigned int b = 0; b < spill.Bunches.size(); b++){
337  outplusbunches.push_back(spill.Bunches[b]);
338  }
339 
340  //------ Loop over outofbunch+bunches --------------
341  for (unsigned int b=0; b < outplusbunches.size(); b++){
342 
343  AnaBunch* bunch = static_cast<AnaBunch*>(outplusbunches[b]);
344 
345  if (!bunch) continue;
346 
347  // Check whether there are FGD or TPC reconstructed tracks in the bunch
348  bool ok_recon = CheckReconFillFlatTree(*bunch);
349 
350  // Stop if there is no interesting recon info
351  if (!ok_recon) continue;
352 
353  // Put all variables to their default value
354  InitializeTree(GetCurrentTree());
355 
356  // Summary info for the spill + Beam + DQ + trigger
357  AnaSpill* spill = static_cast<AnaSpill*>(&input().GetSpill());
358  AnaSpillIO spill_io(*spill);
359 
360  // When the RooTrackerVtx tree is saved in the output file the entry must be recomputed (is not the one in the input file)
361  if (HasTree(RooTrackerVtx))
362  spill_io.RooVtxEntry = _rooVtxManager.GetRooVtxEntry();
363 
364  // Summary info for the spill + Beam + DQ
365  spill_io.Write(*this, "s");
366 
367 
368  AnaBunchIO bunch_io(*bunch);
369 
370  // Fill Bunch variables
371  WriteBunch(&bunch_io);
372 
373  // Fill spill first for having AnaTrueParticle and AnaTrueVertex to point to
374  // Fill spill && truth info only for the first bunch saved
375  if (!_spill_filled) {
376  // TrueVertices and FgdTimeBins
377  FillSpillVariables();
378 
379  // Fill the RooTrackerVtx tree
380  if (HasTree(RooTrackerVtx)){
381  OutputManager::FillTree(RooTrackerVtx);
382  _rooVtxManager.IncrementRooVtxEntry();
383  }
384 
385  _spill_filled = true;
386  }
387 
388  //------ Particles ----------
389  for (UInt_t i = 0; i < bunch->Particles.size(); i++){
390  AnaTrack* track = static_cast<AnaTrack*>(bunch->Particles[i]);
391 
392  if (!track) continue;
393 
394 
395  // TPC constituent variables
396  if (_saveTPCInfo) {
397  ResetCheckWriteSegment();
398  for (int j = 0; j < track->nTPCSegments; j++){
399  AnaTPCParticle* particle = static_cast<AnaTPCParticle*>(track->TPCSegments[j]);
400  AnaTPCParticleIO particle_io(*particle);
401  if (CheckWriteSegment(SubDetId::kTPC, *track->TPCSegments[j])) WriteTPCParticle(&particle_io);
402  }
403  }
404 
405  // FGD constituent variables
406  if (_saveFGDInfo) {
407  ResetCheckWriteSegment();
408  for (int j = 0; j < track->nFGDSegments; j++){
409  AnaFGDParticle* particle = static_cast<AnaFGDParticle*>(track->FGDSegments[j]);
410  AnaFGDParticleIO particle_io(*particle);
411  if (CheckWriteSegment(SubDetId::kFGD, *track->FGDSegments[j])) WriteFGDParticle(&particle_io);
412  }
413  }
414 
415  // ECAL constituent variables
416  if (_saveECALInfo) {
417  ResetCheckWriteSegment();
418  for (int j = 0; j < track->nECALSegments; j++){
419  AnaECALParticle* particle = static_cast<AnaECALParticle*>(track->ECALSegments[j]);
420  AnaECALParticleIO particle_io(*particle);
421  if (CheckWriteSegment(SubDetId::kECAL, *track->ECALSegments[j])) WriteECALParticle(&particle_io);
422  }
423  }
424 
425  // SMRD constituent variables
426  if (_saveSMRDInfo) {
427  ResetCheckWriteSegment();
428  for (int j = 0; j < track->nSMRDSegments; j++){
429  AnaSMRDParticle* particle = static_cast<AnaSMRDParticle*>(track->SMRDSegments[j]);
430  AnaSMRDParticleIO particle_io(*particle);
431 
432  if (CheckWriteSegment(SubDetId::kSMRD, *track->SMRDSegments[j])) WriteSMRDParticle(&particle_io);
433  }
434  }
435 
436  // P0D constituent variables
437  if (_saveP0DInfo) {
438  ResetCheckWriteSegment();
439  for (int j = 0; j < track->nP0DSegments; j++){
440  AnaP0DParticle* particle = static_cast<AnaP0DParticle*>(track->P0DSegments[j]);
441  AnaP0DParticleIO particle_io(*particle);
442 
443  if (CheckWriteSegment(SubDetId::kP0D, *track->P0DSegments[j])) WriteP0DParticle(&particle_io);
444  }
445  }
446 
447  // TRACKER constituent variables
448  if (_saveTrackerInfo) {
449  std::vector<AnaTrackerTrackB*> trackers = track->TRACKERSegments;
450  for (unsigned int j = 0; j < trackers.size(); j++){
451  AnaTrackerTrack* tracker = static_cast<AnaTrackerTrack*>(trackers[j]);
452 
453  AnaTrackerTrackIO tracker_io(*tracker);
454 
455  WriteTrackerTrack(&tracker_io, j);
456  }
457  }
458 
459  AnaTrackIO track_io(*track);
460 
461  // Summary info for the track (adds a new track to the vector)
462  WriteTrack(&track_io);
463  }
464 
465  // Write TECALReconObjects to the bunch ?
466  if (_saveReconDirTECALInfo){
467 
468  // Cast the AnaBunch pointer to an AnaLocalReconBunch
469  AnaLocalReconBunch* localBunch = static_cast<AnaLocalReconBunch*>(bunch);
470 
471  // Iterate over the vector of AnaTECALReconObjects belonging to the bunch and write them
472  // to the flat tree.
473  for (std::vector<AnaTECALReconObject*>::const_iterator it = localBunch->TECALReconObjects.begin(); it != localBunch->TECALReconObjects.end(); it++){
474 
475  AnaTECALReconObject* object = static_cast<AnaTECALReconObject*>(*it);
476  AnaTECALReconObjectIO object_ecal(*object);
477 
478  WriteTECALReconObject(&object_ecal);
479  }
480 
481  // Iterate over the vector of AnaTECALUnmatchedObjects belonging to the bunch and write them
482  // to the flat tree.
483  for (std::vector<AnaTECALUnmatchedObject*>::const_iterator it=localBunch->TECALUnmatchedObjects.begin(); it!=localBunch->TECALUnmatchedObjects.end(); it++){
484 
485  AnaTECALUnmatchedObject* object = static_cast<AnaTECALUnmatchedObject*>(*it);
486  AnaTECALUnmatchedObjectIO object_ecal(*object);
487 
488 
489  WriteTECALUnmatchedObject(&object_ecal);
490  }
491  }
492 
493  // Write P0DReconObjects to the bunch?
494  if (_saveReconDirP0DInfo){
495 
496  // Cast the AnaBunch pointer to an AnaLocalReconBunch
497  AnaLocalReconBunch* localBunch = static_cast<AnaLocalReconBunch*>(bunch);
498 
499 
500  // Iterate over the vector of AnaP0DReconVertex objects belonging to the bunch and write them
501  for (std::vector<AnaP0DReconVertex*>::const_iterator it = localBunch->P0DReconVertices.begin(); it != localBunch->P0DReconVertices.end(); it++){
502 
503  AnaP0DReconVertex* object = static_cast<AnaP0DReconVertex*>(*it);
504  AnaP0DReconVertexIO object_p0d(*object);
505 
506  WriteP0DReconVertex(&object_p0d);
507  }
508 
509  // Iterate over the vector of AnaP0DReconParticle objects belonging to the bunch and write them
510  for (std::vector<AnaP0DReconParticle*>::const_iterator it = localBunch->P0DReconParticles.begin(); it!=localBunch->P0DReconParticles.end(); it++){
511 
512  AnaP0DReconParticle* object = static_cast<AnaP0DReconParticle*>(*it);
513  AnaP0DReconParticleIO object_p0d(*object);
514 
515  WriteP0DReconParticle(&object_p0d);
516  }
517  }
518 
519 
520  //------ Vertices ----------
521  std::vector<int> trueVertexIndices;
522  for (unsigned int i = 0; i < bunch->Vertices.size(); i++) {
523  //Save the trueVertexIndex instead of ID to speed up associations in FlatTreeConverter
524  AnaTrueVertexB* MatchedTrueVertices[100];
525  int nMatchedTrueVertices = bunch->Vertices[i]->GetTrueVertices(MatchedTrueVertices);
526  trueVertexIndices.clear();
527  for (int j = 0; j < nMatchedTrueVertices; j++) {
528  int trueVertexIndex = FindTrueVertexIndex(MatchedTrueVertices[j]);
529  trueVertexIndices.push_back(trueVertexIndex);
530  }
531 
532  AnaVertex* vertex_tmp = static_cast<AnaVertex*>(bunch->Vertices[i]);
533  AnaVertexIO vertex(*vertex_tmp);
534 
535  // Summary info for the vertex (adds a new vertex to the vector)
536  WriteVertex(&vertex, trueVertexIndices);
537  }
538 
539  // fill the flat tree
540  FillFlatTree();
541  }
542 
543  // Fill spill and truth info when there are no bunches
544  if (!_spill_filled){
545 
546  // Check whether this event is true signal (for eff calculation)
547  bool ok_truth = CheckTruthFillFlatTree(spill);
548  if (ok_truth){
549 
550  InitializeTree(GetCurrentTree());
551 
552  AnaSpill* spill_tmp = static_cast<AnaSpill*>(&input().GetSpill());
553  AnaSpillIO spill(*spill_tmp);
554 
555  // When the RooTrackerVtx tree is saved in the output file the entry must be recomputed (is not the one in the input file)
556  if (HasTree(RooTrackerVtx))
557  spill.RooVtxEntry = _rooVtxManager.GetRooVtxEntry();
558 
559  // Summary info for the spill + Beam + DQ
560  spill.Write(*this, "s");
561 
562  // TrueVertices and FgdTimeBins
563  FillSpillVariables();
564 
565  // Fill the flattree
566  FillFlatTree();
567 
568  // Fill the RooTrackerVtx tree
569  if (HasTree(RooTrackerVtx)){
570  OutputManager::FillTree(RooTrackerVtx);
571  _rooVtxManager.IncrementRooVtxEntry();
572  }
573 
574  _spill_filled = true;
575  }
576  }
577 
578  return true;
579 }
int nP0DSegments
How many P0D tracks are associated with this track.
Representation of a global track.
Representation of an ECAL segment of a global track.
AnaP0DParticleB * P0DSegments[NMAXP0DS]
The P0D segments that contributed to this global track.
AnaSpillC & GetCorrectedSpill()
Get the current spill (to have corrections applied to it).
P0DRecon Vertex.
AnaECALParticleB * ECALSegments[NMAXECALS]
The ECAL segments that contributed to this global track.
int nECALSegments
How many ECAL tracks are associated with this track.
AnaSMRDParticleB * SMRDSegments[NMAXSMRDS]
The SMRD segments that contributed to this global track.
Representation of a true Monte Carlo vertex.
std::vector< AnaBunchC * > Bunches
The reconstructed objects, split into timing bunches.
Int_t GetCurrentTree() const
Retuns the current tree index.
Definition: TreeManager.hxx:52
Representation of an SMRD segment of a global track.
AnaTPCParticleB * TPCSegments[NMAXTPCS]
The TPC segments that contributed to this global track.
P0DRecon Particle.
This Ana* object is used to flatten TECALReconObjects from ReconDir/TrackerECal.
AnaBunchB * OutOfBunch
Reconstructed objects that didn&#39;t fit into one of the timing bunches.
std::vector< AnaVertexB * > Vertices
void FillTree()
Fill the current tree.
int nSMRDSegments
How many SMRD tracks are associated with this track.
int nTPCSegments
How many TPC tracks are associated with this track.
void SetCurrentTree(Int_t index)
Sets the current tree provided the index.
Definition: TreeManager.hxx:58
AnaBeamB * Beam
The beam quality flags for this spill.
AnaSpillC & GetSpill()
Get the current spill (to have corrections and systematics applied to it).
Representation of a Tracker segment of a global track.
bool HasTree(Int_t index)
Check the existence of a tree provided the index.
Definition: TreeManager.cxx:59
Representation of a FGD segment of a global track.
std::vector< AnaTrackerTrackB * > TRACKERSegments
The TRACKER segments that contributed to this global track.
void IncrementRooVtxEntry()
Increment by one the current entry in the RooTrackerVtx tree.
Representation of a P0D segment of a global track.
Int_t RooVtxEntry
Not in the MiniTree for the Moment since it produces a seg fault.
This Ana* object is used to flatten TECALUnmatchedObjects from ReconDir/TrackerECal.
int nFGDSegments
How many FGD tracks are associated with this track.
Representation of a global track.
std::vector< AnaParticleB * > Particles
Representation of a TPC segment of a global track.
Representation of a TPC segment of a global particle.
Representation of the beam information, including POT and quality.
AnaFGDParticleB * FGDSegments[NMAXFGDS]
The FGD segments that contributed to this global track.
Representation of a global vertex.

The documentation for this class was generated from the following files: