StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPicoDstReader.h
1 
15 #ifndef StPicoDstReader_h
16 #define StPicoDstReader_h
17 
18 // ROOT headers
19 #include "TChain.h"
20 #include "TTree.h"
21 #include "TFile.h"
22 #include "TString.h"
23 #include "TClonesArray.h"
24 
25 // PicoDst headers
26 #include "StPicoDst.h"
27 #include "StPicoEvent.h"
28 #include "StPicoArrays.h"
29 
30 //_________________
31 class StPicoDstReader : public TObject {
32 
33  public:
34 
37  StPicoDstReader(const Char_t* inFileName);
40 
42  StPicoDst *picoDst() { return mPicoDst; }
44  TChain *chain() { return mChain; }
46  TTree *tree() { return mTree; }
47 
49  void SetStatus(const Char_t* branchNameRegex, Int_t enable);
50 
52  void Init();
54  Bool_t readPicoEvent(Long64_t iEvent);
56  Bool_t ReadPicoEvent(Long64_t iEvent) { return readPicoEvent(iEvent); }
58  void Finish();
59 
60  private:
61 
63  TString mInputFileName;
64 
66  void streamerOff();
67 
69  void createArrays();
71  void clearArrays();
73  void setBranchAddresses(TChain *chain);
74 
76  StPicoDst *mPicoDst;
78  TChain *mChain;
80  TTree *mTree;
81 
83  Int_t mEventCounter;
84 
86  TClonesArray *mPicoArrays[StPicoArrays::NAllPicoArrays];
88  Char_t mStatusArrays[StPicoArrays::NAllPicoArrays];
89 
90  ClassDef(StPicoDstReader, 0)
91 };
92 
93 #endif
Bool_t readPicoEvent(Long64_t iEvent)
Read next event in the chain.
Allows to read picoDst file(s)
TChain * chain()
Return pointer to the chain of .picoDst.root files.
StPicoDst * picoDst()
Return a pointer to picoDst (return NULL if no dst is found)
void SetStatus(const Char_t *branchNameRegex, Int_t enable)
Set enable/disable branch matching when reading picoDst.
Main class that keeps TClonesArrays with main classes.
Definition: StPicoDst.h:40
void Init()
Calls openRead()
TTree * tree()
Return pointer to the current TTree.
~StPicoDstReader()
Destructor.
StPicoDstReader(const Char_t *inFileName)
void Finish()
Close files and finilize.
Bool_t ReadPicoEvent(Long64_t iEvent)
Read next event in the chain.