|
BrOutputTreeElementclass description - source file - inheritance tree class BrOutputTreeElement : public TObjectpublic: Data Membersprivate: Class DescriptionBRAHMS Output Tree Module The idea for creating this class was the use of BrTrackTree to create a usefull output tree. As opposed to BrTrackTree this module does not have limitations on the kinds of objects included in the tree. One can add all the kinds of objects that one usually finds in an output BrEvent. After an analysis session one can use the output tree for easy plotting of distributions and correlations, e.g. using the TTreeViewer. Usage, assuming instance 'mainModule' of BrMainModule is created: BrOutputTreeModule* otm = new BrOutputTreeModule("OTM", "Output Tree Module"); otm->SetIOMode(BrIOModule::kBrJobFile | BrIOModule::kBrRecreateFile); otm->AddFile("mytree.root"); otm->AddElement("BrBbVertex", "BB Vertex"); otm->AddElement("BrFFSTrack", "FFSTrack", kTRUE); ...<Adding other elements>... mainModule->AddModule(otm); The module distinguishes between two kinds of elements added to it. If the element does not represent objects in a BrDataTable in the output BrEvent, a branch for the class given as the first argument in AddElement() is created. It the element represents objects found in BrDataTables, e.g. the case for BrFFSTrack above, a TClonesArray for these objects is instantiated and a branch for the array is created. This behavior requires the third argument of AddElement()to be true. For each event the instance of TClonesArray is filled with objects from its corresponding BrDataTable and the tree is filled. To allow the user to create several instances of this class, the name of the tree includes a number. Thus the first instance of this class creates a tree named 'T1', the second instance creates a tree named 'T2' and so on. Since a branch name in a TTree can not contain blanks, eventual blanks in the name of objects (second argument in AddElement()) is substituted with underscores. Thus the element named 'BB Vertex' above will show up in the tree as 'BB_Vertex'. Note optional arguments in AddElement() for buffer size and split level. Also note the possiblity to set the auto save parameter for the tree using SetAutoSave(). Look for more information obout these parameters in the TTree class descrition and and in the ROOT User Guide. BrOutputTreeElement(const Char_t* className, const Char_t* name, const Char_t* branchName, Bool_t isTable, Int_t arrSize, Int_t bufSize, Int_t splitLevel) : fClassName(className), fName(name), fBranchName(branchName), fIsTable(isTable) Named Constructor If element is data table (isTable == kTRUE), the name of the table is <name> Otherwise the name of the object is <name>. ~BrOutputTreeElement() Destructor. Only if this element refers to a data table, and thus an instance of TClonesArray is allocated, this object will be deleted. void Branch(TTree* t) Create branch in tree t for this element. void Event(BrEventNode* event) Event function. This function is called once per element per event. If data table the table with name fName is searched for in the event. If found the TClonesArray is filled. Otherwise the data object with name fName is searched for in the event. If found its address is assigned to fStore and the address of the branch is updated. void Print() Print the parameters of this element to stdout. Inline FunctionsTClass* Class() TClass* IsA() const void ShowMembers(TMemberInspector& insp, char* parent) void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) BrOutputTreeElement BrOutputTreeElement(BrOutputTreeElement&) |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|