BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page

BrOutputTreeModule


class description - source file - inheritance tree

class BrOutputTreeModule : public BrIOModule


    protected:
virtual void Setup() public:
BrOutputTreeModule BrOutputTreeModule() BrOutputTreeModule BrOutputTreeModule(const Char_t* name, const Char_t* title) BrOutputTreeModule BrOutputTreeModule(BrOutputTreeModule&) virtual void ~BrOutputTreeModule() virtual void AddElement(const Char_t* className, const Char_t* name, const Char_t* branchName, Bool_t isTable = kFALSE, Int_t arrSize = 100, Int_t bufSize = 32000, Int_t splitLevel = 99) virtual void AddElement(const Char_t* className, const Char_t* name, Bool_t isTable = kFALSE, Int_t arrSize = 100, Int_t bufSize = 32000, Int_t splitLevel = 99) static TClass* Class() virtual Bool_t Close() virtual void Event(BrEvent* event) virtual Int_t GetAutoSave() const virtual TClass* IsA() const virtual Bool_t Open(const Char_t*, const Option_t* option = "0") virtual void Print(Option_t* option = "B") const virtual void SetAutoSave(Int_t autos = 10000000) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
TFile* fFile ROOT file TTree* fTree Tree Int_t fAutoSave Tree branch auto save TObjArray* fElements Array of TTrackTreeElements

Class Description

 BRAHMS 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.

BrOutputTreeModule()
 Default constructor. DO NOT USE

BrOutputTreeModule(const Char_t* name, const Char_t* title) : BrIOModule(name, title)
 Named Constructor

~BrOutputTreeModule()
 Destructor

void AddElement(const Char_t* className, const Char_t* name, const Char_t* branchName, Bool_t isTable, Int_t arrSize, Int_t bufSize, Int_t splitLevel)
 Add element to be included in tree.

void AddElement(const Char_t* className, const Char_t* name, Bool_t isTable, Int_t arrSize, Int_t bufSize, Int_t splitLevel)
 Add element to be included in tree.

Bool_t Close()
 Close the file Opened by the object. Return
 kFALSE if no file was open.

void Event(BrEvent* event)
 Per event method.

Bool_t Open(const Char_t* fname, const Option_t* option)
 Open ROOT file. If no options is specified, open in RECREATE mode.

void Print(Option_t* option) const
 Print module information
 See BrModule::Print for options.
 In addition this module defines the Option:
 <fill in here>

void SetAutoSave(Int_t autos)
 Set tree autosave parameter.

void Setup()
 Setup default parameters.



Inline Functions


                     Int_t GetAutoSave() const
                   TClass* Class()
                   TClass* IsA() const
                      void ShowMembers(TMemberInspector& insp, char* parent)
                      void Streamer(TBuffer& b)
                      void StreamerNVirtual(TBuffer& b)
        BrOutputTreeModule BrOutputTreeModule(BrOutputTreeModule&)

This page automatically generated by script docBrat by Christian Holm

Copyright ; 2002 BRAHMS Collaboration <brahmlib@rcf.rhic.bnl.gov>
Last Update on 2002/08/15 17:21:35 $ by videbaek $

Validate HTML
Validate CSS