- Timestamp:
- 02/28/04 03:43:14 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3350 r3351 114 114 MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title) 115 115 : fPedestals(NULL), fCam(NULL), 116 fRawEvt(NULL), fRunHeader(NULL), f EvtTime(NULL),116 fRawEvt(NULL), fRunHeader(NULL), fGeom(NULL), fEvtTime(NULL), 117 117 fSignals(NULL), fPINDiode(NULL), fBlindPixel(NULL) 118 118 { … … 239 239 240 240 241 MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam");242 if (! cam)241 fGeom = (MGeomCam*)pList->FindObject("MGeomCam"); 242 if (!fGeom) 243 243 { 244 244 *fLog << err << GetDescriptor() << ": No MGeomCam found... aborting." << endl; … … 246 246 } 247 247 248 fCam->SetGeomCam( cam);248 fCam->SetGeomCam(fGeom); 249 249 250 250 fNumHiGainSamples = fSignals->GetNumUsedHiGainFADCSlices(); … … 252 252 fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples); 253 253 254 UInt_t npixels = cam->GetNumPixels();254 UInt_t npixels = fGeom->GetNumPixels(); 255 255 256 256 for (UInt_t i=0; i<npixels; i++) … … 346 346 // 347 347 Int_t nvalid = 0; 348 Float_t avped = 0; 349 Float_t avprms = 0; 350 Float_t avnum = 0; 348 Float_t avinnerped = 0; 349 Float_t avinnerprms = 0; 350 Float_t avinnernum = 0; 351 Float_t avouterped = 0; 352 Float_t avouterprms = 0; 353 Float_t avouternum = 0; 351 354 for (Int_t pixid=0; pixid<fPedestals->GetSize(); pixid++) 352 355 { … … 367 370 const Float_t num = TMath::Sqrt((Float_t)fPedestals->GetTotalEntries()); 368 371 369 avped += ped; 370 avprms += prms; 371 avnum += num; 372 if (fGeom->GetPixRatio(pixid) == 1.) 373 { 374 avinnerped += ped; 375 avinnerprms += prms; 376 avinnernum += num; 377 } 378 else 379 { 380 avouterped += ped; 381 avouterprms += prms; 382 avouternum += num; 383 } 372 384 // 373 385 // set them in the calibration camera … … 419 431 if (avinnerpix->IsHiGainSaturation()) 420 432 { 421 avinnerpix->SetPedestal(av ped* fNumLoGainSamples,422 av prms* TMath::Sqrt((Float_t)fNumLoGainSamples),423 av prms * fNumLoGainSamples / avnum);433 avinnerpix->SetPedestal(avinnerped/avinnernum * fNumLoGainSamples, 434 avinnerprms/avinnernum * TMath::Sqrt((Float_t)fNumLoGainSamples), 435 avinnerprms/avinnernum * TMath::Sqrt((Float_t)fNumLoGainSamples/avinnernum)); 424 436 avinnerpix->SetNumLoGainSamples((Float_t)fNumLoGainSamples); 425 437 avinnerpix->ApplyLoGainConversion(); … … 427 439 else 428 440 { 429 avinnerpix->SetPedestal(av ped* fNumHiGainSamples,430 av prms* TMath::Sqrt((Float_t)fNumHiGainSamples),431 av prms * fNumHiGainSamples / avnum);441 avinnerpix->SetPedestal(avinnerped/avinnernum * fNumHiGainSamples, 442 avinnerprms/avinnernum * TMath::Sqrt((Float_t)fNumHiGainSamples), 443 avinnerprms/avinnernum * TMath::Sqrt((Float_t)fNumHiGainSamples/avinnernum)); 432 444 } 433 445 434 446 if (avouterpix->IsHiGainSaturation()) 435 447 { 436 avouterpix->SetPedestal(av ped* fNumLoGainSamples,437 avprms* TMath::Sqrt((Float_t)fNumLoGainSamples),438 avprms * fNumLoGainSamples / avnum);448 avouterpix->SetPedestal(avouterped/avouternum * fNumLoGainSamples, 449 avouterprms/avouternum * TMath::Sqrt((Float_t)fNumLoGainSamples), 450 avouterprms/avouternum * TMath::Sqrt((Float_t)fNumLoGainSamples/avouternum)); 439 451 avouterpix->SetNumLoGainSamples((Float_t)fNumLoGainSamples); 440 452 avouterpix->ApplyLoGainConversion(); … … 442 454 else 443 455 { 444 avouterpix->SetPedestal(av ped* fNumHiGainSamples,445 avprms* TMath::Sqrt((Float_t)fNumHiGainSamples),446 avprms * fNumHiGainSamples / avnum);456 avouterpix->SetPedestal(avouterped/avouternum * fNumHiGainSamples, 457 avouterprms/avouternum * TMath::Sqrt((Float_t)fNumHiGainSamples), 458 avouterprms/avouternum * TMath::Sqrt((Float_t)fNumHiGainSamples/avouternum)); 447 459 } 448 460 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r3292 r3351 28 28 class MCalibrationChargeCalc : public MTask 29 29 { 30 31 30 private: 32 31 … … 35 34 MRawEvtData *fRawEvt; //! raw event data (time slices) 36 35 MRawRunHeader *fRunHeader; //! RunHeader information 36 MGeomCam *fGeom; //! Geometry information 37 37 38 38 MTime *fEvtTime; //! Time of the event
Note:
See TracChangeset
for help on using the changeset viewer.