Changeset 5853 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 01/15/05 19:32:28 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r5729 r5853 144 144 MCalibrateData::MCalibrateData(CalibrationMode_t calmode,const char *name, const char *title) 145 145 : fGeomCam(NULL), fBadPixels(NULL), fCalibrations(NULL), 146 fQEs(NULL), fSignals(NULL), fCerPhotEvt(NULL), fPedestalFlag(kNo) 146 fQEs(NULL), fSignals(NULL), fCerPhotEvt(NULL), 147 fPedestalFlag(kNo), fSignalType(kPhot), fRenormFactor(1.) 147 148 { 148 149 … … 269 270 } 270 271 272 switch (fSignalType) 273 { 274 case kPhe: 275 fRenormFactor = MCalibrationQEPix::gkDefaultAverageQE; 276 break; 277 case kPhot: 278 fRenormFactor = 1.; 279 break; 280 } 281 271 282 return kTRUE; 272 283 } … … 355 366 } 356 367 368 // 369 // output information or warnings: 370 // 371 switch(fSignalType) 372 { 373 case kPhe: 374 *fLog << warn << "WARNING - Renormalization to photo-electrons applied!" << endl; 375 break; 376 case kPhot: 377 break; 378 } 379 357 380 if (TestPedestalFlag(kRun)) 358 381 Calibrate(kFALSE, kTRUE); … … 400 423 401 424 switch(fCalibrationMode) 402 {403 case kFlatCharge:425 { 426 case kFlatCharge: 404 427 { 405 406 407 408 428 MCalibrationChargePix &avpix = (MCalibrationChargePix&)fCalibrations->GetAverageArea(0); 429 calibConv = avpix.GetMean() / (pix.GetMean() * fGeomCam->GetPixRatio(pixidx)); 430 calibConvVar = (avpix.GetMeanRelVar() + pix.GetMeanRelVar()) * calibConv * calibConv; 431 if (pix.IsFFactorMethodValid()) 409 432 { 410 411 412 413 414 433 const Float_t convmin1 = qe.GetQECascadesFFactor(zenith)/pix.GetMeanConvFADC2Phe(); 434 if (convmin1 > 0) 435 calibFFactor *= TMath::Sqrt(convmin1); 436 else 437 calibFFactor = -1.; 415 438 } 439 break; 416 440 } 417 break; 418 419 case kBlindPixel: 441 case kBlindPixel: 420 442 if (!qe.IsBlindPixelMethodValid()) 421 443 return kFALSE; 422 444 calibQE = qe.GetQECascadesBlindPixel ( zenith ); 423 445 calibQEVar = qe.GetQECascadesBlindPixelVar( zenith ); 424 446 break; 425 426 case kPinDiode:447 448 case kPinDiode: 427 449 if (!qe.IsPINDiodeMethodValid()) 428 450 return kFALSE; 429 451 calibQE = qe.GetQECascadesPINDiode ( zenith ); 430 452 calibQEVar = qe.GetQECascadesPINDiodeVar( zenith ); 431 453 break; 432 433 case kFfactor:454 455 case kFfactor: 434 456 if (!pix.IsFFactorMethodValid()) 435 457 return kFALSE; 436 458 calibQE = qe.GetQECascadesFFactor ( zenith ); 437 459 calibQEVar = qe.GetQECascadesFFactorVar( zenith ); 438 460 break; 439 440 case kCombined:461 462 case kCombined: 441 463 if (!qe.IsCombinedMethodValid()) 442 464 return kFALSE; 443 465 calibQE = qe.GetQECascadesCombined ( zenith ); 444 466 calibQEVar = qe.GetQECascadesCombinedVar( zenith ); 445 467 break; 446 447 case kDummy:468 469 case kDummy: 448 470 hiloconv = 1.; 449 471 hiloconverr = 0.; 450 472 break; 451 } /* switch calibration mode */473 } /* switch calibration mode */ 452 474 } /* if(fCalibrationMode!=kNone) */ 453 475 else 454 476 { 455 477 calibConv = 1./fGeomCam->GetPixRatio(pixidx); 456 478 } 457 479 … … 493 515 continue; 494 516 } 517 518 calibConv *= fRenormFactor; 495 519 496 520 if (data) -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.h
r5729 r5853 43 43 UShort_t fCalibrationMode; // Flag defining the calibration mode (CalibrationMode_t) 44 44 Byte_t fPedestalFlag; // Flags defining to calibrate the pedestal each event or each run 45 Byte_t fSignalType; // Flag defining the signal type (kphot or kphe) 46 47 Float_t fRenormFactor; // Possible renormalization factor for signals (-> phes) 45 48 46 49 TList fNamesPedestal; // Names of input and output pedestal conatainer … … 81 84 }; 82 85 86 enum SignalType_t 87 { 88 kPhe, 89 kPhot 90 }; 91 83 92 MCalibrateData(CalibrationMode_t calmode=kDefault, 84 93 const char *name=NULL, const char *title=NULL); … … 89 98 90 99 void SetCalibrationMode ( CalibrationMode_t calmode=kDefault ) { fCalibrationMode=calmode; } 100 void SetSignalType ( SignalType_t sigtype=kPhot ) { fSignalType =sigtype; } 91 101 92 102 void AddPedestal(const char *name="Cam"); 93 103 void AddPedestal(const char *pedestal, const char *pedphot); 94 104 95 ClassDef(MCalibrateData, 0) // Task to calibrate FADC counts into Cherenkov photons105 ClassDef(MCalibrateData, 1) // Task to calibrate FADC counts into Cherenkov photons 96 106 }; 97 107
Note:
See TracChangeset
for help on using the changeset viewer.