Changeset 3658
- Timestamp:
- 04/05/04 20:11:35 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3655 r3658 25 25 26 26 * mcalib/MCalibrationChargeCalc.[h,cc] 27 * mcalib/MCalibrationChargeCam.cc 27 28 - holds also pointers to MExtractedSignalPINDiode and 28 29 MExtractedSignalBlindPixel and does the checks inside the task -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
r3638 r3658 1039 1039 1040 1040 Float_t flux = pindiode.GetMeanFluxOutsidePlexiglass(); 1041 Float_t fluxerr = pindiode.GetMeanFlux ErrOutsidePlexiglass();1041 Float_t fluxerr = pindiode.GetMeanFluxOutsidePlexiglassErr(); 1042 1042 1043 1043 TIter Next(fPixels); -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.cc
r3656 r3658 24 24 25 25 ///////////////////////////////////////////////////////////////////////////// 26 // // 27 // MCalibrationChargePINDiode // 28 // // 29 // This is the storage container to hold informations about the pedestal // 30 // (offset) value of one Pixel (PMT). // 31 // // 26 // 27 // MCalibrationChargePINDiode 28 // 29 // Storage container of the fit results of the PIN Diode signal 30 // (from MHCalibrationChargePINDiode). The PIN Diode is not yet working, so 31 // is the documentation for the moment. 32 // 32 33 ///////////////////////////////////////////////////////////////////////////// 33 34 #include "MCalibrationChargePINDiode.h" 35 #include "MCalibrationChargePix.h" 34 36 35 37 #include "MLog.h" … … 40 42 using namespace std; 41 43 42 const Float_t MCalibrationChargePINDiode::fgChargeLimit = 3.; 43 const Float_t MCalibrationChargePINDiode::fgChargeErrLimit = 0.; 44 const Float_t MCalibrationChargePINDiode::fgChargeRelErrLimit = 1.; 45 46 const Float_t MCalibrationChargePINDiode::fgConvPhotons = -1.; 47 const Float_t MCalibrationChargePINDiode::fgConvPhotonsErr = -1.; 44 const Float_t MCalibrationChargePINDiode::fgChargeToPhotons = -1.; 45 const Float_t MCalibrationChargePINDiode::fgChargeToPhotonsErr = -1.; 48 46 // 49 47 // Area of Inner Pixel w.r.t. PIN Diode (which is 1 cm2) … … 84 82 // Default Constructor. 85 83 // 84 // Sets: 85 // - fCalibFlags to 0 86 // - fChargeToPhotons to fgChargeToPhotons 87 // - fChargeToPhotonsVar to fgChargeToPhotonsErr*fgChargeToPhotonsErr 88 // 89 // Calls: 90 // - Clear() 91 // 86 92 MCalibrationChargePINDiode::MCalibrationChargePINDiode(const char *name, const char *title) 87 93 : fCalibFlags(0) … … 91 97 fTitle = title ? title : "Container of the fit results of MHCalibrationChargePINDiode"; 92 98 99 SetChargeToPhotons(); 100 SetChargeToPhotonsErr(); 101 93 102 Clear(); 94 103 95 SetChargeLimit();96 SetChargeErrLimit();97 SetChargeRelErrLimit();98 99 SetConvPhotons();100 SetConvPhotonsErr();101 102 SetOscillating ( kFALSE );103 SetExcluded ( kFALSE );104 104 } 105 105 106 106 // ------------------------------------------------------------------------ 107 107 // 108 // Invalidate values 108 // Sets: 109 // - all flags to kFALSE 110 // - all variables to -1. 111 // 112 // Calls: 113 // - MCalibrationPix::Clear() 109 114 // 110 115 void MCalibrationChargePINDiode::Clear(Option_t *o) 111 116 { 112 117 118 SetOscillating ( kFALSE ); 113 119 SetChargeFitValid ( kFALSE ); 114 120 SetTimeFitValid ( kFALSE ); 115 121 116 fPed = -1.; 117 fPedRms = -1.; 118 119 fRmsChargeMean = -1.; 120 fRmsChargeMeanErr = -1.; 121 fRmsChargeSigma = -1.; 122 fRmsChargeSigmaErr = -1.; 123 124 fAbsTimeMean = -1.; 125 fAbsTimeRms = -1.; 126 127 fConvertedPhotons = -1.; 128 fConvertedPhotonsErr = -1.; 129 130 fMeanFluxOutsidePlexiglass = -1.; 131 fMeanFluxErrOutsidePlexiglass = -1.; 132 122 fPed = -1.; 123 fPedRms = -1.; 124 125 fRmsChargeMean = -1.; 126 fRmsChargeMeanErr = -1.; 127 fRmsChargeSigma = -1.; 128 fRmsChargeSigmaErr = -1.; 129 130 fAbsTimeMean = -1.; 131 fAbsTimeRms = -1.; 132 133 fConvPhotons = -1.; 134 fConvPhotonsVar = -1.; 135 136 fMeanFluxOutsidePlexiglass = -1.; 137 fMeanFluxOutsidePlexiglassVar = -1.; 138 139 MCalibrationPix::Clear(); 133 140 } 134 141 … … 158 165 // -------------------------------------------------------------------------- 159 166 // 160 // Set the Excluded Bit from outside167 // Set the ChargeFitValid Bit from outside 161 168 // 162 169 void MCalibrationChargePINDiode::SetChargeFitValid(Bool_t b ) … … 167 174 // -------------------------------------------------------------------------- 168 175 // 169 // Set the Excluded Bit from outside176 // Set the TimeFitValid Bit from outside 170 177 // 171 178 void MCalibrationChargePINDiode::SetTimeFitValid(Bool_t b ) … … 174 181 } 175 182 183 // -------------------------------------------------------------------------- 184 // 185 // Set the FluxOutsidePlexiglassAvailable Bit from outside 186 // 176 187 void MCalibrationChargePINDiode::SetFluxOutsidePlexiglassAvailable (const Bool_t b) 177 188 { 178 b ? SETBIT(fCalibFlags, kFluxOutsidePlexiglassAvailable) : CLRBIT(fCalibFlags, kFluxOutsidePlexiglassAvailable); 179 } 180 189 b ? SETBIT(fCalibFlags, kFluxOutsidePlexiglassAvailable) 190 : CLRBIT(fCalibFlags, kFluxOutsidePlexiglassAvailable); 191 } 192 193 // -------------------------------------------------------------------------- 194 // 195 // Return -1 if fMeanFluxOutsidePlexiglassVar is smaller than 0. 196 // Return square root of fMeanFluxOutsidePlexiglassVar 197 // 198 Float_t MCalibrationChargePINDiode::GetMeanFluxOutsidePlexiglassErr() const 199 { 200 if (fMeanFluxOutsidePlexiglassVar < 0.) 201 return -1.; 202 203 return TMath::Sqrt(fMeanFluxOutsidePlexiglassVar); 204 } 205 206 207 // -------------------------------------------------------------------------- 208 // 209 // Test bit kChargeFitValid 210 // 181 211 Bool_t MCalibrationChargePINDiode::IsChargeFitValid() const 182 212 { … … 184 214 } 185 215 216 // -------------------------------------------------------------------------- 217 // 218 // Test bit kTimeFitValid 219 // 186 220 Bool_t MCalibrationChargePINDiode::IsTimeFitValid() const 187 221 { … … 189 223 } 190 224 225 // -------------------------------------------------------------------------- 226 // 227 // Return kFALSE if IsChargeFitValid() is kFALSE 228 // 229 // Calculate fMeanFluxOutsidePlexiglass with the formula: 230 // - fMeanFluxOutsidePlexiglass = fConvPhotons*gkPINDiodeArea*gkFluxCameravsPINDiode 231 // / gkPINDiodeQE (of the corr. colour) 232 // - fMeanFluxOutsidePlexiglass = fConvPhotons*gkPINDiodeArea*gkFluxCameravsPINDiode 233 // 191 234 Bool_t MCalibrationChargePINDiode::CalcFluxOutsidePlexiglass() 192 235 { … … 196 239 197 240 // Start calculation of number of photons per mm^2 on the camera 198 fMeanFluxOutsidePlexiglass = fConv ertedPhotons * gkPINDiodeArea;241 fMeanFluxOutsidePlexiglass = fConvPhotons * gkPINDiodeArea; 199 242 // Correct for the distance between camera and PIN Diode and for different areas. 200 243 fMeanFluxOutsidePlexiglass *= gkFluxCameravsPINDiode; 201 244 202 245 // Start calculation of number of photons relative Variance (!!) 203 fMeanFlux ErrOutsidePlexiglass = fConvertedPhotonsErr * fConvertedPhotonsErr204 / fConvertedPhotons / fConvertedPhotons;205 fMeanFlux ErrOutsidePlexiglass+= gkFluxCameravsPINDiodeErr*gkFluxCameravsPINDiodeErr246 fMeanFluxOutsidePlexiglassVar = fConvPhotonsVar 247 / ( fConvPhotons * fConvPhotons ) ; 248 fMeanFluxOutsidePlexiglassVar += gkFluxCameravsPINDiodeErr*gkFluxCameravsPINDiodeErr 206 249 / gkFluxCameravsPINDiode/gkFluxCameravsPINDiode; 207 250 … … 210 253 case kGREEN: 211 254 fMeanFluxOutsidePlexiglass /= gkPINDiodeQEGreen; 212 fMeanFlux ErrOutsidePlexiglass+= gkPINDiodeQEGreenErr*gkPINDiodeQEGreenErr255 fMeanFluxOutsidePlexiglassVar += gkPINDiodeQEGreenErr*gkPINDiodeQEGreenErr 213 256 / gkPINDiodeQEGreen/gkPINDiodeQEGreen; 214 257 break; 215 258 case kBLUE: 216 259 fMeanFluxOutsidePlexiglass /= gkPINDiodeQEBlue; 217 fMeanFlux ErrOutsidePlexiglass+= gkPINDiodeQEBlueErr*gkPINDiodeQEBlueErr260 fMeanFluxOutsidePlexiglassVar += gkPINDiodeQEBlueErr*gkPINDiodeQEBlueErr 218 261 / gkPINDiodeQEBlue/gkPINDiodeQEBlue; 219 262 break; 220 263 case kUV: 221 264 fMeanFluxOutsidePlexiglass /= gkPINDiodeQEUV; 222 fMeanFlux ErrOutsidePlexiglass+= gkPINDiodeQEUVErr*gkPINDiodeQEUVErr265 fMeanFluxOutsidePlexiglassVar += gkPINDiodeQEUVErr*gkPINDiodeQEUVErr 223 266 / gkPINDiodeQEUV/gkPINDiodeQEUV; 224 267 break; … … 226 269 default: 227 270 fMeanFluxOutsidePlexiglass /= gkPINDiodeQECT1; 228 fMeanFlux ErrOutsidePlexiglass+= gkPINDiodeQECT1Err*gkPINDiodeQECT1Err271 fMeanFluxOutsidePlexiglassVar += gkPINDiodeQECT1Err*gkPINDiodeQECT1Err 229 272 / gkPINDiodeQECT1/gkPINDiodeQECT1; 230 273 break; … … 239 282 return kFALSE; 240 283 241 if (fMeanFlux ErrOutsidePlexiglass< 0.)284 if (fMeanFluxOutsidePlexiglassVar < 0.) 242 285 return kFALSE; 243 286 244 287 SetFluxOutsidePlexiglassAvailable(); 245 288 246 // Finish calculation of errors -> convert from relative variance to absolute error 247 fMeanFluxErrOutsidePlexiglass = TMath::Sqrt(fMeanFluxErrOutsidePlexiglass); 248 fMeanFluxErrOutsidePlexiglass *= fMeanFluxOutsidePlexiglass; 289 // 290 // Finish calculation of errors -> convert from relative variance to absolute variance 291 // 292 fMeanFluxOutsidePlexiglassVar *= fMeanFluxOutsidePlexiglass*fMeanFluxOutsidePlexiglass; 249 293 250 294 *fLog << inf << " Error on Photon flux [ph/mm^2] outside Plexiglass: " 251 << fMeanFluxErrOutsidePlexiglass<< endl;295 << GetMeanFluxOutsidePlexiglassErr() << endl; 252 296 *fLog << inf << endl; 253 297 254 298 return kTRUE; 255 299 } 256 257 258 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.h
r3656 r3658 10 10 private: 11 11 12 static const Float_t fgChargeLimit; //! Default for fChargeLimit 13 static const Float_t fgChargeErrLimit; //! Default for fChargeErrLimit 14 static const Float_t fgChargeRelErrLimit; //! Default for fChargeRelErrLimit 15 static const Float_t fgConvPhotons; //! Default for fConversionChargePhotons 16 static const Float_t fgConvPhotonsErr; //! Default for fConversionChargePhotonsErr 12 static const Float_t fgChargeToPhotons; //! Default for fChargeToPhotons 13 static const Float_t fgChargeToPhotonsErr; //! Default for fChargeToPhotonsVar 17 14 static const Float_t gkPINDiodeArea; //! PIN Diode Effective Area in mm^2 18 15 static const Float_t gkFluxCameravsPINDiode; //! Flux Conversion PIN Diode - inner pixel … … 34 31 Float_t fChargeErrLimit; // Limit (in units of PedRMS) for acceptance fitted charge sigma 35 32 Float_t fChargeRelErrLimit; // Limit (in units of Error of fitted charge) for acceptance fitted mean 36 Float_t fC onvPhotons;// Mean conv. PIN Diode charge to number of incident photons37 Float_t fC onvPhotonsErr; // Errormean conv. PIN Diode charge to nr. incident photons38 Float_t fConv ertedPhotons;// Number photons incidident on PIN Diode39 Float_t fConv ertedPhotonsErr;// Error on nr. photons incid. on PIN Diode33 Float_t fChargeToPhotons; // Mean conv. PIN Diode charge to number of incident photons 34 Float_t fChargeToPhotonsVar; // Variance of mean conv. PIN Diode charge to nr. incident photons 35 Float_t fConvPhotons; // Number photons incidident on PIN Diode 36 Float_t fConvPhotonsVar; // Error on nr. photons incid. on PIN Diode 40 37 Float_t fMeanFluxOutsidePlexiglass; // Mean number photons in INNER PIXEL outside plexiglass 41 Float_t fMeanFlux ErrOutsidePlexiglass; // Error on nr. photons in INNER PIXEL outside plexiglass38 Float_t fMeanFluxOutsidePlexiglassVar; // Error on nr. photons in INNER PIXEL outside plexiglass 42 39 Float_t fPed; // Mean pedestal (from MPedestalPix) 43 40 Float_t fPedRms; // Pedestal RMS (from MPedestalPix) … … 60 57 61 58 // Setters 62 void SetAbsTimeMean ( const Float_t f ) { fAbsTimeMean = f; } 63 void SetAbsTimeRms ( const Float_t f ) { fAbsTimeRms = f; } 64 void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; } 65 void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; } 66 void SetChargeRelErrLimit( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; } 67 void SetColor ( const PulserColor_t color ) { fColor = color; } 68 void SetConvPhotons ( const Float_t f=fgConvPhotons ) { fConvPhotons = f; } 69 void SetConvPhotonsErr ( const Float_t f=fgConvPhotonsErr ) { fConvPhotonsErr = f; } 70 void SetPedestal ( Float_t ped, Float_t pedrms ); 71 void SetRmsChargeMean ( const Float_t f ) { fRmsChargeMean = f; } 72 void SetRmsChargeMeanErr ( const Float_t f ) { fRmsChargeMeanErr = f; } 73 void SetRmsChargeSigma ( const Float_t f ) { fRmsChargeSigma = f; } 74 void SetRmsChargeSigmaErr( const Float_t f ) { fRmsChargeSigmaErr = f; } 75 void SetOscillating ( const Bool_t b=kTRUE ); 76 void SetChargeFitValid ( const Bool_t b=kTRUE ); 77 void SetTimeFitValid ( const Bool_t b=kTRUE ); 59 void SetAbsTimeMean ( const Float_t f ) { fAbsTimeMean = f; } 60 void SetAbsTimeRms ( const Float_t f ) { fAbsTimeRms = f; } 61 void SetChargeToPhotons ( const Float_t f=fgChargeToPhotons ) { fChargeToPhotons = f; } 62 void SetChargeToPhotonsErr ( const Float_t f=fgChargeToPhotonsErr ) { fChargeToPhotonsVar = f*f; } 63 void SetColor ( const PulserColor_t color ) { fColor = color; } 64 void SetPedestal ( Float_t ped, Float_t pedrms ); 65 void SetRmsChargeMean ( const Float_t f ) { fRmsChargeMean = f; } 66 void SetRmsChargeMeanErr ( const Float_t f ) { fRmsChargeMeanErr = f; } 67 void SetRmsChargeSigma ( const Float_t f ) { fRmsChargeSigma = f; } 68 void SetRmsChargeSigmaErr ( const Float_t f ) { fRmsChargeSigmaErr = f; } 69 void SetOscillating ( const Bool_t b=kTRUE ); 70 void SetChargeFitValid ( const Bool_t b=kTRUE ); 71 void SetTimeFitValid ( const Bool_t b=kTRUE ); 78 72 void SetFluxOutsidePlexiglassAvailable ( const Bool_t b = kTRUE ); 79 73 80 74 // Getters 81 75 Float_t GetMeanFluxOutsidePlexiglass() const { return fMeanFluxOutsidePlexiglass; } 82 Float_t GetMeanFlux ErrOutsidePlexiglass() const { return fMeanFluxErrOutsidePlexiglass; }76 Float_t GetMeanFluxOutsidePlexiglassErr() const; 83 77 84 78 // Pedestals -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
r3654 r3658 108 108 fTitle = title ? title : "Container of the fit results of MHCalibrationChargePixs "; 109 109 110 Clear();111 112 110 // 113 111 // At the moment, we don't have a database, yet, … … 119 117 SetPheFFactorMethodLimit(); 120 118 119 Clear(); 121 120 } 122 121 … … 124 123 // 125 124 // Sets: 126 // - all flags to 0125 // - all flags to kFALSE 127 126 // - all variables to -1. 128 127 //
Note:
See TracChangeset
for help on using the changeset viewer.