Changeset 4732 for trunk/MagicSoft/Mars
- Timestamp:
- 08/25/04 17:30:31 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4731 r4732 21 21 22 22 23 2004/08/25 : Wolfgang Wittek 23 2004/08/25: Thomas Bretz 24 25 * callisto.cc: 26 - updated handling of command line parameters 27 - added MJPedestal in second loop 28 - changed MJ* to support new MJob base class 29 30 * mjobs/JobsLinkDef.h, mjobs/Makefile: 31 - added MJob 32 33 * mjobs/MJob.[h,cc]: 34 - added 35 36 * mjobs/MJCalibrateSignal.[h,cc], mjobs/MJCalibrateSignal.[h,cc], 37 mjobs/MJCalibration.[h,cc], mjobs/MJPedestal.[h,cc]: 38 - derived from MJob 39 - removed obsolete code (which has been moved to MJob) 40 41 * mjobs/MSequence.[h,cc]: 42 - use MDirIter::GetEntries in SetupRuns 43 - implemented raw-file mode 44 - added GetNum*Runs 45 46 * callisto.rc: 47 - fixed 48 49 * showlog.cc, mbase/MTime.cc, mreport/MReportFileReadCC.cc: 50 - some fixes for gcc 2.95.3 51 52 * mbase/MEvtLoop.cc: 53 - allow prefix argument in ReadEnv 54 55 * mbase/MLog.cc: 56 - added options for log-file and html-file 57 58 * mbase/MTaskEnv.[h,cc]: 59 - added comment 60 - implemented dummy/skip-mode 61 62 * mjobs/MJCalibrateSignal.cc: 63 - removed non existance check from reading extractors (MTaskEnv dummy mode!) 64 - small changed to output 65 66 * mjobs/MJCalibration.cc: 67 - added a cast for gcc 2.95.3 68 - allow dummy mode MTaskEnvs 69 70 * mjobs/MJPedestal.[h,cc]: 71 - implemented CheckEnv 72 73 * msignal/MExtractTime.cc: 74 - fixed Print()-output 75 76 * msignal/MExtractTimeFastSpline.[h,cc]: 77 - added ReadEnv 78 - added Print 79 80 81 82 2004/08/25: Wolfgang Wittek 24 83 25 84 * mpointing/MPointingPos.h … … 27 86 28 87 29 2004/08/24 : Thomas Bretz 88 89 2004/08/24: Thomas Bretz 30 90 31 91 * Makefile: … … 102 162 103 163 104 2004/08/23: Wolfgang Wittek164 2004/08/23: Wolfgang Wittek 105 165 106 166 * mtemp/MTelAxisFromStars.[h,cc] -
trunk/MagicSoft/Mars/callisto.cc
r4729 r4732 51 51 gLog << " Options:" << endl; 52 52 gLog.Usage(); 53 gLog << " --debug-env Debug setting resources from file" << endl << endl; 53 54 gLog << endl; 54 55 gLog << " -f Force overwrite of existing files" << endl; … … 63 64 gLog << " --path=path Path to write the all results to [def=local path]" << endl; 64 65 gLog << " (overwrites --iny, --outc and --outy)" << endl; 65 gLog << " --print seqPrint Sequence information" << endl;66 gLog << " --print filesPrint Files taken from Sequence" << endl;67 gLog << " --print onlyDo not excute anything except print" << endl;66 gLog << " --print-seq Print Sequence information" << endl; 67 gLog << " --print-files Print Files taken from Sequence" << endl; 68 gLog << " --print-only Do not excute anything except print" << endl; 68 69 gLog << " --config=callisto.rc Resource file [default=callistop.rc]" << endl; 69 70 gLog << endl; … … 103 104 const TString kConfig = arg.GetStringAndRemove("--config=", "callisto.rc"); 104 105 105 const Bool_t kPrintSeq = arg.HasOnlyAndRemove("--printseq"); 106 const Bool_t kPrintFiles = arg.HasOnlyAndRemove("--printfiles"); 107 const Bool_t kPrintOnly = arg.HasOnlyAndRemove("--printonly"); 106 const Bool_t kPrintSeq = arg.HasOnlyAndRemove("--print-seq"); 107 const Bool_t kPrintFiles = arg.HasOnlyAndRemove("--print-files"); 108 const Bool_t kPrintOnly = arg.HasOnlyAndRemove("--print-only"); 109 const Bool_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env"); 108 110 109 111 const Bool_t kOverwrite = arg.HasOnlyAndRemove("-f"); … … 122 124 { 123 125 gLog << err << "Neither calibration (-c) nor signal extraction (-y) mode specified!" << endl; 126 Usage(); 124 127 return 0; 125 128 } … … 217 220 job1.SetSequence(seq); 218 221 job1.SetEnv(kConfig); 222 job1.SetEnvDebug(kDebugEnv); 219 223 job1.SetDisplay(d);; 220 224 job1.SetOverwrite(kOverwrite); … … 238 242 job2.SetSequence(seq); 239 243 job2.SetEnv(kConfig); 244 job2.SetEnvDebug(kDebugEnv); 240 245 job2.SetDisplay(d);; 241 246 job2.SetBadPixels(job1.GetBadPixels()); … … 256 261 return 1; 257 262 } 263 264 gLog << endl << endl; 258 265 } 259 266 … … 265 272 job1.SetSequence(seq); 266 273 job1.SetEnv(kConfig); 274 job1.SetEnvDebug(kDebugEnv); 267 275 job1.SetDisplay(d);; 268 276 //job1.SetPathIn(kInpathY); // not yet needed … … 287 295 job2.SetDisplay(d);; 288 296 job2.SetEnv(kConfig); 297 job2.SetEnvDebug(kDebugEnv); 289 298 job2.SetOverwrite(kOverwrite); 290 299 job2.SetPathIn(kInpathY); … … 301 310 return 1; 302 311 } 312 313 gLog << endl << endl; 303 314 } 304 315 -
trunk/MagicSoft/Mars/callisto.rc
r4723 r4732 27 27 # If you don't want it, it is written to the calibration output anyhow. 28 28 # ------------------------------------------------------------------------- 29 #MJPedestal 1.OutputPath: .29 #MJPedestalC.PathOut: . 30 30 31 31 # ------------------------------------------------------------------------- … … 34 34 # assumed. (overwrites command line options) 35 35 # ------------------------------------------------------------------------- 36 #MJCalibration. OutputPath: calped36 #MJCalibration.PathOut: calped 37 37 38 38 # ------------------------------------------------------------------------- … … 42 42 # datacenter is used. (overwrites command line options) 43 43 # ------------------------------------------------------------------------- 44 #MJPedestal 1.InputPath: calped45 #MJCalibration. InputPath: calped44 #MJPedestalC.PathData: /data/MAGIC/Period016/ 45 #MJCalibration.PathData: /data/MAGIC/Period016/ 46 46 47 47 # ------------------------------------------------------------------------- … … 68 68 # could be (if no pedestal file available) a data-file, too. 69 69 # ------------------------------------------------------------------------- 70 #MJ Calibration.ExtractPedestal: MPedCalcPedRun71 #MJ Calibration.ExtractPedestal.HiGainFirst: 072 #MJ Calibration.ExtractPedestal.HiGainLast: 2973 #MJ Calibration.ExtractPedestal.LoGainFirst: 074 #MJ Calibration.ExtractPedestal.LoGainLast: 1475 #MJ Calibration.ExtractPedestal.HiGainWindowSize: 1476 #MJ Calibration.ExtractPedestal.LoGainWindowSize: 070 #MJPedestalC.ExtractPedestal: MPedCalcPedRun 71 #MJPedestalC.ExtractPedestal.HiGainFirst: 0 72 #MJPedestalC.ExtractPedestal.HiGainLast: 29 73 #MJPedestalC.ExtractPedestal.LoGainFirst: 0 74 #MJPedestalC.ExtractPedestal.LoGainLast: 14 75 #MJPedestalC.ExtractPedestal.HiGainWindowSize: 14 76 #MJPedestalC.ExtractPedestal.LoGainWindowSize: 0 77 77 78 78 # ------------------------------------------------------------------------- … … 81 81 # could be (if no pedestal file available) a data-file, too. 82 82 # ------------------------------------------------------------------------- 83 MJ Calibration.ExtractPedestal: MPedCalcFromLoGain84 MJ Calibration.ExtractPedestal.PedestalUpdate: no85 #MJ Calibration.ExtractPedestal.HiGainFirst: 086 #MJ Calibration.ExtractPedestal.HiGainLast: 1187 #MJ Calibration.ExtractPedestal.LoGainFirst: 188 #MJ Calibration.ExtractPedestal.LoGainLast: 1489 #MJ Calibration.ExtractPedestal.HiGainWindowSize: 1290 #MJ Calibration.ExtractPedestal.LoGainWindowSize: 1491 #MJ Calibration.ExtractPedestal.MaxHiGainVar: 4083 MJPedestalC.ExtractPedestal: MPedCalcFromLoGain 84 MJPedestalC.ExtractPedestal.PedestalUpdate: no 85 #MJPedestalC.ExtractPedestal.HiGainFirst: 0 86 #MJPedestalC.ExtractPedestal.HiGainLast: 11 87 #MJPedestalC.ExtractPedestal.LoGainFirst: 1 88 #MJPedestalC.ExtractPedestal.LoGainLast: 14 89 #MJPedestalC.ExtractPedestal.HiGainWindowSize: 12 90 #MJPedestalC.ExtractPedestal.LoGainWindowSize: 14 91 #MJPedestalC.ExtractPedestal.MaxHiGainVar: 40 92 92 93 93 # ------------------------------------------------------------------------- … … 95 95 # ------------------------------------------------------------------------- 96 96 # Maximum number of event processed in the loop 97 #MJPedestal 1.MaxEvents: 100097 #MJPedestalC.MaxEvents: 1000 98 98 # Allow to overwrite existing files with the output file 99 #MJPedestal 1.AllowOverwrite: No99 #MJPedestalC.AllowOverwrite: No 100 100 # Use data runs from the sequence instead of calibration runs 101 #MJPedestal 1.UseData: No101 #MJPedestalC.UseData: No 102 102 103 103 … … 106 106 # and automatically the data extraction 107 107 # ------------------------------------------------------------------------- 108 MJCalibration.ExtractSignal: MExtractFixedWindow PeakSearch109 #MJCalibration.ExtractSignal.HiGainFirst: 2 110 #MJCalibration.ExtractSignal.HiGainLast: 14111 #MJCalibration.ExtractSignal.LoGainFirst: 2 112 #MJCalibration.ExtractSignal.LoGainLast: 14 108 MJCalibration.ExtractSignal: MExtractFixedWindow 109 MJCalibration.ExtractSignal.HiGainFirst: 3 110 MJCalibration.ExtractSignal.HiGainLast: 14 111 MJCalibration.ExtractSignal.LoGainFirst: 4 112 MJCalibration.ExtractSignal.LoGainLast: 13 113 113 #MJCalibration.ExtractSignal.HiGainWindowSize: 6 114 114 #MJCalibration.ExtractSignal.LoGainWindowSize: 6 … … 121 121 # and automatically the data extraction 122 122 # ------------------------------------------------------------------------- 123 MJCalibration.ExtractTime: MExtractTime HighestIntegral124 #MJCalibration.ExtractTime.HiGainFirst: 0125 #MJCalibration.ExtractTime.HiGainLast: 14 126 #MJCalibration.ExtractTime.LoGainFirst: 3127 #MJCalibration.ExtractTime.LoGainLast: 14 123 MJCalibration.ExtractTime: MExtractTimeFastSpline 124 MJCalibration.ExtractTime.HiGainFirst: 0 125 MJCalibration.ExtractTime.HiGainLast: 7 126 MJCalibration.ExtractTime.LoGainFirst: 3 127 MJCalibration.ExtractTime.LoGainLast: 8 128 128 #MJCalibration.ExtractTime.WindowSizeHiGain: 6 129 129 #MJCalibration.ExtractTime.WindowSizeLoGain: 6 … … 162 162 # Use a OutputPath if you want to write the results to a file 163 163 # ------------------------------------------------------------------------- 164 #MJCalibrateSignal.OutputPath: . 165 166 MJPedestal2.UseData: Yes 167 MJPedestal2.MaxEvents: 750 168 169 MJPedestal2.ExtractPedestal: MPedCalcFromLoGain 170 MJPedestal2.ExtractPedestal.PedestalUpdate: yes 171 MJPedestal2.ExtractPedestal.NumEventsDump: 500 164 #MJCalibrateSignal.PathOut: . 165 #MJPedestalY.PathOut: . 166 #MJPedestalY.PathData: /data/MAGIC/Period016/ 167 #MJCalibrateSignal.PathData: /data/MAGIC/Period016/ 168 #MJCalibrateSignal.PathIn: . 169 170 MJPedestalY.UseData: Yes 171 MJPedestalY.MaxEvents: 750 172 173 MJPedestalY.ExtractPedestal: MPedCalcFromLoGain 174 MJPedestalY.ExtractPedestal.PedestalUpdate: yes 175 MJPedestalY.ExtractPedestal.NumEventsDump: 500 172 176 173 177 # ------------------------------------------------------------------------- … … 175 179 # ------------------------------------------------------------------------- 176 180 MJCalibrateSignal.MPedCalcFromLoGain: MPedCalcFromLoGain 177 MJCalibrateSignal. MPedCalcFromLoGain.PedestalUpdate: yes178 MJCalibrateSignal. MPedCalcFromLoGain.NumEventsDump: 500181 MJCalibrateSignal.ExtractPedestal.PedestalUpdate: yes 182 MJCalibrateSignal.ExtractPedestal.NumEventsDump: 500 179 183 #MJCalibrateSignal.ExtractPedestal.HiGainFirst: 0 180 184 #MJCalibrateSignal.ExtractPedestal.HiGainLast: 11 -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r4702 r4732 103 103 operator TIterator*() const; 104 104 105 ClassDef(MCerPhotEvt, 2) // class for an event containing cerenkov photons105 ClassDef(MCerPhotEvt, 3) // class for an event containing cerenkov photons 106 106 }; 107 107 -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r4722 r4732 933 933 // CleaningLevel1: 3.0 934 934 // 935 // 936 // With the argument prefix you can overwrite the name of the MEvtLoop object 937 // as prefix - use with extreme care! The prifix argument must not end with 938 // a dot! 939 // 940 // 935 941 // Warning: The programmer is responsible for the names to be unique in 936 942 // all Mars classes. … … 938 944 Int_t MEvtLoop::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 939 945 { 940 if (!prefix.IsNull()) 941 *fLog << warn << "WARNING - Second argument in MEvtLoop::ReadEnv has no meaning... ignored." << endl; 942 943 prefix = fName; 946 // if (!prefix.IsNull()) 947 // *fLog << warn << "WARNING - Second argument in MEvtLoop::ReadEnv has no meaning... ignored." << endl; 948 949 if (prefix.IsNull()) 950 prefix = fName; 944 951 prefix += "."; 945 952 -
trunk/MagicSoft/Mars/mbase/MLog.cc
r4722 r4732 107 107 #include <TGTextView.h> 108 108 109 #include "M LogPlugin.h"109 #include "MArgs.h" 110 110 #include "MParContainer.h" 111 #include "MArgs.h" 111 112 #include "MLogHtml.h" 112 113 113 114 ClassImp(MLog); … … 520 521 *this << " -v# Verbosity level # [default=2]" << endl; 521 522 *this << " -a, --no-colors Do not use Ansii color codes" << endl; 523 *this << " --log[=file] Write log-out to ascii-file [default: prgname.log]" << endl; 524 *this << " --html[=file] Write log-out to html-file [default: prgname.html]" << endl; 522 525 *this << " --debug[=n] Enable root debugging [default: gDebug=1]" << endl; 526 *this << " --null Null output (supresses all output)" << endl; 523 527 } 524 528 … … 527 531 // Setup MLog and global debug output from command line arguments. 528 532 // 529 // gLog << " -v# Verbosity level # [default=2]" << endl;530 // gLog << " -a, --no-colors Do not use Ansii color codes" << endl;531 // gLog << " --debug[=n] Enable root debugging (Default: gDebug=1)" << endl;532 //533 533 void MLog::Setup(MArgs &arg) 534 534 { 535 if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a")) 536 SetNoColors(); 537 538 SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2); 539 535 // FXIME: This is not really at a place where it belongs to! 540 536 gDebug = arg.HasOption("--debug=") ? arg.GetIntAndRemove("--debug=") : 0; 541 537 if (gDebug==0 && arg.HasOnlyAndRemove("--debug")) 542 538 gDebug=1; 539 540 TString f1 = arg.GetStringAndRemove("--log=", ""); 541 if (f1.IsNull() && arg.HasOnlyAndRemove("--log")) 542 f1 = Form("%s.log", arg.GetName()); 543 if (!f1.IsNull()) 544 { 545 SetOutputFile(f1); 546 EnableOutputDevice(eFile); 547 } 548 549 TString f2 = arg.GetStringAndRemove("--html=", ""); 550 if (f2.IsNull() && arg.HasOnlyAndRemove("--html")) 551 f2 = Form("%s.html", arg.GetName()); 552 if (!f2.IsNull()) 553 { 554 MLogHtml *html = new MLogHtml(f2); 555 html->SetBit(kCanDelete); 556 AddPlugin(html); 557 } 558 559 const Bool_t null = arg.HasOnlyAndRemove("--null"); 560 if (null) 561 SetNullOutput(); 562 563 if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a")) 564 SetNoColors(); 565 566 SetDebugLevel(arg.GetIntAndRemove("-v", 2)); 543 567 } 544 568 … … 653 677 // is automatically removed from the list of active plugins. 654 678 // 679 // If MLog should take the ownership cal plug->SetBit(kCanDelete); 680 // 655 681 void MLog::AddPlugin(MLogPlugin *plug) 656 682 { 657 683 fPlugins->Add(plug); 658 plug->SetBit(kMustCleanup); 659 } 684 } -
trunk/MagicSoft/Mars/mbase/MTaskEnv.cc
r4723 r4732 27 27 // MTaskEnv 28 28 // 29 // If you want to create a new task inside a macro you will have to compile 30 // your macro using macro.C++, because the root interpreter cannot use 31 // uncompiled classes. To workaround this problem you can write simple 32 // funcions (which can be handled by CINT) and use MTaskEnv. 33 // 34 // This is a simple way to develop new code in a macro without need 35 // to compile it. 36 // 37 // Example: 38 // Int_t Process() 39 // { 40 // gLog << "Processing..." << endl; 41 // return kTRUE; 42 // } 43 // 44 // void main() 45 // { 46 // MTaskEnv task; 47 // task.SetProcess(Process); 48 // MTaskList list; 49 // list.AddToList(&task); 50 // } 29 // This class is used if a task - at runtime - should be replaced or setup 30 // from a resource file, eg. 31 // 32 // 33 // resources.rc: 34 // MyTask: MThisIsMyClass 35 // MyTask.Resource1: yes 36 // MyTask.Resource2: 50 37 // 38 // macro.C: 39 // MTaskList list; 40 // 41 // MDefaultTask def; 42 // MTaskEnv taskenv("MyTask"); 43 // taskenv.SetDefault(&def); 44 // 45 // list.AddToList(&taskenv); 46 // [...] 47 // evtloop.ReadEnv("resource.rc"); 48 // 49 // In this case MTaskEnv will act like MDefaultTask if nothing is found in the 50 // resource file. If the task is setup via the resource file like in the 51 // example above it will act like a MThisIsMyClass setup with Resource1 and 52 // Resource2. 53 // 54 // 55 // You can also skip the task completely if you setup (in lower case letters!) 56 // 57 // resources.rc: 58 // MyTask: <dummy> 59 // 60 // 61 // A third option is to setup a MTaskEnv to be skipped except a task is 62 // initialized through the resource file: 63 // MTaskEnv taskenv("MyTask"); 64 // taskenv.SetDefault(0); 51 65 // 52 66 // … … 165 179 Bool_t MTaskEnv::ReInit(MParList *list) 166 180 { 167 *fLog << fTask->ClassName() << " -" << flush;181 *fLog << fTask->ClassName() << " <MTaskEnv>... " << flush; 168 182 return fTask->ReInit(list); 169 183 } … … 171 185 Int_t MTaskEnv::PreProcess(MParList *list) 172 186 { 187 if (TestBit(kIsDummy)) 188 { 189 *fLog << inf << "Dummy Task... skipped." << endl; 190 return kSKIP; 191 } 192 173 193 if (!fTask) 174 194 { … … 177 197 } 178 198 179 *fLog << fTask->ClassName() << " -" << flush;199 *fLog << fTask->ClassName() << " <MTaskEnv>... " << flush; 180 200 return fTask->CallPreProcess(list); 181 201 } … … 188 208 Int_t MTaskEnv::PostProcess() 189 209 { 190 *fLog << fTask->ClassName() << " -" << flush;210 *fLog << fTask->ClassName() << " <MTaskEnv>... " << flush; 191 211 return fTask->CallPostProcess(); 192 212 } … … 200 220 task.ReplaceAll("\015", ""); 201 221 task = task.Strip(TString::kBoth); 222 223 if (task=="<dummy>") 224 { 225 if (TestBit(kIsOwner) && fTask) 226 delete fTask; 227 fTask = 0; 228 SetBit(kIsDummy); 229 return kTRUE; 230 } 231 202 232 fTask = GetTask(task.Data()); 203 233 if (!fTask) -
trunk/MagicSoft/Mars/mbase/MTaskEnv.h
r4723 r4732 14 14 MTask *fTask; 15 15 16 enum { kIsOwner = BIT(14) };16 enum { kIsOwner = BIT(14), kIsDummy = BIT(15) }; 17 17 18 18 MTask *GetTask(const char *name) const; … … 33 33 void SetOwner(Bool_t b=kTRUE) { b ? SetBit(kIsOwner) : ResetBit(kIsOwner); } 34 34 35 void SetDefault(MTask *task) { fTask = task; }35 void SetDefault(MTask *task) { fTask = task; if (!task) SetBit(kIsDummy); } 36 36 void SetDefault(const char *def); 37 37 -
trunk/MagicSoft/Mars/mbase/MTime.cc
r4627 r4732 70 70 71 71 #include <iomanip> 72 73 #ifndef __USE_XOPEN 74 #define __USE_XOPEN // on some systems needed for strptime 75 #endif 72 76 73 77 #include <time.h> // struct tm -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r4729 r4732 148 148 149 149 TObject *o = file.Get("ExtractSignal"); 150 if (!o)151 {152 *fLog << err << dbginf << "ERROR - Unable to read ExtractSignal from file " << fname << endl;153 return kFALSE;154 }155 if ( !o->InheritsFrom(MExtractor::Class()))150 // if (!o) 151 // { 152 // *fLog << err << dbginf << "ERROR - Unable to read ExtractSignal from file " << fname << endl; 153 // return kFALSE; 154 // } 155 if (o && !o->InheritsFrom(MExtractor::Class())) 156 156 { 157 157 *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl; 158 158 return kFALSE; 159 159 } 160 ext1 = (MTask*)o->Clone();160 ext1 = o ? (MTask*)o->Clone() : NULL; 161 161 162 162 o = file.Get("ExtractTime"); 163 if (!o)164 {165 *fLog << err << dbginf << "ERROR - Unable to read ExtractTime from file " << fname << endl;166 return kFALSE;167 }168 if ( !o->InheritsFrom(MExtractor::Class()))163 // if (!o) 164 // { 165 // *fLog << err << dbginf << "ERROR - Unable to read ExtractTime from file " << fname << endl; 166 // return kFALSE; 167 // } 168 if (o && !o->InheritsFrom(MExtractor::Class())) 169 169 { 170 170 *fLog << err << dbginf << "ERROR - ExtractTime read from " << fname << " doesn't inherit from MExtractor!" << endl; 171 171 return kFALSE; 172 172 } 173 ext2 = (MTask*)o->Clone(); 173 ext2 = o ? (MTask*)o->Clone() : NULL; 174 175 if (!ext1 && !ext2) 176 { 177 *fLog << err << dbginf << "ERROR - Neither ExtractSignal nor ExrtractTime found in " << fname << "!" << endl; 178 return kFALSE; 179 } 174 180 175 181 return kTRUE; … … 226 232 227 233 *fLog << all; 228 *fLog << "Extractors read from file" << endl; 229 *fLog << "=========================" << endl; 230 extractor1->Print(); 231 *fLog << endl; 232 extractor2->Print(); 233 *fLog << endl; 234 if (extractor1) 235 { 236 *fLog << underline << "Signal Extractor found in calibration file" << endl; 237 extractor1->Print(); 238 *fLog << endl; 239 } 240 else 241 *fLog << inf << "No Signal Extractor: ExtractSignal in file." << endl; 242 243 if (extractor2) 244 { 245 *fLog << underline << "Time Extractor found in calibration file" << endl; 246 extractor2->Print(); 247 *fLog << endl; 248 } 249 else 250 *fLog << inf << "No Time Extractor: ExtractTime in file." << endl; 234 251 235 252 // This is necessary for the case in which it is not in the files … … 302 319 tlist.AddToList(&pedlo); 303 320 tlist.AddToList(&fill0); 304 tlist.AddToList(&taskenv1); 305 tlist.AddToList(&taskenv2); 321 if (extractor1) 322 tlist.AddToList(&taskenv1); 323 if (extractor2) 324 tlist.AddToList(&taskenv2); 306 325 tlist.AddToList(&fill1); 307 326 tlist.AddToList(&calib); … … 320 339 evtloop.SetDisplay(fDisplay); 321 340 evtloop.SetLogStream(fLog); 322 if ( GetEnv())323 evtloop.ReadEnv(*GetEnv());341 if (!SetupEnv(evtloop)) 342 return kFALSE; 324 343 325 344 // Execute first analysis -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4729 r4732 248 248 TString title = fDisplay->GetTitle(); 249 249 title += "-- Calibration "; 250 title += fSequence.IsValid() ? Form("calib%06d", fSequence.GetSequence()) : fRuns->GetRunsAsString();250 title += fSequence.IsValid() ? Form("calib%06d", fSequence.GetSequence()) : (const char*)fRuns->GetRunsAsString(); 251 251 title += " --"; 252 252 fDisplay->SetTitle(title); … … 1247 1247 Bool_t MJCalibration::CheckEnv() 1248 1248 { 1249 if (!MJob::CheckEnv())1250 return kFALSE;1251 1252 1249 TString col = GetEnv("Color", ""); 1253 1250 if (!col.IsNull()) … … 1269 1266 SetUsePINDiode(GetEnv("UsePINDiode", IsUsePINDiode())); 1270 1267 1271 return kTRUE;1268 return MJob::CheckEnv(); 1272 1269 } 1273 1270 … … 1557 1554 evtloop.SetDisplay(fDisplay); 1558 1555 evtloop.SetLogStream(fLog); 1559 if (GetEnv()) 1560 evtloop.ReadEnv(*GetEnv()); 1561 1562 //if (!WriteEventloop(evtloop)) 1563 // return kFALSE; 1556 if (!SetupEnv(evtloop)) 1557 return kFALSE; 1558 1559 if (!taskenv.GetTask() && !taskenv2.GetTask()) 1560 { 1561 *fLog << err << "ERROR - Neither ExtractSignal nor ExtractTime initializedor both '<dummy>'." << endl; 1562 return kFALSE; 1563 } 1564 1564 1565 1565 if (!WriteTasks(taskenv.GetTask(), taskenv2.GetTask())) … … 1738 1738 } 1739 1739 1740 if (t1 ->Write()<=0)1740 if (t1 && t1->Write()<=0) 1741 1741 { 1742 1742 *fLog << err << "Unable to write " << t1->GetName() << " to " << oname << endl; 1743 1743 return kFALSE; 1744 1744 } 1745 if (t2 ->Write()<=0)1745 if (t2 && t2->Write()<=0) 1746 1746 { 1747 1747 *fLog << err << "Unable to write " << t2->GetName() << " to " << oname << endl; -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r4729 r4732 460 460 } 461 461 */ 462 463 Bool_t MJPedestal::CheckEnv() 464 { 465 if (HasEnv("DataCheckDisplay")) 466 fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay; 467 468 SetDataCheck(GetEnv("DataCheck", fDataCheck)); 469 SetOverwrite(GetEnv("Overwrite", fOverwrite)); 470 471 return MJob::CheckEnv(); 472 } 473 462 474 Bool_t MJPedestal::WriteResult() 463 475 { … … 617 629 evtloop.SetDisplay(fDisplay); 618 630 evtloop.SetLogStream(fLog); 619 if ( GetEnv())620 evtloop.ReadEnv(*GetEnv());631 if (!SetupEnv(evtloop)) 632 return kFALSE; 621 633 622 634 // if (!WriteEventloop(evtloop)) -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r4729 r4732 61 61 void DisplayOutliers(TH1D *hist) const; 62 62 void FixDataCheckHist(TH1D *hist) const; 63 64 Bool_t CheckEnv(); 63 65 64 66 public: … … 78 80 void SetInput(MRunIter *iter) { fRuns = iter; } 79 81 80 void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); }82 void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; b ? SetDataCheckDisplay() : SetNormalDisplay(); } 81 83 82 84 void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; } -
trunk/MagicSoft/Mars/mjobs/MJob.cc
r4729 r4732 37 37 #include "MLog.h" 38 38 #include "MLogManip.h" 39 40 #include "MEvtLoop.h" 39 41 40 42 ClassImp(MJob); … … 77 79 fEnv = new TEnv(env); 78 80 79 f PrefixEnv= prefix;81 fEnvPrefix = prefix; 80 82 if (!prefix) 81 f PrefixEnv= fName.First(' ')>0 ? fName(0, fName.First(' ')) : fName;83 fEnvPrefix = fName.First(' ')>0 ? fName(0, fName.First(' ')) : fName; 82 84 83 if (f PrefixEnv.EndsWith("."))84 f PrefixEnv.Remove(fPrefixEnv.Length()-1);85 if (fEnvPrefix.EndsWith(".")) 86 fEnvPrefix.Remove(fEnvPrefix.Length()-1); 85 87 86 88 return kTRUE; … … 118 120 Int_t MJob::GetEnv(const char *name, Int_t dflt) const 119 121 { 120 return fEnv->GetValue(Form("%s%s", fPrefixEnv.Data(), name), dflt);122 return GetEnvValue(*fEnv, fEnvPrefix, name, dflt); // return fEnv->GetValue(Form("%s%s", fEnvPrefix.Data(), name), dflt); 121 123 } 122 124 123 125 Double_t MJob::GetEnv(const char *name, Double_t dflt) const 124 126 { 125 return fEnv->GetValue(Form("%s%s", fPrefixEnv.Data(), name), dflt);127 return GetEnvValue(*fEnv, fEnvPrefix, name, dflt); // return fEnv->GetValue(Form("%s%s", fEnvPrefix.Data(), name), dflt); 126 128 } 127 129 128 130 const char *MJob::GetEnv(const char *name, const char *dflt) const 129 131 { 130 return fEnv->GetValue(Form("%s%s", fPrefixEnv.Data(), name), dflt);132 return GetEnvValue(*fEnv, fEnvPrefix, name, dflt); //fEnv->GetValue(Form("%s%s", fEnvPrefix.Data(), name), dflt); 131 133 } 132 134 133 135 Bool_t MJob::HasEnv(const char *name) const 134 136 { 135 return fEnv->Lookup(Form("%s%s", fPrefixEnv.Data(), name));137 return IsEnvDefined(*fEnv, fEnvPrefix, name, fEnvDebug);//fEnv->Lookup(Form("%s%s", fEnvPrefix.Data(), name)); 136 138 } 137 139 138 140 Bool_t MJob::CheckEnv() 139 141 { 140 if (!fEnv)141 {142 *fLog << warn << "WARNING - " << GetDescriptor() << " CheckEnv called without further SetEnv!" << endl;143 return kFALSE;144 }145 146 142 TString p; 147 143 p = GetEnv("PathOut", ""); … … 162 158 return kTRUE; 163 159 } 160 161 Bool_t MJob::SetupEnv(MEvtLoop &loop) const 162 { 163 if (!fEnv) 164 return kTRUE; 165 166 return loop.ReadEnv(*fEnv, fEnvPrefix, fEnvDebug) ? kTRUE : kFALSE; 167 } -
trunk/MagicSoft/Mars/mjobs/MJob.h
r4729 r4732 7 7 8 8 class TEnv; 9 class MEvtLoop; 9 10 10 11 class MJob : public MParContainer … … 14 15 15 16 TEnv *fEnv; // Resource file 16 TString fPrefixEnv; // Prefix for resources 17 TString fEnvPrefix; // Prefix for resources 18 Bool_t fEnvDebug; // Debug setup of resources 17 19 18 20 protected: … … 27 29 MSequence fSequence; // Sequence 28 30 29 virtual Bool_t CheckEnv();30 31 TEnv *GetEnv() const { return fEnv; }32 31 Int_t GetEnv(const char *name, Int_t dflt) const; 33 32 Double_t GetEnv(const char *name, Double_t dflt) const; 34 33 const char *GetEnv(const char *name, const char *dflt) const; 35 34 Bool_t HasEnv(const char *name) const; 35 36 Bool_t SetupEnv(MEvtLoop &loop) const; 37 virtual Bool_t CheckEnv(); 36 38 37 39 public: … … 45 47 void SetOverwrite(Bool_t b=kTRUE) { fOverwrite=b; } 46 48 Bool_t SetEnv(const char *env, const char *prefix=0); 49 void SetEnvDebug(Bool_t b=kTRUE) { fEnvDebug=b; } 47 50 48 51 void SetMaxEvents(Int_t max) { fMaxEvents = max; } -
trunk/MagicSoft/Mars/mjobs/MSequence.cc
r4729 r4732 73 73 } 74 74 75 Int_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path ) const75 Int_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, Bool_t raw) const 76 76 { 77 77 TString d(path); … … 80 80 if (d.IsNull()) 81 81 { 82 d = Form("/data/MAGIC/Period%03d/rootdata/", fPeriod); 82 d = Form("/data/MAGIC/Period%03d/", fPeriod); 83 d += raw ? "rawdata/" : "rootdata/"; 83 84 d += fNight.GetStringFmt("%Y_%m_%d"); 84 85 } … … 90 91 // Create file name 91 92 n = fNight.GetStringFmt("%Y%m%d_"); 92 n += Form("%05d_*_E.root", arr[i]); 93 n += Form("%05d_*_E", arr[i]); 94 n += raw ? ".raw" : ".root"; 93 95 94 96 // Add Path/File to TIter … … 182 184 // If path==0 the standard path of the data-center is assumed. 183 185 // If you have the runs locally use path="." 184 // Return the number of files added. 185 // 186 Int_t MSequence::SetupPedRuns(MDirIter &iter, const char *path) const 187 { 188 return SetupRuns(iter, fPedRuns, path); 186 // Using raw=kTRUE you get correspodning raw-files setup. 187 // Return the number of files added. 188 // 189 Int_t MSequence::SetupPedRuns(MDirIter &iter, const char *path, Bool_t raw) const 190 { 191 return SetupRuns(iter, fPedRuns, path, raw); 189 192 } 190 193 … … 194 197 // If path==0 the standard path of the data-center is assumed. 195 198 // If you have the runs locally use path="." 196 // Return the number of files added. 197 // 198 Int_t MSequence::SetupDatRuns(MDirIter &iter, const char *path) const 199 { 200 return SetupRuns(iter, fDatRuns, path); 199 // Using raw=kTRUE you get correspodning raw-files setup. 200 // Return the number of files added. 201 // 202 Int_t MSequence::SetupDatRuns(MDirIter &iter, const char *path, Bool_t raw) const 203 { 204 return SetupRuns(iter, fDatRuns, path, raw); 201 205 } 202 206 … … 206 210 // If path==0 the standard path of the data-center is assumed. 207 211 // If you have the runs locally use path="." 208 // Return the number of files added. 209 // 210 Int_t MSequence::SetupAllRuns(MDirIter &iter, const char *path) const 211 { 212 return SetupRuns(iter, fRuns, path); 212 // Using raw=kTRUE you get correspodning raw-files setup. 213 // Return the number of files added. 214 // 215 Int_t MSequence::SetupAllRuns(MDirIter &iter, const char *path, Bool_t raw) const 216 { 217 return SetupRuns(iter, fRuns, path, raw); 213 218 } 214 219 … … 218 223 // If path==0 the standard path of the data-center is assumed. 219 224 // If you have the runs locally use path="." 220 // Return the number of files added. 221 // 222 Int_t MSequence::SetupCalRuns(MDirIter &iter, const char *path) const 223 { 224 return SetupRuns(iter, fCalRuns, path); 225 } 225 // Using raw=kTRUE you get correspodning raw-files setup. 226 // Return the number of files added. 227 // 228 Int_t MSequence::SetupCalRuns(MDirIter &iter, const char *path, Bool_t raw) const 229 { 230 return SetupRuns(iter, fCalRuns, path, raw); 231 } -
trunk/MagicSoft/Mars/mjobs/MSequence.h
r4729 r4732 36 36 37 37 void Split(TString &runs, TArrayI &data) const; 38 Int_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path ) const;38 Int_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, Bool_t raw=kFALSE) const; 39 39 40 40 public: … … 53 53 Bool_t IsValid() const { return fSequence!=(UInt_t)-1; } 54 54 55 Int_t SetupPedRuns(MDirIter &iter, const char *path=0 ) const;56 Int_t SetupDatRuns(MDirIter &iter, const char *path=0 ) const;57 Int_t SetupAllRuns(MDirIter &iter, const char *path=0 ) const;58 Int_t SetupCalRuns(MDirIter &iter, const char *path=0 ) const;55 Int_t SetupPedRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const; 56 Int_t SetupDatRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const; 57 Int_t SetupAllRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const; 58 Int_t SetupCalRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const; 59 59 60 60 Int_t GetNumAllRuns() const { return fRuns.GetSize(); } -
trunk/MagicSoft/Mars/mreport/MReportFileReadCC.cc
r4587 r4732 44 44 45 45 #include <fstream> 46 #include <stdlib.h> // atoi on gcc 2.95.3 46 47 47 48 #include <TRegexp.h> -
trunk/MagicSoft/Mars/msignal/MExtractTime.cc
r4723 r4732 230 230 } 231 231 232 rc = MExtractor::ReadEnv(env, prefix, print) ? kTRUE : rc; 233 234 return rc; 232 return MExtractor::ReadEnv(env, prefix, print) ? kTRUE : rc; 235 233 } 236 234 … … 240 238 if (IsA()==MExtractTime::Class()) 241 239 *fLog << GetDescriptor() << ":" << endl; 242 *fLog << " Offset Lo-Gain =" << fOffsetLoGain << endl;240 *fLog << " Offset Lo-Gain: " << fOffsetLoGain << endl; 243 241 MExtractor::Print(o); 244 242 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeFastSpline.cc
r4284 r4732 54 54 const Float_t MExtractTimeFastSpline::fgResolution = 0.003; 55 55 const Float_t MExtractTimeFastSpline::fgRiseTime = 1.5; 56 56 57 // -------------------------------------------------------------------------- 57 58 // … … 672 673 } 673 674 674 675 // -------------------------------------------------------------------------- 676 // 677 // In addition to the resources of the base-class MExtractor: 678 // MJPedestal.MExtractor.Resolution: 0.003 679 // MJPedestal.MExtractor.RiseTime: 1.5 680 // 681 Int_t MExtractTimeFastSpline::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 682 { 683 Bool_t rc = kFALSE; 684 685 if (IsEnvDefined(env, prefix, "HiGainWindowSize", print)) 686 { 687 SetResolution(GetEnvValue(env, prefix, "Resolution", fResolution)); 688 rc = kTRUE; 689 } 690 if (IsEnvDefined(env, prefix, "LoGainWindowSize", print)) 691 { 692 SetRiseTime(GetEnvValue(env, prefix, "RiseTime", fRiseTime)); 693 rc = kTRUE; 694 } 695 696 return MExtractTime::ReadEnv(env, prefix, print) ? kTRUE : rc; 697 } 698 699 void MExtractTimeFastSpline::Print(Option_t *o) const 700 { 701 *fLog << all; 702 *fLog << GetDescriptor() << ":" << endl; 703 *fLog << " Resolution: " << fResolution << endl; 704 *fLog << " RiseTime: " << fRiseTime << endl; 705 MExtractTime::Print(o); 706 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeFastSpline.h
r4723 r4732 18 18 static const Float_t fgRiseTime ; // Default for fRiseTime (now set to: 1.5 C 19 19 20 Float_t *fHiGainFirstDeriv; 21 Float_t *fLoGainFirstDeriv; 22 Float_t *fHiGainSecondDeriv; 23 Float_t *fLoGainSecondDeriv; 20 Float_t *fHiGainFirstDeriv; //! 21 Float_t *fLoGainFirstDeriv; //! 22 Float_t *fHiGainSecondDeriv; //! 23 Float_t *fLoGainSecondDeriv; //! 24 24 25 Float_t fResolution; 26 Float_t fRiseTime ; // The rise time of the pulse27 Byte_t fStartBeforeMax; 25 Float_t fResolution; // The time resolution in FADC units 26 Float_t fRiseTime ; // The rise time of the pulse 27 Byte_t fStartBeforeMax; // Slices to start searching for the halfmax before max 28 28 29 29 void FindTimeHiGain(Byte_t *first, Float_t &time, Float_t &dtime, Byte_t &sat, const MPedestalPix &ped) const; 30 30 void FindTimeLoGain(Byte_t *first, Float_t &time, Float_t &dtime, Byte_t &sat, const MPedestalPix &ped) const; 31 32 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 31 33 32 34 public: … … 38 40 void SetResolution(Float_t f=fgResolution) { fResolution = f; } 39 41 void SetRiseTime (Float_t f=fgRiseTime ) { fRiseTime = f; fStartBeforeMax = (Int_t)(2*fRiseTime); } 42 43 void Print(Option_t *o) const; 40 44 41 ClassDef(MExtractTimeFastSpline, 0) // Task to Extract the Arrival Times using a Fast Spline45 ClassDef(MExtractTimeFastSpline, 1) // Task to Extract the Arrival Times using a Fast Spline 42 46 }; 43 47 -
trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.cc
r4723 r4732 324 324 SetWindowSize(hw, lw); 325 325 326 rc = MExtractTime::ReadEnv(env, prefix, print) ? kTRUE : rc; 327 328 return rc; 326 return MExtractTime::ReadEnv(env, prefix, print) ? kTRUE : rc; 329 327 } 330 328 -
trunk/MagicSoft/Mars/showlog.cc
r4591 r4732 28 28 } 29 29 30 istream *in = argc==2 ? new ifstream(argv[1]) : &cin; 30 // casts necessary for gcc 2.95.3 31 istream *in = argc==2 ? (istream*)new ifstream(argv[1]) : (istream*)&cin; 31 32 if (!*in) 32 33 {
Note:
See TracChangeset
for help on using the changeset viewer.