Changeset 6318
- Timestamp:
- 02/09/05 19:37:19 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6313 r6318 22 22 23 23 2005/02/09 Abelardo Moralejo 24 25 * manalysis/MMcCalibrationUpdate.cc 26 - Updated to make the MC calibration in phe- work 27 28 * macros/starmc.C 29 - same as above. Now default is calibration in phe- 24 30 25 31 * mraw/MRawEvtHeader.h -
trunk/MagicSoft/Mars/macros/starmc.C
r5819 r6318 52 52 // differences in gain of outer pixels) 53 53 // 54 CalibrationFilename = new TString("/data1/magic/mc_data/root/Period021_0.73_mirror/gammas_nonoise/Gamma_zbin0_*.root"); 54 CalibrationFilename = new TString("/users/emc/moralejo/mcdata/Period021_0.73_mirror/gammas_nonoise/Gamma_zbin0_*.root"); 55 55 56 // File to be used in the calibration (must be a camera file without added noise) 56 57 57 Char_t* AnalysisFilename = "Gamma_zbin*.root"; // File to be analyzed 58 Char_t* AnalysisFilename = "Gamma_*w0.root"; // File to be analyzed 59 // Char_t* AnalysisFilename = "Gamma_*1000to1009*w0.root"; // File to be analyzed 58 60 59 61 … … 72 74 Float_t accepted_fraction = 1.; 73 75 74 Float_t CleanLev[2] = {3., 2.}; // Tail cuts for image analysis 76 Float_t CleanLev[2] = {5.75, 3.84}; // Tail cuts for image analysis 77 MImgCleanStd clean(CleanLev[0], CleanLev[1]); // Applies tail cuts to image. 78 // clean.SetMethod(MImgCleanStd::kScaled); 75 79 76 80 // Int_t BinsHigh[2] = {5, 10}; // First and last FADC bin of the range to be integrated, … … 81 85 // sigextract.SetRange(BinsHigh[0], BinsHigh[1], BinsLow[0], BinsLow[1]); 82 86 83 MExtractFixedWindowPeakSearch sigextract; 84 sigextract.SetWindows(6, 6, 4); 87 // MExtractFixedWindowPeakSearch sigextract; 88 // sigextract.SetWindows(6, 6, 4); 89 90 MExtractTimeAndChargeDigitalFilter sigextract; 91 sigextract.SetNameWeightsFile("/users/emc/moralejo/Mars/msignal/MC_weights.dat"); 92 sigextract.SetNameWeightsFile("/users/emc/moralejo/Mars/msignal/cosmics_weights.dat"); 93 sigextract.SetRange(1, 14, 3, 14); 85 94 86 95 MSrcPosCam src; … … 136 145 MCalibrateData calib; // Transforms signals from ADC counts into photons. 137 146 calib.SetCalibrationMode(MCalibrateData::kFfactor); 147 calib.SetSignalType(MCalibrateData::kPhe); 138 148 139 149 // MBlindPixelCalc blind; 140 150 // blind.SetUseInterpolation(); 141 142 MImgCleanStd clean(CleanLev[0], CleanLev[1]); // Applies tail cuts to image.143 151 144 152 MHillasCalc hcalc; // Calculates Hillas parameters not dependent on source position. … … 223 231 // 224 232 225 MProgressBar bar;226 bar.SetWindowName("Calibrating...");233 // MProgressBar bar; 234 // bar.SetWindowName("Calibrating..."); 227 235 228 236 MEvtLoop evtloop; 229 evtloop.SetProgressBar(&bar);237 // evtloop.SetProgressBar(&bar); 230 238 evtloop.SetParList(&plist); 231 239 … … 261 269 tlist.AddToListBefore(&skip, &sigextract); 262 270 263 bar.SetWindowName("Analyzing...");271 // bar.SetWindowName("Analyzing..."); 264 272 265 273 tlist.RemoveFromList(&mccalibcalc); // Removes calibration task from list. -
trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc
r5977 r6318 30 30 // MMcFadcHeader and translates it to the pedestal mean and rms (in adc counts). 31 31 // If not already existing in the parameter list, an MCalibrationCam object 32 // is created, with the conversion factor between photons and ADC counts is 33 // set to 1 to allow the analysis to proceed. 32 // is created, with the conversion factor between ADC counts and photons or 33 // photoelectrons (depending on fSignalType) is set to 1 to allow the analysis 34 // to proceed. 34 35 // 35 36 // Then it creates and fills also the MPedPhotCam object containing the pedestal 36 // mean and rms in units of photons .37 // mean and rms in units of photons or photoelectrons. 37 38 // 38 39 // Input Containers: … … 71 72 #include "MMcFadcHeader.hxx" 72 73 #include "MMcConfigRunHeader.h" 74 #include "MCalibrateData.h" 73 75 74 76 ClassImp(MMcCalibrationUpdate); … … 85 87 fAmplitudeOuter = -1.; 86 88 fConversionHiLo = -1.; 89 90 fSignalType = MCalibrateData::kPhe; 87 91 88 92 fFillCalibrationCam = kTRUE; … … 221 225 // If MCalibrationChargeCam and MCalibrationQECam already existed 222 226 // in the parameter list before MMcCalibrationUpdate::PreProcess was 223 // executed (from a previous calibration loop) we must not fill it,227 // executed (from a previous calibration loop) we must not fill them, 224 228 // hence nothing else has to be done in ReInit: 225 229 // … … 233 237 // perpendicular to the camera plane. 234 238 // 235 // FIXME! We shouldlook for AddSerialNumber("MMcConfigRunHeader") but239 // FIXME! We look for AddSerialNumber("MMcConfigRunHeader") but 236 240 // for the moment the stereo version of camera does not write one such 237 241 // header per telescope (it should!) … … 254 258 // (at angle = 90 deg) 255 259 256 // Set now the default conversion from ADC counts to "photoelectrons"260 // Set now the default conversion from ADC counts to photoelectrons 257 261 // (in case no previous calibration existed in the parameter list). 258 // As default we want 1 photon = 1 inner pixel ADC count 259 // (this will make Size to be in ADC counts, which is what we want for 260 // the MC calibration loop). To achieve this we set the ADC to 261 // photoelectron conversion equal to the QE, which will later make the 262 // ADC to photon conversion factor (= ADC2PhotEl/QE) to be = 1. 263 // 264 fADC2PhElInner = MCalibrationQEPix::gkDefaultAverageQE; 262 // 263 // As default we want to have SIZE in ADC counts, or rather, in "inner pixel 264 // equivalent ADC counts". 265 // 266 // To achieve this: 267 // - In the case fSignalType==kPhot: we set the ADC to photoelectron conversion 268 // equal to the QE, which will later make the ADC to photon conversion factor 269 // (= ADC2PhotEl/QE) to be = 1, 270 // 271 // - In the case fSignalType==kPhe: we set the ADC to photoelectron conversion 272 // equal to 1, since this will be applied directly to the signals... 273 274 if (fSignalType == MCalibrateData::kPhot) 275 fADC2PhElInner = MCalibrationQEPix::gkDefaultAverageQE; 276 else 277 fADC2PhElInner = 1.; 265 278 266 279 // … … 281 294 282 295 if (fOuterPixelsGainScaling) 283 fADC2PhElOuter = MCalibrationQEPix::gkDefaultAverageQE296 fADC2PhElOuter = fADC2PhElInner 284 297 * (fAmplitude / fAmplitudeOuter); 285 298 else … … 397 410 398 411 Float_t qe = qepix.GetAverageQE(); 399 Float_t adc2phot = calpix.GetMeanConvFADC2Phe() / qe; 412 413 414 Float_t conv = (fSignalType == MCalibrateData::kPhot? 415 calpix.GetMeanConvFADC2Phe() / qe : 416 calpix.GetMeanConvFADC2Phe()); 417 400 418 Float_t hi2lo = calpix.GetConversionHiLo(); 401 419 402 420 if (sigpix.IsLoGainUsed()) 403 pedpix.Set( adc2phot*hi2lo*pedestmean, adc2phot*hi2lo*pedestrms);421 pedpix.Set(conv*hi2lo*pedestmean, conv*hi2lo*pedestrms); 404 422 else 405 pedpix.Set( adc2phot*pedestmean, adc2phot*pedestrms);423 pedpix.Set(conv*pedestmean, conv*pedestrms); 406 424 407 425 } … … 409 427 return kTRUE; 410 428 } 429
Note:
See TracChangeset
for help on using the changeset viewer.