- Timestamp:
- 04/09/04 16:59:46 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3695 r3696 21 21 22 22 * mcalib/MHCalibrationChargePINDiode.[h,cc] 23 * mcalib/MHCalibrationChargeCam.[h,cc] 24 * mcalib/MHCalibrationChargeCalc.[h,cc] 23 25 - put abs. time consistency check from MCalibrationChargeCalc into 24 MHCalibrationChargePINDiode 26 MHCalibrationChargePINDiode and MHCalibrationChargeCam 25 27 26 28 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc
r3676 r3696 393 393 { 394 394 395 fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam");396 if (!fBadPixels)397 return kFALSE;398 399 400 395 const Int_t npixels = fGeom->GetNumPixels(); 401 396 const Int_t nsectors = fGeom->GetNumSectors(); 402 397 const Int_t nareas = fGeom->GetNumAreas(); 398 399 fBadPixels = (MBadPixelsCam*)pList->FindObject("MBadPixelsCam"); 400 if (!fBadPixels) 401 { 402 fBadPixels = (MBadPixelsCam*)pList->FindCreateObj(AddSerialNumber("MBadPixelsCam")); 403 if (!fBadPixels) 404 { 405 gLog << err << "Cannot find nor create MBadPixelsCam ... abort." << endl; 406 return kFALSE; 407 } 408 else 409 fBadPixels->InitSize(npixels); 410 } 403 411 404 412 // -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h
r3639 r3696 7 7 8 8 class MRawEvtData; 9 class MBadPixelsPix; 10 class MCalibrationChargeCam; 9 class MExtractedSignalCam; 11 10 class MCalibrationChargePix; 12 11 class MHCalibrationChargePix; … … 15 14 private: 16 15 17 static const Float_t fgNumHiGainSaturationLimit; // The default for fNumHiGainSaturationLimit 18 static const Float_t fgNumLoGainSaturationLimit; // The default for fNumLoGainSaturationLimit 16 static const Float_t fgNumHiGainSaturationLimit; //! The default for fNumHiGainSaturationLimit (now at: 0.01) 17 static const Float_t fgNumLoGainSaturationLimit; //! The default for fNumLoGainSaturationLimit (now at: 0.005) 18 static const Float_t fgTimeLowerLimit; //! Default for fTimeLowerLimit (now set to: 1.) 19 static const Float_t fgTimeUpperLimit; //! Default for fTimeUpperLimit (now set to: 2.) 19 20 20 21 Float_t fNumHiGainSaturationLimit; // Rel. amount sat. higain FADC slices until pixel is called saturated 21 22 Float_t fNumLoGainSaturationLimit; // Rel. amount sat. logain FADC slices until pixel is called saturated 22 23 MRawEvtData *fRawEvt; //! Raw event data 23 Float_t fTimeLowerLimit; // Limit dist. to first signal slice (in units of FADC slices) 24 Float_t fTimeUpperLimit; // Limit dist. to last signal slice (in units of FADC slices) 25 26 MRawEvtData *fRawEvt; //! Raw event data 27 MExtractedSignalCam *fSig; //! Signal Extractor 24 28 25 29 Bool_t SetupHists(const MParList *pList); 26 30 Bool_t ReInitHists(MParList *pList); 27 31 Bool_t FillHists(const MParContainer *par, const Stat_t w=1); 32 33 void FinalizeAbsTimes (MHCalibrationChargePix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad, 34 Byte_t first, Byte_t last); 28 35 Bool_t FinalizeHists(); 29 36 void FinalizeBadPixels(); 30 37 31 void FinalizeHiGainHists(MHCalibrationChargePix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad);32 void FinalizeLoGainHists(MHCalibrationChargePix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad);33 38 34 39 public: … … 39 44 void SetNumLoGainSaturationLimit( const Float_t lim=fgNumLoGainSaturationLimit) { fNumLoGainSaturationLimit = lim; } 40 45 void SetNumHiGainSaturationLimit( const Float_t lim=fgNumHiGainSaturationLimit) { fNumHiGainSaturationLimit = lim; } 46 void SetTimeLowerLimit ( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; } 47 void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; } 41 48 42 49 Float_t GetNumHiGainSaturationLimit() const { return fNumHiGainSaturationLimit; } -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePINDiode.cc
r3670 r3696 52 52 using namespace std; 53 53 54 const Int_t MHCalibrationChargePINDiode::fgChargeNbins = 200; 54 const Axis_t MHCalibrationChargePINDiode::fgAbsTimeFirst = -0.5; 55 const Axis_t MHCalibrationChargePINDiode::fgAbsTimeLast = 29.5; 56 const Int_t MHCalibrationChargePINDiode::fgAbsTimeNbins = 30; 55 57 const Axis_t MHCalibrationChargePINDiode::fgChargeFirst = -0.5; 56 58 const Axis_t MHCalibrationChargePINDiode::fgChargeLast = 199.5; 59 const Int_t MHCalibrationChargePINDiode::fgChargeNbins = 200; 57 60 const Int_t MHCalibrationChargePINDiode::fgRmsChargeNbins = 100; 58 61 const Axis_t MHCalibrationChargePINDiode::fgRmsChargeFirst = 0.; 59 62 const Axis_t MHCalibrationChargePINDiode::fgRmsChargeLast = 100.; 60 const Int_t MHCalibrationChargePINDiode::fgAbsTimeNbins = 30; 61 const Axis_t MHCalibrationChargePINDiode::fgAbsTimeFirst = -0.5; 62 const Axis_t MHCalibrationChargePINDiode::fgAbsTimeLast = 29.5; 63 const Float_t MHCalibrationChargePINDiode::fgTimeLowerLimit = 3.; 64 const Float_t MHCalibrationChargePINDiode::fgTimeUpperLimit = 4.; 63 65 // -------------------------------------------------------------------------- 64 66 // … … 66 68 // 67 69 // Sets: 70 // - the default number for fAbsTimeFirst (fgAbsTimeFirst) 71 // - the default number for fAbsTimeLast (fgAbsTimeLast) 72 // - the default number for fAbsTimeNbins (fgAbsTimeNbins) 68 73 // - the default number for MHGausEvents::fNbins (fgChargeNbins) 69 74 // - the default number for MHGausEvents::fFirst (fgChargeFirst) … … 72 77 // - the default number for fRmsChargeFirst (fgRmsChargeFirst) 73 78 // - the default number for fRmsChargeLast (fgRmsChargeLast) 74 // - the default number for fAbsTimeNbins (fgAbsTimeNbins) 75 // - the default number for fAbsTimeFirst (fgAbsTimeFirst) 76 // - the default number for fAbsTimeLast (fgAbsTimeLast) 79 // - the default number for fTimeLowerLimit (fgTimeLowerLimit) 80 // - the default number for fTimeUpperLimit (fgTimeUpperLimit) 77 81 // 78 82 // - the default name of the fHGausHist ("HCalibrationChargePINDiode") … … 99 103 // 100 104 MHCalibrationChargePINDiode::MHCalibrationChargePINDiode(const char *name, const char *title) 101 : fPINDiode(NULL), f HRmsCharge()105 : fPINDiode(NULL), fSigPIN(NULL), fHRmsCharge() 102 106 { 103 107 … … 105 109 fTitle = title ? title : "Fill the FADC sums of the PINDiode events and perform the fits"; 106 110 111 SetAbsTimeFirst(); 112 SetAbsTimeLast(); 113 SetAbsTimeNbins(); 114 107 115 SetNbins( fgChargeNbins ); 108 116 SetFirst( fgChargeFirst ); … … 113 121 SetRmsChargeLast(); 114 122 115 SetAbsTimeNbins(); 116 SetAbsTimeFirst(); 117 SetAbsTimeLast(); 123 SetTimeLowerLimit(); 124 SetTimeUpperLimit(); 118 125 119 126 fHGausHist.SetName("HCalibrationChargePINDiode"); … … 159 166 // 160 167 // Gets or creates the pointers to: 168 // - MExtractedSignalPINDiode 161 169 // - MCalibrationChargePINDiode 162 170 // … … 164 172 { 165 173 174 fSigPIN = (MExtractedSignalPINDiode*)pList->FindCreateObj("MExtractedSignalPINDiode"); 175 if (!fSigPIN) 176 { 177 *fLog << err << "MExtractedSignalPINDiode not found... aborting " << endl; 178 return kFALSE; 179 } 180 166 181 fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode"); 167 182 if (!fPINDiode) … … 237 252 // - Rms Charge Sigma and Error 238 253 // 254 // Performs one consistency check on the arrival time: 255 // The check returns kFALSE if: 256 // 257 // -The mean arrival time is in fTimeLowerLimit slices from the lower edge 258 // and fUpperLimit slices from the upper edge 259 // 239 260 Bool_t MHCalibrationChargePINDiode::Finalize() 240 261 { … … 262 283 fPINDiode->SetRmsChargeSigma( GetRmsChargeSigma() ); 263 284 fPINDiode->SetRmsChargeSigmaErr( GetRmsChargeSigmaErr() ); 285 286 const Byte_t loweredge = fSigPIN->GetFirstUsedSlice(); 287 const Byte_t upperedge = fSigPIN->GetLastUsedSlice(); 288 const Float_t lowerlimit = (Float_t)loweredge + fTimeLowerLimit; 289 const Float_t upperlimit = (Float_t)upperedge + fTimeUpperLimit; 290 291 if (GetAbsTimeMean() < lowerlimit) 292 { 293 *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in first " << fTimeLowerLimit 294 << " extraction bin in PIN Diode " << endl; 295 *fLog << GetAbsTimeMean() << " " << lowerlimit << endl; 296 return kFALSE; 297 } 298 299 if ( GetAbsTimeMean() > upperlimit ) 300 { 301 *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in last " << fTimeUpperLimit 302 << " two extraction bins in PIN Diode " << endl; 303 *fLog << GetAbsTimeMean() << " " << upperlimit << endl; 304 return kFALSE; 305 } 264 306 265 307 return kTRUE; -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePINDiode.h
r3639 r3696 8 8 9 9 class TH1F; 10 class MExtractedSignalPINDiode; 10 11 class MCalibrationChargePINDiode; 11 12 class MHCalibrationChargePINDiode : public MHCalibrationChargePix … … 13 14 private: 14 15 16 static const Axis_t fgAbsTimeFirst; //! Default for fAbsTimeFirst (now set to: -0.5 ) 17 static const Axis_t fgAbsTimeLast; //! Default for fAbsTimeLast (now set to: 29.5 ) 18 static const Int_t fgAbsTimeNbins; //! Default for fAbsTimeNBins (now set to: 30 ) 15 19 static const Int_t fgChargeNbins; //! Default for fNBins (now set to: 200 ) 16 20 static const Axis_t fgChargeFirst; //! Default for fFirst (now set to: -0.5 ) … … 19 23 static const Axis_t fgRmsChargeFirst; //! Default for fRmsChargeFirst (now set to: 0. ) 20 24 static const Axis_t fgRmsChargeLast; //! Default for fRmsChargeLast (now set to: 100. ) 21 static const Int_t fgAbsTimeNbins; //! Default for fAbsTimeNBins (now set to: 30 ) 22 static const Axis_t fgAbsTimeFirst; //! Default for fAbsTimeFirst (now set to: -0.5 ) 23 static const Axis_t fgAbsTimeLast; //! Default for fAbsTimeLast (now set to: 29.5 ) 25 static const Float_t fgTimeLowerLimit; //! Default for fTimeLowerLimit (now set to: 1.) 26 static const Float_t fgTimeUpperLimit; //! Default for fTimeUpperLimit (now set to: 2.) 27 28 MCalibrationChargePINDiode *fPINDiode; //! Storage container of the results 29 MExtractedSignalPINDiode *fSigPIN; //! Storage container of extracted signal 24 30 25 MCalibrationChargePINDiode *fPINDiode; //! Storage container of the results31 TH1F fHRmsCharge; // Histogram containing Variance of summed FADC slices 26 32 27 TH1F fHRmsCharge; // Histogram containing Variance of summed FADC slices 28 29 Int_t fRmsChargeNbins; // Number of bins used for the fHRmsCharge 30 Axis_t fRmsChargeFirst; // Lower bound bin used for the fHRmsCharge 31 Axis_t fRmsChargeLast; // Upper bound bin used for the fHRmsCharge 32 33 Float_t fRmsChargeMean; // Mean of the Gauss fit 34 Float_t fRmsChargeSigma; // Sigma of the Gauss fit 35 Float_t fRmsChargeMeanErr; // Error of the mean of the Gauss fit 36 Float_t fRmsChargeSigmaErr; // Error of the sigma of the Gauss fit 37 33 Axis_t fRmsChargeFirst; // Lower bound bin used for the fHRmsCharge 34 Axis_t fRmsChargeLast; // Upper bound bin used for the fHRmsCharge 35 Int_t fRmsChargeNbins; // Number of bins used for the fHRmsCharge 36 Float_t fRmsChargeMean; // Mean of the Gauss fit 37 Float_t fRmsChargeMeanErr; // Error of the mean of the Gauss fit 38 Float_t fRmsChargeSigma; // Sigma of the Gauss fit 39 Float_t fRmsChargeSigmaErr; // Error of the sigma of the Gauss fit 40 Float_t fTimeLowerLimit; // Limit dist. to first signal slice (units: FADC slices) 41 Float_t fTimeUpperLimit; // Limit dist. to last signal slice (units: FADC slices) 42 38 43 public: 39 44 … … 44 49 Bool_t ReInit ( MParList *pList); 45 50 Bool_t Fill (const MParContainer *par, const Stat_t w=1); 46 Bool_t Finalize(); 47 48 // Setters 49 void SetAbsTimeNbins(const Int_t bins =fgAbsTimeNbins) { fAbsTimeNbins = bins; } 50 void SetAbsTimeFirst(const Axis_t first=fgAbsTimeFirst) { fAbsTimeFirst = first; } 51 void SetAbsTimeLast( const Axis_t last =fgAbsTimeLast) { fAbsTimeLast = last; } 52 53 void SetRmsChargeNbins(const Int_t bins =fgRmsChargeNbins) { fRmsChargeNbins = bins; } 54 void SetRmsChargeFirst(const Axis_t first=fgRmsChargeFirst) { fRmsChargeFirst = first; } 55 void SetRmsChargeLast( const Axis_t last =fgRmsChargeLast) { fRmsChargeLast = last; } 56 51 Bool_t Finalize (); 52 53 // Draw 54 void Draw(Option_t *opt=""); 55 57 56 // Getters 58 TH1F *GetHRmsCharge() { return &fHRmsCharge; } 59 const TH1F *GetHRmsCharge() const { return &fHRmsCharge; } 60 61 Float_t GetRmsChargeMean() const { return fRmsChargeMean; } 62 Float_t GetRmsChargeMeanErr() const { return fRmsChargeMeanErr; } 63 Float_t GetRmsChargeSigma() const { return fRmsChargeSigma; } 64 Float_t GetRmsChargeSigmaErr() const { return fRmsChargeSigmaErr; } 57 TH1F *GetHRmsCharge() { return &fHRmsCharge; } 58 const TH1F *GetHRmsCharge() const { return &fHRmsCharge; } 59 Float_t GetRmsChargeMean() const { return fRmsChargeMean; } 60 Float_t GetRmsChargeMeanErr() const { return fRmsChargeMeanErr; } 61 Float_t GetRmsChargeSigma() const { return fRmsChargeSigma; } 62 Float_t GetRmsChargeSigmaErr() const { return fRmsChargeSigmaErr; } 65 63 66 64 // Fill histos … … 70 68 Bool_t FitRmsCharge(Option_t *option="RQ0"); 71 69 72 // Draw 73 void Draw(Option_t *opt=""); 74 70 // Setters 71 void SetAbsTimeNbins ( const Int_t bins =fgAbsTimeNbins ) { fAbsTimeNbins = bins; } 72 void SetAbsTimeFirst ( const Axis_t first=fgAbsTimeFirst ) { fAbsTimeFirst = first; } 73 void SetAbsTimeLast ( const Axis_t last =fgAbsTimeLast ) { fAbsTimeLast = last; } 74 void SetRmsChargeNbins ( const Int_t bins =fgRmsChargeNbins ) { fRmsChargeNbins = bins; } 75 void SetRmsChargeFirst ( const Axis_t first=fgRmsChargeFirst ) { fRmsChargeFirst = first; } 76 void SetRmsChargeLast ( const Axis_t last =fgRmsChargeLast ) { fRmsChargeLast = last; } 77 void SetTimeLowerLimit ( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; } 78 void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; } 79 75 80 ClassDef(MHCalibrationChargePINDiode, 1) // Histogram class for Charge PIN Diode Calibration 76 81 };
Note:
See TracChangeset
for help on using the changeset viewer.