Changeset 760 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 04/23/01 14:16:02 (24 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r757 r760 55 55 56 56 // -------------------------------------------------------------------------- 57 // 58 // Default constructor. It creates an TChain instance which represents the 59 // the Tree you want to read and adds the given file (if you gave one). 60 // More files can be added using MReadTree::AddFile. 61 // Also an empty veto list is created. This list is used if you want to 62 // veto (disable or "don't enable") a branch in the tree. 63 // 57 64 MReadTree::MReadTree(const char *tname, const char *fname, 58 65 const char *name, const char *title) … … 72 79 73 80 // -------------------------------------------------------------------------- 81 // 82 // Destructor. It deletes the TChain and veto list object 83 // 74 84 MReadTree::~MReadTree() 75 85 { … … 79 89 80 90 // -------------------------------------------------------------------------- 91 // 92 // If you want to read the given tree over several files you must add 93 // the files here before PreProcess is called. Be carfull: This does 94 // only work if the trees in the files containing the same branches yet. 95 // 81 96 /*Int_t*/ void MReadTree::AddFile(const char *fname) 82 97 { … … 92 107 // -------------------------------------------------------------------------- 93 108 // 94 // open file and check if file is really open 109 // The PreProcess loops (till now) over the branches in the given tree. 110 // It checks if the corresponding containers (containers with the same 111 // name than the branch name) are existing in the Parameter Container List. 112 // If not, a container of objec type 'branch-name' is created (everything 113 // after the last semicolon in the branch name is stripped). Only 114 // branches which don't have a veto (see VetoBranch) are enabled If the 115 // object isn't found in the root dictionary (a list of classes known by the 116 // root environment) the branch is skipped and an error message is printed 117 // out. 95 118 // 96 119 Bool_t MReadTree::PreProcess (MParList *pList) … … 167 190 168 191 // -------------------------------------------------------------------------- 192 // 193 // The Process-function reads one event from the tree (this contains all 194 // enabled branches) and increases the position in the file by one event. 195 // (Remark: The position can also be set by some member functions 196 // If the end of the file is reached the Eventloop is stopped. 169 197 Bool_t MReadTree::Process() 170 198 { … … 178 206 // get entry 179 207 // 180 fChain->GetEntry(fNumEntry ); 181 182 fNumEntry ++ ; 183 184 return kTRUE; 185 } 186 187 // -------------------------------------------------------------------------- 188 // 189 // Close File 190 // 191 Bool_t MReadTree::PostProcess() 192 { 193 //fFile->Close(); 208 fChain->GetEntry(fNumEntry); 209 210 fNumEntry++; 194 211 195 212 return kTRUE; -
trunk/MagicSoft/Mars/mbase/MReadTree.h
r757 r760 29 29 Bool_t PreProcess(MParList *pList); 30 30 Bool_t Process(); 31 Bool_t PostProcess();32 31 33 32 void AddFile(const char *fname);
Note:
See TracChangeset
for help on using the changeset viewer.