Changeset 4291 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 06/14/04 14:23:25 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc
r3831 r4291 70 70 #include "MMcRunHeader.hxx" 71 71 #include "MMcFadcHeader.hxx" 72 #include "MMcConfigRunHeader.h" 72 73 73 74 ClassImp(MMcCalibrationUpdate); … … 80 81 fTitle = title ? title : "Write MC pedestals and conversion factors into MCalibration Container"; 81 82 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;89 83 90 84 fAmplitude = -1.; … … 224 218 } 225 219 226 227 228 // 229 // If MCalibrationCam already existed in the parameter list before 230 // MMcCalibrationUpdate::PreProcess was executed (from a 231 // previous calibration loop) we must not fill it, hence nothing 232 // else has to be done in ReInit: 220 // 221 // If MCalibrationChargeCam and MCalibrationQECam already existed 222 // in the parameter list before MMcCalibrationUpdate::PreProcess was 223 // executed (from a previous calibration loop) we must not fill it, 224 // hence nothing else has to be done in ReInit: 233 225 // 234 226 if (!fFillCalibrationCam) 235 227 return kTRUE; 228 229 // Now check the light collection for inner and outer pixels to 230 // calculate the ratio between the two. FIXME! Light collection 231 // depends on the incidence angle of the light w.r.t. the camera 232 // plane. For the moment we take the ratio for light impinging 233 // perpendicular to the camera plane. 234 // 235 // FIXME! We should look for AddSerialNumber("MMcConfigRunHeader") but 236 // for the moment the stereo version of camera does not write one such 237 // header per telescope (it should!) 238 // 239 MMcConfigRunHeader* mcconfig = (MMcConfigRunHeader*) pList->FindObject("MMcConfigRunHeader"); 240 if (!mcconfig) 241 { 242 *fLog << err << "MMcConfigRunHeader" << " not found... aborting." << endl; 243 return kFALSE; 244 } 245 TArrayF innerlightcoll = mcconfig->GetLightCollectionFactor(); 246 TArrayF outerlightcoll = mcconfig->GetLightCollectionFactorOuter(); 247 248 // In principle outer pixels seem to have a different average light 249 // collection efficiency than outer ones. We set here the factor between 250 // the two. 251 252 fOuterPixelsLightCollection = outerlightcoll[90] / innerlightcoll[90]; 253 // (at angle = 90 deg) 254 255 // Set now the conversion from ADC counts to photoelectrons (in case 256 // no previous calibration existed in the parameter list). 257 // As default we want 1 photon = 1 inner pixel ADC count 258 // (this will make Size to be in ADC counts which is what we want for 259 // the MC calibration loop. To achieve this we set the ADC to 260 // photoelectron conversion equal to the QE, which will later make the 261 // ADC to photon conversion factor to be = 1. 262 // 263 fADC2PhElInner = MCalibrationQEPix::gkDefaultAverageQE; 236 264 237 265 // … … 240 268 // inner and outer pixels, (fOuterPixelsGainScaling = kFALSE), 241 269 // which may be useful for display purposes. 270 // If we apply the factor, we must take into account the different 271 // gain photoelectrons->ADC counts, and also apply the correct QE 272 // (see comment above) for the outer pixels through the factor 273 // fOuterPixelsLightCollection. 242 274 // 243 275 244 276 if (fOuterPixelsGainScaling) 245 fADC2PhElOuter = fADC2PhElInner * (fAmplitude / fAmplitudeOuter); 277 fADC2PhElOuter = MCalibrationQEPix::gkDefaultAverageQE 278 * fOuterPixelsLightCollection 279 * (fAmplitude / fAmplitudeOuter); 246 280 else 247 281 fADC2PhElOuter = fADC2PhElInner; 248 282 249 283 250 const int num = fCalCam->GetSize();284 Int_t num = fCalCam->GetSize(); 251 285 252 286 fCalCam->SetFFactorMethodValid ( kTRUE ); … … 256 290 fQECam->SetPINDiodeMethodValid ( kTRUE ); 257 291 258 for ( int i=0; i<num; i++)292 for (Int_t i=0; i<num; i++) 259 293 { 260 294 MCalibrationChargePix &calpix = (MCalibrationChargePix&)(*fCalCam)[i]; … … 274 308 calpix.SetMeanConvFADC2Phe(adc2photel); 275 309 calpix.SetMeanConvFADC2PheVar(0.); 276 calpix.SetMeanFFactorFADC2Phot(0.); 277 278 } 279 310 calpix.SetMeanFFactorFADC2Phot(0.); // Not used for now. 311 312 } 313 314 // 315 // Now set the average QE for each type of pixels. Correct outer pixels 316 // by different light collection efficiency. 317 // 318 num = fQECam->GetSize(); 319 for (Int_t i=0; i<num; i++) 320 { 321 MCalibrationQEPix &qepix = (MCalibrationQEPix&)(*fQECam)[i]; 322 Float_t avqe = 323 (fGeom->GetPixRatio(i) < fGeom->GetPixRatio(0))? 324 MCalibrationQEPix::gkDefaultAverageQE*fOuterPixelsLightCollection: 325 MCalibrationQEPix::gkDefaultAverageQE; 326 327 qepix.SetAverageQE(avqe); 328 } 280 329 281 330 return kTRUE; … … 289 338 Int_t MMcCalibrationUpdate::Process() 290 339 { 291 const int num = fCalCam->GetSize();292 293 for ( int i=0; i<num; i++)340 const Int_t num = fCalCam->GetSize(); 341 342 for (Int_t i=0; i<num; i++) 294 343 { 295 344 MExtractedSignalPix &sigpix = (*fSignalCam)[i]; … … 330 379 331 380 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. 381 // This factor should convert the default average QE to average QE 382 // for a spectrum like that of Cherenkov light. See the documentation 383 // of MCalibrationQEPix. Here it is 1 because we calibrate using 384 // Cherenkov light. 334 385 335 386 Float_t qe = qepix.GetAverageQE(); -
trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h
r3768 r4291 38 38 Float_t fConversionHiLo; // Ratio of high to low gain. 39 39 40 Float_t fOuterPixelsLightCollection; 41 // Photon collection efficiency of outer pixels w.r.t. inner ones. 42 40 43 public: 41 44 MMcCalibrationUpdate(const char *name=NULL, const char *title=NULL);
Note:
See TracChangeset
for help on using the changeset viewer.