- Timestamp:
- 02/16/09 10:19:21 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9343 r9345 18 18 19 19 -*-*- END OF LINE -*-*- 20 2009/02/16 Thomas Bretz 21 22 * mimage/MHHillas.cc, mimage/MHHillasExt.cc, mimage/MHHillasSrc.cc, 23 mimage/MHImagePar.cc: 24 - replaced green by blue for better readability on projectors 25 26 * mbase/MEnv.[h,cc]: 27 - added the option of a default name to allow i/o more similar 28 to MParContainer 29 - improved Print() 30 31 * ceres.cc, callisto.cc, star.cc, ganymed.cc, sponde.cc: 32 - make use of the new default name of MEnv 33 34 * mjobs/MJSpectrum.cc: 35 - read and write ganymed.rc 36 37 * mbase/MParList.cc: 38 - if adding a TObjArray add only MParContainers (for sanity) 39 40 * mjobs/MJob.cc: 41 - when reading read also TObjects 42 43 * mjobs/MJSpectrum.cc: 44 - now read the ganymed.rc and write it to the output 45 46 47 20 48 2009/02/15 Thomas Bretz 21 49 -
trunk/MagicSoft/Mars/NEWS
r9343 r9345 84 84 eff. on-time from the fit in the new tab, e.g. when a zenith distance 85 85 cut was made in ganymed. This can now be forced by ''--force-ontimefit'' 86 87 * now reads the ''ganymed.rc'' from the ''ganymed.root'' and writes 88 it to its own output file (for convinience) 86 89 87 90 -
trunk/MagicSoft/Mars/callisto.cc
r9276 r9345 216 216 // --rc= from the list of arguments. 217 217 // 218 MEnv env(kConfig );218 MEnv env(kConfig, "callisto.rc"); 219 219 if (!env.IsValid()) 220 220 { -
trunk/MagicSoft/Mars/ceres.cc
r9276 r9345 137 137 // --rc= from the list of arguments. 138 138 // 139 MEnv env(kConfig );139 MEnv env(kConfig, "ceres.rc"); 140 140 if (!env.IsValid()) 141 141 { -
trunk/MagicSoft/Mars/ganymed.cc
r9276 r9345 185 185 // --rc= from the list of arguments. 186 186 // 187 MEnv env(kConfig );187 MEnv env(kConfig, "ganymed.rc"); 188 188 if (!env.IsValid()) 189 189 { -
trunk/MagicSoft/Mars/mbase/MEnv.cc
r9314 r9345 18 18 ! Author(s): Thomas Bretz 2/2005 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 720 ! Copyright: MAGIC Software Development, 2000-2009 21 21 ! 22 22 ! … … 44 44 // the including file. 45 45 // 46 // Class Version 1: 47 // ---------------- 48 // + TString fName 49 // 46 50 ////////////////////////////////////////////////////////////////////////////// 47 51 #include "MEnv.h" … … 71 75 // is called which can then be checked by IsValid() 72 76 // 73 MEnv::MEnv(const char *name) : TEnv(name) 77 // The second argument is the default name. Usually as name of the MEnv 78 // the base name of the file is returned. By giving a default name 79 // you can overwrite this behavious. This is useful for I/O 80 // because it allows to use Read and Write without argument. 81 // 82 MEnv::MEnv(const char *name, const char *defname) : TEnv(name), fName(defname) 74 83 { 75 84 fChecked.SetOwner(); … … 174 183 inc = inc.Strip(TString::kBoth); 175 184 176 // Set final resource, now as kEnvLocal (previously set as kEnvCh naged)185 // Set final resource, now as kEnvLocal (previously set as kEnvChanged) 177 186 SetValue("Include", inc, kEnvLocal); 178 187 … … 198 207 } 199 208 209 // -------------------------------------------------------------------------- 210 // 211 // Read an object from the current directory. If no name is given 212 // the name of this object is used. 213 // 214 Int_t MEnv::Read(const char *name) 215 { 216 const Int_t rc = TEnv::Read(name?name:(const char*)fName); 217 //if (name) 218 // SetName(name); 219 return rc; 220 } 221 200 222 //--------------------------------------------------------------------------- 201 223 // … … 204 226 const char *MEnv::GetName() const 205 227 { 228 if (!fName.IsNull()) 229 return fName; 230 206 231 const char *pos = strrchr(GetRcName(), '/'); 207 232 return pos>0 ? pos+1 : GetRcName(); … … 1061 1086 void MEnv::PrintEnv(EEnvLevel level) const 1062 1087 { 1063 cout << "# Path: " << GetRcName() << endl; 1064 cout << "# Name: " << GetName() << endl; 1088 if (!TString(GetRcName()).IsNull()) 1089 { 1090 cout << "# Path: " << GetRcName() << endl; 1091 cout << "# File: " << gSystem->BaseName(GetRcName()) << endl; 1092 } 1093 if (!fName.IsNull()) 1094 cout << "# Name: " << fName << endl; 1095 1065 1096 TEnv::PrintEnv(level); 1066 1097 } -
trunk/MagicSoft/Mars/mbase/MEnv.h
r9301 r9345 21 21 { 22 22 private: 23 TOrdCollection fChecked; 23 TOrdCollection fChecked; //! 24 25 TString fName; 24 26 25 27 TString Compile(TString str, const char *post) const; … … 27 29 28 30 public: 29 MEnv(const char *name="" );31 MEnv(const char *name="", const char *defname=0); 30 32 31 33 Bool_t IsValid() const { return !TString(GetRcName()).IsNull(); } … … 44 46 45 47 const char *GetName() const; 48 void SetName(const char *name=0) { fName = name; } 46 49 47 50 Int_t GetColor(const char *name, Int_t dftl); … … 73 76 Bool_t TakeEnv(MArgs &args, Bool_t print=kFALSE, Bool_t overwrite=kTRUE); 74 77 78 Int_t Read(const char *name=0); 75 79 Int_t ReadFile(const char *fname, EEnvLevel level); 76 80 … … 85 89 Int_t GetNumUntouched() const; 86 90 87 ClassDef(MEnv, 0) // A slightly more advanced version of TEnv91 ClassDef(MEnv, 1) // A slightly more advanced version of TEnv 88 92 }; 89 93 -
trunk/MagicSoft/Mars/mbase/MParList.cc
r9268 r9345 245 245 // -------------------------------------------------------------------------- 246 246 // 247 // Add all entries of the TObjArray to the list. 247 // Add all entries which derive from MParContainer 248 // of the TObjArray to the list. 248 249 // 249 250 void MParList::AddToList(TObjArray *list) … … 255 256 return; 256 257 257 MIter Next(list);258 259 MParContainer*cont = NULL;258 TIter Next(list); 259 260 TObject *cont = NULL; 260 261 while ((cont=Next())) 261 262 { 263 if (!dynamic_cast<MParContainer*>(cont)) 264 continue; 265 262 266 cont->SetBit(kMustCleanup); 263 267 AddToList(cont); -
trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
r9343 r9345 58 58 #include "MH3.h" 59 59 #include "MHn.h" 60 #include "MEnv.h" 60 61 #include "MBinning.h" 61 62 #include "MParameters.h" … … 1539 1540 MBinning binsa("BinningAsym"); 1540 1541 MBinning binsb("BinningConc1"); 1542 1543 MEnv env("", "ganymed.rc"); 1541 1544 1542 1545 MAlphaFitter fit; … … 1963 1966 // Write the output 1964 1967 TObjArray cont; 1965 cont.Add((TObject*)GetEnv()); // const_cast 1966 cont.Add((TObject*)&set); // const_cast 1968 cont.Add(&env); // ganymed.rc 1969 cont.Add(const_cast<TEnv*>(GetEnv())); // sponde.rc 1970 cont.Add(const_cast<MDataSet*>(&set)); // Dataset 1967 1971 cont.Add(plist.FindObject("MAlphaFitter")); 1968 1972 cont.Add(&area0); -
trunk/MagicSoft/Mars/mjobs/MJob.cc
r9261 r9345 460 460 } 461 461 462 MIter Next(&list);463 MParContainer*o=0;462 TIter Next(&list); 463 TObject *o=0; 464 464 while ((o=Next())) 465 465 { 466 *fLog << inf << " - Reading " << o->GetDescriptor() << "..." << flush;466 *fLog << inf << " - Reading " << MParContainer::GetDescriptor(*o) << "..." << flush; 467 467 if (o->Read(o->GetName())<=0) 468 468 { 469 *fLog << err << dbginf << "ERROR - Reading " << o->GetDescriptor() << " from file " << gFile->GetName() << endl;469 *fLog << err << dbginf << "ERROR - Reading " << MParContainer::GetDescriptor(*o) << " from file " << gFile->GetName() << endl; 470 470 return kFALSE; 471 471 } -
trunk/MagicSoft/Mars/sponde.cc
r9343 r9345 151 151 // --rc= from the list of arguments. 152 152 // 153 MEnv env(kConfig );153 MEnv env(kConfig, "sponde.rc"); 154 154 if (!env.IsValid()) 155 155 { -
trunk/MagicSoft/Mars/star.cc
r9276 r9345 149 149 // --rc= from the list of arguments. 150 150 // 151 MEnv env(kConfig );151 MEnv env(kConfig, "star.rc"); 152 152 if (!env.IsValid()) 153 153 {
Note:
See TracChangeset
for help on using the changeset viewer.