Changeset 5683
- Timestamp:
- 12/22/04 21:45:54 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/calibration.C
r5532 r5683 59 59 #include "MJPedestal.h" 60 60 #include "MJCalibration.h" 61 #include "MJExtractSignal.h"62 61 #include "MJExtractCalibTest.h" 62 #include "MJCalibrateSignalFromOutside.h" 63 63 #include "MRunIter.h" 64 64 #include "MStatusDisplay.h" … … 69 69 #include "MArray.h" 70 70 #include "MParContainer.h" 71 #include "MGeomCamMagic.h" 71 72 72 73 #include "TStyle.h" … … 98 99 static const Int_t calrun2 = 0; 99 100 // 101 // the default start data run 102 // 103 static const Int_t datrun1 = 39900; 104 // 105 // the default last calibration run (if 0, only one run is taken, otherwise consecutive runs 106 // between calrun1 and calrun2) 107 // 108 static const Int_t datrun2 = 0; 109 // 100 110 // A switch to output debugging information about Objects use 101 111 // … … 120 130 // Tell if you want to test the intensity calibration 121 131 // 122 static Bool_t useIntensity = kFALSE;132 static Bool_t useIntensity = kFALSE; 123 133 // 124 134 // Tell if you want to store and read the F0 and F1- files 125 135 // 126 static Bool_t usestorage = k FALSE;136 static Bool_t usestorage = kTRUE; 127 137 // 128 138 // Tell which extractor you want to use. The flags are counted according 129 139 // to the extractor-TDAS 130 140 // 131 static Int_t extractorflag = 1;141 static Int_t extractorflag = 33; 132 142 // 133 143 Int_t calibration(const UInt_t extflag=extractorflag, const Int_t prun=pedrun, 134 const Int_t crun1=calrun1, const Int_t crun2=calrun2) 144 const Int_t crun1=calrun1, const Int_t crun2=calrun2, 145 const Int_t drun1=datrun1, const Int_t drun2=datrun2) 135 146 { 136 147 137 MExtractor *extractor = getExtractor(extflag );148 MExtractor *extractor = getExtractor(extflag==33 ? 32 : extflag); 138 149 139 150 if (!extractor) … … 164 175 cruns.AddRuns(crun1,crun2,inpath); 165 176 177 166 178 MStatusDisplay *display = NULL; 167 179 … … 179 191 // Hand over to the jobs a QE Cam with Cornings initialized 180 192 // 193 MGeomCamMagic geomcam; 181 194 MCalibrationQECamMagic qecam; 182 195 MBadPixelsCam badcam; 196 badcam.InitSize(geomcam.GetNumPixels()); 183 197 // 184 198 // If you want to exclude pixels from the beginning, read … … 193 207 194 208 MJPedestal pedloop1; 195 pedloop1.SetNoStorage( !usestorage);209 pedloop1.SetNoStorage(); 196 210 pedloop1.SetEnvDebug(debug); 197 211 pedloop1.SetExtractor(extractor); … … 218 232 { 219 233 /***********************************************************/ 220 /* NEEDE FOR SECOND LOOP: EXTRACTOR RESOLUTION COMPUTATION */234 /* NEEDED FOR SECOND LOOP: EXTRACTOR RESOLUTION COMPUTATION */ 221 235 /***********************************************************/ 222 236 223 237 pedloop2.SetUseData(); 224 pedloop2.SetNoStorage( !usestorage);238 pedloop2.SetNoStorage(); 225 239 pedloop2.SetEnvDebug(debug); 226 240 pedloop2.SetExtractor(extractor); … … 239 253 return 1; 240 254 241 extractor->SetNoiseCalculation(kFALSE);242 255 calloop.SetExtractorCam(pedloop2.GetPedestalCam()); 243 256 } … … 252 265 // calloop.SetHistsStorage(); 253 266 calloop.SetNoStorage(!usestorage); 267 calloop.SetRelTimeCalibration(kTRUE); 254 268 // 255 269 // If you want to set a colour explicitely from outside (not recommanded!) … … 277 291 calloop.SetUsePINDiode(pindiode); 278 292 calloop.SetQECam(qecam); 279 calloop.SetBadPixels( pedloop1.GetBadPixels());293 calloop.SetBadPixels(badcam); 280 294 281 295 if (!calloop.Process(pedcam)) 282 296 return 2; 283 297 298 // return 0; 299 284 300 // 285 301 // The next lines are the use the Print() function and have … … 288 304 if (debug) 289 305 { 290 MCalibrationChargeCam &chargecam = calloop.GetCalibrationCam();291 306 MCalibrationQECam &nqecam = calloop.GetQECam(); 292 307 MBadPixelsCam &badbad = calloop.GetBadPixels(); 308 MCalibrationChargeCam &chargecam = calloop.GetCalibrationCam(); 293 309 chargecam.Print(); 294 310 nqecam.Print(); … … 318 334 return 3; 319 335 320 return 4; 321 322 } 336 } 337 338 if (drun1 == 0) 339 return 4; 340 341 MRunIter druns; 342 343 if (drun2==0) 344 druns.AddRun(drun1,inpath); 345 else 346 druns.AddRuns(drun1,drun2,inpath); 347 323 348 324 349 /********************************************************************/ … … 326 351 /********************************************************************/ 327 352 328 MJExtractSignal pedphotloop; 329 330 pedphotloop.SetExtractor(extractor); 331 pedphotloop.SetInput(&pruns); 332 pedphotloop.SetOutputPath(outpath); 353 if (extflag == 33) 354 { 355 delete extractor; 356 extractor = getExtractor(28); 357 } 358 359 MJCalibrateSignalFromOutside calibloop; 360 361 calibloop.SetExtractor(extractor); 362 calibloop.SetInput(&druns); 363 // calibloop.SetOutputPath(outpath); 333 364 if (useDisplay) 334 pedphotloop.SetDisplay(display); 335 pedphotloop.SetBadPixels(calloop.GetBadPixels()); 336 337 if (!pedphotloop.ProcessP(pedloop1.GetPedestalCam(),calloop.GetCalibrationCam(),calloop.GetQECam())) 365 calibloop.SetDisplay(display); 366 calibloop.SetBadPixels(calloop.GetBadPixels()); 367 calibloop.SetNoStorage(!usestorage); 368 369 if (!calibloop.ProcessFile(pedloop1.GetPedestalCam(),timeandcharge ? pedloop2.GetPedestalCam() : pedloop1.GetPedestalCam(), calloop.GetCalibrationCam(),calloop.GetQECam(), calloop.GetRelTimeCam())) 338 370 return 5; 339 371 … … 347 379 gObjectTable->Print(); 348 380 381 349 382 return 0; 350 383 } … … 355 388 gLog << "Usage:" << endl; 356 389 gLog << endl; 357 gLog << " calibration [ped.run nr.] [first cal.run nr.] [last cal.run nr.] " << endl ;390 gLog << " calibration [ped.run nr.] [first cal.run nr.] [last cal.run nr.] [first dat.run nr.] [last dat.run nr.]" << endl ; 358 391 gLog << endl; 359 392 gLog << " ped.run.nr: Run number of the pedestal file." << endl; 360 393 gLog << " first cal.run nr.: Run number of the first calibration file." << endl; 361 394 gLog << " last cal.run nr.: Run number of the last calibration file." << endl; 362 gLog << endl; 363 gLog << "All calibration runs between (first cal.run nr.) and (last cal.run nr.) will be used" << endl; 395 gLog << " first dat.run nr.: Run number of the first data file to be calibrated." << endl; 396 gLog << " last dat.run nr.: Run number of the last data file to be calibrated." << endl; 397 gLog << endl; 398 gLog << "All calibration runs between (first cal.run nr.) and (last cal.run nr.) will be used" << endl; 364 399 gLog << "If last.cal.run.nr is 0 (default), only one calibration run is taken" << endl; 400 gLog << endl; 401 gLog << "All data runs between (first dat.run nr.) and (last dat.run nr.) will be used" << endl; 402 gLog << "If last.dat.run.nr is 0 (default), only one data run is taken" << endl; 365 403 gLog << endl; 366 404 gLog << "Additional Options: " << endl; 367 405 gLog << " --extractor=# Choose one of the following possible extractors (integer)" << endl; 406 gLog << " (default: Nr. 33) " << endl; 368 407 gLog << endl; 369 408 gLog << " Nr. Extractor Parameters " << endl; … … 372 411 gLog << " with the following parameters, if 'maxbin' defines the mean position" << endl; 373 412 gLog << " of the High-Gain FADC slice carrying the pulse maximum: " << endl; 374 gLog << " 1: SetRange('maxbin }}-1,'maxbin}}+2,'maxbin}}+0.5,'maxbin}}+3.5) " << endl;413 gLog << " 1: SetRange('maxbin'-1,'maxbin'+2,'maxbin'+0.5,'maxbin'+3.5) " << endl; 375 414 gLog << " 2: SetRange('maxbin'-1,'maxbin'+2,'maxbin'-0.5,'maxbin'+4.5)" << endl; 376 415 gLog << " 3: SetRange('maxbin'-2,'maxbin'+3,'maxbin'-0.5,'maxbin'+4.5)" << endl; … … 415 454 gLog << " 31: SetNameWeightsFile('msignal/cosmics_weights_logain4.dat')" << endl; 416 455 gLog << " 32: SetNameWeightsFile('msignal/calibration_weights_UV.dat')" << endl; 417 gLog << " 33: SetNameWeightsFile('msignal/calibration_weights_UV4.dat')" << endl; 418 gLog << " 34: SetNameWeightsFile('msignal/calibration_weights_UV_logain6.dat')" << endl; 419 gLog << " 35: SetNameWeightsFile('msignal/calibration_weights_UV_logain4.dat')" << endl; 420 gLog << " 36: Real Fit: (not yet implemented)" << endl; 456 gLog << " 33: Use calibration weights for calibration events and cosmics weights for data events" << endl; 421 457 gLog << endl; 422 458 gLog << " --inpath=# Find the data in inpath" << endl; -
trunk/MagicSoft/Mars/mjobs/JobsLinkDef.h
r4758 r5683 12 12 #pragma link C++ class MJCalibration+; 13 13 #pragma link C++ class MJCalibrateSignal+; 14 #pragma link C++ class MJCalibrateSignalFromOutside+; 14 15 #pragma link C++ class MJExtractSignal+; 15 16 #pragma link C++ class MJExtractCalibTest+; -
trunk/MagicSoft/Mars/mjobs/Makefile
r4932 r5683 30 30 MJCalibration.cc \ 31 31 MJCalibrateSignal.cc \ 32 MJCalibrateSignalFromOutside.cc \ 32 33 MJExtractSignal.cc \ 33 34 MJExtractCalibTest.cc
Note:
See TracChangeset
for help on using the changeset viewer.