- Timestamp:
- 04/16/04 19:17:36 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3764 r3768 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2004/04/16: Abelardo Moralejo 22 * mcalib/MCalibrationQEPix.[h,cc] 23 - Added fAverageQE. Same role as gkDefaultAverageQE, but can be 24 changed via SetAverageQE. Made public GetAverageQE and 25 GetAverageQERelVar (this changes needed for MC). 26 27 * mcalib/MMcCalibrationCalc.[h,cc] 28 * manalysis/MMcCalibrationUpdate.[h,cc] 29 - Adapted to M. Gaug's changes in calibration classes. Behaviour 30 has been tested to be the same as before those changes. Now the 31 conversion factor from ADC counts to photoelectrons, and the 32 average QE (photons->photoelectrons) are calculated independently 33 (and later combined by MCalibrate to obtain the conversion 34 ADC->photons). 35 36 * mmain/MEventDisplay.cc, macros/mccalibrate.C, starmc.C 37 - Added call to MExtractSignal::SetSaturationLimit(240) Affects 38 only MC display. This was necessary because if electronic noise 39 is simulated in the FADC, sometimes saturated slices look not 40 saturated due to negative fluctuations, so it is better to set 41 the saturation limit at a safe value (240 ADC counts). Changed 42 signal integration range (only for MC), now from slices 5 to 10. 43 44 20 45 2004/04/16: Markus Gaug 21 46 … … 33 58 into the "low-gain samples" and mislead thus sliding window to 34 59 be maximized on the tail of the high-gain pulse. 35 36 60 37 61 2004/04/15: Markus Gaug -
trunk/MagicSoft/Mars/macros/mccalibrate.C
r3744 r3768 46 46 // ------------- user change ----------------- 47 47 TString* CalibrationFilename; 48 CalibrationFilename = new TString(" nonoise/Gamma_zbin0_0*.root");48 CalibrationFilename = new TString("../../gammas_nonoise/Gamma_zbin0_0*.root"); 49 49 // File to be used for the calibration (must be a camera file without added noise) 50 50 … … 54 54 55 55 56 Int_t BinsHigh[2] = {5, 9}; // First and last FADC bin of the range to be integrated,57 Int_t BinsLow[2] = {5, 9}; // for high and low gain respectively.56 Int_t BinsHigh[2] = {5, 10}; // First and last FADC bin of the range to be integrated, 57 Int_t BinsLow[2] = {5, 10}; // for high and low gain respectively. 58 58 59 59 // ------------------------------------------- … … 95 95 96 96 MExtractSignal sigextract; 97 sigextract.SetSaturationLimit(240); 98 97 99 // Define ADC slices to be integrated in high and low gain: 98 100 sigextract.SetRange(BinsHigh[0], BinsHigh[1], BinsLow[0], BinsLow[1]); … … 101 103 102 104 MCalibrate calib; // Transforms signals from ADC counts into photons. 103 calib.SetCalibrationMode(MCalibrate::k Dummy);105 calib.SetCalibrationMode(MCalibrate::kFfactor); 104 106 105 107 // MBlindPixelCalc blind; … … 170 172 } 171 173 172 calib.SetCalibrationMode(MCalibrate::kFfactor);173 174 174 // 175 175 // Second loop: analysis loop -
trunk/MagicSoft/Mars/macros/starmc.C
r3534 r3768 52 52 // differences in gain of outer pixels) 53 53 // 54 CalibrationFilename = new TString(" nonoise/Gamma_zbin0_90_*.root");54 CalibrationFilename = new TString("../../gammas_nonoise/Gamma_zbin0_90_*.root"); 55 55 // File to be used in the calibration (must be a camera file without added noise) 56 56 57 57 Char_t* AnalysisFilename = "Gamma_zbin*.root"; // File to be analyzed 58 58 59 59 60 // ------------- user change ----------------- … … 73 74 Float_t CleanLev[2] = {4., 3.}; // Tail cuts for image analysis 74 75 75 Int_t BinsHigh[2] = {5, 9}; // First and last FADC bin of the range to be integrated,76 Int_t BinsLow[2] = {5, 9}; // for high and low gain respectively.76 Int_t BinsHigh[2] = {5, 10}; // First and last FADC bin of the range to be integrated, 77 Int_t BinsLow[2] = {5, 10}; // for high and low gain respectively. 77 78 78 79 // ------------------------------------------- … … 114 115 115 116 MExtractSignal sigextract; 117 sigextract.SetSaturationLimit(240); 116 118 // Define ADC slices to be integrated in high and low gain: 117 119 sigextract.SetRange(BinsHigh[0], BinsHigh[1], BinsLow[0], BinsLow[1]); … … 120 122 121 123 MCalibrate calib; // Transforms signals from ADC counts into photons. 124 calib.SetCalibrationMode(MCalibrate::kFfactor); 122 125 123 126 // MBlindPixelCalc blind; -
trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc
r3689 r3768 39 39 // MMcFadcHeader 40 40 // MRawRunHeader 41 // [MCalibrationCam] (if it existed previously) 41 // [MCalibrationChargeCam] (if it existed previously) 42 // [MCalibrationQECam] (if it existed previously) 42 43 // 43 44 // Output Containers: 44 45 // MPedPhotCam 45 // [MCalibrationCam] (if it did not exist previously) 46 // [MCalibrationChargeCam] (if it did not exist previously) 47 // [MCalibrationQECam] (if it did not exist previously) 46 48 // 47 49 ///////////////////////////////////////////////////////////////////////////// … … 78 80 fTitle = title ? title : "Write MC pedestals and conversion factors into MCalibration Container"; 79 81 80 fADC2PhInner = 1.; 81 fADC2PhOuter = 1.; 82 // 83 // As default we set 1 photon = 1 ADC count. 84 // (this will make Size to be in ADC counts if no previous calibration has been made) 85 // Hence: 86 // 87 fADC2PhElInner = MCalibrationQEPix::gkDefaultAverageQE; 88 fADC2PhElOuter = MCalibrationQEPix::gkDefaultAverageQE; 82 89 83 90 fAmplitude = -1.; … … 114 121 { 115 122 fCalCam = (MCalibrationChargeCam*) pList->FindObject(AddSerialNumber("MCalibrationChargeCam")); 116 if (!fCalCam) 123 fQECam = (MCalibrationQECam*) pList->FindObject(AddSerialNumber("MCalibrationQECam")); 124 125 if (!fCalCam || !fQECam) 117 126 { 118 127 fCalCam = (MCalibrationChargeCam*) pList->FindCreateObj(AddSerialNumber("MCalibrationChargeCam")); 119 if (!fCalCam) 128 fQECam = (MCalibrationQECam*) pList->FindCreateObj(AddSerialNumber("MCalibrationQECam")); 129 if (!fCalCam || !fQECam) 120 130 return kFALSE; 121 131 } … … 123 133 { 124 134 fFillCalibrationCam = kFALSE; 125 *fLog << inf << AddSerialNumber("MCalibrationChargeCam") << " already exists... " << endl; 126 } 127 128 fQECam = (MCalibrationQECam*) pList->FindObject(AddSerialNumber("MCalibrationQECam")); 129 if (!fQECam) 130 { 131 fQECam = (MCalibrationQECam*) pList->FindCreateObj(AddSerialNumber("MCalibrationQECam")); 132 if (!fQECam) 133 return kFALSE; 134 } 135 else 136 { 137 fFillQECam = kFALSE; 138 *fLog << inf << AddSerialNumber("MCalibrationQECam") << " already exists... " << endl; 139 } 140 135 *fLog << inf << AddSerialNumber("MCalibrationChargeCam") << " and " << 136 AddSerialNumber("MCalibrationQECam") << " already exist... " << endl; 137 } 141 138 142 139 fPedPhotCam = (MPedPhotCam*) pList->FindCreateObj(AddSerialNumber("MPedPhotCam")); … … 246 243 247 244 if (fOuterPixelsGainScaling) 248 fADC2Ph Outer = fADC2PhInner * (fAmplitude / fAmplitudeOuter);245 fADC2PhElOuter = fADC2PhElInner * (fAmplitude / fAmplitudeOuter); 249 246 else 250 fADC2Ph Outer = fADC2PhInner;247 fADC2PhElOuter = fADC2PhElInner; 251 248 252 249 … … 272 269 // and outer pixels). 273 270 // 274 Float_t adc2phot = (fGeom->GetPixRatio(i) < fGeom->GetPixRatio(0))? 275 fADC2PhOuter : fADC2PhInner; 276 277 // 278 // FIXME: This has now to be split into a adc2phe part and a phe2phot (==QE) part 279 // 280 const Float_t qe = MCalibrationQEPix::gkDefaultAverageQE; 281 calpix.SetMeanConvFADC2Phe(adc2phot*qe); // here, the FADC to phe part should go. 271 Float_t adc2photel = (fGeom->GetPixRatio(i) < fGeom->GetPixRatio(0))? 272 fADC2PhElOuter : fADC2PhElInner; 273 274 calpix.SetMeanConvFADC2Phe(adc2photel); 282 275 calpix.SetMeanConvFADC2PheVar(0.); 283 276 calpix.SetMeanFFactorFADC2Phot(0.); … … 334 327 335 328 MCalibrationChargePix &calpix = (MCalibrationChargePix&)(*fCalCam)[i]; 336 // MCalibrationQEPix &qepix = (MCalibrationQEPix&) (*fQECam) [i]; 337 338 Float_t qe = MCalibrationQEPix::gkDefaultAverageQE; 329 MCalibrationQEPix &qepix = (MCalibrationQEPix&)(*fQECam)[i]; 330 331 qepix.SetAvNormFFactor(1.); 332 // This factor should convert the default average QE to average QE for a spectrum 333 // like that of Cherenkov light. See the documentration of MCalibrationQEPix. 334 335 Float_t qe = qepix.GetAverageQE(); 339 336 Float_t adc2phot = calpix.GetMeanConvFADC2Phe() / qe; 340 337 Float_t hi2lo = calpix.GetConversionHiLo(); -
trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h
r3689 r3768 28 28 MExtractedSignalCam *fSignalCam; 29 29 30 Float_t fADC2Ph Inner; // Conversion factor from ADC counts to photo-electrons31 Float_t fADC2Ph Outer; // for inner and outer pixels.30 Float_t fADC2PhElInner; // Conversion factor from ADC counts to photo-electrons 31 Float_t fADC2PhElOuter; // for inner and outer pixels. 32 32 33 33 Bool_t fFillCalibrationCam; 34 Bool_t fFillQECam;35 34 Bool_t fOuterPixelsGainScaling; 36 35 -
trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc
r3759 r3768 177 177 fQEFFactorVar ( MCalibrationCam::gkNumPulserColors ), 178 178 fQEPINDiode ( MCalibrationCam::gkNumPulserColors ), 179 fQEPINDiodeVar ( MCalibrationCam::gkNumPulserColors ), 179 fQEPINDiodeVar ( MCalibrationCam::gkNumPulserColors ), 180 fAverageQE ( gkDefaultAverageQE ), 180 181 fValidFlags ( MCalibrationCam::gkNumPulserColors ) 181 182 { … … 368 369 const Float_t MCalibrationQEPix::GetAverageQE( const Float_t zenith ) const 369 370 { 370 return gkDefaultAverageQE ; 371 // return gkDefaultAverageQE ; 372 return fAverageQE; 371 373 } 372 374 -
trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h
r3755 r3768 48 48 Float_t fAvNormPINDiode; // Normalization w.r.t. default QE (PIN Diode Method) 49 49 Float_t fAvNormPINDiodeVar; // Variance norm. w.r.t. def. QE (PIN Diode Method) 50 50 Float_t fAverageQE; // Average QE for Cascade spectrum (default 0.18) 51 51 52 TArrayC fValidFlags; // Bit-field for valid flags, one array entry for each color 52 53 Byte_t fAvailableFlags; // Bit-field for available flags … … 62 63 void AddAveragePINDiodeQEs ( const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw ); 63 64 64 const Float_t GetAverageQE ( const Float_t zenith=0. ) const;65 const Float_t GetAverageQERelVar( const Float_t zenith=0. ) const;66 67 65 const Float_t GetAvNormBlindPixelRelVar() const; 68 66 const Float_t GetAvNormCombinedRelVar() const; … … 81 79 82 80 // Getters 81 82 const Float_t GetAverageQE ( const Float_t zenith=0. ) const; 83 const Float_t GetAverageQERelVar( const Float_t zenith=0. ) const; 84 83 85 Float_t GetDefaultQE ( const MCalibrationCam::PulserColor_t col ) const; 84 86 Float_t GetDefaultQERelVar ( const MCalibrationCam::PulserColor_t col ) const; … … 122 124 123 125 // Setters 126 void SetAverageQE ( const Float_t f ) { fAverageQE = f; } 124 127 void SetAvNormBlindPixel ( const Float_t f ) { fAvNormBlindPixel = f; } 125 128 void SetAvNormBlindPixelVar ( const Float_t f ) { fAvNormBlindPixelVar = f; } -
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 } -
trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.h
r3687 r3768 27 27 MMcFadcHeader *fHeaderFadc; 28 28 29 Float_t fADC2Phot; 29 Float_t fADC2PhotEl; // Conversion factor (photel / ADC count) 30 Float_t fPhot2PhotEl; // Conversion factor (photons / photoelectron) = average QE 30 31 Long_t fEvents; 31 32 -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r3753 r3768 265 265 266 266 MExtractSignal* extra = new MExtractSignal(); 267 extra->SetRange(5, 9, 5, 9); 267 extra->SetRange(5, 10, 5, 10); 268 extra->SetSaturationLimit(240); 268 269 269 270 MMcCalibrationUpdate* mcupd = new MMcCalibrationUpdate; … … 271 272 272 273 MCalibrate* mccal = new MCalibrate; 273 mccal->SetCalibrationMode(MCalibrate::k Dummy);274 mccal->SetCalibrationMode(MCalibrate::kFfactor); 274 275 275 276 // MC
Note:
See TracChangeset
for help on using the changeset viewer.