Changeset 4723 for trunk/MagicSoft/Mars
- Timestamp:
- 08/24/04 18:15:29 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4722 r4723 20 20 -*-*- END OF LINE -*-*- 21 21 22 2004/08/24 : Wolfgang Wittek22 2004/08/24 : Thomas Bretz 23 23 24 24 * Makefile: … … 74 74 * msignal/MExtractTimeHighestIntegral.[h,cc]: 75 75 - added ReadEnv 76 77 * mcalib/MCalibrationRelTimeCalc.cc: 78 - do not write to a log file if logging is not enabled 79 - replaced some arrays by TArrays 80 81 * mjobs/JobsLinkDef.h, mjobs/Makefile: 82 - added MJCalibrateSignal 83 84 * mjobs/MJCalibrateSignal.[h,cc]: 85 - added 86 87 * msignal/MExtractFixedWindow.[h,cc], msignal/MExtractFixedWindowPeakSearch.[h,cc], 88 msignal/MExtractSlidingWindow.[h,cc], msignal/MExtractTime.[h,cc], 89 msignal/MExtractTimeAndCharge.[h,cc], msignal/MExtractTimeHighestIntegral.[h,cc] 90 msignal/MExtractor.[h,cc]: 91 - added Print 92 - added ReadEnv 93 - changed version number to 1 76 94 77 95 -
trunk/MagicSoft/Mars/NEWS
r4716 r4723 8 8 more): showlog 9 9 10 - added new program to display an MStatusArray of plots (stored with 11 MStatusDisplay) from a file: showplot 12 10 13 - Added support for Sequences (MSequence). Sequences are blocks of run 11 14 files containing the same calibration and belonging to the same … … 31 34 - added a cleaning which takes signal height _and_ arrival time into 32 35 account: probability cleaning (for more details see MImgCleanStd) 36 37 - added program doing the calibration and the signal extraction 38 and signal calibration: callisto 33 39 34 40 -
trunk/MagicSoft/Mars/callisto.cc
r4722 r4723 16 16 #include "MJPedestal.h" 17 17 #include "MJCalibration.h" 18 #include "MJCalibrateSignal.h" 18 19 19 20 using namespace std; … … 40 41 gLog << all << endl; 41 42 gLog << "Sorry the usage is:" << endl; 42 gLog << " callisto [ options] sequence.txt" << endl << endl;43 gLog << " callisto [-c] [-y] [options] sequence.txt" << endl << endl; 43 44 gLog << " Arguments:" << endl; 44 45 gLog << " sequence.txt: An ascii file defining a sequence of runs" << endl; 45 46 gLog << " Root Options:" << endl; 46 47 gLog << " -b Batch mode (no graphical output to screen)" << endl<<endl; 48 gLog << " Operation Modes:" << endl; 49 gLog << " -c Calculate the calibration constants" << endl; 50 gLog << " -y Extract and calibrate signal" << endl << endl; 47 51 gLog << " Options:" << endl; 48 52 gLog.Usage(); … … 50 54 gLog << " -f Force overwrite of existing files" << endl; 51 55 gLog << " --in=path Path where to search for the data files" << endl; 52 gLog << " --out=path Path where to write the result to" << endl; 56 gLog << " [default=standard path in datacenter]" << endl; 57 gLog << " --iny=path Path where to search for the calibration files" << endl; 58 gLog << " [default=local path or output path of Mode-C]" << endl; 59 gLog << " --out=path Path to write the all results to [def=local path]" << endl; 60 gLog << " --outc=path Path to write Mode-C result to [def=local path]" << endl; 61 gLog << " --outy=path Path to write Mode-Y result to [def=local path]" << endl; 53 62 gLog << " --printseq Print Sequence information" << endl; 54 63 gLog << " --printfiles Print Files taken from Sequence" << endl; … … 92 101 const Bool_t kPrintOnly = arg.HasOnlyAndRemove("--printonly"); 93 102 const Bool_t kOverwrite = arg.HasOnlyAndRemove("-f"); 103 const TString kInpathY = arg.GetStringAndRemove("--iny=", ""); 104 TString kInpath = arg.GetStringAndRemove("--in=", ""); 94 105 const TString kOutpath = arg.GetStringAndRemove("--out=", ""); 95 const TString kInpath = arg.GetStringAndRemove("--in=", ""); 96 106 TString kOutpathC = arg.GetStringAndRemove("--outc=", ""); 107 TString kOutpathY = arg.GetStringAndRemove("--outy=", ""); 108 109 const Bool_t kModeC = arg.HasOnlyAndRemove("-c"); 110 const Bool_t kModeY = arg.HasOnlyAndRemove("-y"); 111 112 if (!kModeC && !kModeY) 113 { 114 gLog << err << "Neither calibration (-c) nor signal extraction (-y) mode specified!" << endl; 115 return 0; 116 } 117 118 if (!kOutpath.IsNull()) 119 { 120 if (!kOutpathC.IsNull() || !kOutpathY.IsNull()) 121 { 122 gLog << err << "You cannot use --out= and --outc= or --outy= together!" << endl; 123 return 0; 124 } 125 if (kOutpathC.IsNull()) 126 kOutpathC = kOutpath; 127 if (kOutpathY.IsNull()) 128 kOutpathY = kOutpath; 129 } 97 130 if (arg.GetNumOptions()>0) 98 131 { … … 116 149 if (gROOT->IsBatch() || !gClient) 117 150 { 118 gLog << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;151 gLog << err << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl; 119 152 return 1; 120 153 } … … 164 197 d->SetTitle(kSequence); 165 198 166 MJPedestal job1; 167 job1.SetSequence(&seq); 168 job1.SetEnv(kConfig); 169 job1.SetDisplay(d);; 170 job1.SetOutputPath(kOutpath); 171 172 if (!job1.ProcessFile()) 173 { 174 gLog << err << "Calculation of pedestal failed." << endl << endl; 175 return -1; 176 } 177 178 if (!job1.GetDisplay()) 179 { 180 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 181 return 1; 182 } 183 184 MJCalibration job2; 185 job2.SetSequence(&seq); 186 job2.SetEnv(kConfig); 187 job2.SetDisplay(d);; 188 job2.SetBadPixels(job1.GetBadPixels()); 189 job2.SetOutputPath(kOutpath); 190 job2.SetOverwrite(kOverwrite); 191 192 if (!job2.ProcessFile(job1.GetPedestalCam())) 193 { 194 gLog << err << "Calculation of calibration failed." << endl << endl; 195 return -1; 196 } 197 198 if (!job2.GetDisplay()) 199 { 200 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 201 return 1; 199 if (kModeC) 200 { 201 MJPedestal job1("MJPedestal1"); 202 job1.SetSequence(&seq); 203 job1.SetEnv(kConfig); 204 job1.SetDisplay(d);; 205 job1.SetInputPath(kInpath); 206 job1.SetOutputPath(kOutpathC); 207 job1.SetOverwrite(kOverwrite); 208 209 if (!job1.ProcessFile()) 210 { 211 gLog << err << "Calculation of pedestal failed." << endl << endl; 212 return -1; 213 } 214 215 if (!job1.GetDisplay()) 216 { 217 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 218 return 1; 219 } 220 221 MJCalibration job2("MJCalibration"); 222 job2.SetSequence(&seq); 223 job2.SetEnv(kConfig); 224 job2.SetDisplay(d);; 225 job2.SetBadPixels(job1.GetBadPixels()); 226 job2.SetInputPath(kInpath); 227 job2.SetOutputPath(kOutpathC); 228 job2.SetOverwrite(kOverwrite); 229 230 if (!job2.ProcessFile(job1.GetPedestalCam())) 231 { 232 gLog << err << "Calculation of calibration failed." << endl << endl; 233 return -1; 234 } 235 236 if (!job2.GetDisplay()) 237 { 238 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 239 return 1; 240 } 241 } 242 243 if (kModeY) 244 { 245 d->Reset(); 246 247 MJCalibrateSignal job("MJCalibrateSignal"); 248 job.SetDisplay(d);; 249 job.SetInputPath(kInpath); // Where to search for data files 250 job.SetOutputPath(kOutpathY); 251 job.SetOverwrite(kOverwrite); 252 // Where to search for calibration files 253 if (!job.ProcessFile(seq, kConfig, kModeC ? kOutpathC : kInpathY)) 254 return -1; 255 256 if (!job.GetDisplay()) 257 { 258 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 259 return 1; 260 } 202 261 } 203 262 -
trunk/MagicSoft/Mars/callisto.rc
r4722 r4723 1 ############################################################################# 2 # 1 # ========================================================================== 2 ############################################################################# 3 # ========================================================================== 4 # General 5 # ========================================================================== 6 ############################################################################# 7 # ========================================================================== 8 9 # ------------------------------------------------------------------------- 3 10 # Use this if you want to setup the logging stream for the jobs 4 11 # (overwrites command line options) 5 # 6 ############################################################################# 12 # ------------------------------------------------------------------------- 7 13 #MLog.VerbosityLevel: 2 8 14 #MLog.DebugLevel: 1 9 15 #MLog.NoColors: yes 10 16 11 ############################################################################# 12 # 17 # ========================================================================== 18 ############################################################################# 19 # ========================================================================== 20 # Calibration 21 # ========================================================================== 22 ############################################################################# 23 # ========================================================================== 24 25 # ------------------------------------------------------------------------- 13 26 # Use this if you want to write the MJPedestal output somewhere 14 27 # If you don't want it, it is written to the calibration output anyhow. 15 # 16 ############################################################################# 17 #MJPedestal.OutputPath: . 18 19 ############################################################################# 20 # 28 # ------------------------------------------------------------------------- 29 #MJPedestal1.OutputPath: . 30 31 # ------------------------------------------------------------------------- 21 32 # Use this to define where the calibration output is stored. The filename 22 33 # is created from the sequence number. If nothing is specified '.' is 23 # assumed. 24 # (overwrites command line options) 25 # 26 ############################################################################# 34 # assumed. (overwrites command line options) 35 # ------------------------------------------------------------------------- 27 36 #MJCalibration.OutputPath: calped 28 37 29 ############################################################################# 30 # 38 # ------------------------------------------------------------------------- 31 39 # Use this to define where the program should search for the pedestal 32 40 # and calibration files defined in the sequence. To use the local 33 41 # directory use '.' If nothing is specified the default path in the 34 # datacenter is used. 35 # (overwrites command line options) 36 # 37 ############################################################################# 38 #MJPedestal.InputPath: calped 42 # datacenter is used. (overwrites command line options) 43 # ------------------------------------------------------------------------- 44 #MJPedestal1.InputPath: calped 39 45 #MJCalibration.InputPath: calped 40 46 41 ############################################################################# 42 # 43 # You can choose the pedestal extraction algorithm/task. To use 44 # MPedCalcPedRun use the lines below. Be carefull, a pedestal file 45 # could be (if no pedestal file available) a data-file, too. 46 # 47 ############################################################################# 48 #ExtractPedestal: MPedCalcPedRun 49 #ExtractPedestal.HiGainFirst: 0 50 #ExtractPedestal.HiGainLast: 29 51 #ExtractPedestal.LoGainFirst: 0 52 #ExtractPedestal.LoGainLast: 14 53 #ExtractPedestal.HiGainWindowSize: 14 54 #ExtractPedestal.LoGainWindowSize: 0 55 56 ############################################################################# 57 # 58 # You can choose the pedestal extraction algorithm/task. To use 59 # MPedCalcFromLoGain use the lines below. Be carefull, a pedestal file 60 # could be (if no pedestal file available) a data-file, too. 61 # 62 ############################################################################# 63 ExtractPedestal: MPedCalcFromLoGain 64 ExtractPedestal.PedestalUpdate: no 65 #ExtractPedestal.HiGainFirst: 0 66 #ExtractPedestal.HiGainLast: 11 67 #ExtractPedestal.LoGainFirst: 1 68 #ExtractPedestal.LoGainLast: 14 69 #ExtractPedestal.HiGainWindowSize: 12 70 #ExtractPedestal.LoGainWindowSize: 14 71 #ExtractPedestal.MaxHiGainVar: 40 72 73 ############################################################################# 74 # 75 # Configure MJPedestal 76 # 77 ############################################################################# 78 # Maximum number of event processed in the loop 79 #MJPedestal.MaxEvents: 1000 80 # Allow to overwrite existing files with the output file 81 #MJPedestal.AllowOverwrite: No 82 # Use data runs from the sequence instead of calibration runs 83 #MJPedestal.UseData: No 84 85 ############################################################################# 86 # 47 # ------------------------------------------------------------------------- 87 48 # Configure MJCalibration 88 # 89 ############################################################################# 49 # ------------------------------------------------------------------------- 90 50 # Switch on relative time calibration 91 51 MJCalibration.RelTimeCalibration: Yes … … 103 63 #MJCalibration.UsePINDiode: No 104 64 105 ############################################################################# 106 # 65 # ------------------------------------------------------------------------- 66 # You can choose the pedestal extraction algorithm/task. To use 67 # MPedCalcPedRun use the lines below. Be carefull, a pedestal file 68 # could be (if no pedestal file available) a data-file, too. 69 # ------------------------------------------------------------------------- 70 #MJCalibration.ExtractPedestal: MPedCalcPedRun 71 #MJCalibration.ExtractPedestal.HiGainFirst: 0 72 #MJCalibration.ExtractPedestal.HiGainLast: 29 73 #MJCalibration.ExtractPedestal.LoGainFirst: 0 74 #MJCalibration.ExtractPedestal.LoGainLast: 14 75 #MJCalibration.ExtractPedestal.HiGainWindowSize: 14 76 #MJCalibration.ExtractPedestal.LoGainWindowSize: 0 77 78 # ------------------------------------------------------------------------- 79 # You can choose the pedestal extraction algorithm/task. To use 80 # MPedCalcFromLoGain use the lines below. Be carefull, a pedestal file 81 # could be (if no pedestal file available) a data-file, too. 82 # ------------------------------------------------------------------------- 83 MJCalibration.ExtractPedestal: MPedCalcFromLoGain 84 MJCalibration.ExtractPedestal.PedestalUpdate: no 85 #MJCalibration.ExtractPedestal.HiGainFirst: 0 86 #MJCalibration.ExtractPedestal.HiGainLast: 11 87 #MJCalibration.ExtractPedestal.LoGainFirst: 1 88 #MJCalibration.ExtractPedestal.LoGainLast: 14 89 #MJCalibration.ExtractPedestal.HiGainWindowSize: 12 90 #MJCalibration.ExtractPedestal.LoGainWindowSize: 14 91 #MJCalibration.ExtractPedestal.MaxHiGainVar: 40 92 93 # ------------------------------------------------------------------------- 94 # Configure MJPedestal 95 # ------------------------------------------------------------------------- 96 # Maximum number of event processed in the loop 97 #MJPedestal1.MaxEvents: 1000 98 # Allow to overwrite existing files with the output file 99 #MJPedestal1.AllowOverwrite: No 100 # Use data runs from the sequence instead of calibration runs 101 #MJPedestal1.UseData: No 102 103 104 # ------------------------------------------------------------------------- 107 105 # Use this if you want to change the signal extractor for the calibration 108 106 # and automatically the data extraction 109 # 110 ############################################################################# 111 ExtractSignal: MExtractFixedWindowPeakSearch 112 #ExtractSignal.HiGainFirst: 2 113 #ExtractSignal.HiGainLast: 14 114 #ExtractSignal.LoGainFirst: 2 115 #ExtractSignal.LoGainLast: 14 116 #ExtractSignal.HiGainWindowSize: 6 117 #ExtractSignal.LoGainWindowSize: 6 118 #ExtractSignal.PeakSearchWindow: 4 119 #ExtractSignal.OffsetFromWindow: 1 120 #ExtractSignal.LoGainPeakShift: 0 121 122 ############################################################################# 123 # 107 # ------------------------------------------------------------------------- 108 MJCalibration.ExtractSignal: MExtractFixedWindowPeakSearch 109 #MJCalibration.ExtractSignal.HiGainFirst: 2 110 #MJCalibration.ExtractSignal.HiGainLast: 14 111 #MJCalibration.ExtractSignal.LoGainFirst: 2 112 #MJCalibration.ExtractSignal.LoGainLast: 14 113 #MJCalibration.ExtractSignal.HiGainWindowSize: 6 114 #MJCalibration.ExtractSignal.LoGainWindowSize: 6 115 #MJCalibration.ExtractSignal.PeakSearchWindow: 4 116 #MJCalibration.ExtractSignal.OffsetFromWindow: 1 117 #MJCalibration.ExtractSignal.LoGainPeakShift: 0 118 119 # ------------------------------------------------------------------------- 124 120 # Use this if you want to change the time extractor for the calibration 125 121 # and automatically the data extraction 126 # 127 ############################################################################# 128 ExtractTime: MExtractTimeHighestIntegral 129 #ExtractTime.HiGainFirst: 0 130 #ExtractTime.HiGainLast: 14 131 #ExtractTime.LoGainFirst: 3 132 #ExtractTime.LoGainLast: 14 133 #ExtractTime.WindowSizeHiGain: 6 134 #ExtractTime.WindowSizeLoGain: 6 135 136 ############################################################################# 137 # 122 # ------------------------------------------------------------------------- 123 MJCalibration.ExtractTime: MExtractTimeHighestIntegral 124 #MJCalibration.ExtractTime.HiGainFirst: 0 125 #MJCalibration.ExtractTime.HiGainLast: 14 126 #MJCalibration.ExtractTime.LoGainFirst: 3 127 #MJCalibration.ExtractTime.LoGainLast: 14 128 #MJCalibration.ExtractTime.WindowSizeHiGain: 6 129 #MJCalibration.ExtractTime.WindowSizeLoGain: 6 130 #MJCalibration.ExtractTime.OffsetLoGain: 1.51 131 132 # ------------------------------------------------------------------------- 138 133 # Use this to change the behaviour of the calibration 139 # 140 ############################################################################# 141 #MCalibrationChargeCalc.ChargeLimit: 2.5 142 #MCalibrationChargeCalc.ChargeErrLimit: 0 143 #MCalibrationChargeCalc.ChargeRelErrLimit: 1 144 #MCalibrationChargeCalc.Debug: no 145 146 #MCalibrationChargeCalc.FFactorErrLimit: 4.5 147 #MCalibrationChargeCalc.LambdaErrLimit: 0.2 148 #MCalibrationChargeCalc.LambdaCheckLimit: 0.5 149 #MCalibrationChargeCalc.PheErrLimit: 3.5 134 # ------------------------------------------------------------------------- 135 #MJCalibration.MCalibrationChargeCalc.ChargeLimit: 2.5 136 #MJCalibration.MCalibrationChargeCalc.ChargeErrLimit: 0 137 #MJCalibration.MCalibrationChargeCalc.ChargeRelErrLimit: 1 138 #MJCalibration.MCalibrationChargeCalc.Debug: no 139 140 #MJCalibration.MCalibrationChargeCalc.FFactorErrLimit: 4.5 141 #MJCalibration.MCalibrationChargeCalc.LambdaErrLimit: 0.2 142 #MJCalibration.MCalibrationChargeCalc.LambdaCheckLimit: 0.5 143 #MJCalibration.MCalibrationChargeCalc.PheErrLimit: 3.5 150 144 #//MCalibrationChargeCalc.PulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; } 151 145 152 ############################################################################# 153 # 146 # ------------------------------------------------------------------------- 154 147 # Use this to change the behaviour of the calibration 155 # 156 ############################################################################# 157 #MHCalibrationChargeCam.Debug: no 148 # ------------------------------------------------------------------------- 149 #MJCalibration.MHCalibrationChargeCam.Debug: no 150 151 152 153 # ========================================================================== 154 ############################################################################# 155 # ========================================================================== 156 # Signal extraction 157 # ========================================================================== 158 ############################################################################# 159 # ========================================================================== 160 161 # ------------------------------------------------------------------------- 162 # Use a OutputPath if you want to write the results to a file 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 172 173 # ------------------------------------------------------------------------- 174 # Setup pedestal extraktor for running through data 175 # ------------------------------------------------------------------------- 176 MJCalibrateSignal.MPedCalcFromLoGain: MPedCalcFromLoGain 177 MJCalibrateSignal.MPedCalcFromLoGain.PedestalUpdate: yes 178 MJCalibrateSignal.MPedCalcFromLoGain.NumEventsDump: 500 179 #MJCalibrateSignal.ExtractPedestal.HiGainFirst: 0 180 #MJCalibrateSignal.ExtractPedestal.HiGainLast: 11 181 #MJCalibrateSignal.ExtractPedestal.LoGainFirst: 1 182 #MJCalibrateSignal.ExtractPedestal.LoGainLast: 14 183 #MJCalibrateSignal.ExtractPedestal.HiGainWindowSize: 12 184 #MJCalibrateSignal.ExtractPedestal.LoGainWindowSize: 14 185 #MJCalibrateSignal.ExtractPedestal.MaxHiGainVar: 40 186 187 # ------------------------------------------------------------------------- 188 # Setup calibration of data 189 # ------------------------------------------------------------------------- 190 MJCalibrateSignal.MCalibrateData.PedestalFlag: Event 191 MJCalibrateSignal.MCalibrateData.CalibrationMode: Default 192 193 # ------------------------------------------------------------------------- 194 # Setup level for determining of bad pixels 195 # ------------------------------------------------------------------------- 196 # MJCalibrateSignal.MBadPixelsCalc.PedestalLevel: 3.0 197 MJCalibrateSignal.MBadPixelsTreat.NumMinNeighbors: 2 198 MJCalibrateSignal.MBadPixelsTreat.UseInterpolation: yes 199 MJCalibrateSignal.MBadPixelsTreat.ProcessPedestal: yes 200 #MJCalibrateSignal.MBadPixelsTreat.UseCentralPixel: no 201 #MJCalibrateSignal.MBadPixelsTreat.HardTreatment: no -
trunk/MagicSoft/Mars/mbase/MTaskEnv.cc
r4609 r4723 165 165 Bool_t MTaskEnv::ReInit(MParList *list) 166 166 { 167 *fLog << fTask->ClassName() << " - " << flush; 167 168 return fTask->ReInit(list); 168 169 } … … 187 188 Int_t MTaskEnv::PostProcess() 188 189 { 190 *fLog << fTask->ClassName() << " - " << flush; 189 191 return fTask->CallPostProcess(); 190 192 } -
trunk/MagicSoft/Mars/mbase/MTaskEnv.h
r4601 r4723 36 36 void SetDefault(const char *def); 37 37 38 MTask *GetTask() { return fTask; } 39 38 40 ClassDef(MTaskEnv, 0) // Task which can be setup from an environment file 39 41 }; -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc
r4133 r4723 96 96 SetRelTimeResolutionLimit(); 97 97 SetOutputPath(); 98 SetOutputFile( );98 SetOutputFile(""); 99 99 100 100 Clear(); … … 233 233 // Re-direct the output to an ascii-file from now on: 234 234 // 235 MLog asciilog; 236 asciilog.SetOutputFile(GetOutputFile(),kTRUE); 237 SetLogStream(&asciilog); 235 MLog *asciilog = fOutputFile.IsNull() ? 0 : new MLog; 236 if (asciilog) 237 { 238 asciilog->SetOutputFile(GetOutputFile(),kTRUE); 239 SetLogStream(asciilog); 240 } 241 238 242 // 239 243 // Finalize calibration statistics … … 254 258 "Pixels with unsuccesful Gauss fit to the times: "); 255 259 256 SetLogStream(&gLog); 260 if (asciilog) 261 { 262 SetLogStream(&gLog); 263 delete asciilog; 264 } 257 265 258 266 return kTRUE; … … 277 285 const UInt_t nareas = fGeom->GetNumAreas(); 278 286 279 Float_t lowlim [nareas];280 Float_t upplim [nareas];281 Float_t areasum [nareas];287 TArrayF lowlim (nareas); 288 TArrayF upplim (nareas); 289 TArrayF areasum (nareas); 282 290 // Float_t areasum2 [nareas]; 283 Int_t numareavalid [nareas]; 284 Int_t useunreliable[nareas]; 285 286 memset(lowlim ,0, nareas * sizeof(Float_t)); 287 memset(upplim ,0, nareas * sizeof(Float_t)); 288 memset(areasum ,0, nareas * sizeof(Float_t)); 289 // memset(areasum2 ,0, nareas * sizeof(Float_t)); 290 memset(numareavalid ,0, nareas * sizeof(Int_t )); 291 memset(useunreliable ,0, nareas * sizeof(Int_t )); 291 TArrayI numareavalid (nareas); 292 TArrayI useunreliable(nareas); 292 293 293 294 // … … 312 313 useunreliable[aidx] = 1; 313 314 314 memset(numareavalid ,0, nareas * sizeof(Int_t ));315 numareavalid.Reset(); 315 316 // 316 317 // First loop: Get mean time resolution the RMS -
trunk/MagicSoft/Mars/merpp.cc
r4578 r4723 58 58 static void Usage() 59 59 { 60 // 1 2 3 4 5 6 7 8 61 // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 60 62 gLog << all << endl; 61 63 gLog << "Sorry the usage is:" << endl; 62 gLog << " merpp [-h] [-?] [-a] [-vn] [-cn] [-u, -f]" << endl; 63 gLog << " inputfile[.rep,[.raw],[.txt]] [outputfile[.root]]" << endl << endl; 64 gLog << " merpp [options] inputfile[.rep,[.raw],[.txt]] [outputfile[.root]]" << endl << endl; 64 65 gLog << " Arguments:" << endl; 65 gLog << " inputfile.raw :Magic DAQ binary file." << endl;66 gLog << " inputfile.rep :Magic Central Control report file." << endl;67 gLog << " inputfile.txt :Magic DC currents file." << endl;68 gLog << " ouputfile.root :Merpped root file." << endl << endl;66 gLog << " inputfile.raw Magic DAQ binary file." << endl; 67 gLog << " inputfile.rep Magic Central Control report file." << endl; 68 gLog << " inputfile.txt Magic DC currents file." << endl; 69 gLog << " ouputfile.root Merpped root file." << endl << endl; 69 70 gLog << " Options:" << endl; 70 gLog << " -c# Compression level #=1..9 [default=2]" << endl; 71 gLog << " -v# Verbosity level # [default=2]" << endl; 72 gLog << " -u, --update Update file" << endl; 73 gLog << " -a, --no-colors Do not use Ansii color codes" << endl; 74 gLog << " -f Force overwrite of an existing file" << endl; 75 gLog << " --debug[=n] Enable root debugging (Default: gDebug=1)" << endl; 76 gLog << " -?, -h, --help This help" << endl << endl; 71 gLog.Usage(); 72 gLog << " -?, -h, --help This help" << endl << endl; 73 gLog << " File Options:" << endl; 74 gLog << " -c# Compression level #=1..9 [default=2]" << endl; 75 gLog << " -f Force overwrite of an existing file" << endl << endl; 77 76 gLog << " Raw Data Options:" << endl; 78 gLog << " -ff Force merpp to ignore broken events" << endl;79 gLog << " --interleave=# Process only each i-th event [default=1]" << endl << endl;77 gLog << " -ff Force merpp to ignore broken events" << endl; 78 gLog << " --interleave=# Process only each i-th event [default=1]" << endl << endl; 80 79 // gLog << " --sql=mysql://user:password@url Insert run into database" << endl << endl; 81 80 gLog << " Report File Options:" << endl; 82 gLog << " --start=date/time Start event time" << endl;83 gLog << " --stop=date/time Stop event time" << endl;84 gLog << " --run=# Only data corresponding to this run number" << endl;85 gLog << " (from RUN-REPORT)" << endl;86 gLog << " --runfile=# Allow only run-control files" << endl;87 gLog << " (from .rep header)" << endl;88 gLog << " --sumfile Check for an all night summary file" << endl;89 gLog << " (from .rep header)" << endl;90 gLog << " --allfiles Don't check file type <default>" << endl << endl;81 gLog << " --start=date/time Start event time" << endl; 82 gLog << " --stop=date/time Stop event time" << endl; 83 gLog << " --run=# Only data corresponding to this run number" << endl; 84 gLog << " (from RUN-REPORT)" << endl; 85 gLog << " --runfile=# Allow only run-control files" << endl; 86 gLog << " (from .rep header)" << endl; 87 gLog << " --sumfile Check for an all night summary file" << endl; 88 gLog << " (from .rep header)" << endl; 89 gLog << " --allfiles Don't check file type <default>" << endl << endl; 91 90 gLog << " REMARK: - At the moment you can process a .raw _or_ a .rep file, only!" << endl; 92 91 gLog << " - 'date/time' has the format 'yyyy-mm-dd/hh:mm:ss.mmm'" << endl << endl; … … 128 127 gLog.Setup(arg); 129 128 130 const Int_t kComprlvl = arg.HasOption("-c") ? arg.GetIntAndRemove("-c") : 2; 131 Bool_t kUpdate = arg.HasOnlyAndRemove("--update") || arg.HasOnlyAndRemove("-u"); 132 const Bool_t kInterleave = arg.HasOption("--interleave=") ? arg.GetIntAndRemove("--interleave=") : 1; 133 const Bool_t kForce = arg.HasOnlyAndRemove("-f"); 134 const Bool_t kForceProc = arg.HasOnlyAndRemove("-ff"); 129 const Int_t kComprlvl = arg.GetIntAndRemove("-c", 2); 130 const Bool_t kInterleave = arg.GetIntAndRemove("--interleave=", 1); 131 const Bool_t kForce = arg.HasOnlyAndRemove("-f"); 132 const Bool_t kForceProc = arg.HasOnlyAndRemove("-ff"); 133 const Int_t kRunNumber = arg.GetIntAndRemove("--run=", -1); 134 Int_t kRunFile = arg.GetIntAndRemove("--runfile=", -1); 135 Bool_t kUpdate = arg.HasOnlyAndRemove("--update") || arg.HasOnlyAndRemove("-u"); 135 136 136 137 MTime kTimeStart; … … 141 142 kTimeStop = AnalyseTime(arg.GetStringAndRemove("--stop=")); 142 143 143 const Int_t kRunNumber = arg.HasOption("--run=") ? arg.GetIntAndRemove("--run=") : -1;144 144 // const TString kSqlDataBase(arg.GetStringAndRemove("--sql=")); 145 145 146 Int_t kRunFile = arg.HasOption("--runfile=") ? arg.GetIntAndRemove("--runfile=") : -1;147 146 if (arg.HasOnlyAndRemove("--sumfile")) 148 147 kRunFile = 0; -
trunk/MagicSoft/Mars/mjobs/JobsLinkDef.h
r4718 r4723 9 9 #pragma link C++ class MJPedestal+; 10 10 #pragma link C++ class MJCalibration+; 11 //#pragma link C++ class MJCalibrateSignal+;11 #pragma link C++ class MJCalibrateSignal+; 12 12 #pragma link C++ class MJExtractSignal+; 13 13 #pragma link C++ class MJExtractCalibTest+; -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4722 r4723 1266 1266 return; 1267 1267 1268 TString e1 = fEnv->GetValue( "MJCalibration.OutputPath", "");1268 TString e1 = fEnv->GetValue(Form("%s.OutputPath", fName.Data()), ""); 1269 1269 if (!e1.IsNull()) 1270 1270 { … … 1273 1273 } 1274 1274 1275 TString col = fEnv->GetValue( "MJCalibration.Color", "");1275 TString col = fEnv->GetValue(Form("%s.Color", fName.Data()), ""); 1276 1276 if (!col.IsNull()) 1277 1277 { 1278 1278 } 1279 1279 1280 TString dis = fEnv->GetValue( "MJCalibration.Display", "");1280 TString dis = fEnv->GetValue(Form("%s.Display", fName.Data()), ""); 1281 1281 if (dis.BeginsWith("Full", TString::kIgnoreCase)) 1282 1282 SetFullDisplay(); … … 1286 1286 SetNormalDisplay(); 1287 1287 1288 SetRelTimeCalibration(fEnv->GetValue( "MJCalibration.RelTimeCalibration", fRelTimes));1289 SetDataCheck(fEnv->GetValue( "MJCalibration.Datacheck", fDataCheck));1290 SetDebug(fEnv->GetValue( "MJCalibration.Debug", fDebug));1291 SetUseBlindPixel(fEnv->GetValue( "MJCalibration.UseBlindPixel", IsUseBlindPixel()));1292 SetUsePINDiode(fEnv->GetValue( "MJCalibration.UsePINDiode", IsUsePINDiode()));1293 1294 SetOverwrite(fEnv->GetValue( "MJPedestal.AllowOverwrite", fOverwrite));1295 SetInputPath(fEnv->GetValue( "MJPedestal.InputPath", fInputPath));1288 SetRelTimeCalibration(fEnv->GetValue(Form("%s.RelTimeCalibration", fName.Data()), fRelTimes)); 1289 SetDataCheck(fEnv->GetValue(Form("%s.Datacheck", fName.Data()), fDataCheck)); 1290 SetDebug(fEnv->GetValue(Form("%s.Debug", fName.Data()), fDebug)); 1291 SetUseBlindPixel(fEnv->GetValue(Form("%s.UseBlindPixel", fName.Data()), IsUseBlindPixel())); 1292 SetUsePINDiode(fEnv->GetValue(Form("%s.UsePINDiode", fName.Data()), IsUsePINDiode())); 1293 1294 SetOverwrite(fEnv->GetValue(Form("%s.AllowOverwrite", fName.Data()), fOverwrite)); 1295 SetInputPath(fEnv->GetValue(Form("%s.InputPath", fName.Data()), fInputPath)); 1296 1296 } 1297 1297 … … 1426 1426 MTaskList tlist; 1427 1427 plist.AddToList(&tlist); 1428 plist.AddToList(this); // take care of fDisplay! 1428 1429 1429 1430 MReadMarsFile read("Events"); … … 1495 1496 calcalc.SetPulserColor(fColor); 1496 1497 1497 MFillH fillpin("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode" );1498 MFillH fillbnd("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel" );1499 MFillH fillcam("MHCalibrationChargeCam", "MExtractedSignalCam" );1500 MFillH filltme("MHCalibrationRelTimeCam", "MArrivalTimeCam" );1498 MFillH fillpin("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode", "FillPINDiode"); 1499 MFillH fillbnd("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel", "FillBlindCam"); 1500 MFillH fillcam("MHCalibrationChargeCam", "MExtractedSignalCam", "FillChargeCam"); 1501 MFillH filltme("MHCalibrationRelTimeCam", "MArrivalTimeCam", "FillRelTime"); 1501 1502 fillpin.SetNameTab("PINDiode"); 1502 1503 fillbnd.SetNameTab("BlindPix"); … … 1566 1567 evtloop.ReadEnv(*fEnv); 1567 1568 1569 //if (!WriteEventloop(evtloop)) 1570 // return kFALSE; 1571 1572 if (!WriteTasks(taskenv.GetTask(), taskenv2.GetTask())) 1573 return kFALSE; 1574 1568 1575 // Execute first analysis 1569 1576 if (!evtloop.Eventloop()) … … 1580 1587 // the display. No idea where this comes from... 1581 1588 // 1589 // FIND THE REASON! THE NEXT CHANGE SOMEBODY DOES MIGHT RESULT 1590 // IN __YOUR__ WORKAROUN NOT WORKING IF IT IS NOT CLEANLY DONE! 1591 /* 1582 1592 if (fDisplay) 1583 1593 { … … 1607 1617 } 1608 1618 } 1609 1619 */ 1610 1620 DisplayResult(plist); 1611 1621 … … 1613 1623 return kFALSE; 1614 1624 1615 *fLog << inf<< GetDescriptor() << ": Done." << endl;1625 *fLog << all << GetDescriptor() << ": Done." << endl; 1616 1626 1617 1627 return kTRUE; … … 1716 1726 } 1717 1727 1728 Bool_t MJCalibration::WriteEventloop(MEvtLoop &evtloop) const 1729 { 1730 if (fOutputPath.IsNull()) 1731 return kTRUE; 1732 1733 const TString oname(GetOutputFile()); 1734 1735 *fLog << inf << "Writing to file: " << oname << endl; 1736 1737 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9); 1738 if (!file.IsOpen()) 1739 { 1740 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 1741 return kFALSE; 1742 } 1743 1744 if (evtloop.Write(fName)<=0) 1745 { 1746 *fLog << err << "Unable to write MEvtloop to " << oname << endl; 1747 return kFALSE; 1748 } 1749 1750 return kTRUE; 1751 } 1752 1753 Bool_t MJCalibration::WriteTasks(MTask *t1, MTask *t2) const 1754 { 1755 if (fOutputPath.IsNull()) 1756 return kTRUE; 1757 1758 const TString oname(GetOutputFile()); 1759 1760 *fLog << inf << "Writing to file: " << oname << endl; 1761 1762 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9); 1763 if (!file.IsOpen()) 1764 { 1765 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 1766 return kFALSE; 1767 } 1768 1769 if (t1->Write()<=0) 1770 { 1771 *fLog << err << "Unable to write " << t1->GetName() << " to " << oname << endl; 1772 return kFALSE; 1773 } 1774 if (t2->Write()<=0) 1775 { 1776 *fLog << err << "Unable to write " << t2->GetName() << " to " << oname << endl; 1777 return kFALSE; 1778 } 1779 1780 return kTRUE; 1781 } 1782 1718 1783 // -------------------------------------------------------------------------- 1719 1784 // … … 1736 1801 *fLog << inf << "Writing to file: " << oname << endl; 1737 1802 1738 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9);1803 TFile file(oname, "UPDATE", "File created by MJCalibration", 9); 1739 1804 if (!file.IsOpen()) 1740 1805 { -
trunk/MagicSoft/Mars/mjobs/MJCalibration.h
r4645 r4723 22 22 23 23 class TEnv; 24 class MTask; 24 25 class MRunIter; 25 26 class MSequence; … … 28 29 class MExtractor; 29 30 class MExtractTime; 31 class MEvtLoop; 30 32 31 33 class MExtractBlindPixel; … … 56 58 57 59 TString fOutputPath; // Path to the output files 60 TString fInputPath; // Path to get the data files from 58 61 59 62 TEnv *fEnv; // Input setup-file … … 89 92 90 93 Byte_t fDevices; // Bit-field for used devices for calibration 91 94 95 // Combine these options into a single bit-files (TestBit/SetBit, etc) 92 96 Bool_t fRelTimes; // Flag if relative times have to be calibrated 93 97 Bool_t fDataCheck; // Flag if the data check is run on raw data 94 98 Bool_t fDebug; // Flag if debug option is passed onto cal. classes 99 Bool_t fOverwrite; // Allow to overwite existing files 95 100 96 101 void DisplayResult ( MParList &plist ); … … 102 107 103 108 Bool_t WriteResult(); 109 Bool_t WriteEventloop(MEvtLoop &evtloop) const; 110 Bool_t WriteTasks(MTask *t1, MTask *t2) const; 104 111 void CheckEnv(); 105 112 … … 134 141 void SetSequence(MSequence *seq) { fSequence=seq; } 135 142 void SetOutputPath(const char *path="."); 143 void SetInputPath(const char *path="."); 144 void SetOverwrite(Bool_t b=kTRUE) { fOverwrite=b; } 136 145 137 146 // Displays … … 156 165 Bool_t ProcessFile(MPedestalCam &pedcam); 157 166 Bool_t Process(MPedestalCam &pedcam); 167 168 MStatusDisplay *GetDisplay() { return fDisplay; } 158 169 159 170 ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r4722 r4723 440 440 441 441 } 442 443 444 Bool_t MJPedestal::WriteResult() 442 /* 443 Bool_t MJPedestal::WriteEventloop(MEvtLoop &evtloop) const 445 444 { 446 445 if (fOutputPath.IsNull()) … … 452 451 453 452 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJPedestal", 9); 453 if (!file.IsOpen()) 454 { 455 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 456 return kFALSE; 457 } 458 459 if (evtloop.Write(fName)<=0) 460 { 461 *fLog << err << "Unable to write MEvtloop to " << oname << endl; 462 return kFALSE; 463 } 464 465 return kTRUE; 466 } 467 */ 468 Bool_t MJPedestal::WriteResult() 469 { 470 if (fOutputPath.IsNull()) 471 return kTRUE; 472 473 const TString oname(GetOutputFile()); 474 475 *fLog << inf << "Writing to file: " << oname << endl; 476 477 TFile file(oname, "UPDATE", "File created by MJPedestal", 9); 454 478 if (!file.IsOpen()) 455 479 { … … 527 551 return; 528 552 529 TString e1 = fEnv->GetValue( "MJPedestal.OutputPath", "");553 TString e1 = fEnv->GetValue(Form("%s.OutputPath", fName.Data()), ""); 530 554 if (!e1.IsNull()) 531 555 { … … 534 558 } 535 559 536 SetMaxEvents(fEnv->GetValue( "MJPedestal.MaxEvents", fMaxEvents));537 SetOverwrite(fEnv->GetValue( "MJPedestal.AllowOverwrite", fOverwrite));538 539 fUseData = fEnv->GetValue( "MJPedestal.UseData", fUseData);560 SetMaxEvents(fEnv->GetValue(Form("%s.MaxEvents", fName.Data()), fMaxEvents)); 561 SetOverwrite(fEnv->GetValue(Form("%s.AllowOverwrite", fName.Data()), fOverwrite)); 562 563 fUseData = fEnv->GetValue(Form("%s.UseData", fName.Data()), fUseData); 540 564 } 541 565 … … 570 594 MTaskList tlist; 571 595 plist.AddToList(&tlist); 596 plist.AddToList(this); // take care of fDisplay! 572 597 573 598 MReadMarsFile read("Events"); … … 640 665 evtloop.ReadEnv(*fEnv); 641 666 667 // if (!WriteEventloop(evtloop)) 668 // return kFALSE; 669 642 670 // Execute first analysis 643 671 if (!evtloop.Eventloop(fMaxEvents)) … … 654 682 return kFALSE; 655 683 656 *fLog << inf<< GetDescriptor() << ": Done." << endl;684 *fLog << all << GetDescriptor() << ": Done." << endl; 657 685 658 686 return kTRUE; -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r4695 r4723 17 17 class TH1D; 18 18 class MExtractor; 19 class MEvtLoop; 19 20 20 21 class MJPedestal : public MParContainer … … 39 40 40 41 TString fOutputPath; // Directory where the F0-files get stored 42 TString fInputPath; // Directory from which to read the data files 41 43 42 44 TEnv *fEnv; // Input setup-file … … 55 57 Bool_t fDataCheck; // Flag if the data check is run on raw data 56 58 Bool_t fUseData; // Use data-runs from sequence instead of pedestal runs 59 Bool_t fOverwrite; // Allow to overwite existing files 57 60 58 61 Int_t fMaxEvents; // Maximum number of events … … 60 63 Bool_t ReadPedestalCam(); 61 64 Bool_t WriteResult(); 65 //Bool_t WriteEventloop(MEvtLoop &evtloop) const; 62 66 63 67 void DisplayResult(MParList &plist); … … 86 90 void SetSequence(const MSequence *seq, Bool_t usedata=kFALSE) { fSequence = seq; } 87 91 void SetOutputPath(const char *path="."); 92 void SetInputPath(const char *path="."); 88 93 void SetEnv(const char *env); 94 void SetOverwrite(Bool_t b=kTRUE) { fOverwrite=b; } 89 95 void SetMaxEvents(Int_t max) { fMaxEvents = max; } 90 96 … … 94 100 void SetNormalDisplay() { fDisplayType = kNormalDisplay; } 95 101 102 MStatusDisplay *GetDisplay() { return fDisplay; } 103 96 104 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam) 97 105 }; -
trunk/MagicSoft/Mars/mjobs/Makefile
r4718 r4723 28 28 MJPedestal.cc \ 29 29 MJCalibration.cc \ 30 MJCalibrateSignal.cc \ 30 31 MJExtractSignal.cc \ 31 32 MJExtractCalibTest.cc -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc
r4340 r4723 282 282 out << ");" << endl; 283 283 } 284 285 void MExtractFixedWindow::Print(Option_t *o) const 286 { 287 *fLog << all; 288 *fLog << GetDescriptor() << ":" << endl; 289 MExtractor::Print(o); 290 } -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h
r4340 r4723 33 33 34 34 void SetRange(Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0); 35 36 void Print(Option_t *o="") const; 35 37 36 ClassDef(MExtractFixedWindow, 0) // Signal Extractor for a fixed extraction window38 ClassDef(MExtractFixedWindow, 1) // Signal Extractor for a fixed extraction window 37 39 }; 38 40 -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindowPeakSearch.cc
r4722 r4723 520 520 return rc; 521 521 } 522 523 void MExtractFixedWindowPeakSearch::Print(Option_t *o) const 524 { 525 *fLog << all; 526 *fLog << GetDescriptor() << ":" << endl; 527 *fLog << " Windows: Hi-Gain=" << (int)fHiGainWindowSize << " Lo-Gain=" << (int)fLoGainWindowSize; 528 *fLog << " Peak-Search=" << (int)fPeakSearchWindowSize << endl; 529 *fLog << " Offset From Window: " << (int)fOffsetFromWindow << endl; 530 *fLog << " Lo-Gain peak Shift: " << (int)fLoGainPeakShift << endl; 531 MExtractor::Print(o); 532 } -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindowPeakSearch.h
r4722 r4723 45 45 46 46 void SetLoGainPeakShift(Byte_t shift=fgLoGainPeakShift) { fLoGainPeakShift = shift; } 47 48 ClassDef(MExtractFixedWindowPeakSearch, 0) // Signal Extractor for fixed size trigger-corrected extraction window 47 48 void Print(Option_t *o="") const; 49 50 ClassDef(MExtractFixedWindowPeakSearch, 1) // Signal Extractor for fixed size trigger-corrected extraction window 49 51 }; 50 52 -
trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.h
r4340 r4723 32 32 Byte_t windowl=fgLoGainWindowSize); 33 33 34 ClassDef(MExtractSlidingWindow, 0) // Signal Extractor for sliding extraction window34 ClassDef(MExtractSlidingWindow, 1) // Signal Extractor for sliding extraction window 35 35 }; 36 36 -
trunk/MagicSoft/Mars/msignal/MExtractTime.cc
r4608 r4723 69 69 70 70 using namespace std; 71 71 72 const Float_t MExtractTime::fgOffsetLoGain = 1.51; // 5 ns 73 72 74 // -------------------------------------------------------------------------- 73 75 // … … 83 85 // 84 86 MExtractTime::MExtractTime(const char *name, const char *title) 85 : fArrTime(NULL) , fNamePedContainer("MPedestalCam")87 : fArrTime(NULL) 86 88 { 87 89 … … 108 110 Int_t MExtractTime::PreProcess(MParList *pList) 109 111 { 110 111 112 fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData")); 112 113 if (!fRawEvt) … … 129 130 130 131 131 fPedestals = (MPedestalCam*)pList->FindObject( AddSerialNumber(fNamePed Container), "MPedestalCam");132 fPedestals = (MPedestalCam*)pList->FindObject( AddSerialNumber(fNamePedestalCam), "MPedestalCam"); 132 133 if (!fPedestals) 133 134 { … … 214 215 } 215 216 217 // -------------------------------------------------------------------------- 218 // 219 // In addition to the resources of the base-class MExtractor: 220 // MJPedestal.MExtractor.OffsetLoGain: 1.51 221 // 222 Int_t MExtractTime::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 223 { 224 Bool_t rc = kFALSE; 225 226 if (IsEnvDefined(env, prefix, "OffsetLoGain", print)) 227 { 228 fOffsetLoGain = GetEnvValue(env, prefix, "OffsetLoGain", fOffsetLoGain); 229 rc = kTRUE; 230 } 231 232 rc = MExtractor::ReadEnv(env, prefix, print) ? kTRUE : rc; 233 234 return rc; 235 } 236 237 void MExtractTime::Print(Option_t *o) const 238 { 239 *fLog << all; 240 if (IsA()==MExtractTime::Class()) 241 *fLog << GetDescriptor() << ":" << endl; 242 *fLog << " Offset Lo-Gain=" << fOffsetLoGain << endl; 243 MExtractor::Print(o); 244 } -
trunk/MagicSoft/Mars/msignal/MExtractTime.h
r4586 r4723 8 8 class MPedestalPix; 9 9 class MArrivalTimeCam; 10 10 11 class MExtractTime : public MExtractor 11 12 { 12 13 private: 13 14 static const Float_t fgOffsetLoGain; // Default for fOffsetLoGain (now set to 1.51 (= 5ns) 14 15 16 Int_t PreProcess(MParList *pList); 17 Bool_t ReInit(MParList *pList); 18 Int_t Process(); 19 15 20 protected: 21 Float_t fOffsetLoGain; // Offset of the low-gain signal w.r.t. the High-Gain slices 16 22 17 Float_t fOffsetLoGain; // Offset of the low-gain signal w.r.t. the High-Gain slices 18 19 MArrivalTimeCam *fArrTime; // Container with the photons arrival times 20 TString fNamePedContainer; // name of the 'MPedestalCam' container 23 MArrivalTimeCam *fArrTime; //! Container with the photons arrival times 21 24 22 23 virtual Int_t PreProcess(MParList *pList);24 virtual Bool_t ReInit(MParList *pList);25 virtual Int_t Process();26 27 25 virtual void FindTimeHiGain(Byte_t *firstused, Float_t &time, Float_t &dtime, 28 26 Byte_t &sat, const MPedestalPix &ped) const; … … 30 28 Byte_t &sat, const MPedestalPix &ped) const; 31 29 30 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 31 32 32 public: 33 34 33 MExtractTime(const char *name=NULL, const char *title=NULL); 35 34 36 35 void SetOffsetLoGain( const Float_t f=fgOffsetLoGain) { fOffsetLoGain = f; } 37 void SetNamePedContainer(const char *name) { fNamePedContainer = name; }38 36 39 40 ClassDef(MExtractTime, 0) // Arrival Time Extractor Base Class 37 void Print(Option_t *o) const; 38 39 ClassDef(MExtractTime, 1) // Arrival Time Extractor Base Class 41 40 }; 42 41 43 42 #endif 44 45 46 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.h
r4260 r4723 9 9 class MExtractTimeAndCharge : public MExtractTime 10 10 { 11 private: 12 Int_t PreProcess(MParList *pList); 13 Bool_t ReInit(MParList *pList); 14 Int_t Process(); 15 11 16 protected: 12 13 virtual Int_t PreProcess(MParList *pList);14 virtual Bool_t ReInit(MParList *pList);15 virtual Int_t Process();16 17 17 virtual void FindTimeAndChargeHiGain(Byte_t *firstused, Byte_t *logain, Float_t &sum, Float_t &dsum, 18 18 Float_t &time, Float_t &dtime, -
trunk/MagicSoft/Mars/msignal/MExtractTimeFastSpline.h
r4284 r4723 7 7 8 8 class MPedestalPix; 9 9 10 class MExtractTimeFastSpline : public MExtractTime 10 11 { 11 12 private: 12 13 static const Byte_t fgHiGainFirst; // Default for fHiGainFirst (now set to: 2) 13 14 static const Byte_t fgHiGainLast; // Default for fHiGainLast (now set to: 14) -
trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.cc
r4722 r4723 324 324 SetWindowSize(hw, lw); 325 325 326 rc = MExtract or::ReadEnv(env, prefix, print) ? kTRUE : rc;326 rc = MExtractTime::ReadEnv(env, prefix, print) ? kTRUE : rc; 327 327 328 328 return rc; 329 329 } 330 331 void MExtractTimeHighestIntegral::Print(Option_t *o) const 332 { 333 *fLog << all; 334 *fLog << GetDescriptor() << ":" << endl; 335 *fLog << " Windows: Hi-Gain=" << (int)fHiGainWindowSize << " Lo-Gain=" << (int)fLoGainWindowSize << endl; 336 MExtractTime::Print(o); 337 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.h
r4722 r4723 9 9 { 10 10 private: 11 12 11 static const Byte_t fgHiGainFirst; 13 12 static const Byte_t fgHiGainLast; … … 34 33 Byte_t windowl=fgLoGainWindowSize); 35 34 36 ClassDef(MExtractTimeHighestIntegral, 0) // Task to Extract the Arrival Times As the mean time of the fWindowSize time slices 35 void Print(Option_t *o="") const; 36 37 ClassDef(MExtractTimeHighestIntegral, 1) // Task to Extract the Arrival Times As the mean time of the fWindowSize time slices 37 38 }; 38 39 -
trunk/MagicSoft/Mars/msignal/MExtractTimeSpline.h
r3943 r4723 7 7 8 8 class MPedestalPix; 9 9 10 class MExtractTimeSpline : public MExtractTime 10 11 { 11 12 private: 12 13 static const Byte_t fgHiGainFirst; 13 14 static const Byte_t fgHiGainLast; -
trunk/MagicSoft/Mars/msignal/MExtractor.cc
r4615 r4723 42 42 // setup file. For more information see ReadEnv and MEvtLoop::ReadEnv 43 43 // 44 // 45 // IMPORTANT: For all classes you derive from MExtractor make sure that: 46 // - Print() is correctly implemented 47 // - Clone() works 48 // - Class Version number != 0 and the I/O works PERFECTLY 49 // - only data members which are necessary for the setup (not the ones 50 // created in PreProcess and Process) are written 51 // - the version number is maintained! 52 // 53 // 44 54 // Input Containers: 45 55 // MRawEvtData … … 75 85 76 86 const Byte_t MExtractor::fgSaturationLimit = 254; 77 const TString MExtractor::fgNamePedContainer = "MPedestalCam"; 87 const TString MExtractor::fgNamePedestalCam = "MPedestalCam"; 88 78 89 // -------------------------------------------------------------------------- 79 90 // … … 84 95 // - all variables to 0 85 96 // - fSaturationLimit to fgSaturationLimit 86 // - fNamePed Container to fgNamePedContainer97 // - fNamePedestalCam to fgNamePedestalCam 87 98 // 88 99 // Call: … … 98 109 AddToBranchList("MRawEvtData.*"); 99 110 100 SetNamePed Container();111 SetNamePedestalCam(); 101 112 SetRange(); 102 113 SetSaturationLimit(); … … 141 152 142 153 154 fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber(fNamePedestalCam), "MPedestalCam"); 155 if (!fPedestals) 156 { 157 *fLog << err << AddSerialNumber("MPedestalCam") << " not found... aborting" << endl; 158 return kFALSE; 159 } 160 143 161 fSignals = (MExtractedSignalCam*)pList->FindCreateObj(AddSerialNumber("MExtractedSignalCam")); 144 162 if (!fSignals) 145 163 return kFALSE; 146 147 fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber(fNamePedContainer), "MPedestalCam");148 if (!fPedestals)149 {150 *fLog << err << AddSerialNumber("MPedestalCam") << " not found... aborting" << endl;151 return kFALSE;152 }153 164 154 165 return kTRUE; … … 363 374 return rc; 364 375 } 376 377 void MExtractor::Print(Option_t *o) const 378 { 379 *fLog << all; 380 381 if (IsA()==MExtractor::Class()) 382 *fLog << GetDescriptor() << ":" << endl; 383 384 *fLog << " Hi Gain Range: " << (int)fHiGainFirst << " " << (int)fHiGainLast << endl; 385 *fLog << " Lo Gain Range: " << (int)fLoGainFirst << " " << (int)fLoGainLast << endl; 386 *fLog << " Saturation Lim: " << (int)fSaturationLimit << endl; 387 } -
trunk/MagicSoft/Mars/msignal/MExtractor.h
r4615 r4723 25 25 26 26 static const Byte_t fgSaturationLimit; //! Default for fSaturationLimit (now set to: 254) 27 static const TString fgNamePed Container; //! "MPedestalCam"27 static const TString fgNamePedestalCam; //! "MPedestalCam" 28 28 29 29 MPedestalCam *fPedestals; //! Pedestals of all pixels in the camera 30 MExtractedSignalCam *fSignals; // 30 MExtractedSignalCam *fSignals; //! Extracted signal of all pixels in the camera 31 31 32 32 MRawEvtData *fRawEvt; //! Raw event data (time slices) … … 47 47 48 48 Byte_t fSaturationLimit; // Highest FADC slice value until being declared saturated 49 TString fNamePed Container; // Name of the 'MPedestalCam' container49 TString fNamePedestalCam; // Name of the 'MPedestalCam' container 50 50 51 51 virtual void FindSignalHiGain(Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat) const { } … … 59 59 60 60 public: 61 62 61 MExtractor(const char *name=NULL, const char *title=NULL); 63 62 … … 72 71 73 72 void SetSaturationLimit ( Byte_t lim=fgSaturationLimit ) { fSaturationLimit = lim; } 74 void SetNamePedContainer ( const char *name=fgNamePedContainer.Data()) { fNamePedContainer = name; } 75 76 ClassDef(MExtractor, 0) // Signal Extractor Base Class 73 void SetNamePedestalCam ( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; } 74 75 void Print(Option_t *o="") const; 76 77 ClassDef(MExtractor, 1) // Signal Extractor Base Class 77 78 }; 78 79
Note:
See TracChangeset
for help on using the changeset viewer.