Changeset 3642 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 04/04/04 17:50:30 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.cc
r3617 r3642 85 85 // 86 86 MCalibrationChargePINDiode::MCalibrationChargePINDiode(const char *name, const char *title) 87 : f Flags(0)87 : fCalibFlags(0) 88 88 { 89 89 … … 112 112 { 113 113 114 115 116 117 114 SetChargeFitValid ( kFALSE ); 115 SetTimeFitValid ( kFALSE ); 116 SetMeanTimeInFirstBin ( kFALSE ); 117 SetMeanTimeInLastBin ( kFALSE ); 118 118 119 fMeanCharge = -1.;120 fMeanChargeErr = -1.;121 fSigmaCharge = -1.;122 fSigmaChargeErr = -1.;123 fChargeProb = -1.;124 119 fPed = -1.; 125 120 fPedRms = -1.; … … 163 158 void MCalibrationChargePINDiode::SetOscillating( const Bool_t b) 164 159 { 165 b ? SETBIT(fFlags,kOscillating) : CLRBIT(fFlags,kOscillating); 166 } 167 168 // -------------------------------------------------------------------------- 169 // 170 // Set the Excluded Bit from outside 171 // 172 void MCalibrationChargePINDiode::SetExcluded(Bool_t b ) 173 { 174 b ? SETBIT(fFlags, kExcluded) : CLRBIT(fFlags, kExcluded); 160 b ? SETBIT(fCalibFlags,kOscillating) : CLRBIT(fCalibFlags,kOscillating); 175 161 } 176 162 … … 182 168 void MCalibrationChargePINDiode::SetExcludeQualityCheck(Bool_t b ) 183 169 { 184 b ? SETBIT(f Flags, kExcludeQualityCheck) : CLRBIT(fFlags, kExcludeQualityCheck);170 b ? SETBIT(fCalibFlags, kExcludeQualityCheck) : CLRBIT(fCalibFlags, kExcludeQualityCheck); 185 171 } 186 172 … … 191 177 void MCalibrationChargePINDiode::SetChargeFitValid(Bool_t b ) 192 178 { 193 b ? SETBIT(f Flags, kChargeFitValid) : CLRBIT(fFlags, kChargeFitValid);179 b ? SETBIT(fCalibFlags, kChargeFitValid) : CLRBIT(fCalibFlags, kChargeFitValid); 194 180 } 195 181 … … 200 186 void MCalibrationChargePINDiode::SetTimeFitValid(Bool_t b ) 201 187 { 202 b ? SETBIT(f Flags, kTimeFitValid) : CLRBIT(fFlags, kTimeFitValid);188 b ? SETBIT(fCalibFlags, kTimeFitValid) : CLRBIT(fCalibFlags, kTimeFitValid); 203 189 } 204 190 205 191 void MCalibrationChargePINDiode::SetFluxOutsidePlexiglassAvailable (const Bool_t b) 206 192 { 207 b ? SETBIT(f Flags, kFluxOutsidePlexiglassAvailable) : CLRBIT(fFlags, kFluxOutsidePlexiglassAvailable);193 b ? SETBIT(fCalibFlags, kFluxOutsidePlexiglassAvailable) : CLRBIT(fCalibFlags, kFluxOutsidePlexiglassAvailable); 208 194 } 209 195 210 196 void MCalibrationChargePINDiode::SetMeanTimeInFirstBin(const Bool_t b) 211 197 { 212 b ? SETBIT(f Flags,kMeanTimeInFirstBin) : CLRBIT(fFlags,kMeanTimeInFirstBin);198 b ? SETBIT(fCalibFlags,kMeanTimeInFirstBin) : CLRBIT(fCalibFlags,kMeanTimeInFirstBin); 213 199 } 214 200 215 201 void MCalibrationChargePINDiode::SetMeanTimeInLastBin(const Bool_t b) 216 202 { 217 b ? SETBIT(f Flags,kMeanTimeInLastBin) : CLRBIT(fFlags,kMeanTimeInLastBin);203 b ? SETBIT(fCalibFlags,kMeanTimeInLastBin) : CLRBIT(fCalibFlags,kMeanTimeInLastBin); 218 204 } 219 205 220 206 Bool_t MCalibrationChargePINDiode::IsMeanTimeInFirstBin() const 221 207 { 222 return TESTBIT(f Flags,kMeanTimeInFirstBin);208 return TESTBIT(fCalibFlags,kMeanTimeInFirstBin); 223 209 } 224 210 225 211 Bool_t MCalibrationChargePINDiode::IsMeanTimeInLastBin() const 226 212 { 227 return TESTBIT(fFlags,kMeanTimeInLastBin); 228 } 229 230 Bool_t MCalibrationChargePINDiode::IsExcluded() const 231 { 232 return TESTBIT(fFlags,kExcluded); 213 return TESTBIT(fCalibFlags,kMeanTimeInLastBin); 233 214 } 234 215 235 216 Bool_t MCalibrationChargePINDiode::IsChargeFitValid() const 236 217 { 237 return TESTBIT(f Flags, kChargeFitValid);218 return TESTBIT(fCalibFlags, kChargeFitValid); 238 219 } 239 220 240 221 Bool_t MCalibrationChargePINDiode::IsTimeFitValid() const 241 222 { 242 return TESTBIT(f Flags, kTimeFitValid);223 return TESTBIT(fCalibFlags, kTimeFitValid); 243 224 } 244 225 … … 255 236 256 237 257 if ( fMeanCharge< fChargeLimit*GetPedRms())238 if (GetMean() < fChargeLimit*GetPedRms()) 258 239 { 259 240 *fLog << warn << "WARNING: Fitted Charge is smaller than " … … 262 243 } 263 244 264 if ( fMeanChargeErr< fChargeErrLimit)245 if (GetMeanErr() < fChargeErrLimit) 265 246 { 266 247 *fLog << warn << "WARNING: Error of Fitted Charge is smaller than " … … 269 250 } 270 251 271 if ( fMeanCharge < fChargeRelErrLimit*fMeanChargeErr)252 if (GetMean() < fChargeRelErrLimit*GetMeanErr()) 272 253 { 273 254 *fLog << warn << "WARNING: Fitted Charge is smaller than " … … 276 257 } 277 258 278 if ( fSigmaCharge< GetPedRms())259 if (GetSigma() < GetPedRms()) 279 260 { 280 261 *fLog << warn << "WARNING: Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl; -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.h
r3617 r3642 2 2 #define MARS_MCalibrationChargePINDiode 3 3 4 #ifndef MARS_M ParContainer5 #include "M ParContainer.h"4 #ifndef MARS_MCalibrationPix 5 #include "MCalibrationPix.h" 6 6 #endif 7 7 8 class MCalibrationChargePINDiode : public M ParContainer8 class MCalibrationChargePINDiode : public MCalibrationPix 9 9 { 10 10 private: … … 42 42 Float_t fPedRms; // The pedestal RMS (from MPedestalPix) 43 43 44 Float_t fMeanCharge; // The mean charge after the fit45 Float_t fMeanChargeErr; // The error of mean charge after the fit46 Float_t fSigmaCharge; // The sigma of the mean charge after the fit47 Float_t fSigmaChargeErr; // The error of the sigma of the mean charge after the fit48 Float_t fChargeProb; // The probability of the fit function49 50 44 Float_t fRmsChargeMean; 51 45 Float_t fRmsChargeMeanErr; … … 53 47 Float_t fRmsChargeSigmaErr; 54 48 55 Byte_t f Flags; // Flag for the set Bits49 Byte_t fCalibFlags; // Flag for the set Bits 56 50 57 51 Float_t fAbsTimeMean; … … 69 63 PulserColor_t fColor; 70 64 71 enum { kExclude d, kExcludeQualityCheck, kOscillating,65 enum { kExcludeQualityCheck, kOscillating, 72 66 kChargeFitValid, kTimeFitValid, 73 67 kMeanTimeInFirstBin, kMeanTimeInLastBin, … … 83 77 // Setters 84 78 void SetColor( const PulserColor_t color ) { fColor = color; } 85 86 void SetMeanCharge ( const Float_t f ) { fMeanCharge = f; }87 void SetMeanChargeErr ( const Float_t f ) { fMeanChargeErr = f; }88 void SetSigmaCharge ( const Float_t f ) { fSigmaCharge = f; }89 void SetSigmaChargeErr ( const Float_t f ) { fSigmaChargeErr = f; }90 79 91 80 void SetRmsChargeMean ( const Float_t f ) { fRmsChargeMean = f; } … … 107 96 108 97 void SetOscillating ( const Bool_t b=kTRUE); 109 void SetExcluded ( const Bool_t b = kTRUE );110 98 void SetExcludeQualityCheck( const Bool_t b = kTRUE ); 111 99 void SetChargeFitValid ( const Bool_t b = kTRUE ); … … 118 106 119 107 // Getters 120 Float_t GetMeanCharge() const { return fMeanCharge; }121 Float_t GetMeanChargeErr() const { return fMeanChargeErr; }122 Float_t GetSigmaCharge() const { return fSigmaCharge; }123 Float_t GetSigmaChargeErr() const { return fSigmaChargeErr; }124 Float_t GetChargeProb() const { return fChargeProb; }125 126 108 Float_t GetMeanFluxOutsidePlexiglass() const { return fMeanFluxOutsidePlexiglass; } 127 109 Float_t GetMeanFluxErrOutsidePlexiglass() const { return fMeanFluxErrOutsidePlexiglass; } … … 132 114 133 115 134 Bool_t IsExcluded() const;135 116 Bool_t IsChargeFitValid() const; 136 117 Bool_t IsTimeFitValid() const; -
trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc
r3636 r3642 702 702 } 703 703 704 hist.Renorm(); 704 705 // 705 706 // 4) Check for oscillations -
trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimeCam.cc
r3639 r3642 232 232 "Relative Arrival Times average sector "); 233 233 234 InitHists(GetAverageHiGainSector(j),fCam->GetAverageBadSector(j),j); 235 234 236 GetAverageHiGainSector(j).GetHGausHist()->SetTitle("Relative Arrival Times average Sector "); 235 237 GetAverageHiGainSector(j).SetNbins(fAverageNbins); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimePix.cc
r3639 r3642 31 31 // pixel number 1 (hardware index: 2). Times are taken from MArrivalTimePix 32 32 // 33 // Results are re-normalized to a value per time (ns) with the formulae: 34 // 35 // - Mean Rel. Time = Mean Rel. Time * fFADCSliceWidth 36 // - Mean Rel. Time Error = Mean Rel. Time Error * fFADCSliceWidth 37 // - Sigma Rel. Time = Sigma Rel. Time * fFADCSliceWidth 38 // - Sigma Rel. Time Error = Sigma Rel. Time Error * fFADCSliceWidth 39 // 33 40 ////////////////////////////////////////////////////////////////////////////// 34 41 #include "MHCalibrationRelTimePix.h" … … 43 50 const Axis_t MHCalibrationRelTimePix::fgRelTimeFirst = -13.; 44 51 const Axis_t MHCalibrationRelTimePix::fgRelTimeLast = 13.; 52 const Float_t MHCalibrationRelTimePix::fgFADCSliceWidth = 3.3333; 45 53 // -------------------------------------------------------------------------- 46 54 // … … 56 64 // - the default x-axis title for fHGausHist ("FADC Slice") 57 65 // - the default y-axis title for fHGausHist ("Nr. of events") 58 // 59 // Executes: 60 // - MHGausEvents::Clear() 66 // 67 // - the default number for fFADCSliceWidth (fgFADCSliceWidth) 61 68 // 62 69 MHCalibrationRelTimePix::MHCalibrationRelTimePix(const char *name, const char *title) … … 69 76 SetFirst ( fgRelTimeFirst ); 70 77 SetLast ( fgRelTimeLast ); 78 SetFADCSliceWidth(); 71 79 72 80 // Create a large number of bins, later we will rebin … … 75 83 fHGausHist.SetXTitle("FADC Slice"); 76 84 fHGausHist.SetYTitle("Nr. of events"); 77 78 Clear();79 85 80 86 } … … 89 95 } 90 96 97 // -------------------------------------------------------------------------- 98 // 99 // If mean and sigma have not yet been set, returns. 100 // 101 // Results are re-normalized to a value per time (ns) with the formulae: 102 // 103 // - Mean Rel. Time = Mean Rel. Time * fFADCSliceWidth 104 // - Mean Rel. Time Error = Mean Rel. Time Error * fFADCSliceWidth 105 // - Sigma Rel. Time = Sigma Rel. Time * fFADCSliceWidth 106 // - Sigma Rel. Time Error = Sigma Rel. Time Error * fFADCSliceWidth 107 // 108 void MHCalibrationRelTimePix::Renorm() 109 { 91 110 111 if (fMean == fMeanErr == fSigma == fSigmaErr == 0.) 112 return; 113 114 fMean *= fFADCSliceWidth; 115 fMeanErr *= fFADCSliceWidth; 116 fSigma *= fFADCSliceWidth; 117 fSigmaErr*= fFADCSliceWidth; 118 119 }
Note:
See TracChangeset
for help on using the changeset viewer.