Changeset 891 for trunk/MagicSoft
- Timestamp:
- 07/20/01 16:44:11 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r889 r891 7 7 * mhist/MFillH.cc: 8 8 - added comments 9 10 * mbase/MParList.[h,cc]: 11 - Added AddToList from a TObjArray 12 - Added GetClassName 13 - Added GetObjName 14 - Added FindObjectList 15 - Added FindCreateObjList 16 - Added CreateObjList 9 17 10 18 -
trunk/MagicSoft/Mars/mbase/MParList.cc
r890 r891 69 69 // -------------------------------------------------------------------------- 70 70 // 71 // copy constructor 71 // Copy constructor. It copies all entries of the parameter list, but it 72 // takes care of, that the automatically created entries are only deleted 73 // once. (doesn't copy the list which holds the automatically created 74 // entries) 72 75 // 73 76 MParList::MParList(MParList &ts) … … 78 81 // -------------------------------------------------------------------------- 79 82 // 80 // create the Iterator over the tasklist 83 // Set the logging streamer of the parameter list and all contained 84 // parameter containers 81 85 // 82 86 void MParList::SetLogStream(MLog *log) -
trunk/MagicSoft/Mars/mbase/MParList.h
r858 r891 29 29 TOrdCollection fAutodelete; // All what this list contains is deleted in the destructor 30 30 31 static TString GetClassName(const char *classname); 32 static TString GetObjectName(const char *classname, const char *objname); 33 31 34 public: 32 35 MParList(const char *name=NULL, const char *title=NULL); … … 38 41 39 42 Bool_t AddToList(MParContainer *obj, MParContainer *where = NULL); 43 void AddToList(TObjArray *list); 40 44 41 45 void SetLogStream(MLog *log); … … 44 48 TObject *FindObject(TObject *obj) const; 45 49 MParContainer *FindCreateObj(const char *classname, const char *objname=NULL); 50 51 TObjArray FindObjectList(const char *name, const UInt_t from, const UInt_t to=0) const; 52 TObjArray FindCreateObjList(const char *cname, const UInt_t from, const UInt_t to=0, const char *oname=NULL); 53 54 static TObjArray CreateObjList(const char *cname, const UInt_t from, const UInt_t to=0, const char *oname=NULL); 46 55 47 56 void Reset(); -
trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc
r867 r891 33 33 #include "MHMcEnergy.h" 34 34 35 #include <stdlib.h> 35 36 #include <iostream.h> 36 37 … … 46 47 // Default Constructor. 47 48 // 48 MHMcEnergy::MHMcEnergy(const UInt_t idx, constchar *name, const char *title)49 MHMcEnergy::MHMcEnergy(const char *name, const char *title) 49 50 { 50 char aux[15]="MHMcEnergy"; 51 52 if (idx>0) 53 sprintf(aux+strlen(aux), ";%i", idx); 54 55 *fName = name ? name : aux; 56 *fTitle = title ? title : "Container for an energy distribution histogram" ; 51 *fTitle = title ? title : "Container for an energy distribution histogram"; 57 52 58 53 // - we initialize the histogram … … 60 55 // root don't allow us to have diferent histograms with the same name 61 56 57 fHist = new TH1F("", "", 40, 0.5, 4.5); 58 fHist->SetXTitle("log(E/GeV)"); 59 fHist->SetYTitle("dN/dE"); 60 61 SetName(name ? name : "MHMcEnergy"); 62 } 63 64 // ------------------------------------------------------------------------- 65 // 66 // This doesn't only set the name. It tries to get the number from the 67 // name and creates also name and title of the histogram. 68 // 69 // This is necessary for example if a list of such MHMcEnergy histograms 70 // is created (s. MParList::CreateObjList) 71 // 72 void MHMcEnergy::SetName(const char *name) 73 { 74 TString cname(name); 75 const char *semicolon = strrchr(cname, ';'); 76 77 UInt_t idx = semicolon ? atoi(semicolon+1) : 0; 78 79 *fName = cname; 80 62 81 char text[256]; 63 sprintf(text, "Energy Distribution for trigger condition #%i", idx); 64 82 if (idx>0) 83 sprintf(text, "Energy Distribution for trigger condition #%i", idx); 84 else 85 sprintf(text, "Energy Distribution"); 86 87 char aux[256]; 65 88 strcpy(aux, "log(E)"); 89 66 90 if (idx>0) 67 91 sprintf(aux+strlen(aux), " #%i", idx); 68 fHist = new TH1F(aux, text, 40, 0.5, 4.5); 69 fHist->Set XTitle("log(E/GeV)");70 fHist->Set YTitle("dN/dE");92 93 fHist->SetName(aux); 94 fHist->SetTitle(text); 71 95 } 72 96 -
trunk/MagicSoft/Mars/mhist/MHMcEnergy.h
r867 r891 31 31 public: 32 32 33 MHMcEnergy(const UInt_t idx=0, constchar *name=NULL, const char *title=NULL);33 MHMcEnergy(const char *name=NULL, const char *title=NULL); 34 34 ~MHMcEnergy(); 35 36 void SetName(const char *name); 35 37 36 38 Float_t GetThreshold() const { return fThreshold; }
Note:
See TracChangeset
for help on using the changeset viewer.