- Timestamp:
- 02/28/04 02:38:54 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3312 r3350 345 345 // loop over the pedestal events and check if we have calibration 346 346 // 347 Int_t nvalid = 0; 348 for (UInt_t pixid=0; pixid<fPedestals->GetSize(); pixid++) 347 Int_t nvalid = 0; 348 Float_t avped = 0; 349 Float_t avprms = 0; 350 Float_t avnum = 0; 351 for (Int_t pixid=0; pixid<fPedestals->GetSize(); pixid++) 349 352 { 350 353 … … 364 367 const Float_t num = TMath::Sqrt((Float_t)fPedestals->GetTotalEntries()); 365 368 369 avped += ped; 370 avprms += prms; 371 avnum += num; 366 372 // 367 373 // set them in the calibration camera … … 394 400 } 395 401 402 403 396 404 // 397 405 // The Michele check ... … … 404 412 } 405 413 414 MCalibrationChargePix *avinnerpix = fCam->GetAverageInnerPix(); 415 MCalibrationChargePix *avouterpix = fCam->GetAverageOuterPix(); 416 // 417 // set the pedestans in the calibration camera 418 // 419 if (avinnerpix->IsHiGainSaturation()) 420 { 421 avinnerpix->SetPedestal(avped * fNumLoGainSamples, 422 avprms * TMath::Sqrt((Float_t)fNumLoGainSamples), 423 avprms * fNumLoGainSamples / avnum); 424 avinnerpix->SetNumLoGainSamples((Float_t)fNumLoGainSamples); 425 avinnerpix->ApplyLoGainConversion(); 426 } 427 else 428 { 429 avinnerpix->SetPedestal(avped * fNumHiGainSamples, 430 avprms * TMath::Sqrt((Float_t)fNumHiGainSamples), 431 avprms * fNumHiGainSamples / avnum); 432 } 433 434 if (avouterpix->IsHiGainSaturation()) 435 { 436 avouterpix->SetPedestal(avped * fNumLoGainSamples, 437 avprms * TMath::Sqrt((Float_t)fNumLoGainSamples), 438 avprms * fNumLoGainSamples / avnum); 439 avouterpix->SetNumLoGainSamples((Float_t)fNumLoGainSamples); 440 avouterpix->ApplyLoGainConversion(); 441 } 442 else 443 { 444 avouterpix->SetPedestal(avped * fNumHiGainSamples, 445 avprms * TMath::Sqrt((Float_t)fNumHiGainSamples), 446 avprms * fNumHiGainSamples / avnum); 447 } 448 449 if (!avinnerpix->CheckChargeValidity() || !avinnerpix->CheckTimeValidity()) 450 if (!avinnerpix->CalcReducedSigma()) 451 avinnerpix->CalcFFactorMethod(); 452 453 if (!avouterpix->CheckChargeValidity() || !avouterpix->CheckTimeValidity()) 454 if (!avouterpix->CalcReducedSigma()) 455 avouterpix->CalcFFactorMethod(); 456 457 406 458 if (!fBlindPixel->CheckChargeFitValidity()) 407 459 { -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
r3319 r3350 159 159 fTitle = title ? title : "Storage container for the Calibration Information in the camera"; 160 160 161 fPixels = new TClonesArray("MCalibrationChargePix",1); 161 fPixels = new TClonesArray("MCalibrationChargePix",1); 162 fAverageInnerPix = new MCalibrationChargePix("AverageInnerPix","Container of the fit results of the camera average inner pixels"); 163 fAverageOuterPix = new MCalibrationChargePix("AverageOuterPix","Container of the fit results of the camera average outer pixels"); 162 164 163 165 Clear(); … … 178 180 // 179 181 delete fPixels; 180 182 delete fAverageInnerPix; 183 delete fAverageOuterPix; 184 181 185 if (fOffsets) 182 186 delete fOffsets; … … 199 203 { 200 204 201 //202 // check if we have already initialized to size203 //204 if (CheckBounds(i))205 return;206 207 205 fPixels->ExpandCreate(i); 208 206 … … 221 219 } 222 220 221 223 222 // -------------------------------------------------------------------------- 224 223 // 225 // Check if position i is inside the current bounds of the TClonesArray 226 // 227 Bool_t MCalibrationChargeCam::CheckBounds(Int_t i) const 228 { 229 return i < GetSize(); 230 } 231 224 // Get i-th pixel (pixel number) 225 // 226 MCalibrationChargePix &MCalibrationChargeCam::operator[](UInt_t i) 227 { 228 return *static_cast<MCalibrationChargePix*>(fPixels->UncheckedAt(i)); 229 } 232 230 233 231 // -------------------------------------------------------------------------- … … 235 233 // Get i-th pixel (pixel number) 236 234 // 237 MCalibrationChargePix &MCalibrationChargeCam::operator[](UInt_t i) 235 const MCalibrationChargePix &MCalibrationChargeCam::operator[](UInt_t i) const 238 236 { 239 237 return *static_cast<MCalibrationChargePix*>(fPixels->UncheckedAt(i)); 240 238 } 241 239 242 // --------------------------------------------------------------------------243 //244 // Get i-th pixel (pixel number)245 //246 const MCalibrationChargePix &MCalibrationChargeCam::operator[](UInt_t i) const247 {248 return *static_cast<MCalibrationChargePix*>(fPixels->UncheckedAt(i));249 }250 251 240 252 241 // -------------------------------------- … … 256 245 257 246 fPixels->ForEach(TObject, Clear)(); 247 fAverageInnerPix->Clear(); 248 fAverageOuterPix->Clear(); 258 249 259 250 fNumExcludedPixels = 0; … … 385 376 } 386 377 *fLog << all << id << " Excluded pixels " << endl; 378 *fLog << endl; 379 *fLog << all << "Average Inner Pix: " 380 << ": Ped. Rms: " << fAverageInnerPix->GetPedRms() << " +- " << fAverageInnerPix->GetPedRmsErr() 381 << " Mean signal: " << fAverageInnerPix->GetMeanCharge() << " +- " << fAverageInnerPix->GetSigmaCharge() 382 << " Reduced Sigma: " << fAverageInnerPix->GetRSigmaCharge() 383 << " Nr Phe's: " << fAverageInnerPix->GetPheFFactorMethod() 384 << endl; 385 *fLog << all << "Average Outer Pix: " 386 << ": Ped. Rms: " << fAverageOuterPix->GetPedRms() << " +- " << fAverageOuterPix->GetPedRmsErr() 387 << " Mean signal: " << fAverageOuterPix->GetMeanCharge() << " +- " << fAverageOuterPix->GetSigmaCharge() 388 << " Reduced Sigma: " << fAverageOuterPix->GetRSigmaCharge() 389 << " Nr Phe's: " << fAverageOuterPix->GetPheFFactorMethod() 390 << endl; 391 387 392 } 388 393 … … 755 760 void MCalibrationChargeCam::DrawPixelContent(Int_t idx) const 756 761 { 757 (*this)[idx].DrawClone(); 762 if (idx == -1) 763 fAverageInnerPix->DrawClone(); 764 if (idx == -2) 765 fAverageOuterPix->DrawClone(); 766 767 (*this)[idx].DrawClone(); 758 768 } 759 769 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h
r3313 r3350 22 22 Int_t fNumPixels; 23 23 TClonesArray *fPixels; //-> Array of MCalibrationPix with fit results 24 MCalibrationChargePix *fAverageInnerPix; //-> Average Pixel of all events 25 MCalibrationChargePix *fAverageOuterPix; //-> Average Pixel of all events 24 26 25 27 const MCalibrationChargeBlindPix *fBlindPixel; //! Pointer to the Blind Pixel with fit results … … 73 75 MCalibrationChargePix &operator[](UInt_t i); 74 76 const MCalibrationChargePix &operator[](UInt_t i) const; 75 76 Bool_t CheckBounds(Int_t i) const; 77 78 MCalibrationChargePix *GetAverageInnerPix() { return fAverageInnerPix; } 79 const MCalibrationChargePix *GetAverageInnerPix() const { return fAverageInnerPix; } 80 81 MCalibrationChargePix *GetAverageOuterPix() { return fAverageOuterPix; } 82 const MCalibrationChargePix *GetAverageOuterPix() const { return fAverageOuterPix; } 77 83 78 84 // Prints
Note:
See TracChangeset
for help on using the changeset viewer.