Changeset 3768 for trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc
- Timestamp:
- 04/16/04 19:17:36 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc
r3688 r3768 35 35 // 36 36 // Output Containers: 37 // (containers mus exist already, they are filled with new values). 37 38 // MCalibrationChargeCam 39 // MCalibrationQECam 38 40 // 39 41 ///////////////////////////////////////////////////////////////////////////// … … 69 71 { 70 72 fName = name ? name : "MMcCalibrationCalc"; 71 fTitle = title ? title : "Calculate and write conversion factors into MCalibrationC am Container";72 73 fHistRatio = new TH1F(AddSerialNumber("HistRatio"), "log10(fP assPhotCone/fSize)", 1500, -3., 3.);74 fHistRatio->SetXTitle("log_{10}(fP assPhotCone / fSize) [phot/ADC count]");73 fTitle = title ? title : "Calculate and write conversion factors into MCalibrationChargeCam and MCalibrationQECam containers"; 74 75 fHistRatio = new TH1F(AddSerialNumber("HistRatio"), "log10(fPhotElfromShower/fSize)", 1500, -3., 3.); 76 fHistRatio->SetXTitle("log_{10}(fPhotElfromShower / fSize) [photel/ADC count]"); 75 77 } 76 78 … … 100 102 { 101 103 fHistRatio->Reset(); 102 fADC2Phot = 0; 104 fADC2PhotEl = 0; 105 fPhot2PhotEl = 0; 103 106 104 107 fCalCam = (MCalibrationChargeCam*) pList->FindObject(AddSerialNumber("MCalibrationChargeCam")); … … 204 207 // FIXME? The present cut (1000 "inner-pixel-counts") is somehow 205 208 // arbitrary. Might it be optimized? 206 // 207 if (fHillas->GetSize()<1000) 209 // 210 211 const Float_t size = fHillas->GetSize(); 212 // Size will at this point be in ADC counts (still uncalibrated) 213 214 if (size < 1000) 208 215 return kTRUE; 209 216 210 fADC2Phot += fMcEvt->GetPassPhotCone()/fHillas->GetSize(); 211 212 fHistRatio->Fill(TMath::Log10(fMcEvt->GetPassPhotCone()/fHillas->GetSize())); 217 fPhot2PhotEl += (Float_t) fMcEvt->GetPhotElfromShower() / 218 (Float_t) fMcEvt->GetPassPhotCone(); 219 220 fHistRatio->Fill(TMath::Log10(fMcEvt->GetPhotElfromShower()/size)); 213 221 214 222 return kTRUE; … … 228 236 } 229 237 230 fADC2Phot /= n; 231 232 // 233 // For the calibration we no longer use the mean, 234 // but the peak of the distribution: 238 fPhot2PhotEl /= n; // Average quantum efficiency 239 240 // 241 // Find peak of log10(photel/Size) histogram: 235 242 // 236 243 const Int_t reach = 2; 237 238 244 Stat_t summax = 0; 239 245 Int_t mode = 0; 240 241 // FIXME: Is this necessary? We could use GetMaximumBin instead..242 246 for (Int_t ibin = 1+reach; ibin <= fHistRatio->GetNbinsX()-reach; ibin++) 243 247 { … … 251 255 } 252 256 253 fADC2Phot = TMath::Power(10, fHistRatio->GetBinCenter(mode));257 fADC2PhotEl = TMath::Power(10, fHistRatio->GetBinCenter(mode)); 254 258 255 259 const Int_t num = fCalCam->GetSize(); … … 257 261 for (int i=0; i<num; i++) 258 262 { 259 260 263 MCalibrationChargePix &calpix = (MCalibrationChargePix&)(*fCalCam)[i]; 261 // MCalibrationQEPix &qepix = (MCalibrationQEPix&) (*fQECam) [i]; 262 263 const Float_t qe = MCalibrationQEPix::gkDefaultAverageQE; 264 const Float_t factor = fADC2Phot/qe*calpix.GetMeanConvFADC2Phe(); 265 // 266 // FIXME: Now, only the conversion to PHe is stored, need also the quantum efficiency simulated!!! 267 // 264 MCalibrationQEPix &qepix = (MCalibrationQEPix&) (*fQECam) [i]; 265 266 qepix.SetAverageQE(fPhot2PhotEl); 267 268 qepix.SetAvNormFFactor(1.); 269 // This factor should convert the default average QE for different colors to 270 // average QE for a spectrum like that of Cherenkov light (see the documentration 271 // of MCalibrationQEPix). 272 // Here we obtain average QE using already a Cherenkov spectrum so AvNormFFacto 273 // must be 1. 274 275 276 Float_t factor = fADC2PhotEl; 277 278 // 279 // We take into account the (possibly) different gain of outer pixels: 280 // 281 if (fGeom->GetPixRatio(i) < 1.) 282 factor *= fHeaderFadc->GetAmplitud()/fHeaderFadc->GetAmplitudOuter(); 283 268 284 calpix.SetMeanConvFADC2Phe(factor); 269 285 calpix.SetMeanConvFADC2PheVar(0.); 286 270 287 calpix.SetMeanFFactorFADC2Phot(0.); 271 288 }
Note:
See TracChangeset
for help on using the changeset viewer.