Changeset 1472 for trunk/MagicSoft
- Timestamp:
- 08/01/02 15:22:34 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1471 r1472 9 9 mfileio/MWriteRootFile.[h,cc], mhist/MFillH.[h,cc]: 10 10 - added SavePrimitive 11 12 * mbase/MEvtLoop.h, mbase/MParList.h, mbase/MTaskList.h, 13 mfileio/MReadMarsFile.h, mfileio/MReadTree.h, 14 mfileio/MWriteRootFile.h, mhist/MFillH.h: 15 - changed from ClassVersion 0 to ClassVersion 1 16 17 * mfileio/FileIOLinkDef.h: 18 - added MChain 19 20 * mfileio/MReadMarsFile.cc, mfileio/MReadTree.cc, 21 mfileio/MWriteRootFile.cc, mhist/MFillH.cc: 22 - added default constructor 23 24 * mfileio/MReadTree.cc: 25 - moved MChain to its own file 26 27 * mfileio/MWriteRootFile.cc: 28 - added default constructor to MRootFileBranch 29 - changed Version number from 0 to 1 30 31 * mfileio/Makefile, mfileio/FileIOLinkDef.h: 32 - MChain added 33 34 * mfileio/MChain.[h,cc]: 35 - added (from MReadTree.cc) 11 36 12 37 * manalysis/MHillas.[h,cc]: -
trunk/MagicSoft/Mars/NEWS
r1466 r1472 64 64 - added possibility to use interpolated pixel values for blind pixels 65 65 instead of removing it completely from the analysis 66 67 - started a first implementation to be able to write the eventloop/ 68 eventloop setup to a file (root-file, root-macro) 66 69 67 70 -
trunk/MagicSoft/Mars/mbase/MEvtLoop.h
r1471 r1472 22 22 private: 23 23 MParList *fParList; 24 MTaskList *fTaskList; 24 MTaskList *fTaskList; //! 25 25 26 TGProgressBar *fProgress; 26 TGProgressBar *fProgress; //! 27 27 28 28 enum { kIsOwner = BIT(14) }; … … 48 48 void SavePrimitive(ofstream &out, Option_t *o=""); 49 49 50 ClassDef(MEvtLoop, 0) // Class to execute the tasks in a tasklist50 ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist 51 51 }; 52 52 -
trunk/MagicSoft/Mars/mbase/MParList.h
r1471 r1472 26 26 private: 27 27 TOrdCollection *fContainer; // Collection of Parameter and Data Containers 28 TOrdCollection *fAutodelete; // All what this list contains is deleted in the destructor28 TOrdCollection *fAutodelete; //! All what this list contains is deleted in the destructor 29 29 30 30 static TString GetClassName(const char *classname); … … 80 80 void SavePrimitive(ofstream &out, Option_t *o=""); 81 81 82 ClassDef(MParList, 0) // list of parameter containers (MParContainer)82 ClassDef(MParList, 1) // list of parameter containers (MParContainer) 83 83 }; 84 84 -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1471 r1472 21 21 { 22 22 private: 23 TList *fTasks; // Container for the ordered list of different tasks23 TList *fTasks; // Container for the ordered list of different tasks 24 24 TList fTasksProcess; //! 25 MParList *fParList; 25 MParList *fParList; //! 26 26 27 UInt_t *fCntContinue; 28 UInt_t *fCntTrue; 27 UInt_t *fCntContinue; //! 28 UInt_t *fCntTrue; //! 29 29 30 30 enum { kIsOwner = BIT(14) }; … … 60 60 const TList *GetList() const { return fTasks; } 61 61 62 ClassDef(MTaskList, 0)//collection of tasks to be performed in the eventloop62 ClassDef(MTaskList, 1) //collection of tasks to be performed in the eventloop 63 63 }; 64 64 -
trunk/MagicSoft/Mars/mfileio/FileIOLinkDef.h
r1382 r1472 5 5 #pragma link off all functions; 6 6 7 #pragma link C++ class MChain+; 7 8 #pragma link C++ class MReadTree+; 8 9 #pragma link C++ class MReadMarsFile+; -
trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc
r1381 r1472 50 50 // -------------------------------------------------------------------------- 51 51 // 52 // Default constructor. Don't use it. 53 // 54 MReadMarsFile::MReadMarsFile() : fRun(NULL) 55 { 56 fName = "MReadMarsFile"; 57 fTitle = "Task to loop over all events in a tree of a Mars file."; 58 } 59 60 // -------------------------------------------------------------------------- 61 // 52 62 // Default constructor. It creates a MReadTree object to read the 53 63 // RunHeaders and disables Auto Scheme for this tree. -
trunk/MagicSoft/Mars/mfileio/MReadMarsFile.h
r1381 r1472 20 20 21 21 public: 22 MReadMarsFile(); 22 23 MReadMarsFile(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL); 23 24 ~MReadMarsFile(); … … 25 26 Int_t AddFile(const char *fname); 26 27 27 ClassDef(MReadMarsFile, 0) // Reads a tree from file(s)28 ClassDef(MReadMarsFile, 1) // Reads a tree from file(s) 28 29 }; 29 30 -
trunk/MagicSoft/Mars/mfileio/MReadTree.cc
r1471 r1472 54 54 55 55 #include <TFile.h> // TFile::GetName 56 #include <TChain.h>57 56 #include <TSystem.h> // gSystem->ExpandPath 58 57 #include <TGProgressBar.h> … … 63 62 #include "MLogManip.h" 64 63 65 #include "M Time.h"64 #include "MChain.h" 66 65 #include "MFilter.h" 67 66 #include "MParList.h" … … 70 69 ClassImp(MReadTree); 71 70 72 class MChain : public TChain 73 { 74 private: 75 Bool_t fNotified; 76 77 public: 78 MChain() : TChain(), fNotified(kFALSE) {} 79 MChain(const char *name, const char *title="") : TChain(name, title), fNotified(kFALSE) {} 80 81 void ResetTree() { fTree = 0; } 82 83 virtual Bool_t Notify() { fNotified = kTRUE; return kTRUE; } 84 virtual void SetNotify(TObject *obj) { fNotify = obj; fNotified = kFALSE; } 85 86 Int_t LoadTree(Int_t entry) 87 { 88 // 89 // This is the code from TChain::LoadTree but skips the 90 // notification in LoadTree. If LoadTree raises the notification 91 // a flag is set and the notification is done by hand. This 92 // is done to be able to catch the return value from Notify. If 93 // it has not been successfull -15 is returned. 94 // This is to support return values from Notify()/Reinit() 95 // 96 TObject *notify = GetNotify(); 97 98 SetNotify(this); 99 100 Int_t rc = TChain::LoadTree(entry); 101 102 if (rc >= 0 && fNotified && notify) 103 if (!notify->Notify()) 104 rc = -15; 105 106 SetNotify(notify); 107 108 return rc; 109 } 110 }; 111 112 // -------------------------------------------------------------------------- 113 // 114 // Default constructor. It creates an TChain instance which represents the 71 // -------------------------------------------------------------------------- 72 // 73 // Default constructor. Don't use it. 74 // 75 MReadTree::MReadTree() 76 : fNumEntry(0), fBranchChoosing(kFALSE), fAutoEnable(kTRUE), fProgress(NULL) 77 { 78 fName = "MReadTree"; 79 fTitle = "Task to loop over all events in one single tree"; 80 81 fVetoList = NULL; 82 fNotify = NULL; 83 84 fChain = NULL; 85 } 86 87 // -------------------------------------------------------------------------- 88 // 89 // Constructor. It creates an TChain instance which represents the 115 90 // the Tree you want to read and adds the given file (if you gave one). 116 91 // More files can be added using MReadTree::AddFile. … … 806 781 TString name = ToLower(fName); 807 782 808 out << " " << ClassName() << " " << name << "( ";809 out << fChain->GetName() << " , \"" << fName << "\", \"" << fTitle << "\");" << endl;783 out << " " << ClassName() << " " << name << "(\""; 784 out << fChain->GetName() << "\", \"" << fName << "\", \"" << fTitle << "\");" << endl; 810 785 811 786 TIter Next(fChain->GetListOfFiles()); -
trunk/MagicSoft/Mars/mfileio/MReadTree.h
r1471 r1472 40 40 41 41 public: 42 MReadTree(); 42 43 MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL); 43 44 ~MReadTree(); … … 73 74 virtual void SavePrimitive(ofstream &out, Option_t *o=""); 74 75 75 ClassDef(MReadTree, 0) // Reads a tree from file(s)76 ClassDef(MReadTree, 1) // Reads a tree from file(s) 76 77 }; 77 78 -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r1471 r1472 51 51 // -------------------------------------------------------------------------- 52 52 // 53 // Default constructor. It is there to support some root stuff. 54 // Don't use it. 55 // 56 MWriteRootFile::MWriteRootFile() : fOut(NULL) 57 { 58 fName = "MWriteRootFile"; 59 fTitle = "Task which writes a root-output file"; 60 61 fBranches.SetOwner(); 62 } 63 64 // -------------------------------------------------------------------------- 65 // 53 66 // Specify the name of the root file. You can also give an option ("UPDATE" 54 67 // and "RECREATE" would make sense only) as well as the file title and … … 391 404 out << fOut->GetTitle() << "\", "; 392 405 out << fOut->GetCompressionLevel() << ", \""; 393 out << fName << "\", " << fTitle << "\");" << endl;;406 out << fName << "\", \"" << fTitle << "\");" << endl;; 394 407 395 408 MRootFileBranch *entry; -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h
r1471 r1472 16 16 { 17 17 private: 18 TTree *fTree; 19 TBranch *fBranch; 18 TTree *fTree; //! 19 TBranch *fBranch; //! 20 20 21 MParContainer *fContainer; 21 MParContainer *fContainer; //! 22 22 TString fContName; 23 23 … … 29 29 30 30 public: 31 MRootFileBranch() : fTree(NULL), fBranch(NULL), fContainer(NULL) 32 { 33 Init(NULL, NULL); 34 fContName = ""; 35 } 36 31 37 MRootFileBranch(const char *cname, const char *tname=NULL, const char *ttitle=NULL) 32 38 : fTree(NULL), fBranch(NULL), fContainer(NULL) … … 52 58 void SetTree(TTree *tree) { fTree = tree; } 53 59 54 ClassDef(MRootFileBranch, 0) // Storage container for MWriteRootFile to store TBranch informations60 ClassDef(MRootFileBranch, 1) // Storage container for MWriteRootFile to store TBranch informations 55 61 }; 56 62 … … 61 67 62 68 TObjArray fBranches; 63 TObjArray fTrees; 69 TObjArray fTrees; //! 64 70 65 71 void CheckAndWrite() const; … … 69 75 70 76 public: 77 MWriteRootFile(); 71 78 MWriteRootFile(const char *fname, 72 79 const Option_t *opt="RECREATE", … … 87 94 void SavePrimitive(ofstream &out, Option_t *o=""); 88 95 89 ClassDef(MWriteRootFile, 0) // Class to write one container to a root file96 ClassDef(MWriteRootFile, 1) // Class to write one container to a root file 90 97 }; 91 98 -
trunk/MagicSoft/Mars/mfileio/Makefile
r1382 r1472 31 31 .SUFFIXES: .c .cc .cxx .h .hxx .o 32 32 33 SRCFILES = MReadTree.cc \ 33 SRCFILES = MChain.cc \ 34 MReadTree.cc \ 34 35 MReadMarsFile.cc \ 35 36 MWriteFile.cc \ -
trunk/MagicSoft/Mars/mhist/MFillH.cc
r1471 r1472 89 89 fTitle = title ? title : "Task to fill Mars histograms"; 90 90 91 fH = NULL; 92 fParContainer = NULL; 91 fH = NULL; 92 fParContainer = NULL; 93 } 94 95 // -------------------------------------------------------------------------- 96 // 97 // Default Constructor. This is to support some root-stuff. 98 // Never try to use it yourself! 99 // 100 MFillH::MFillH() 101 { 102 Init(NULL, NULL); 93 103 } 94 104 -
trunk/MagicSoft/Mars/mhist/MFillH.h
r1471 r1472 12 12 { 13 13 private: 14 const MParContainer *fParContainer; 14 const MParContainer *fParContainer; //! 15 15 TString fParContainerName; 16 16 17 MH* fH; 17 MH* fH; //! 18 18 TString fHName; 19 19 … … 24 24 25 25 public: 26 MFillH(); 26 27 MFillH(const char *hist, const char *par=NULL, const char *name=NULL, const char *title=NULL); 27 28 MFillH(const char *hist, const MParContainer *par, const char *name=NULL, const char *title=NULL); … … 35 36 void SavePrimitive(ofstream &out, Option_t *o=""); 36 37 37 ClassDef(MFillH, 0) // Task to fill a histogram with data from a parameter container38 ClassDef(MFillH, 1) // Task to fill a histogram with data from a parameter container 38 39 }; 39 40
Note:
See TracChangeset
for help on using the changeset viewer.