Changeset 760
- Timestamp:
- 04/23/01 14:16:02 (24 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 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); -
trunk/MagicSoft/Mars/mraw/MRawCrateArray.cc
r749 r760 42 42 ClassImp(MRawCrateArray) 43 43 44 // -------------------------------------------------------------------------- 45 // 46 // Default Constructor. It creates the TClonesArray which is used to store 47 // the crate data. 48 // 44 49 MRawCrateArray::MRawCrateArray(const char *name, const char *title) 45 50 { … … 54 59 } 55 60 61 // -------------------------------------------------------------------------- 62 // 63 // Destructor. Deletes the TClones Array which stores the crate information 64 // 56 65 MRawCrateArray::~MRawCrateArray() 57 66 { 67 // FIXME: Is the contained data deleted, too? 58 68 delete fArray; 59 69 } 60 70 71 // -------------------------------------------------------------------------- 72 // 73 // clear the entries in the TClonesArray 74 // 61 75 void MRawCrateArray::Clear(Option_t *opt) 62 76 { 63 //64 // clear the entries in the TClonesArray65 //66 77 fArray->Clear(); 67 78 } 68 79 69 void MRawCrateArray::Print(Option_t *opt) 70 { 71 *fLog << "MRawCrateArray::Print()" << endl; 72 } 73 80 // -------------------------------------------------------------------------- 81 // 82 // Return a pointer the i-th entry in the array 83 // 74 84 MRawCrateData *MRawCrateArray::GetEntry(Int_t i) 75 85 { 76 //77 // Return a pointer the i-th entry in the array78 //79 86 return (MRawCrateData*)fArray->AddrAt(i); 80 87 } 81 88 89 // -------------------------------------------------------------------------- 90 // 91 // Return the i-th entry in the array 92 // 82 93 MRawCrateData* &MRawCrateArray::operator[](Int_t i) 83 94 { 84 //85 // Return the i-th entry in the array86 //87 95 return (MRawCrateData*&)(*fArray)[i]; 88 96 } 89 97 98 // -------------------------------------------------------------------------- 99 // 100 // return a pointer to the pointer of the array 101 // (actually not used. You may need it if you want to write 102 // the TClonesArray directly) 103 // 90 104 TClonesArray **MRawCrateArray::GetArray() 91 105 { 92 //93 // return a pointer to the pointer of the array94 // (actually not used. You may need it if you want to write95 // the TClonesArray directly)96 //97 106 return &fArray; 98 107 }
Note:
See TracChangeset
for help on using the changeset viewer.