Changeset 2627 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 12/09/03 18:25:21 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 6 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r2581 r2627 69 69 #pragma link C++ class MCalibrationCalc+; 70 70 71 #pragma link C++ class MExtractedSignalCam+; 72 #pragma link C++ class MExtractedSignalPix+; 73 #pragma link C++ class MExtractSignal+; 74 71 75 72 76 #endif -
trunk/MagicSoft/Mars/manalysis/MCalibrationBlindPix.h
r2603 r2627 48 48 Float_t GetErrSigma1() const { return fErrSigma1; } 49 49 50 Float_t GetTime() 51 Float_t GetErrTime() 50 Float_t GetTime() const { return fTime; } 51 Float_t GetErrTime() const { return fErrTime; } 52 52 53 Bool_t FillCharge( Int_t q){ return fHist->FillBlindPixelCharge(q); }54 Bool_t FillTime(Int_t t) 53 Bool_t FillCharge(Float_t q) { return fHist->FillBlindPixelCharge(q); } 54 Bool_t FillTime(Int_t t) { return fHist->FillBlindPixelTime(t); } 55 55 Bool_t FillRChargevsTime(Float_t rq, Int_t t) { return fHist->FillBlindPixelChargevsN(rq,t); } 56 56 57 Bool_t IsValid() 57 Bool_t IsValid() { return fLambda > 0. || fErrLambda > 0.; } 58 58 59 59 Bool_t FitCharge(); -
trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.cc
r2603 r2627 53 53 // Every MCalibrationPix holds a histogram class, // 54 54 // MHCalibrationPixel which itself hold histograms of type: // 55 // HCharge(npix) (distribution of summed FADC time slice entries) //56 // HTime(npix) (distribution of position of maximum) //57 // HChargevsN(npix) (distribution of charges vs. event number. //58 // //59 // PostProcess: All histograms HCharge(npix) are fitted to a Gaussian //60 // All histograms HTime(npix) are fitted to a Gaussian //61 // The histogram HBlindPixelCharge (blind pixel) is fitted to a single //62 // PhE fit //63 // The histogram HBlindPixelTime (blind pixel) is fitted to a Gaussian //64 // The histograms of the PIN Diode are fitted to Gaussians //65 // //66 // Fits can be excluded via the commands: //67 // MalibrationCam::SetSkipTimeFits() (skip all time fits) //68 // MalibrationCam::SetSkipBlindPixelFits() (skip all blind pixel fits) //69 // MalibrationCam::SetSkipPinDiodeFits() (skip all PIN Diode fits) //70 // //55 // HCharge(npix) (distribution of summed FADC time slice entries) 56 // HTime(npix) (distribution of position of maximum) 57 // HChargevsN(npix) (distribution of charges vs. event number. 58 // 59 // PostProcess: All histograms HCharge(npix) are fitted to a Gaussian 60 // All histograms HTime(npix) are fitted to a Gaussian 61 // The histogram HBlindPixelCharge (blind pixel) is fitted to a single 62 // PhE fit 63 // The histogram HBlindPixelTime (blind pixel) is fitted to a Gaussian 64 // The histograms of the PIN Diode are fitted to Gaussians 65 // 66 // Fits can be excluded via the commands: 67 // MalibrationCam::SetSkipTimeFits() (skip all time fits) 68 // MalibrationCam::SetSkipBlindPixelFits() (skip all blind pixel fits) 69 // MalibrationCam::SetSkipPinDiodeFits() (skip all PIN Diode fits) 70 // 71 71 ////////////////////////////////////////////////////////////////////////////// 72 72 … … 169 169 case kEBlue: 170 170 fCalibrations->SetColor(MCalibrationCam::kECBlue); 171 171 break; 172 172 case kEGreen: 173 173 fCalibrations->SetColor(MCalibrationCam::kECGreen); 174 174 break; 175 175 case kEUV: 176 176 fCalibrations->SetColor(MCalibrationCam::kECUV); 177 break; 178 case kECT1: 179 fCalibrations->SetColor(MCalibrationCam::kECCT1); 180 break; 181 default: 182 fCalibrations->SetColor(MCalibrationCam::kECCT1); 177 183 } 178 179 180 184 181 185 fPedestals = (MPedestalCam*)pList->FindObject("MPedestalCam"); … … 185 189 return kFALSE; 186 190 } 187 188 191 189 192 return kTRUE; … … 245 248 MRawEvtPixelIter pixel(fRawEvt); 246 249 250 // 247 251 // Create a first loop to sort out the cosmics ... 248 252 // … … 266 270 Float_t pedrms = ped.GetPedestalRms(); 267 271 268 if ((float)sum < ( pedes*fNumHiGainSamples)+(1.5*pedrms) )272 if ((float)sum < ((pedes*fNumHiGainSamples)+(30.*pedrms)) ) 269 273 cosmicpix++; 270 274 } … … 274 278 { 275 279 fCosmics++; 276 return k TRUE;280 return kCONTINUE; 277 281 } 278 282 279 283 pixel.Reset(); 280 284 285 // 286 // Create a second loop to do fill the calibration histograms 287 // 288 281 289 while (pixel.Next()) 282 290 { 283 291 284 292 UShort_t sat = 0; 285 UShort_t lowgainoverflow = 0;286 293 287 294 const Int_t pixid = pixel.GetPixelId(); 288 295 289 Byte_t *ptr = pixel.GetHiGainSamples();290 296 Byte_t mid = pixel.GetIdxMaxHiGainSample(); 291 297 UInt_t max = pixel.GetMaxHiGainSample(); 292 298 293 Int_t sum = (max > gkSaturationLimit // overflow ? 294 ? sat++, pixel.GetSumLoGainSamples() // take Low Gain 295 : pixel.GetSumHiGainSamples()); // no overflow 296 297 if (sat) 298 { 299 300 ptr = pixel.GetLoGainSamples(); 301 max = pixel.GetMaxLoGainSample(); 302 mid = pixel.GetIdxMaxLoGainSample(); 303 304 // 305 // FIXME: It seems the conversion HiGain LoGain is already 306 // performed in the data?!? 307 // 308 sum = (max > gkSaturationLimit // overflow of LoGain ??? -> GimmeABreak!!! 309 ? lowgainoverflow++, gkLoGainOverFlow // OUCH (Florian was maybe right) 310 : sum*gkConversionHiLo ); // OUFF (Florian was wrong) !! 311 // : sum ); 312 313 if (lowgainoverflow) 314 { 315 *fLog << err << dbginf << "Warning: Saturation of LoGain reached in pixel: " << pixid << " " 316 << " sum = " << sum << endl; 317 fHistOverFlow++; 318 } 319 } 320 321 MPedestalPix &ped = (*fPedestals)[pixid]; 322 MCalibrationPix &pix = (*fCalibrations)[pixid]; 323 299 MPedestalPix &ped = (*fPedestals)[pixid]; 300 MCalibrationPix &pix = (*fCalibrations)[pixid]; 301 324 302 Float_t pedes = ped.GetPedestal(); 325 Float_t pedrms = ped.GetPedestalRms();326 303 Float_t sum; 304 327 305 // 328 306 // FIXME: This is preliminary, we will change to pedestals per slice!!! 329 307 // Assume pedestals per time slice ==> multiply with number of slices 330 308 // 331 pedes *= (sat ? fNumLoGainSamples : fNumHiGainSamples ); 332 pedrms *= (sat ? fNumLoGainSamples : fNumHiGainSamples ); 333 334 Float_t rsum = (float)sum - pedes; 335 309 310 if (max < gkSaturationLimit) // take Hi Gain 311 { 312 sum = (float)pixel.GetSumHiGainSamples() - pedes*fNumHiGainSamples; 313 } 314 else // Lo Gain 315 { 316 317 sat++; 318 pix.SetHiGainSaturation(); 319 320 sum = (float)pixel.GetSumLoGainSamples() - pedes*fNumLoGainSamples ; 321 sum *= gkConversionHiLo; 322 323 max = pixel.GetMaxLoGainSample(); 324 mid = pixel.GetIdxMaxLoGainSample(); 325 326 if (max > gkSaturationLimit) 327 { 328 *fLog << err << dbginf 329 << "Warning: Saturation of Lo Gain reached in pixel: " 330 << pixid << " " << " sum = " << sum << endl; 331 fHistOverFlow++; 332 } 333 334 } 335 336 336 switch(pixid) 337 337 { … … 339 339 case gkCalibrationBlindPixelId: 340 340 341 //342 // FIXME: This works only when the blind pixel ID is much larger than343 // the rest of the pixels (which is the case right now)344 //345 341 if (!blindpixel.FillCharge(sum)) 346 342 *fLog << warn << … … 351 347 "Overflow or Underflow occurred filling Blind Pixel time = " << (int)mid << endl; 352 348 353 if (!blindpixel.FillRChargevsTime( rsum,fEvents))349 if (!blindpixel.FillRChargevsTime(sum,fEvents)) 354 350 *fLog << warn << 355 351 "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl; … … 362 358 *fLog << warn << 363 359 "Overflow or Underflow occurred filling HTime: time = " << (int)mid << endl; 364 if (!pindiode.FillRChargevsTime( rsum,fEvents))360 if (!pindiode.FillRChargevsTime(sum,fEvents)) 365 361 *fLog << warn << 366 362 "Overflow or Underflow occurred filling HChargevsN: eventnr = " << fEvents << endl; … … 368 364 default: 369 365 370 if (!pix.FillCharge(sum)) 371 *fLog << warn << "Could not fill Charge of pixel: " << pixid 372 << " signal = " << sum << endl; 373 374 // 375 // Fill the reduced charge into the control histo for better visibility 376 // 377 if (!pix.FillRChargevsTime(rsum,fEvents)) 378 *fLog << warn << "Could not fill red. Charge vs. EvtNr of pixel: " << pixid 379 << " signal = " << rsum << " event Nr: " << fEvents << endl; 380 381 382 if (!pix.FillTime((int)mid)) 383 *fLog << warn << "Could not fill Time of pixel: " << pixid << " time = " << (int)mid << endl; 384 385 366 if (sat) 367 { 368 369 if (!pix.FillChargeLoGain(sum)) 370 *fLog << warn << "Could not fill Lo Gain Charge of pixel: " << pixid 371 << " signal = " << sum << endl; 372 373 if (!pix.FillTimeLoGain((int)mid)) 374 *fLog << warn << "Could not fill Lo Gain Time of pixel: " 375 << pixid << " time = " << (int)mid << endl; 376 377 // 378 // Fill the reduced charge into the control histo for better visibility 379 // 380 if (!pix.FillRChargevsTimeLoGain(sum,fEvents)) 381 *fLog << warn << "Could not fill Lo Gain Charge vs. EvtNr of pixel: " 382 << pixid << " signal = " << sum << " event Nr: " << fEvents << endl; 383 384 } 385 else 386 { 387 if (!pix.FillChargeHiGain(sum)) 388 *fLog << warn << "Could not fill Hi Gain Charge of pixel: " << pixid 389 << " signal = " << sum << endl; 390 391 if (!pix.FillTimeHiGain((int)mid)) 392 *fLog << warn << "Could not fill Hi Gain Time of pixel: " 393 << pixid << " time = " << (int)mid << endl; 394 395 if (!pix.FillRChargevsTimeHiGain(sum,fEvents)) 396 *fLog << warn << "Could not fill Hi Gain Charge vs. EvtNr of pixel: " 397 << pixid << " signal = " << sum << " event Nr: " << fEvents << endl; 398 } 399 386 400 } /* switch(pixid) */ 387 401 … … 396 410 *fLog << inf << endl; 397 411 *fLog << GetDescriptor() << " Cut Histogram Edges" << endl; 412 398 413 // 399 414 // Cut edges to make fits and viewing of the hists easier … … 414 429 { 415 430 if (blindpixel.FitCharge()) 416 if (!fCalibrations->CalcNrPhotInnerPixel()) 417 *fLog << err << dbginf << "Could not calculate Number of photons from the blind pixel " << endl; 431 { 432 if (!fCalibrations->CalcNrPhotInnerPixel()) 433 *fLog << err << dbginf << "Could not calculate Number of photons from the blind pixel " << endl; 434 } 418 435 else 419 *fLog << err << dbginf << "Could not fit the blind pixel " << endl; 420 436 { 437 *fLog << err << dbginf << "Could not fit the blind pixel " << endl; 438 } 439 421 440 if (!blindpixel.FitTime()) 422 441 *fLog << warn << "Could not the Times of the blind pixel " << endl; -
trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.h
r2603 r2627 54 54 public: 55 55 56 enum PulserColor_t { kEGreen, kEBlue, kEUV };56 enum PulserColor_t { kEGreen, kEBlue, kEUV, kECT1 }; 57 57 58 58 private: -
trunk/MagicSoft/Mars/manalysis/MCalibrationCam.cc
r2603 r2627 57 57 MCalibrationCam::MCalibrationCam(const char *name, const char *title) 58 58 : fMeanNrPhotAvailable(kFALSE), 59 fMeanNrPhotInnerPix(-1.) 59 fMeanNrPhotInnerPix(-1.), 60 fMeanNrPhotInnerPixErr(-1.) 60 61 { 61 62 fName = name ? name : "MCalibrationCam"; … … 153 154 Bool_t MCalibrationCam::IsPixelFitted(Int_t idx) const 154 155 { 155 return ((*this)[idx].Get RCharge() > 0. && (*this)[idx].GetErrRCharge() > 0.);156 return ((*this)[idx].GetCharge() > 0. && (*this)[idx].GetErrCharge() > 0.); 156 157 } 157 158 … … 359 360 int id = 0; 360 361 362 *fLog << "Succesfully calibrated pixels:" << endl; 363 *fLog << endl; 364 361 365 TIter Next(fPixels); 362 366 MCalibrationPix *pix; … … 364 368 { 365 369 366 *fLog << id << " Pedestals: " << pix->GetPed() << " +- " << pix->GetPedRms() << " Charge: " 367 << pix->GetCharge() << " Reduced Charge: " << pix->GetRCharge() << " +- " 368 << pix->GetSigmaCharge() << " Reduced Sigma: " << pix->GetRSigma() << endl; 369 370 id++; 371 } 370 if (pix->GetCharge() >= 0.) 371 { 372 *fLog << pix->GetPixId() << " Pedestals: " << pix->GetPed() << " +- " << pix->GetPedRms() 373 << " Reduced Charge: " << pix->GetCharge() << " +- " 374 << pix->GetSigmaCharge() << " Reduced Sigma: " << pix->GetRSigma() << endl; 375 id++; 376 } 377 } 378 379 *fLog << id << " succesful pixels :-))" << endl; 380 id = 0; 381 382 *fLog << endl; 383 *fLog << "Pixels with errors:" << endl; 384 *fLog << endl; 385 386 TIter Next2(fPixels); 387 while ((pix=(MCalibrationPix*)Next2())) 388 { 389 390 if (pix->GetCharge() == -1.) 391 { 392 *fLog << pix->GetPixId() << " Pedestals: " << pix->GetPed() << " +- " << pix->GetPedRms() 393 << " Reduced Charge: " << pix->GetCharge() << " +- " 394 << pix->GetSigmaCharge() << " Reduced Sigma: " << pix->GetRSigma() << endl; 395 id++; 396 } 397 } 398 *fLog << id << " pixels with errors :-((" << endl; 399 372 400 } 373 401 … … 379 407 { 380 408 case 0: 381 382 409 val = (*this)[idx].GetCharge(); 410 break; 383 411 case 1: 384 385 412 val = (*this)[idx].GetErrCharge(); 413 break; 386 414 case 2: 387 388 415 val = (*this)[idx].GetSigmaCharge(); 416 break; 389 417 case 3: 390 391 418 val = (*this)[idx].GetErrSigmaCharge(); 419 break; 392 420 case 4: 393 394 421 val = (*this)[idx].GetChargeProb(); 422 break; 395 423 case 5: 396 397 424 val = (*this)[idx].GetTime(); 425 break; 398 426 case 6: 399 400 427 val = (*this)[idx].GetSigmaTime(); 428 break; 401 429 case 7: 402 403 430 val = (*this)[idx].GetTimeProb(); 431 break; 404 432 case 8: 405 406 433 val = (*this)[idx].GetPed(); 434 break; 407 435 case 9: 408 409 436 val = (*this)[idx].GetPedRms(); 437 break; 410 438 case 10: 411 val = (*this)[idx].GetR Charge();439 val = (*this)[idx].GetRSigma(); 412 440 break; 413 441 case 11: 414 val = (*this)[idx].Get RSigma();442 val = (*this)[idx].GetPheFFactorMethod(); 415 443 break; 416 444 case 12: 417 val = (*this)[idx].Get PheFFactorMethod();445 val = (*this)[idx].GetConversionFFactorMethod(); 418 446 break; 419 447 case 13: 420 val = (*this)[idx].GetConversionFFactorMethod(); 448 if (idx < 397) 449 val = (double)fMeanNrPhotInnerPix; 450 else 451 val = (double)fMeanNrPhotInnerPix*gkCalibrationOuterPixelArea; 421 452 break; 422 453 case 14: 423 val = (double)fMeanNrPhotInnerPix; 424 break; 425 case 15: 426 if ((fMeanNrPhotInnerPix > 0. ) && ((*this)[idx].GetRCharge() > 100.)) 427 val = fMeanNrPhotInnerPix / (*this)[idx].GetRCharge(); 428 else 429 val = -1.; 454 if ((fMeanNrPhotInnerPix > 0. ) && ((*this)[idx].GetCharge() != -1.)) 455 { 456 if (idx < 397) 457 val = fMeanNrPhotInnerPix / (*this)[idx].GetCharge(); 458 else 459 val = fMeanNrPhotInnerPix*gkCalibrationOuterPixelArea / (*this)[idx].GetCharge(); 460 } 461 else 462 { 463 val = -1.; 464 } 430 465 break; 431 466 default: … … 467 502 / gkCalibrationBlindPixelArea; 468 503 break; 504 case kECCT1: 505 default: 506 fMeanNrPhotInnerPix = (mean / gkCalibrationBlindPixelQECT1 ) 507 *TMath::Power(10,gkCalibrationBlindPixelAttCT1) 508 / gkCalibrationBlindPixelArea; 509 break; 469 510 } 470 511 … … 474 515 475 516 476 477 Bool_t MCalibrationCam::GetConversionFactor(Int_t ipx, Float_t &mean, Float_t &err) 517 Bool_t MCalibrationCam::GetConversionFactorBlindPixel(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma) 478 518 { 479 519 … … 485 525 return kFALSE; 486 526 487 mean = fMeanNrPhotInnerPix / (*this)[ipx].Get RCharge();527 mean = fMeanNrPhotInnerPix / (*this)[ipx].GetCharge(); 488 528 489 529 // 490 530 // Not yet ready , sorry 491 531 // 492 err = 100000000000.; 532 err = -1.; 533 sigma = -1.; 493 534 494 535 return kTRUE; 495 536 } 537 538 539 Bool_t MCalibrationCam::GetConversionFactorFFactor(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma) 540 { 541 542 if (ipx < 0 || !IsPixelFitted(ipx)) 543 return kFALSE; 544 545 Float_t conv = (*this)[ipx].GetConversionFFactorMethod(); 546 547 if (conv < 0.) 548 return kFALSE; 549 550 mean = conv; 551 552 // 553 // Not yet ready , sorry 554 // 555 err = -1.; 556 sigma = -1.; 557 558 return kTRUE; 559 } -
trunk/MagicSoft/Mars/manalysis/MCalibrationCam.h
r2603 r2627 38 38 MCalibrationPINDiode *fPINDiode; //! containing PIN Diode data with fit results 39 39 40 Bool_t fMeanNrPhotAvailable; 40 41 Float_t fMeanNrPhotInnerPix; // The mean number of photons in an inner pixel 41 42 Float_t fMeanNrPhotInnerPixErr; // The uncertainty about the number of photons in an inner pixel 42 Bool_t fMeanNrPhotAvailable;43 43 44 44 public: 45 45 46 enum CalibrationColor_t { kECGreen, kECBlue, kECUV };46 enum CalibrationColor_t { kECGreen, kECBlue, kECUV, kECCT1 }; 47 47 48 48 private: … … 89 89 void SetColor(CalibrationColor_t color) { fColor = color; } 90 90 91 Bool_t GetConversionFactor(Int_t ipx, Float_t &mean, Float_t &err); 91 Bool_t GetConversionFactorFFactor(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma); 92 Bool_t GetConversionFactorBlindPixel(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma); 92 93 93 94 ClassDef(MCalibrationCam, 1) // Storage Container for all calibration information of the camera -
trunk/MagicSoft/Mars/manalysis/MCalibrationConfig.h
r2603 r2627 15 15 16 16 // The conversion factor between High Gain and Low Gain 17 const UShort_t gkConversionHiLo = 10.;17 const Float_t gkConversionHiLo = 10.; 18 18 19 19 // The penalty constant to produce overflow in the histogram … … 29 29 const Float_t gkCalibrationBlindPixelQEBlue = 0.226; 30 30 const Float_t gkCalibrationBlindPixelQEUV = 0.247; 31 const Float_t gkCalibrationBlindPixelQECT1 = 0.247; 31 32 32 33 // Attenuation factor Blind Pixel (three colours) … … 34 35 const Float_t gkCalibrationBlindPixelAttBlue = 1.96; 35 36 const Float_t gkCalibrationBlindPixelAttUV = 1.95; 37 const Float_t gkCalibrationBlindPixelAttCT1 = 1.95; 36 38 37 39 // Area of Blind Pixel w.r.t. Inner Pixel 38 40 const Float_t gkCalibrationBlindPixelArea = 0.25; 41 42 // Area of Outer Pixel w.r.t. Inner Pixel 43 const Float_t gkCalibrationOuterPixelArea = 4.00; 39 44 40 45 // ----- PIN DIODE ------------------------// -
trunk/MagicSoft/Mars/manalysis/MCalibrationPINDiode.cc
r2603 r2627 79 79 Bool_t MCalibrationPINDiode::FitCharge() 80 80 { 81 if(!fHist->FitCharge ())81 if(!fHist->FitChargeHiGain()) 82 82 return kFALSE; 83 83 … … 94 94 { 95 95 96 if(!fHist->FitTime ())96 if(!fHist->FitTimeHiGain()) 97 97 return kFALSE; 98 98 -
trunk/MagicSoft/Mars/manalysis/MCalibrationPINDiode.h
r2603 r2627 33 33 void Clear(Option_t *o=""); 34 34 35 void SetPed(Float_t ped) { fPed = ped; }35 void SetPed(Float_t ped) { fPed = ped; } 36 36 void SetPedRms(Float_t pedrms) { fPedRms = pedrms; } 37 37 38 38 Bool_t IsValid() const { return fRCharge >=0 || fErrRCharge >= 0; } 39 39 40 Bool_t FillCharge( Int_t q) { return fHist->FillCharge(q); }41 Bool_t FillTime(Int_t t) { return fHist->FillTime(t); }42 Bool_t FillRChargevsTime(Float_t rq, Int_t t) { return fHist->FillChargevsN (rq,t); }40 Bool_t FillCharge(Float_t q) { return fHist->FillChargeHiGain(q); } 41 Bool_t FillTime(Int_t t) { return fHist->FillTimeHiGain(t); } 42 Bool_t FillRChargevsTime(Float_t rq, Int_t t) { return fHist->FillChargevsNHiGain(rq,t); } 43 43 44 44 Bool_t FitCharge(); -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc
r2603 r2627 50 50 fSigmaCharge(-1.), 51 51 fErrSigmaCharge(-1.), 52 fRSigma(-1.), 52 53 fChargeProb(-1.), 53 54 fPed(-1.), … … 56 57 fSigmaTime(-1.), 57 58 fTimeProb(-1.), 58 fRCharge(-1.),59 fErrRCharge(-1.),60 fRSigma(-1.),61 59 fFactor(1.3), 62 60 fPheFFactorMethod(-1.), 63 fConversionFFactorMethod(-1.) 61 fConversionFFactorMethod(-1.), 62 fHiGainSaturation(kFALSE) 64 63 { 65 64 … … 102 101 103 102 if (fPed && fPedRms) 104 fHist->SetLowerFitRange(fPed + 1.5*fPedRms); 103 fHist->SetLowerFitRange(3.5*fPedRms); 104 // fHist->SetLowerFitRange(fPed + 3.5*fPedRms); 105 105 else 106 106 *fLog << warn << "Cannot set lower fit range to suppress cosmics: Pedestals not available" << endl; 107 107 108 if(!fHist->FitCharge()) 108 109 if (fHiGainSaturation) 109 110 { 110 *fLog << warn << "Could not fit charges of pixel " << fPixId << endl; 111 fHist->PrintChargeFitResult(); 112 return kFALSE; 111 if(!fHist->FitChargeLoGain()) 112 { 113 *fLog << warn << "Could not fit Lo Gain charges of pixel " << fPixId << endl; 114 fHist->PrintChargeFitResult(); 115 return kFALSE; 116 } 117 } 118 else 119 { 120 if(!fHist->FitChargeHiGain()) 121 { 122 *fLog << warn << "Could not fit Hi Gain charges of pixel " << fPixId << endl; 123 fHist->PrintChargeFitResult(); 124 return kFALSE; 125 } 113 126 } 114 127 128 115 129 fCharge = fHist->GetChargeMean(); 116 130 fErrCharge = fHist->GetChargeMeanErr(); … … 122 136 { 123 137 124 fRCharge = fCharge - fPed;125 fErrRCharge = TMath::Sqrt(fErrCharge*fErrCharge + fPedRms*fPedRms);126 127 138 fRSigma = (fSigmaCharge*fSigmaCharge) - (fPedRms*fPedRms); 128 139 129 140 if (fRSigma > 0. ) 130 141 { 131 fPheFFactorMethod = fFactor * f RCharge*fRCharge / fRSigma;132 fConversionFFactorMethod = fPheFFactorMethod / fRCharge ;142 fPheFFactorMethod = fFactor * fCharge*fCharge / fRSigma; 143 fConversionFFactorMethod = fPheFFactorMethod / fCharge ; 133 144 } 134 145 else … … 144 155 } 145 156 157 146 158 void MCalibrationPix::SetPedestal(Float_t ped, Float_t pedrms) 147 159 { … … 150 162 fPedRms = pedrms; 151 163 152 if ((fRCharge == -1.) && (fCharge > 0.))153 fRCharge = fCharge - fPed;154 if ((fErrRCharge == -1.) && (fErrCharge > 0.))155 fErrRCharge = TMath::Sqrt(fErrCharge*fErrCharge + fPedRms*fPedRms);156 157 164 } 158 165 … … 160 167 { 161 168 162 if (!fHist->FitTime())169 if (fHiGainSaturation) 163 170 { 164 *fLog << warn << "Could not fit times of pixel " << fPixId << endl; 165 fHist->PrintTimeFitResult(); 166 return kFALSE; 171 if(!fHist->FitTimeLoGain()) 172 { 173 *fLog << warn << "Could not fit Lo Gain times of pixel " << fPixId << endl; 174 fHist->PrintTimeFitResult(); 175 return kFALSE; 176 } 167 177 } 168 178 else 179 { 180 if(!fHist->FitTimeHiGain()) 181 { 182 *fLog << warn << "Could not fit Hi Gain times of pixel " << fPixId << endl; 183 fHist->PrintTimeFitResult(); 184 return kFALSE; 185 } 186 } 187 169 188 fTime = fHist->GetTimeMean(); 170 189 fSigmaTime = fHist->GetTimeSigma(); -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h
r2603 r2627 14 14 Int_t fPixId; // the pixel Id 15 15 16 Float_t fCharge; // The mean charge after the fit17 Float_t fErrCharge; // The error of mean charge after the fit16 Float_t fCharge; // The mean reduced charge after the fit 17 Float_t fErrCharge; // The error of reduced mean charge after the fit 18 18 Float_t fSigmaCharge; // The sigma of the mean charge after the fit 19 19 Float_t fErrSigmaCharge; // The error of the sigma of the mean charge after the fit 20 Float_t fRSigma; // The reduced squares of sigmas after the fit 20 21 Float_t fChargeProb; // The probability of the fit function 21 22 … … 27 28 Float_t fTimeProb; // The probability of the fit function 28 29 29 Float_t fRCharge; // The reduced mean charge after the fit30 Float_t fErrRCharge; // The error of the reduced mean charge after the fit31 Float_t fRSigma; // The reduced squares of sigmas after the fit32 33 30 Float_t fFactor; // The laboratory F-factor 34 31 Float_t fPheFFactorMethod; // The number of Phe's calculated after the F-factor method 35 32 Float_t fConversionFFactorMethod; // The conversion factor to Phe's calculated after the F-factor method 33 34 Bool_t fHiGainSaturation; // Is Lo-Gain used at all? 36 35 37 36 MHCalibrationPixel *fHist; //! Pointer to the histograms performing the fits, etc. … … 45 44 46 45 Float_t GetCharge() const { return fCharge; } 47 Float_t GetRCharge() const { return fRCharge; }48 46 Float_t GetRSigma() const { return fRSigma; } 49 47 50 48 Float_t GetErrCharge() const { return fErrCharge; } 51 Float_t GetErrRCharge() const { return fErrRCharge; }52 49 Float_t GetChargeProb() const { return fChargeProb; } 53 50 54 51 Float_t GetSigmaCharge() const { return fSigmaCharge; } 55 52 Float_t GetErrSigmaCharge() const { return fErrSigmaCharge; } 56 Float_t GetTime() const { return fTime; }57 Float_t GetSigmaTime() const { return fSigmaTime; }58 Float_t GetTimeProb() const { return fTimeProb; }53 Float_t GetTime() const { return fTime; } 54 Float_t GetSigmaTime() const { return fSigmaTime; } 55 Float_t GetTimeProb() const { return fTimeProb; } 59 56 60 Float_t GetPed() const { return fPed; }61 Float_t GetPedRms() const { return fPedRms; }57 Float_t GetPed() const { return fPed; } 58 Float_t GetPedRms() const { return fPedRms; } 62 59 63 60 void SetPedestal(Float_t ped, Float_t pedrms); 61 void SetHiGainSaturation() { fHiGainSaturation = kTRUE; fHist->SetUseLoGain(); } 64 62 65 Bool_t FillCharge(Int_t q) { return fHist->FillCharge(q); } 66 Bool_t FillTime(Int_t t) { return fHist->FillTime(t); } 67 Bool_t FillRChargevsTime(Float_t rq, Int_t t) { return fHist->FillChargevsN(rq,t); } 63 Bool_t FillChargeHiGain(Float_t q) { return fHist->FillChargeHiGain(q); } 64 Bool_t FillTimeHiGain(Int_t t) { return fHist->FillTimeHiGain(t); } 65 Bool_t FillRChargevsTimeHiGain(Float_t rq, Int_t t) { return fHist->FillChargevsNHiGain(rq,t); } 66 67 Bool_t FillChargeLoGain(Float_t q) { return fHist->FillChargeLoGain(q); } 68 Bool_t FillTimeLoGain(Int_t t) { return fHist->FillTimeLoGain(t); } 69 Bool_t FillRChargevsTimeLoGain(Float_t rq, Int_t t) { return fHist->FillChargevsNLoGain(rq,t); } 68 70 69 Bool_t IsValid() const { return fRCharge >=0 || fErrRCharge >= 0; }70 Int_t GetPixId() const { return fPixId; }71 Bool_t IsValid() const { return fCharge >=0 || fErrCharge >= 0; } 72 Int_t GetPixId() const { return fPixId; } 71 73 void DefinePixId(Int_t i); 72 74 … … 74 76 Bool_t FitTime(); 75 77 76 MHCalibrationPixel *GetHist() const { return fHist;}77 v irtual void Draw(Option_t *opt=""){ fHist->Draw(opt); }78 MHCalibrationPixel *GetHist() const { return fHist; } 79 void Draw(Option_t *opt="") { fHist->Draw(opt); } 78 80 79 81 Float_t GetPheFFactorMethod() const { return fPheFFactorMethod; } -
trunk/MagicSoft/Mars/manalysis/Makefile
r2581 r2627 75 75 MCalibrationBlindPix.cc \ 76 76 MCalibrationPINDiode.cc \ 77 MCalibrationCam.cc 77 MCalibrationCam.cc \ 78 MExtractedSignalCam.cc \ 79 MExtractedSignalPix.cc \ 80 MExtractSignal.cc 78 81 79 82 SRCS = $(SRCFILES)
Note:
See TracChangeset
for help on using the changeset viewer.