Changeset 17867 for trunk/Mars
- Timestamp:
- 05/16/14 11:52:02 (11 years ago)
- Location:
- trunk/Mars/mfileio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mfileio/MWriteRootFile.cc
r14029 r17867 213 213 Init(name, title); 214 214 215 const Bool_t hasrule = fSplitRule.BeginsWith("s/") && fSplitRule.EndsWith("/"); 216 if (!hasrule) 217 fSplitRule = ""; 218 215 219 // 216 220 // Open a TFile in dummy mode! This is necessary to be able to create … … 218 222 // a valid file. (Stupid workaround - but does a good job) 219 223 // 220 fOut = OpenFile("/dev/null", option, ftitle, comp); 224 const TString fname = hasrule ? "/dev/null" : rule; 225 fOut = OpenFile(fname, option, ftitle, comp); 221 226 } 222 227 … … 393 398 // is the name of the tree. 394 399 // 395 void MWriteRootFile::AddContainer(const char *cname, const char *tname, Bool_t must )400 void MWriteRootFile::AddContainer(const char *cname, const char *tname, Bool_t must, Long64_t max) 396 401 { 397 402 if (!fOut && !tname) … … 412 417 // add the entry to the list. 413 418 // 414 MRootFileBranch *entry = new MRootFileBranch(AddSerialNumber(cname), tname, must );419 MRootFileBranch *entry = new MRootFileBranch(AddSerialNumber(cname), tname, must, max); 415 420 fBranches.AddLast(entry); 416 421 … … 429 434 // is the name of the tree. 430 435 // 431 void MWriteRootFile::AddContainer(MParContainer *cont, const char *tname, Bool_t must )436 void MWriteRootFile::AddContainer(MParContainer *cont, const char *tname, Bool_t must, Long64_t max) 432 437 { 433 438 if (!fOut && !tname) … … 449 454 // add the entry to the list. 450 455 // 451 MRootFileBranch *entry = new MRootFileBranch(cont, tname, must );456 MRootFileBranch *entry = new MRootFileBranch(cont, tname, must, max); 452 457 fBranches.AddLast(entry); 453 458 } … … 712 717 continue; 713 718 719 if (b->GetMaxEntries()==b->GetTree()->GetEntries()) 720 continue; 721 714 722 // 715 723 // If the write flag of the branch entry is set, set the write flag of -
trunk/Mars/mfileio/MWriteRootFile.h
r14447 r17867 25 25 26 26 Bool_t fMust; 27 Long64_t fMaxEntries; 27 28 28 29 void Init(const char *name, Bool_t must) … … 33 34 34 35 public: 35 MRootFileBranch() : fTree(NULL), fBranch(NULL), fContainer(NULL), fMust(0) 36 MRootFileBranch() : fTree(NULL), fBranch(NULL), fContainer(NULL), fMust(0), fMaxEntries(0) 36 37 { 37 38 Init(NULL, kFALSE); … … 39 40 } 40 41 41 MRootFileBranch(const char *cname, const char *tname=NULL, Bool_t must=kFALSE )42 : fTree(NULL), fBranch(NULL), fContainer(NULL), fMust(0) 42 MRootFileBranch(const char *cname, const char *tname=NULL, Bool_t must=kFALSE, Long64_t max=-1) 43 : fTree(NULL), fBranch(NULL), fContainer(NULL), fMust(0), fMaxEntries(max) 43 44 { 44 45 Init(tname, must); … … 46 47 } 47 48 48 MRootFileBranch(MParContainer *cont, const char *tname=NULL, Bool_t must=kFALSE )49 : fTree(NULL), fBranch(NULL), fMust(0) 49 MRootFileBranch(MParContainer *cont, const char *tname=NULL, Bool_t must=kFALSE, Long64_t max=-1) 50 : fTree(NULL), fBranch(NULL), fMust(0), fMaxEntries(max) 50 51 { 51 52 Init(tname, must); … … 54 55 } 55 56 56 TTree *GetTree() const { return fTree; } 57 MParContainer *GetContainer() const { return fContainer; } 58 void *GetAddress() { return &fContainer; } 59 TBranch *GetBranch() const { return fBranch; } 60 const char *GetContName() const { return fTitle; } 61 Bool_t MustHave() const { return fMust; } 57 TTree *GetTree() const { return fTree; } 58 MParContainer *GetContainer() const { return fContainer; } 59 void *GetAddress() { return &fContainer; } 60 TBranch *GetBranch() const { return fBranch; } 61 const char *GetContName() const { return fTitle; } 62 Bool_t MustHave() const { return fMust; } 63 Long64_t GetMaxEntries() const { return fMaxEntries; } 62 64 63 65 void SetContainer(MParContainer *cont) { fContainer = cont; } … … 129 131 ~MWriteRootFile(); 130 132 131 void AddContainer(const char *cname, const char *tname=NULL, Bool_t must=kTRUE );132 void AddContainer(MParContainer *cont, const char *tname=NULL, Bool_t must=kTRUE );133 void AddContainer(const char *cname, const char *tname=NULL, Bool_t must=kTRUE, Long64_t max=-1); 134 void AddContainer(MParContainer *cont, const char *tname=NULL, Bool_t must=kTRUE, Long64_t max=-1); 133 135 void AddCopySource(const char *tname, const char *bname=NULL, Bool_t force=kTRUE); 134 136 void AddCopySource(const char *tname, Bool_t force)
Note:
See TracChangeset
for help on using the changeset viewer.