| 1 | #ifndef MARS_MCalibrationChargeCalc
|
|---|
| 2 | #define MARS_MCalibrationChargeCalc
|
|---|
| 3 |
|
|---|
| 4 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 5 | // //
|
|---|
| 6 | // MCalibrationChargeCalc //
|
|---|
| 7 | // //
|
|---|
| 8 | // Integrates the time slices of the all pixels of a calibration event //
|
|---|
| 9 | // and substract the pedestal value //
|
|---|
| 10 | // //
|
|---|
| 11 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 12 |
|
|---|
| 13 | #ifndef MARS_MTask
|
|---|
| 14 | #include "MTask.h"
|
|---|
| 15 | #endif
|
|---|
| 16 |
|
|---|
| 17 | #ifndef MARS_MBadPixelsPix
|
|---|
| 18 | #include "MBadPixelsPix.h"
|
|---|
| 19 | #endif
|
|---|
| 20 |
|
|---|
| 21 | #ifndef MARS_MCalibrationCam
|
|---|
| 22 | #include "MCalibrationCam.h"
|
|---|
| 23 | #endif
|
|---|
| 24 |
|
|---|
| 25 | #ifndef ROOT_TArrayC
|
|---|
| 26 | #include "TArrayC.h"
|
|---|
| 27 | #endif
|
|---|
| 28 |
|
|---|
| 29 | class MRawEvtData;
|
|---|
| 30 | class MRawRunHeader;
|
|---|
| 31 | class MPedestalCam;
|
|---|
| 32 | class MPedestalPix;
|
|---|
| 33 | class MCalibrationChargePINDiode;
|
|---|
| 34 | class MCalibrationChargeBlindCam;
|
|---|
| 35 | class MCalibrationChargeBlindPix;
|
|---|
| 36 | class MCalibrationChargePix;
|
|---|
| 37 | class MCalibrationChargeCam;
|
|---|
| 38 | class MCalibrationQECam;
|
|---|
| 39 | class MGeomCam;
|
|---|
| 40 | class MExtractedSignalCam;
|
|---|
| 41 | class MExtractedSignalBlindPixel;
|
|---|
| 42 | class MExtractedSignalPINDiode;
|
|---|
| 43 | class MBadPixelsCam;
|
|---|
| 44 | class MBadPixelsPix;
|
|---|
| 45 | class MTime;
|
|---|
| 46 | class MCalibrationChargeCalc : public MTask
|
|---|
| 47 | {
|
|---|
| 48 | private:
|
|---|
| 49 |
|
|---|
| 50 | static const Float_t fgChargeLimit; //! Default for fChargeLimit (now set to: 2.5)
|
|---|
| 51 | static const Float_t fgChargeErrLimit; //! Default for fChargeErrLimit (now set to: 0.)
|
|---|
| 52 | static const Float_t fgChargeRelErrLimit; //! Default for fChargeRelErrLimit (now set to: 1.)
|
|---|
| 53 | static const Float_t fgLambdaCheckLimit; //! Default for fLambdaCheckLimit (now set to: 0.2)
|
|---|
| 54 | static const Float_t fgLambdaErrLimit; //! Default for fLabmdaErrLimit (now set to: 0.5)
|
|---|
| 55 | static const Float_t fgPheErrLimit; //! Default for fPheErrLimit (now set to: 4.)
|
|---|
| 56 | static const Float_t fgFFactorErrLimit; //! Default for fFFactorErrLimit (now set to: 4.)
|
|---|
| 57 |
|
|---|
| 58 | // Variables
|
|---|
| 59 | Float_t fChargeLimit; // Limit acceptance mean charge (in units of PedRMS)
|
|---|
| 60 | Float_t fChargeErrLimit; // Limit acceptance charge error (in abs. numbers)
|
|---|
| 61 | Float_t fChargeRelErrLimit; // Limit acceptance rel. error mean (in abs. numbers)
|
|---|
| 62 | Float_t fLambdaCheckLimit; // Limit rel. diff. lambda and lambdacheck in Blind Pixel
|
|---|
| 63 | Float_t fLambdaErrLimit; // Limit acceptance lambda error in Blind Pixel
|
|---|
| 64 | Float_t fNumHiGainSamples; // Number High-Gain FADC slices used by extractor
|
|---|
| 65 | Float_t fNumLoGainSamples; // Number Low -Gain FADC slices used by extractor
|
|---|
| 66 | Float_t fPheErrLimit; // Limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
|
|---|
| 67 | Float_t fFFactorErrLimit; // Limit acceptance F-Factor w.r.t. area idx mean
|
|---|
| 68 | Float_t fSqrtHiGainSamples; // Square root nr. High-Gain FADC slices used by extractor
|
|---|
| 69 | Float_t fSqrtLoGainSamples; // Square root nr. Low -Gain FADC slices used by extractor
|
|---|
| 70 | MCalibrationCam::PulserColor_t fPulserColor; // Calibration LEDs colour
|
|---|
| 71 | Int_t fNumInnerFFactorMethodUsed; // Number of inner pixels used for F-Factor Method calibration
|
|---|
| 72 |
|
|---|
| 73 | Byte_t fFlags; // Bit-field for the general flags
|
|---|
| 74 | TArrayC fResultFlags; // Bit-fields for the fitting results (one field per area index)
|
|---|
| 75 | TArrayC fBlindPixelFlags; // Bit-fields for the blind pixel flags (one field per blind pixel)
|
|---|
| 76 | TArrayC fPINDiodeFlags; // Bit-fields for the PIN Diode flags (one field per PIN Diode )
|
|---|
| 77 |
|
|---|
| 78 | TString fOutputPath; // Path to the output file
|
|---|
| 79 | TString fOutputFile; // Name of the output file
|
|---|
| 80 |
|
|---|
| 81 | // Pointers
|
|---|
| 82 | MBadPixelsCam *fBadPixels; // Bad Pixels
|
|---|
| 83 | MCalibrationChargeCam *fCam; // Calibrated Charges of all pixels
|
|---|
| 84 | MCalibrationChargeBlindPix *fBlindPixel; // Calibrated Charges of the Blind Pixel
|
|---|
| 85 | MCalibrationChargeBlindCam *fBlindCam; // Calibrated Charges of the Blind Pixels
|
|---|
| 86 | MCalibrationChargePINDiode *fPINDiode; // Calibrated Charges of the PIN Diode
|
|---|
| 87 | MCalibrationQECam *fQECam; // Calibrated Quantum Efficiencies of all pixels
|
|---|
| 88 | MGeomCam *fGeom; //! Camera geometry
|
|---|
| 89 | MPedestalCam *fPedestals; //! Pedestals all pixels (calculated previously from ped.file)
|
|---|
| 90 |
|
|---|
| 91 | // enums
|
|---|
| 92 | enum { kDebug, kPheFitOK, kFFactorFitOK, kBlindPixelFitOK, kBlindPixelPedFitOK, kPINDiodeFitOK };
|
|---|
| 93 |
|
|---|
| 94 | // functions
|
|---|
| 95 | const char* GetOutputFile();
|
|---|
| 96 | void FinalizePedestals ( const MPedestalPix &ped, MCalibrationChargePix &cal, const Int_t aidx );
|
|---|
| 97 | Bool_t FinalizeCharges ( MCalibrationChargePix &cal, MBadPixelsPix &bad );
|
|---|
| 98 | Bool_t FinalizePINDiode ();
|
|---|
| 99 | Bool_t FinalizeBlindPixel ();
|
|---|
| 100 | Bool_t FinalizeFFactorMethod ();
|
|---|
| 101 | void FinalizeBadPixels ();
|
|---|
| 102 | void FinalizeFFactorQECam ();
|
|---|
| 103 | void FinalizeBlindPixelQECam ();
|
|---|
| 104 | void FinalizePINDiodeQECam ();
|
|---|
| 105 | void FinalizeUnsuitablePixels();
|
|---|
| 106 |
|
|---|
| 107 | void PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
|
|---|
| 108 |
|
|---|
| 109 | void SetPheFitOK ( const Int_t aidx, const Bool_t b=kTRUE ) { b ? SETBIT(fResultFlags[aidx], kPheFitOK)
|
|---|
| 110 | : CLRBIT(fResultFlags[aidx], kPheFitOK); }
|
|---|
| 111 | void SetFFactorFitOK ( const Int_t aidx, const Bool_t b=kTRUE ) { b ? SETBIT(fResultFlags[aidx], kFFactorFitOK)
|
|---|
| 112 | : CLRBIT(fResultFlags[aidx], kFFactorFitOK); }
|
|---|
| 113 | void SetBlindPixelFitOK ( const Int_t idx, const Bool_t b=kTRUE ) { b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelFitOK)
|
|---|
| 114 | : CLRBIT(fBlindPixelFlags[idx], kBlindPixelFitOK); }
|
|---|
| 115 | void SetBlindPixelPedFitOK( const Int_t idx, const Bool_t b=kTRUE ) { b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK)
|
|---|
| 116 | : CLRBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK); }
|
|---|
| 117 | void SetPINDiodeFitOK ( const Int_t idx, const Bool_t b=kTRUE ) { b ? SETBIT(fPINDiodeFlags[idx], kPINDiodeFitOK)
|
|---|
| 118 | : CLRBIT(fPINDiodeFlags[idx], kPINDiodeFitOK); }
|
|---|
| 119 |
|
|---|
| 120 | Int_t PreProcess (MParList *pList);
|
|---|
| 121 | Bool_t ReInit (MParList *pList);
|
|---|
| 122 | Int_t Process ();
|
|---|
| 123 | Int_t PostProcess();
|
|---|
| 124 |
|
|---|
| 125 | public:
|
|---|
| 126 |
|
|---|
| 127 | MCalibrationChargeCalc(const char *name=NULL, const char *title=NULL);
|
|---|
| 128 |
|
|---|
| 129 | void Clear(const Option_t *o="");
|
|---|
| 130 |
|
|---|
| 131 | Bool_t IsDebug() const { return TESTBIT(fFlags,kDebug); }
|
|---|
| 132 |
|
|---|
| 133 | void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; }
|
|---|
| 134 | void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; }
|
|---|
| 135 | void SetChargeRelErrLimit ( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; }
|
|---|
| 136 | void SetDebug ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags, kDebug)
|
|---|
| 137 | : CLRBIT(fFlags, kDebug); }
|
|---|
| 138 | void SetFFactorErrLimit ( const Float_t f=fgFFactorErrLimit ) { fFFactorErrLimit = f; }
|
|---|
| 139 | void SetLambdaErrLimit ( const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; }
|
|---|
| 140 | void SetLambdaCheckLimit ( const Float_t f=fgLambdaCheckLimit ) { fLambdaCheckLimit = f; }
|
|---|
| 141 | void SetOutputPath ( TString path="." );
|
|---|
| 142 | void SetOutputFile ( TString file="ChargeCalibStat.txt" );
|
|---|
| 143 | void SetPheErrLimit ( const Float_t f=fgPheErrLimit ) { fPheErrLimit = f; }
|
|---|
| 144 | void SetPulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; }
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 | ClassDef(MCalibrationChargeCalc, 1) // Task calculating Calibration Containers and Quantum Efficiencies
|
|---|
| 148 | };
|
|---|
| 149 |
|
|---|
| 150 | #endif
|
|---|