Changeset 3792
- Timestamp:
- 04/22/04 09:15:08 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrate.cc
r3751 r3792 18 18 ! Author(s): Javier Lopez 12/2003 <mailto:jlopez@ifae.es> 19 19 ! Author(s): Javier Rico 01/2004 <mailto:jrico@ifae.es> 20 ! Author(s): Markus Gaug 0 2/2004 <mailto:markus@ifae.es>20 ! Author(s): Markus Gaug 04/2004 <mailto:markus@ifae.es> 21 21 ! 22 22 ! Copyright: MAGIC Software Development, 2000-2004 … … 41 41 // kBlindpixel: calibrates using the BlindPixel method 42 42 // kBlindpixel: calibrates using the BlindPixel method 43 // kFlatCharge: perform a charge flat-flatfielding. Outer pixels are area-corrected. 43 44 // kDummy: calibrates with fixed conversion factors of 1 and errors of 0. 44 45 // … … 134 135 } 135 136 136 fQEs = (MCalibrationQECam*)pList->FindObject(AddSerialNumber("MCalibrationQECam")); 137 if (!fQEs) 138 { 139 *fLog << err << AddSerialNumber("MCalibrationQECam") << " not found ... aborting." << endl; 140 return kFALSE; 141 } 142 137 if (fCalibrationMode>kFlatCharge) 138 { 139 fQEs = (MCalibrationQECam*)pList->FindObject(AddSerialNumber("MCalibrationQECam")); 140 if (!fQEs) 141 { 142 *fLog << err << AddSerialNumber("MCalibrationQECam") << " not found ... aborting." << endl; 143 return kFALSE; 144 } 145 } 143 146 } 144 147 … … 179 182 } 180 183 184 185 if (fCalibrationMode == kFlatCharge) 186 { 187 fGeomCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); 188 if (!fGeomCam) 189 { 190 *fLog << err << AddSerialNumber("MGeomCam") << " not found ... aborting." << endl; 191 return kFALSE; 192 } 193 } 194 195 196 197 181 198 switch(fCalibrationMode) 182 199 { … … 194 211 << ": Combined Calibration mode not yet available " << endl; 195 212 return kFALSE; 213 break; 214 case kFlatCharge: 215 *fLog << warn << GetDescriptor() 216 << ": WARNING: Flat-fielding charges - only for Keiichi!!" << endl; 196 217 break; 197 218 case kDummy: … … 246 267 Float_t calibQE = 1.; 247 268 Float_t calibQEVar = 0.; 269 Float_t avMean = 1.; 270 Float_t avMeanRelVar = 0.; 271 272 273 if (fCalibrationMode == kFlatCharge) 274 { 275 MCalibrationChargePix &avpix = (MCalibrationChargePix&)fCalibrations->GetAverageArea(0); 276 avMean = avpix.GetMean(); 277 avMeanRelVar = avpix.GetMeanRelVar(); 278 } 279 248 280 249 281 for (UInt_t pixidx=0; pixidx<npix; pixidx++) … … 252 284 if(fCalibrationMode!=kNone) 253 285 { 254 255 286 256 287 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCalibrations)[pixidx]; 257 MCalibrationQEPix &qe = (MCalibrationQEPix&) (*fQEs )[pixidx]; 258 288 289 hiloconv = pix.GetConversionHiLo (); 290 hiloconverr= pix.GetConversionHiLoErr(); 291 259 292 if (fBadPixels) 260 293 { … … 268 301 calibFFactor = pix.GetMeanFFactorFADC2Phot(); 269 302 270 switch(fCalibrationMode) 271 { 272 case kBlindPixel: 273 if (qe.IsBlindPixelMethodValid()) 274 { 275 calibQE = qe.GetQECascadesBlindPixel ( zenith ); 276 calibQEVar = qe.GetQECascadesBlindPixelVar( zenith ); 277 } 278 else 279 continue; 280 break; 281 case kPinDiode: 282 if (qe.IsPINDiodeMethodValid()) 283 { 284 calibQE = qe.GetQECascadesPINDiode ( zenith ); 285 calibQEVar = qe.GetQECascadesPINDiodeVar( zenith ); 286 } 287 else 288 continue; 289 break; 290 case kFfactor: 291 if (pix.IsFFactorMethodValid()) 292 { 293 calibQE = qe.GetQECascadesFFactor ( zenith ); 294 calibQEVar = qe.GetQECascadesFFactorVar( zenith ); 295 } 296 else 297 continue; 298 break; 299 case kCombined: 300 if (qe.IsCombinedMethodValid()) 301 { 302 calibQE = qe.GetQECascadesCombined ( zenith ); 303 calibQEVar = qe.GetQECascadesCombinedVar( zenith ); 304 } 305 else 306 continue; 307 break; 308 case kDummy: 309 hiloconv = 1.; 310 hiloconverr = 0.; 311 calibQE = 1.; 312 calibQEVar = 0.; 313 break; 314 315 } /* switch calibration mode */ 316 317 hiloconv = pix.GetConversionHiLo (); 318 hiloconverr= pix.GetConversionHiLoErr(); 319 303 if (fCalibrationMode== kFlatCharge) 304 { 305 calibConv = avMean / pix.GetMean() / fGeomCam->GetPixRatio(pixidx) ; 306 calibConvVar = (avMeanRelVar + pix.GetMeanRelVar()) * calibConv * calibConv; 307 calibFFactor = pix.GetRSigmaPerCharge(); 308 } 309 else 310 { 311 312 MCalibrationQEPix &qe = (MCalibrationQEPix&) (*fQEs)[pixidx]; 313 314 switch(fCalibrationMode) 315 { 316 case kBlindPixel: 317 if (qe.IsBlindPixelMethodValid()) 318 { 319 calibQE = qe.GetQECascadesBlindPixel ( zenith ); 320 calibQEVar = qe.GetQECascadesBlindPixelVar( zenith ); 321 } 322 else 323 continue; 324 break; 325 case kPinDiode: 326 if (qe.IsPINDiodeMethodValid()) 327 { 328 calibQE = qe.GetQECascadesPINDiode ( zenith ); 329 calibQEVar = qe.GetQECascadesPINDiodeVar( zenith ); 330 } 331 else 332 continue; 333 break; 334 case kFfactor: 335 if (pix.IsFFactorMethodValid()) 336 { 337 calibQE = qe.GetQECascadesFFactor ( zenith ); 338 calibQEVar = qe.GetQECascadesFFactorVar( zenith ); 339 } 340 else 341 continue; 342 break; 343 case kCombined: 344 if (qe.IsCombinedMethodValid()) 345 { 346 calibQE = qe.GetQECascadesCombined ( zenith ); 347 calibQEVar = qe.GetQECascadesCombinedVar( zenith ); 348 } 349 else 350 continue; 351 break; 352 case kDummy: 353 hiloconv = 1.; 354 hiloconverr = 0.; 355 calibQE = 1.; 356 calibQEVar = 0.; 357 break; 358 359 } /* switch calibration mode */ 360 } /* else fCalibrationMode == kFlatCharge */ 320 361 } /* if(fCalibrationMode!=kNone) */ 321 362 else … … 329 370 calibQEVar = 0.; 330 371 } 372 331 373 MExtractedSignalPix &sig = (*fSignals)[pixidx]; 332 374 … … 354 396 nphotErr = calibFFactor*TMath::Sqrt(nphot); 355 397 398 if (fCalibrationMode == kFlatCharge) 399 nphotErr = calibFFactor * signal; 400 401 356 402 // 357 403 // The following part is the outcommented first version of the error calculation -
trunk/MagicSoft/Mars/mcalib/MCalibrate.h
r3686 r3792 40 40 public: 41 41 42 enum CalibrationMode_t{kNone=0,k BlindPixel,kFfactor,kPinDiode,kCombined, kDummy};42 enum CalibrationMode_t{kNone=0,kFlatCharge=1,kBlindPixel,kFfactor,kPinDiode,kCombined, kDummy}; 43 43 static const CalibrationMode_t kDefault = kBlindPixel; 44 44
Note:
See TracChangeset
for help on using the changeset viewer.