- Timestamp:
- 10/26/01 15:11:45 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MWriteRootFile.h
r969 r994 13 13 class TBranch; 14 14 15 class MRootFile Tree : public TObject15 class MRootFileBranch : public TNamed 16 16 { 17 17 private: 18 18 TTree *fTree; 19 Bool_t fWriteFlag; 20 ULong_t fNumEntries; 19 TBranch *fBranch; 21 20 22 public: 23 MRootFileTree(TTree *tree) : fTree(tree), fWriteFlag(kFALSE), fNumEntries(0) {} 24 TTree *GetTree() const { return fTree; } 25 Bool_t HasWriteFlag() const { return fWriteFlag; } 26 ULong_t GetNumEntries() const { return fNumEntries; } 27 void operator++(int) { fNumEntries++; } 28 void SetWriteFlag() { fWriteFlag = kTRUE; } 29 void DelWriteFlag() { fWriteFlag = kFALSE; } 21 MParContainer *fContainer; 22 TString fContName; 30 23 31 ClassDef(MRootFileTree, 0) // Storage container for MWriteRootFile to store Tree informations 32 }; 33 34 class MRootFileBranch : public TObject 35 { 36 private: 37 MRootFileTree *fTree; 38 TBranch *fBranch; 39 MParContainer *fContainer; 40 TString *fContName; 41 TString *fTreeName; 42 TString *fTreeTitle; 24 void Init(const char *name, const char *title) 25 { 26 SetName(name?name:""); 27 SetTitle(title?title:""); 28 } 43 29 44 30 public: … … 46 32 : fTree(NULL), fBranch(NULL), fContainer(NULL) 47 33 { 48 fContName = new TString(cname); 49 fTreeName = tname ? new TString(tname) : NULL; 50 fTreeTitle = ttitle ? new TString(ttitle) : NULL; 34 Init(tname, ttitle); 35 fContName = cname; 51 36 } 52 37 53 38 MRootFileBranch(MParContainer *cont, const char *tname=NULL, const char *ttitle=NULL) 54 : fTree(NULL), fBranch(NULL), fContName( NULL)39 : fTree(NULL), fBranch(NULL), fContName("") 55 40 { 41 Init(tname, ttitle); 56 42 fContainer = cont; 57 fTreeName = tname ? new TString(tname) : NULL;58 fTreeTitle = ttitle ? new TString(ttitle) : NULL;59 43 } 60 44 61 MRootFileTree *GetTree() const{ return fTree; }45 TTree *GetTree() const { return fTree; } 62 46 MParContainer *GetContainer() const { return fContainer; } 63 void *GetAddress() { return &fContainer; } 64 TBranch *GetBranch() const { return fBranch; } 65 const char *GetContName() const { return fContName ? (const char*)(*fContName) : NULL; } 66 const char *GetTreeName() const { return fTreeName ? (const char*)(*fTreeName) : NULL; } 67 const char *GetTreeTitle() const { return fTreeTitle ? (const char*)(*fTreeTitle) : NULL; } 47 void *GetAddress() { return &fContainer; } 48 TBranch *GetBranch() const { return fBranch; } 49 const char *GetContName() const { return fContName; } 68 50 69 51 void SetContainer(MParContainer *cont) { fContainer = cont; } 70 void SetTree( MRootFileTree *tree){ fTree = tree; }52 void SetTree(TTree *tree) { fTree = tree; } 71 53 72 54 ClassDef(MRootFileBranch, 0) // Storage container for MWriteRootFile to store TBranch informations … … 95 77 ~MWriteRootFile(); 96 78 97 void Print(Option_t *t=NULL);98 79 99 80 void AddContainer(const char *cname, … … 102 83 const char *tname=NULL, const char *ttitle=NULL); 103 84 85 86 void Print(Option_t *t=NULL) const; 87 104 88 ClassDef(MWriteRootFile, 0) // Class to write one container to a root file 105 89 };
Note:
See TracChangeset
for help on using the changeset viewer.