Changeset 3697
- Timestamp:
- 04/09/04 17:05:05 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3696 r3697 25 25 - put abs. time consistency check from MCalibrationChargeCalc into 26 26 MHCalibrationChargePINDiode and MHCalibrationChargeCam 27 28 * mcalib/MHCalibrationCam.[h,cc] 29 * mcalib/MHCalibrationChargeCalc.[h,cc] 30 - number of used FADC slices also stored in MHCalibrationCam, 31 MHCalibrationChargeCalc needs no pointer to the signal extractors 32 any more -> removed 27 33 28 34 -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
r3694 r3697 76 76 // Initializes: 77 77 // - fPulserColor to kCT1 78 // - fNumHiGainFADCSlices to 0. 79 // - fNumLoGainFADCSlices to 0. 78 80 // 79 81 // Creates a TClonesArray of MBadPixelsPix containers for the TClonesArray's: … … 86 88 // 87 89 MCalibrationCam::MCalibrationCam(const char *name, const char *title) 88 : fPulserColor(kCT1), fPixels(NULL), fAverageAreas(NULL), fAverageSectors(NULL) 90 : fNumHiGainFADCSlices(0.), fNumLoGainFADCSlices(0.), fPulserColor(kCT1), 91 fPixels(NULL), fAverageAreas(NULL), fAverageSectors(NULL) 89 92 { 90 93 fName = name ? name : "MCalibrationCam"; -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h
r3694 r3697 18 18 class MCalibrationCam : public MParContainer, public MCamEvent 19 19 { 20 21 20 public: 22 21 … … 25 24 26 25 protected: 26 27 Float_t fNumHiGainFADCSlices; // Number High-Gain FADC slices used by extractor 28 Float_t fNumLoGainFADCSlices; // Number Low -Gain FADC slices used by extractor 27 29 28 30 PulserColor_t fPulserColor; // Colour of the pulsed LEDs … … 53 55 const Int_t GetAverageSectors () const; 54 56 const MCalibrationPix &GetAverageSector ( UInt_t i ) const; 57 const Float_t GetNumHiGainFADCSlices() const { return fNumHiGainFADCSlices; } 58 const Float_t GetNumLoGainFADCSlices() const { return fNumLoGainFADCSlices; } 55 59 virtual Bool_t GetPixelContent ( Double_t &val, Int_t idx, 56 60 const MGeomCam &cam, Int_t type=0) const; 57 const PulserColor_t GetPulserColor() const { return fPulserColor; }61 const PulserColor_t GetPulserColor() const { return fPulserColor; } 58 62 const Int_t GetSize() const; 59 63 … … 62 66 63 67 // Inits 64 void Init ( const MGeomCam &geom);65 void InitSize ( const UInt_t i);66 void InitAverageAreas ( const UInt_t i);67 void InitAverageSectors ( const UInt_t i);68 void Init ( const MGeomCam &geom ); 69 void InitSize ( const UInt_t i ); 70 void InitAverageAreas ( const UInt_t i ); 71 void InitAverageSectors ( const UInt_t i ); 68 72 69 73 // Setters 70 void SetPulserColor ( const PulserColor_t col=kCT1 ) { fPulserColor = col; } 74 void SetNumHiGainFADCSlices ( const Float_t f ) { fNumHiGainFADCSlices = f; } 75 void SetNumLoGainFADCSlices ( const Float_t f ) { fNumLoGainFADCSlices = f; } 76 void SetPulserColor ( const PulserColor_t col=kCT1 ) { fPulserColor = col; } 71 77 72 78 ClassDef(MCalibrationCam, 1) // Base class Container for Calibration Results Camera -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3694 r3697 28 28 // 29 29 // Task to calculate the calibration conversion factors and quantum efficiencies 30 // from the FADC time slices. The integrated time slices have to be delivered by an 31 // MExtractedSignalCam, pedestals by an MPedestalCam. 32 // 33 // The output container MCalibrationCam holds one entry of type MCalibrationChargePix 34 // for every pixel. It is filled in the following way: 35 // 36 // PreProcess(): Initialize MCalibrationCam 30 // from the fit results to the summed FADC slice distributions delivered by 31 // MCalibrationChargeCam, MCalibrationChargePix, MCalibrationChargeBlindPix and 32 // MCalibrationChargePINDiode, calculated and filled by MHCalibrationChargeCam, 33 // MHCalibrationChargePix, MHCalibrationChargeBlindPix and MHCalibrationChargePINDiode. 34 // 35 // PreProcess(): Initialize pointers to MCalibrationChargeCam, MCalibrationChargeBlindPix 36 // MCalibrationChargePINDiode and MCalibrationQECam 37 // 37 38 // Initialize pulser light wavelength 38 39 // … … 231 232 const Float_t MCalibrationChargeCalc::fgLambdaCheckLimit = 0.2; 232 233 const Float_t MCalibrationChargeCalc::fgPheErrLimit = 5.; 233 const Float_t MCalibrationChargeCalc::fgTimeLowerLimit = 1.;234 const Float_t MCalibrationChargeCalc::fgTimeUpperLimit = 2.;235 234 // -------------------------------------------------------------------------- 236 235 // … … 251 250 // - fLambdaCheckLimit to fgLambdaCheckLimit 252 251 // - fLambdaErrLimit to fgLambdaErrLimit 253 // - fTimeLowerLimit to fgTimeLowerLimit254 // - fTimeUpperLimit to fgTimeUpperLimit255 252 // - fPheErrLimit to fgPheErrLimit 256 253 // - fPulserColor to MCalibrationCam::kCT1 … … 261 258 MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title) 262 259 : fBadPixels(NULL), fCam(NULL), fBlindPixel(NULL), fPINDiode(NULL), 263 fQECam(NULL), fSignals(NULL), fSigBlind(NULL), fSigPIN(NULL), 264 fGeom(NULL), fPedestals(NULL), fEvtTime(NULL) 260 fQECam(NULL), fGeom(NULL), fPedestals(NULL), fEvtTime(NULL) 265 261 { 266 262 … … 280 276 SetPheErrLimit(); 281 277 SetPulserColor(MCalibrationCam::kCT1); 282 SetTimeLowerLimit();283 SetTimeUpperLimit();284 278 285 279 Clear(); … … 302 296 // The following container are searched for and execution aborted if not in MParList: 303 297 // - MPedestalCam 304 // - MExtractedSignalCam305 // - MCalibrationChargeCam306 298 // 307 299 // The following containers are searched and created if they were not found: … … 313 305 // cannot be found, the corresponding calibration part is only skipped. 314 306 // 315 // - M ExtractedSignalBlindPixel and MCalibrationChargeBlindPix316 // - M ExtractedSignalPINDiode and MCalibrationChargePINDiode307 // - MCalibrationChargeBlindPix 308 // - MCalibrationChargePINDiode 317 309 // - MTime 318 310 // … … 336 328 } 337 329 338 fSignals = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");339 if (!fSignals)340 {341 *fLog << err << "MExtractedSignalCam not found... aborting" << endl;342 return kFALSE;343 }344 345 fCam = (MCalibrationChargeCam*)pList->FindObject("MCalibrationChargeCam");346 if (!fCam)347 {348 *fLog << err << "Cannot find MCalibrationChargeCam... aborting" << endl;349 *fLog << err << "Maybe you forget to call an MFillH for the MHCalibrationChargeCam before..." << endl;350 return kFALSE;351 }352 353 330 // 354 331 // Containers that are created in case that they are not there. … … 368 345 } 369 346 370 //371 // Optional Containers372 //373 fSigBlind = (MExtractedSignalBlindPixel*)pList->FindObject("MExtractedSignalBlindPixel");374 if (!fSigBlind)375 *fLog << warn << "MExtractedSignalBlindPixel not found... no blind pixel method! " << endl;376 else377 {378 fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindCreateObj("MCalibrationChargeBlindPix");379 if (!fBlindPixel)380 {381 *fLog << err << "Cannot find nor create MCalibrationChargeBlindPix... aborting" << endl;382 return kFALSE;383 }384 }385 386 fSigPIN = (MExtractedSignalPINDiode*)pList->FindObject("MExtractedSignalPINDiode");387 if (!fSigPIN)388 *fLog << warn << "MExtractedSignalPINDiode not found... no PIN Diode method! " << endl;389 else390 {391 fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode");392 if (!fPINDiode)393 {394 *fLog << err << "Cannot find nor create MCalibrationChargePINDiode... aborting" << endl;395 return kFALSE;396 }397 }398 347 399 348 fEvtTime = (MTime*)pList->FindObject("MTime"); … … 418 367 // The ReInit searches for the following input containers: 419 368 // - MGeomCam 420 // 421 // It retrieves the following variables from MExtractedSignalCam: 369 // - MCalibrationChargeCam 370 // 371 // It retrieves the following variables from MCalibrationChargeCam: 422 372 // 423 373 // - fNumHiGainSamples … … 446 396 } 447 397 448 fNumHiGainSamples = fSignals->GetNumUsedHiGainFADCSlices(); 449 fNumLoGainSamples = fSignals->GetNumUsedLoGainFADCSlices(); 398 fCam = (MCalibrationChargeCam*)pList->FindObject("MCalibrationChargeCam"); 399 if (!fCam) 400 { 401 *fLog << err << "Cannot find MCalibrationChargeCam... aborting" << endl; 402 *fLog << err << "Maybe you forget to call an MFillH for the MHCalibrationChargeCam before..." << endl; 403 return kFALSE; 404 } 405 406 // 407 // Optional Containers 408 // 409 fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindObject("MCalibrationChargeBlindPix"); 410 if (!fBlindPixel) 411 { 412 *fLog << warn << GetDescriptor() 413 << ": MCalibrationChargeBlindPix not found... no blind pixel method! " << endl; 414 return kFALSE; 415 } 416 417 fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode"); 418 if (!fPINDiode) 419 { 420 *fLog << warn << GetDescriptor() 421 << "MCalibrationChargePINDiode not found... no PIN Diode method! " << endl; 422 return kFALSE; 423 } 424 425 fNumHiGainSamples = fCam->GetNumHiGainFADCSlices(); 426 fNumLoGainSamples = fCam->GetNumLoGainFADCSlices(); 450 427 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); 451 428 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); … … 565 542 // Finalize charges per pixel: 566 543 // - Check chage validity 567 // - Check absolute time validity568 544 // - Calculate the reduced sigma 569 545 // - Calculate the number of photo-electrons … … 609 585 } 610 586 611 //612 // The check returns kTRUE if:613 //614 // The mean arrival time is at least fTimeLowerLimit slices from the lower edge615 // and fUpperLimit slices from the upper edge616 //617 const Byte_t loweredge = cal.IsHiGainSaturation() ? fSignals->GetFirstUsedSliceLoGain()618 : fSignals->GetFirstUsedSliceHiGain();619 const Byte_t upperedge = cal.IsHiGainSaturation() ? fSignals->GetLastUsedSliceLoGain()620 : fSignals->GetLastUsedSliceHiGain();621 622 const Float_t lowerlimit = (Float_t)loweredge + fTimeLowerLimit;623 const Float_t upperlimit = (Float_t)upperedge + fTimeUpperLimit;624 625 if ( cal.GetAbsTimeMean() < lowerlimit)626 {627 *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in first " << fTimeLowerLimit628 << " extraction bin of the Pixel " << cal.GetPixId() << endl;629 *fLog << cal.GetAbsTimeMean() << " " << lowerlimit << endl;630 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInFirstBin );631 }632 633 if ( cal.GetAbsTimeMean() > upperlimit )634 {635 *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in last " << fTimeUpperLimit636 << " two extraction bins of the Pixel " << cal.GetPixId() << endl;637 *fLog << cal.GetAbsTimeMean() << " " << upperlimit << endl;638 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInLast2Bins );639 }640 641 587 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 642 588 return kFALSE; … … 671 617 // 3) PINDiode has a fitted charge smaller its fChargeRelErrLimit times its charge error 672 618 // 4) PINDiode has a charge sigma smaller than its Pedestal RMS 673 // 5) The mean arrival time is in fTimeLowerLimit slices from the lower edge674 // and fUpperLimit slices from the upper edge675 619 // 676 620 // Calls: … … 680 624 { 681 625 682 if (!fSigPIN)683 return kFALSE;684 685 626 if (!fPINDiode) 686 627 return kFALSE; … … 709 650 if (fPINDiode->GetSigma() < fPINDiode->GetPedRms()) 710 651 { 711 *fLog << warn << GetDescriptor() << ": Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl; 712 } 713 return kFALSE; 714 715 const Byte_t loweredge = fSigPIN->GetFirstUsedSlice(); 716 const Byte_t upperedge = fSigPIN->GetLastUsedSlice(); 717 const Float_t lowerlimit = (Float_t)loweredge + fTimeLowerLimit; 718 const Float_t upperlimit = (Float_t)upperedge + fTimeUpperLimit; 719 720 if (fPINDiode->GetAbsTimeMean() < lowerlimit) 721 { 722 *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in first " << fTimeLowerLimit 723 << " extraction bin in PIN Diode " << endl; 724 *fLog << fPINDiode->GetAbsTimeMean() << " " << lowerlimit << endl; 725 return kFALSE; 726 } 727 728 if ( fPINDiode->GetAbsTimeMean() > upperlimit ) 729 { 730 *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in last " << fTimeUpperLimit 731 << " two extraction bins in PIN Diode " << endl; 732 *fLog << fPINDiode->GetAbsTimeMean() << " " << upperlimit << endl; 733 return kFALSE; 734 } 652 *fLog << warn << GetDescriptor() 653 << ": Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl; 654 return kFALSE; 655 } 656 735 657 736 658 if (!fPINDiode->CalcFluxOutsidePlexiglass()) … … 760 682 { 761 683 762 if (!fSigBlind)763 return kFALSE;764 765 684 if (!fBlindPixel) 766 685 return kFALSE; … … 1340 1259 "Pixels with Low Gain Saturation: "); 1341 1260 PrintUncalibrated(MBadPixelsPix::kMeanTimeInFirstBin, 1342 Form("%s%2.1f%s","Mean Abs. Arr. Time in First ", fTimeLowerLimit," Bin(s): "));1261 Form("%s%2.1f%s","Mean Abs. Arr. Time in First ",1," Bin(s): ")); 1343 1262 PrintUncalibrated(MBadPixelsPix::kMeanTimeInLast2Bins, 1344 Form("%s%2.1f%s","Mean Abs. Arr. Time in Last ", fTimeUpperLimit," Bin(s): "));1263 Form("%s%2.1f%s","Mean Abs. Arr. Time in Last ",2," Bin(s): ")); 1345 1264 PrintUncalibrated(MBadPixelsPix::kHiGainOscillating, 1346 1265 "Pixels with changing Hi Gain signal over time: "); -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r3694 r3697 49 49 static const Float_t fgLambdaErrLimit; //! Default for fLabmdaErrLimit (now set to: 0.2) 50 50 static const Float_t fgPheErrLimit; //! Default for fPheErrLimit (now set to: 5.) 51 static const Float_t fgTimeLowerLimit; //! Default for fTimeLowerLimit (now set to: 1.)52 static const Float_t fgTimeUpperLimit; //! Default for fTimeUpperLimit (now set to: 2.)53 51 54 52 // Variables … … 56 54 Float_t fChargeErrLimit; // Limit acceptance charge error (in abs. numbers) 57 55 Float_t fChargeRelErrLimit; // Limit acceptance rel. error mean (in abs. numbers) 58 Int_tfFlags; // Bit-field for the flags56 Byte_t fFlags; // Bit-field for the flags 59 57 Float_t fLambdaCheckLimit; // Limit rel. diff. lambda and lambdacheck in Blind Pixel 60 58 Float_t fLambdaErrLimit; // Limit acceptance lambda error in Blind Pixel … … 64 62 Float_t fSqrtHiGainSamples; // Square root nr. High-Gain FADC slices used by extractor 65 63 Float_t fSqrtLoGainSamples; // Square root nr. Low -Gain FADC slices used by extractor 66 Float_t fTimeLowerLimit; // Limit dist. to first signal slice (in units of FADC slices)67 Float_t fTimeUpperLimit; // Limit dist. to last signal slice (in units of FADC slices)68 64 MCalibrationCam::PulserColor_t fPulserColor; // Calibration LEDs colour 69 65 … … 74 70 MCalibrationChargePINDiode *fPINDiode; // Calibrated Charges of the PIN Diode 75 71 MCalibrationQECam *fQECam; // Calibrated Quantum Efficiencies of all pixels 76 MExtractedSignalCam *fSignals; //! Extracted signal of all pixels77 MExtractedSignalBlindPixel *fSigBlind; //! Extracted signal of Blind Pixel78 MExtractedSignalPINDiode *fSigPIN; //! Extracted signal of PIN Diode79 72 MGeomCam *fGeom; //! Camera geometry 80 73 MPedestalCam *fPedestals; //! Pedestals all pixels (calculated previously from ped.file) … … 119 112 void SetPheErrLimit ( const Float_t f=fgPheErrLimit ) { fPheErrLimit = f; } 120 113 void SetPulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; } 121 void SetTimeLowerLimit ( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; }122 void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; }123 114 124 115 void SkipHiLoGainCalibration ( const Bool_t b=kTRUE ) -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h
r3678 r3697 17 17 TH2D* fOffvsSlope; //! Histogram with Higain-vs-LoGain fit result Offsets vs. Slopes 18 18 19 Byte_t fFlags; // Bit-field to hold the flags 20 19 21 enum { kFFactorMethodValid }; 20 22 21 Byte_t fFlags; // Bit-field to hold the flags22 23 23 24 public: … … 27 28 28 29 void Clear ( Option_t *o="" ); 29 30 // Setters 31 void SetFFactorMethodValid ( const Bool_t b=kTRUE ); 30 31 // Draws 32 // void DrawHiLoFits(); 33 void DrawPixelContent(Int_t num) const; 32 34 33 35 // Getters 34 36 Bool_t GetConversionFactorFFactor( Int_t ipx, Float_t &mean, Float_t &err, Float_t &ffactor ); 35 37 Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 36 38 Bool_t IsFFactorMethodValid() const; 37 39 38 40 // Prints 39 void Print(Option_t *o="") const; 40 41 // Draws 42 // void DrawHiLoFits(); 43 44 // Others 45 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 46 void DrawPixelContent(Int_t num) const; 41 void Print(Option_t *o="") const; 42 43 // Setters 44 void SetFFactorMethodValid (const Bool_t b=kTRUE ); 47 45 48 46 ClassDef(MCalibrationChargeCam, 1) // Container Charge Calibration Results Camera -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc
r3669 r3697 144 144 const Float_t MHCalibrationChargeCam::fgNumHiGainSaturationLimit = 0.01; 145 145 const Float_t MHCalibrationChargeCam::fgNumLoGainSaturationLimit = 0.005; 146 const Float_t MHCalibrationChargeCam::fgTimeLowerLimit = 1.; 147 const Float_t MHCalibrationChargeCam::fgTimeUpperLimit = 2.; 146 148 // -------------------------------------------------------------------------- 147 149 // … … 154 156 // - fNumHiGainSaturationLimit to fgNumHiGainSaturationLimit 155 157 // - fNumLoGainSaturationLimit to fgNumLoGainSaturationLimit 158 // - fTimeLowerLimit to fgTimeLowerLimit 159 // - fTimeUpperLimit to fgTimeUpperLimit 156 160 // 157 161 MHCalibrationChargeCam::MHCalibrationChargeCam(const char *name, const char *title) 158 : fRawEvt(NULL) 159 { 160 fName = name ? name : "MHCalibrationChargeCam"; 161 fTitle = title ? title : "Class to fill the calibration histograms "; 162 163 SetNumHiGainSaturationLimit(); 164 SetNumLoGainSaturationLimit(); 162 : fRawEvt(NULL), fSig(NULL) 163 { 164 fName = name ? name : "MHCalibrationChargeCam"; 165 fTitle = title ? title : "Class to fill the calibration histograms "; 166 167 SetNumHiGainSaturationLimit(); 168 SetNumLoGainSaturationLimit(); 169 SetTimeLowerLimit(); 170 SetTimeUpperLimit(); 165 171 } 166 172 … … 169 175 // Gets the pointers to: 170 176 // - MRawEvtData 177 // - MExtractedSignalCam 171 178 // 172 179 Bool_t MHCalibrationChargeCam::SetupHists(const MParList *pList) … … 180 187 } 181 188 189 MExtractedSignalCam *fSig = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam"); 190 if (!fSig) 191 { 192 *fLog << err << "MExtractedSignalCam not found... abort." << endl; 193 return kFALSE; 194 } 195 182 196 return kTRUE; 183 197 } … … 187 201 // Gets or creates the pointers to: 188 202 // - MCalibrationChargeCam 189 // 190 // Searches pointer to: 191 // - MExtractedSignalCam 203 // - MBadPixelsCam 204 // 205 // Initializes the number of used FADC slices from MExtractedSignalCam 206 // into MCalibrationChargeCam and test for changes in that variable 192 207 // 193 208 // Initializes, if empty to MGeomCam::GetNumPixels(): … … 229 244 } 230 245 231 MExtractedSignalCam *signal = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam"); 232 if (!signal) 233 { 234 *fLog << err << "MExtractedSignalCam not found... abort." << endl; 246 const Float_t numhigain = fSig->GetNumUsedHiGainFADCSlices(); 247 const Float_t numlogain = fSig->GetNumUsedLoGainFADCSlices(); 248 249 if (fCam->GetNumHiGainFADCSlices() == 0.) 250 fCam->SetNumHiGainFADCSlices ( numhigain ); 251 else if (fCam->GetNumHiGainFADCSlices() != numhigain) 252 { 253 *fLog << err << GetDescriptor() 254 << ": Number of High Gain FADC extraction slices has changes, abort..." << endl; 235 255 return kFALSE; 236 } 256 } 257 258 if (fCam->GetNumLoGainFADCSlices() == 0.) 259 fCam->SetNumLoGainFADCSlices ( numlogain ); 260 else if (fCam->GetNumLoGainFADCSlices() != numlogain) 261 { 262 *fLog << err << GetDescriptor() 263 << ": Number of Low Gain FADC extraction slices has changes, abort..." << endl; 264 return kFALSE; 265 } 237 266 238 267 const Int_t npixels = fGeom->GetNumPixels(); … … 532 561 { 533 562 563 const Byte_t firsthi = fSig->GetFirstUsedSliceHiGain(); 564 const Byte_t lasthi = fSig->GetLastUsedSliceHiGain(); 565 const Byte_t firstlo = fSig->GetFirstUsedSliceLoGain(); 566 const Byte_t lastlo = fSig->GetLastUsedSliceLoGain(); 567 568 534 569 for (Int_t i=0; i<fHiGainArray->GetSize(); i++) 535 570 { … … 537 572 MHCalibrationChargePix &histhi = (MHCalibrationChargePix&)(*this)[i]; 538 573 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 574 MBadPixelsPix &bad = (*fBadPixels)[i]; 539 575 540 576 if (histhi.IsExcluded()) … … 548 584 } 549 585 550 pix.SetAbsTimeMean ( histhi.GetAbsTimeMean()); 551 pix.SetAbsTimeRms ( histhi.GetAbsTimeRms() ); 586 FinalizeAbsTimes(histhi, pix, bad, firsthi, lasthi); 552 587 } 553 588 … … 572 607 573 608 if (pix.IsHiGainSaturation()) 574 { 575 pix.SetAbsTimeMean ( histlo.GetAbsTimeMean()); 576 pix.SetAbsTimeRms ( histlo.GetAbsTimeRms() ); 577 } 609 FinalizeAbsTimes(histlo, pix, bad, firstlo, lastlo); 578 610 } 579 611 … … 583 615 MHCalibrationChargePix &histhi = (MHCalibrationChargePix&)GetAverageHiGainArea(j); 584 616 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageArea(j); 617 MBadPixelsPix &bad = fCam->GetAverageBadArea(j); 585 618 586 619 if (histhi.GetSaturated() > fNumHiGainSaturationLimit*histhi.GetHGausHist()->GetEntries()) … … 591 624 } 592 625 593 pix.SetAbsTimeMean ( histhi.GetAbsTimeMean()); 594 pix.SetAbsTimeRms ( histhi.GetAbsTimeRms() ); 595 } 626 FinalizeAbsTimes(histhi, pix, bad, firsthi, lasthi); 627 } 596 628 597 629 for (Int_t j=0; j<fAverageLoGainAreas->GetSize(); j++) … … 600 632 MHCalibrationChargePix &histlo = (MHCalibrationChargePix&)GetAverageLoGainArea(j); 601 633 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageArea(j); 602 634 MBadPixelsPix &bad = fCam->GetAverageBadArea(j); 635 603 636 if (histlo.GetSaturated() > fNumLoGainSaturationLimit*histlo.GetHGausHist()->GetEntries()) 604 637 { … … 609 642 610 643 if (pix.IsHiGainSaturation()) 611 { 612 pix.SetAbsTimeMean ( histlo.GetAbsTimeMean()); 613 pix.SetAbsTimeRms ( histlo.GetAbsTimeRms() ); 614 } 644 FinalizeAbsTimes(histlo, pix, bad, firstlo, lastlo); 615 645 } 616 646 … … 620 650 MHCalibrationChargePix &histhi = (MHCalibrationChargePix&)GetAverageHiGainSector(j); 621 651 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageSector(j); 622 652 MBadPixelsPix &bad = fCam->GetAverageBadSector(j); 653 623 654 if (histhi.GetSaturated() > fNumHiGainSaturationLimit*histhi.GetHGausHist()->GetEntries()) 624 655 { … … 628 659 } 629 660 630 pix.SetAbsTimeMean ( histhi.GetAbsTimeMean()); 631 pix.SetAbsTimeRms ( histhi.GetAbsTimeRms() ); 661 FinalizeAbsTimes(histhi, pix, bad, firsthi, lasthi); 632 662 } 633 663 … … 648 678 649 679 if (pix.IsHiGainSaturation()) 650 { 651 pix.SetAbsTimeMean ( histlo.GetAbsTimeMean()); 652 pix.SetAbsTimeRms ( histlo.GetAbsTimeRms() ); 653 } 680 FinalizeAbsTimes(histlo, pix, bad, firstlo, lastlo); 654 681 } 655 682 … … 670 697 } 671 698 699 // -------------------------------------------------------------------------------- 700 // 701 // Fill the absolute time results into MCalibrationChargePix 702 // 703 // Check absolute time validity: 704 // - Mean arrival time is at least fTimeLowerLimit slices from the lower edge 705 // - Mean arrival time is at least fUpperLimit slices from the upper edge 706 // 707 void MHCalibrationChargeCam::FinalizeAbsTimes(MHCalibrationChargePix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad, 708 Byte_t first, Byte_t last) 709 { 710 711 const Float_t mean = hist.GetAbsTimeMean(); 712 const Float_t rms = hist.GetAbsTimeRms(); 713 714 pix.SetAbsTimeMean ( mean ); 715 pix.SetAbsTimeRms ( rms ); 716 717 const Float_t lowerlimit = (Float_t)first + fTimeLowerLimit; 718 const Float_t upperlimit = (Float_t)last + fTimeUpperLimit; 719 720 if ( mean < lowerlimit) 721 { 722 *fLog << warn << GetDescriptor() 723 << Form("%s%3.1f%s%2i%s%4i",": Mean ArrivalTime: ",mean," smaller than ",fTimeLowerLimit, 724 " FADC slices from lower edge in pixel ",hist.GetPixId()) << endl; 725 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInFirstBin ); 726 } 727 728 if ( mean > upperlimit ) 729 { 730 *fLog << warn << GetDescriptor() 731 << Form("%s%3.1f%s%2i%s%4i",": Mean ArrivalTime: ",mean," greater than ",fTimeUpperLimit, 732 " FADC slices from upper edge in pixel ",hist.GetPixId()) << endl; 733 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInLast2Bins ); 734 } 735 } 736 672 737 // -------------------------------------------------------------------------- 673 738 //
Note:
See TracChangeset
for help on using the changeset viewer.