Changeset 995 for trunk/MagicSoft
- Timestamp:
- 10/26/01 15:19:12 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r991 r995 37 37 38 38 #pragma link C++ class MRootFileBranch; 39 #pragma link C++ class MRootFileTree;40 39 41 40 #pragma link C++ class MWriteFile; -
trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc
r967 r995 44 44 45 45 ClassImp(MRootFileBranch); 46 ClassImp(MRootFileTree);47 48 46 ClassImp(MWriteRootFile); 47 48 #define kSaveNow BIT(1) 49 49 50 50 // -------------------------------------------------------------------------- … … 100 100 // Delete the file. This'll also close the file (if open) 101 101 // 102 delete fOut; 102 delete fOut; 103 103 } 104 104 … … 107 107 // Prints all trees with the actually number of written entries to log-out. 108 108 // 109 void MWriteRootFile::Print(Option_t *) 110 { 111 *fLog << "File: " << GetFileName() << endl; 112 *fLog << "--------------------------------------------------" << endl; 113 114 MRootFileTree *entry; 115 116 // 117 // Loop over all tree entries 118 // 109 void MWriteRootFile::Print(Option_t *) const 110 { 111 cout << "File: " << GetFileName() << endl; 112 cout << "--------------------------------------------------" << endl; 113 114 TTree *t; 119 115 TObjArrayIter Next(&fTrees); 120 while ((entry=(MRootFileTree*)Next())) 121 { 122 // 123 // Print out the name and the number of actually written entries. 124 // 125 *fLog << entry->GetTree()->GetName() << ": \t"; 126 *fLog << entry->GetNumEntries() << " entries." << endl; 127 } 116 while ((t=(TTree*)Next())) 117 cout << t->GetName() << ": \t" << t->GetEntries() << " entries." << endl; 128 118 } 129 119 … … 185 175 186 176 // 187 //188 177 // loop over all branches which are 'marked' as branches to get written. 178 // 189 179 TObjArrayIter Next(&fBranches); 190 180 while ((entry=(MRootFileBranch*)Next())) … … 221 211 // 222 212 const char *cname = cont->GetName(); 223 const char *tname = entry->Get TreeName();224 const char *ttitle = entry->GetT reeTitle();213 const char *tname = entry->GetName(); 214 const char *ttitle = entry->GetTitle(); 225 215 226 216 // … … 228 218 // the container name. 229 219 // 230 if ( !tname)220 if (tname[0] == '\0') 231 221 tname = cname; 232 222 … … 239 229 // 240 230 // if the tree doesn't exist create a new tree. Use the tree 241 // name as title if title is NULL 231 // name as title if title is NULL. 232 // And add the tree to the list of trees 242 233 // 243 234 tree = new TTree(tname, ttitle ? ttitle : tname); 244 245 // 246 // Create a new entry in the list of trees, which are stored to 247 // the file. Add it to the list. 248 // 249 MRootFileTree *entry = new MRootFileTree(tree); 250 fTrees.AddLast(entry); 235 fTrees.AddLast(tree); 251 236 252 237 *fLog << "Created Tree " << tname << "." << endl; … … 258 243 // Add a pointer to the entry in the tree list to this branch-entry 259 244 // 260 MRootFileTree *loop;245 TObject *obj; 261 246 TObjArrayIter NextTree(&fTrees); 262 while (( loop=(MRootFileTree*)NextTree()))263 { 264 if ( loop->GetTree()== tree)265 entry->SetTree( loop);247 while ((obj=NextTree())) 248 { 249 if (obj == tree) 250 entry->SetTree((TTree*)obj); 266 251 } 267 252 … … 320 305 while ((obj=NextBranch())) 321 306 { 322 MRootFileBranch * entry= (MRootFileBranch*)obj;307 MRootFileBranch *b = (MRootFileBranch*)obj; 323 308 324 309 // 325 310 // Check for the Write flag 326 311 // 327 if (! entry->GetContainer()->IsReadyToSave())312 if (!b->GetContainer()->IsReadyToSave()) 328 313 continue; 329 314 … … 332 317 // the corresponding tree entry. 333 318 // 334 entry->GetTree()->SetWriteFlag();319 b->GetTree()->SetBit(kSaveNow); 335 320 } 336 321 … … 341 326 while ((obj=NextTree())) 342 327 { 343 MRootFileTree *entry = (MRootFileTree*)obj;328 TTree *t = (TTree*)obj; 344 329 345 330 // 346 331 // Check the write flag of the tree 347 332 // 348 if (! entry->HasWriteFlag())333 if (!t->TestBit(kSaveNow)) 349 334 continue; 350 335 351 336 // 352 // If the write flag is set, fill the tree (with the corr asponding337 // If the write flag is set, fill the tree (with the corresponding 353 338 // branches/containers), delete the write flag and increase the number 354 339 // of written/filled entries. 355 340 // 356 entry->GetTree()->Fill(); 357 entry->DelWriteFlag(); 358 (*entry)++; 341 t->Fill(); 342 t->ResetBit(kSaveNow); 359 343 } 360 344 } -
trunk/MagicSoft/Mars/mbase/MWriteRootFile.h
r994 r995 71 71 MWriteRootFile(const char *fname, 72 72 const Option_t *opt="RECREATE", 73 const char *ftitle="Un named",73 const char *ftitle="Untitled", 74 74 const Int_t comp=9, 75 75 const char *name=NULL, -
trunk/MagicSoft/Mars/mhist/MHHillas.cc
r970 r995 80 80 void MHHillas::Fill(const MParContainer *par) 81 81 { 82 MHillas &h = *(MHillas*)par;82 const MHillas &h = *(MHillas*)par; 83 83 84 84 fAlpha ->Fill(fabs(h.GetAlpha()));
Note:
See TracChangeset
for help on using the changeset viewer.