Changeset 6553 for trunk/MagicSoft/Mars
- Timestamp:
- 02/16/05 19:53:21 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6549 r6553 21 21 22 22 -*-*- END OF LINE -*-*- 23 23 24 2005/02/16 Javier Rico 24 25 … … 38 39 branch containing the energy estimator). This may be used 39 40 as layout for spectrum computation program. 40 41 2005/02/16 Abelardo Moralejo 42 43 * mtemp/mpadova/macros/resize.C 44 - Changed weights 41 42 43 44 2005/02/16 Markus Gaug 45 46 * mdata/MDataChain.cc 47 - replaced ROOT version check for the compiler from 4.02.00 to 48 4.01.00 49 50 * mranforest/MRFEnergyEst.cc 51 - include "TVector.h", otherwise this class does not compile 52 in newer root versions 53 54 * msignal/MExtractTimeAndCharge.cc 55 - initialize fLoGainStartShift correctly if read from conf. file 56 and modified fOffsetLoGain exists. 57 58 * msignal/*weights*.dat 59 - new weights with the uniform pedestal RMS. (Please use these!) 60 61 * msignal/pulpo_weights*.dat 62 - new weights with the pulpo-pulse form and without NSB!! 63 64 45 65 46 66 2005/02/16 Thomas Hengstebeck 67 68 * mranforest/MRFEnergyEst.[h,cc] 69 - added RF class for energy estimation 47 70 48 71 * mranforest/MRFEnergyEst.cc … … 50 73 are returned 51 74 52 2005/02/16 Abelardo Moralejo53 54 * mhistmc/MHMcCollectionArea.cc55 - Changed default fName to "MHMcCollectionArea"56 57 2005/02/16 Markus Gaug58 59 * mdata/MDataChain.cc60 - replaced ROOT version check for the compiler from 4.02.00 to61 4.01.0062 63 * mranforest/MRFEnergyEst.cc64 - include "TVector.h", otherwise this class does not compile65 in newer root versions66 67 * msignal/MExtractTimeAndCharge.cc68 - initialize fLoGainStartShift correctly if read from conf. file69 and modified fOffsetLoGain exists.70 71 * msignal/*weights*.dat72 - new weights with the uniform pedestal RMS. (Please use these!)73 74 * msignal/pulpo_weights*.dat75 - new weights with the pulpo-pulse form and without NSB!!76 77 78 2005/02/16 Thomas Hengstebeck79 80 * mranforest/MRFEnergyEst.[h,cc]81 - added RF class for energy estimation82 75 83 76 … … 89 82 MWriteRootFile::AddCopySource 90 83 84 * mhistmc/MHMcCollectionArea.cc 85 - Changed default fName to "MHMcCollectionArea" 86 87 * mtemp/mpadova/macros/resize.C 88 - Changed weights 89 91 90 92 91 … … 121 120 * mranforest/MRFEnergyEst.[h,cc]: 122 121 - cleaned up includes 122 123 * callisto.cc, ganymed.cc, star.cc: 124 - implemented enhanced handling of resource debugging 125 126 * mbase/Makefile, mbase/BaseLinkDef.h: 127 - added MEnv 128 129 * mbase/MEnv.[h,cc]: 130 - added 131 132 * mjobs/MJob.[h,cc]: 133 - added new function to allow distribution of extranl MEnv 134 - replaced Bool_t by Int_t for fEnvDebug 135 136 * mjobs/MJPedestal.cc: 137 - adapted to changes of EnvDebug 123 138 124 139 -
trunk/MagicSoft/Mars/NEWS
r6500 r6553 81 81 camera files. 82 82 83 - enhanced possibility to debug reading of resource file 84 83 85 84 86 -
trunk/MagicSoft/Mars/callisto.cc
r6466 r6553 9 9 #include "MLogManip.h" 10 10 11 #include "MEnv.h" 11 12 #include "MArgs.h" 12 13 #include "MArray.h" … … 59 60 gLog << " Options:" << endl; 60 61 gLog.Usage(); 61 gLog << " --debug-env Debug setting resources from file" << endl; 62 gLog << " --debug-env=0 Disable debugging setting resources <default>" << endl; 63 gLog << " --debug-env[=1] Display untouched resources after program execution" << endl; 64 gLog << " --debug-env=2 Display untouched resources after eventloop setup" << endl; 65 gLog << " --debug-env=3 Debug setting resources from resource file" << endl; 62 66 gLog << " --debug-mem Debug memory usage" << endl << endl; 63 67 gLog << endl; … … 150 154 const Bool_t kPrintFound = arg.HasOnlyAndRemove("--print-found"); 151 155 const Bool_t kUseTest = arg.HasOnlyAndRemove("--use-test"); 152 const Bool_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env");153 156 const Bool_t kDebugMem = arg.HasOnlyAndRemove("--debug-mem"); 157 Int_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env") ? 1 : 0; 158 kDebugEnv = arg.GetIntAndRemove("--debug-env=", kDebugEnv); 154 159 155 160 const Bool_t kQuit = arg.HasOnlyAndRemove("-q"); … … 235 240 { 236 241 gLog << err << "Sorry, sequence file '" << kSequence << "' doesn't exist." << endl; 242 return -1; 243 } 244 245 if (gSystem->AccessPathName(kConfig, kFileExists)) 246 { 247 gLog << err << "Sorry, config file '" << kConfig << "' doesn't exist." << endl; 237 248 return -1; 238 249 } … … 309 320 d->SetTitle(kSequence); 310 321 322 MEnv env(kConfig); 311 323 if (kModeC/* || kUseTest*/) 312 324 { … … 317 329 job1.SetNoStorage(); 318 330 job1.SetSequence(seq); 319 job1.SetEnv( kConfig);331 job1.SetEnv(&env); 320 332 job1.SetEnvDebug(kDebugEnv); 321 333 job1.SetDisplay(d); … … 346 358 job2.SetNoStorage(); 347 359 job2.SetSequence(seq); 348 job2.SetEnv( kConfig);360 job2.SetEnv(&env); 349 361 job2.SetEnvDebug(kDebugEnv); 350 362 job2.SetDisplay(d);; … … 380 392 MJCalibration job3(Form("MJCalibration #%d", seq.GetSequence())); 381 393 job3.SetSequence(seq); 382 job3.SetEnv( kConfig);394 job3.SetEnv(&env); 383 395 job3.SetEnvDebug(kDebugEnv); 384 396 job3.SetDisplay(d); … … 411 423 job4.SetBadPixels(job2.GetBadPixels()); 412 424 job4.SetSequence(seq); 413 job4.SetEnv( kConfig);425 job4.SetEnv(&env); 414 426 job4.SetEnvDebug(kDebugEnv); 415 427 job4.SetDisplay(d);; … … 431 443 } 432 444 } 445 if (kDebugEnv>0) 446 env.PrintUntouched(); 433 447 } 434 448 … … 443 457 job1.SetNoStorage(); 444 458 job1.SetSequence(seq); 445 job1.SetEnv( kConfig);459 job1.SetEnv(&env); 446 460 job1.SetEnvDebug(kDebugEnv); 447 461 job1.SetDisplay(d); … … 473 487 job2.SetNoStorage(); 474 488 job2.SetSequence(seq); 475 job2.SetEnv( kConfig);489 job2.SetEnv(&env); 476 490 job2.SetEnvDebug(kDebugEnv); 477 491 job2.SetDisplay(d); … … 508 522 job3.SetNoStorage(); 509 523 job3.SetSequence(seq); 510 job3.SetEnv( kConfig);524 job3.SetEnv(&env); 511 525 job3.SetEnvDebug(kDebugEnv); 512 526 job3.SetDisplay(d); … … 543 557 job4.SetSequence(seq); 544 558 job4.SetDisplay(d);; 545 job4.SetEnv( kConfig);559 job4.SetEnv(&env); 546 560 job4.SetEnvDebug(kDebugEnv); 547 561 job4.SetOverwrite(kOverwrite); … … 560 574 return 1; 561 575 } 576 577 if (kDebugEnv>0) 578 env.PrintUntouched(); 562 579 } 563 580 -
trunk/MagicSoft/Mars/ganymed.cc
r6453 r6553 9 9 #include "MLogManip.h" 10 10 11 #include "MEnv.h" 11 12 #include "MArgs.h" 12 13 #include "MArray.h" … … 49 50 gLog << " Options:" << endl; 50 51 gLog.Usage(); 51 gLog << " --debug-env Debug setting resources from file" << endl; 52 gLog << " --debug-env=0 Disable debugging setting resources <default>" << endl; 53 gLog << " --debug-env[=1] Display untouched resources after program execution" << endl; 54 gLog << " --debug-env=2 Display untouched resources after eventloop setup" << endl; 55 gLog << " --debug-env=3 Debug setting resources from resource file" << endl; 52 56 gLog << " --debug-mem Debug memory usage" << endl << endl; 53 57 gLog << endl; … … 93 97 const Bool_t kPrintSeq = arg.HasOnlyAndRemove("--print-seq"); 94 98 const Bool_t kPrintFiles = arg.HasOnlyAndRemove("--print-files"); 95 const Bool_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env");96 99 const Bool_t kDebugMem = arg.HasOnlyAndRemove("--debug-mem"); 97 100 const Bool_t kWriteOnly = arg.HasOnlyAndRemove("--write-only"); 101 Int_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env") ? 1 : 0; 102 kDebugEnv = arg.GetIntAndRemove("--debug-env=", kDebugEnv); 98 103 99 104 const Bool_t kQuit = arg.HasOnlyAndRemove("-q"); … … 137 142 } 138 143 144 if (gSystem->AccessPathName(kConfig, kFileExists)) 145 { 146 gLog << err << "Sorry, config file '" << kConfig << "' doesn't exist." << endl; 147 return -1; 148 } 149 139 150 if (kDebugMem) 140 151 TObject::SetObjectStat(kTRUE); … … 184 195 // Calculate pedestal for pedestal-calculation and calibration 185 196 // 197 MEnv env(kConfig); 198 186 199 MJCut job(Form("MJCut #%d", seq.GetNumAnalysis())); 187 job.SetEnv( kConfig);200 job.SetEnv(&env); 188 201 job.SetEnvDebug(kDebugEnv); 189 202 job.SetDisplay(d);; … … 204 217 return -1; 205 218 } 219 if (kDebugEnv>0) 220 env.PrintUntouched(); 206 221 207 222 if (!job.GetDisplay()) -
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r5832 r6553 22 22 #pragma link C++ namespace MMath; 23 23 #pragma link C++ class MString+; 24 #pragma link C++ class MEnv+; 24 25 #pragma link C++ class MIter+; 25 26 #pragma link C++ class MDirIter+; -
trunk/MagicSoft/Mars/mbase/Makefile
r4964 r6553 22 22 MString.cc \ 23 23 MMath.cc \ 24 MEnv.cc \ 24 25 MLog.cc \ 25 26 MLogManip.cc \ -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r6502 r6553 802 802 tenv.SetDefault(fExtractor); 803 803 804 if (tenv.ReadEnv(*GetEnv(), GetEnvPrefix()+".ExtractSignal", GetEnvDebug() )==kERROR)804 if (tenv.ReadEnv(*GetEnv(), GetEnvPrefix()+".ExtractSignal", GetEnvDebug()>2)==kERROR) 805 805 return kFALSE; 806 806 -
trunk/MagicSoft/Mars/mjobs/MJob.cc
r6177 r6553 29 29 // A base class for jobs 30 30 // 31 // SetDebugEnv(0) // switch off debugging 32 // SetDebugEnv(1) // reserved 33 // SetDebugEnv(2) // print untouched resources after evtloop resources setup 34 // SetDebugEnv(3) // do 2) and debug setting env completely 35 // 31 36 ///////////////////////////////////////////////////////////////////////////// 32 37 #include "MJob.h" 33 38 34 #include <TEnv.h>39 #include "MEnv.h" 35 40 #include <TFile.h> 36 41 #include <TSystem.h> … … 54 59 // Sets fDataFlag to 0 55 60 // 56 MJob::MJob(const char *name, const char *title) : fEnv(0), f Overwrite(kFALSE), fMaxEvents(0)61 MJob::MJob(const char *name, const char *title) : fEnv(0), fEnvDebug(0), fOverwrite(kFALSE), fMaxEvents(0) 57 62 58 63 { … … 61 66 } 62 67 68 void MJob::ClearEnv() 69 { 70 if (fEnv && TestBit(kIsOwner)) 71 delete fEnv; 72 ResetBit(kIsOwner); 73 fEnv=0; 74 } 75 63 76 MJob::~MJob() 64 77 { 65 if (fEnv) 66 delete fEnv; 78 ClearEnv(); 67 79 } 68 80 69 81 Bool_t MJob::SetEnv(const char *env, const char *prefix) 70 82 { 71 if (fEnv) 72 { 73 delete fEnv; 74 fEnv = 0; 75 } 83 ClearEnv(); 76 84 77 85 const Bool_t fileexist = !gSystem->AccessPathName(env, kFileExists); … … 82 90 } 83 91 84 fEnv = new TEnv(env); 92 fEnv = new MEnv(env); 93 SetBit(kIsOwner); 85 94 86 95 fEnvPrefix = prefix; … … 94 103 } 95 104 105 void MJob::SetEnv(MEnv *env, const char *prefix) 106 { 107 ClearEnv(); 108 109 fEnv = env; 110 111 fEnvPrefix = prefix; 112 if (!prefix) 113 fEnvPrefix = fName.First(' ')>0 ? fName(0, fName.First(' ')) : fName; 114 115 if (fEnvPrefix.EndsWith(".")) 116 fEnvPrefix.Remove(fEnvPrefix.Length()-1); 117 } 118 96 119 void MJob::FixPath(TString &path) const 97 120 { … … 123 146 } 124 147 148 const TEnv *MJob::GetEnv() const 149 { 150 return static_cast<const TEnv *const>(fEnv); 151 } 152 125 153 Int_t MJob::GetEnv(const char *name, Int_t dflt) const 126 154 { … … 140 168 Bool_t MJob::HasEnv(const char *name) const 141 169 { 142 return IsEnvDefined(*fEnv, fEnvPrefix, name, fEnvDebug );//fEnv->Lookup(Form("%s%s", fEnvPrefix.Data(), name));170 return IsEnvDefined(*fEnv, fEnvPrefix, name, fEnvDebug>2);//fEnv->Lookup(Form("%s%s", fEnvPrefix.Data(), name)); 143 171 } 144 172 … … 163 191 SetMaxEvents(GetEnv("MaxEvents", fMaxEvents)); 164 192 SetOverwrite(GetEnv("Overwrite", fOverwrite)); 193 SetEnvDebug( GetEnv("EnvDebug", fEnvDebug)); 165 194 166 195 return CheckEnvLocal(); … … 172 201 return kTRUE; 173 202 174 return loop.ReadEnv(*fEnv, fEnvPrefix, fEnvDebug) ? kTRUE : kFALSE; 203 if (!loop.ReadEnv(*fEnv, fEnvPrefix, fEnvDebug>2)) 204 return kFALSE; 205 206 if (fEnvDebug>1) 207 fEnv->PrintUntouched(); 208 209 return kTRUE; 175 210 } 176 211 -
trunk/MagicSoft/Mars/mjobs/MJob.h
r6177 r6553 6 6 #endif 7 7 8 class TEnv;8 class MEnv; 9 9 class MEvtLoop; 10 10 … … 12 12 { 13 13 private: 14 enum { kIsOwner = BIT(14) }; 15 14 16 void FixPath(TString &path) const; 17 void ClearEnv(); 15 18 16 const TEnv *fEnv; // Resource file19 const MEnv *fEnv; // Resource file 17 20 TString fEnvPrefix; // Prefix for resources 18 Bool_tfEnvDebug; // Debug setup of resources21 Int_t fEnvDebug; // Debug setup of resources 19 22 20 23 protected: 21 22 24 TString fPathOut; // Directory to write output file to (eg. calib*.root) 23 25 TString fPathIn; // Directory to read output from (eg. calib*.root) … … 29 31 MSequence fSequence; // Sequence 30 32 31 const TEnv *GetEnv() const { return fEnv; } 33 const TEnv *GetEnv() const; 34 const MEnv *GetMEnv() const { return fEnv; } 32 35 const TString &GetEnvPrefix() const { return fEnvPrefix; } 33 Bool_t GetEnvDebug() const { return fEnvDebug; }36 Int_t GetEnvDebug() const { return fEnvDebug; } 34 37 35 38 Int_t GetEnv(const char *name, Int_t dflt) const; … … 40 43 Bool_t SetupEnv(MEvtLoop &loop) const; 41 44 Bool_t CheckEnv(); 45 void PrintUntouchedEnv() const; 42 46 virtual Bool_t CheckEnvLocal() { return kTRUE; } 43 47 … … 57 61 void SetOverwrite(Bool_t b=kTRUE) { fOverwrite=b; } 58 62 Bool_t SetEnv(const char *env, const char *prefix=0); 59 void SetEnvDebug(Bool_t b=kTRUE) { fEnvDebug=b; } 63 void SetEnv(MEnv *env, const char *prefix=0); 64 void SetEnvDebug(Int_t d=2) { fEnvDebug=d; } 60 65 61 66 void SetMaxEvents(Int_t max) { fMaxEvents = max; } -
trunk/MagicSoft/Mars/star.cc
r6466 r6553 9 9 #include "MLogManip.h" 10 10 11 #include "MEnv.h" 11 12 #include "MArgs.h" 12 13 #include "MArray.h" … … 49 50 gLog << " Options:" << endl; 50 51 gLog.Usage(); 51 gLog << " --debug-env Debug setting resources from file" << endl; 52 gLog << " --debug-env=0 Disable debugging setting resources <default>" << endl; 53 gLog << " --debug-env[=1] Display untouched resources after program execution" << endl; 54 gLog << " --debug-env=2 Display untouched resources after eventloop setup" << endl; 55 gLog << " --debug-env=3 Debug setting resources from resource file" << endl; 52 56 gLog << " --debug-mem Debug memory usage" << endl << endl; 53 57 gLog << endl; … … 109 113 const Bool_t kPrintFiles = arg.HasOnlyAndRemove("--print-files"); 110 114 const Bool_t kPrintFound = arg.HasOnlyAndRemove("--print-found"); 111 const Bool_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env");112 115 const Bool_t kDebugMem = arg.HasOnlyAndRemove("--debug-mem"); 116 Int_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env") ? 1 : 0; 117 kDebugEnv = arg.GetIntAndRemove("--debug-env=", kDebugEnv); 113 118 114 119 const Bool_t kQuit = arg.HasOnlyAndRemove("-q"); … … 149 154 } 150 155 156 if (gSystem->AccessPathName(kConfig, kFileExists)) 157 { 158 gLog << err << "Sorry, config file '" << kConfig << "' doesn't exist." << endl; 159 return -1; 160 } 161 151 162 // 152 163 // Setup sequence and check its validity … … 202 213 // Do calibration in a block (debug mem) 203 214 // 215 MEnv env(kConfig); 204 216 { 205 217 MJStar job(Form("MJStar #%d", seq.GetSequence())); 206 218 job.SetSequence(seq); 207 job.SetEnv( kConfig);219 job.SetEnv(&env); 208 220 job.SetEnvDebug(kDebugEnv); 209 221 job.SetDisplay(d);; … … 219 231 } 220 232 233 if (kDebugEnv>0) 234 env.PrintUntouched(); 235 221 236 if (!job.GetDisplay()) 222 237 {
Note:
See TracChangeset
for help on using the changeset viewer.