Changeset 2603 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 12/05/03 01:08:44 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCalibrationBlindPix.cc
r2525 r2603 59 59 fErrLambda = fErrMu0 = fErrMu1 = fErrSigma0 = fErrSigma1 = 0; 60 60 61 fT = fErrT= 0;61 fTime = fErrTime = 0; 62 62 } 63 63 … … 76 76 } 77 77 78 Bool_t MCalibrationBlindPix::Fit Q()78 Bool_t MCalibrationBlindPix::FitCharge() 79 79 { 80 80 if (!fHist->FitSinglePhe()) … … 98 98 99 99 100 Bool_t MCalibrationBlindPix::FitT ()100 Bool_t MCalibrationBlindPix::FitTime() 101 101 { 102 102 103 if(!fHist->FitT ())103 if(!fHist->FitTime()) 104 104 return kFALSE; 105 105 106 fT = fHist->GetMeanT();107 fErrT = fHist->GetMeanTErr();106 fTime = fHist->GetMeanTime(); 107 fErrTime = fHist->GetMeanTimeErr(); 108 108 109 109 return kTRUE; -
trunk/MagicSoft/Mars/manalysis/MCalibrationBlindPix.h
r2599 r2603 24 24 Float_t fErrSigma1; // The error of the width of the first phe-peak 25 25 26 Float_t fT ; // The mean arrival time after the fit27 Float_t fErrT ; // The error of the mean arrival time after the fit26 Float_t fTime; // The mean arrival time after the fit 27 Float_t fErrTime; // The error of the mean arrival time after the fit 28 28 29 29 MHCalibrationBlindPixel *fHist; // Pointer to the histograms performing the fits, etc. … … 48 48 Float_t GetErrSigma1() const { return fErrSigma1; } 49 49 50 Float_t GetT () const { return fT; }51 Float_t GetErrT () const { return fErrT; }50 Float_t GetTime() const { return fTime; } 51 Float_t GetErrTime() const { return fErrTime; } 52 52 53 Bool_t Fill Q(Int_t q) { return fHist->FillBlindPixelQ(q); }54 Bool_t FillT (Int_t t) { return fHist->FillBlindPixelT(t); }55 Bool_t FillR QvsT(Float_t rq, Int_t t) { return fHist->FillBlindPixelQvsN(rq,t); }53 Bool_t FillCharge(Int_t q) { return fHist->FillBlindPixelCharge(q); } 54 Bool_t FillTime(Int_t t) { return fHist->FillBlindPixelTime(t); } 55 Bool_t FillRChargevsTime(Float_t rq, Int_t t) { return fHist->FillBlindPixelChargevsN(rq,t); } 56 56 57 57 Bool_t IsValid() { return fLambda > 0. || fErrLambda > 0.; } 58 58 59 Bool_t Fit Q();60 Bool_t FitT ();59 Bool_t FitCharge(); 60 Bool_t FitTime(); 61 61 62 62 virtual void Draw(Option_t *opt="") { fHist->Draw(opt); } -
trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.cc
r2599 r2603 53 53 // Every MCalibrationPix holds a histogram class, // 54 54 // MHCalibrationPixel which itself hold histograms of type: // 55 // H Q(npix) (distribution of summed FADC time slice entries) //56 // HT (npix) (distribution of position of maximum) //57 // H QvsN(npix) (distribution of charges vs. event number. //58 // // 59 // PostProcess: All histograms H Q(npix) are fitted to a Gaussian //60 // All histograms HT (npix) are fitted to a Gaussian //61 // The histogram HB PQ(blind pixel) is fitted to a single //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 62 // PhE fit // 63 // The histogram HB PT(blind pixel) is fitted to a Gaussian //63 // The histogram HBlindPixelTime (blind pixel) is fitted to a Gaussian // 64 64 // The histograms of the PIN Diode are fitted to Gaussians // 65 65 // // 66 66 // Fits can be excluded via the commands: // 67 // MalibrationCam::SetSkipT Fits() (skip all time fits) //68 // MalibrationCam::SetSkipB PFits() (skip all blind pixel fits) //69 // MalibrationCam::SetSkipP DFits() (skip all PIN Diode fits) //67 // MalibrationCam::SetSkipTimeFits() (skip all time fits) // 68 // MalibrationCam::SetSkipBlindPixelFits() (skip all blind pixel fits) // 69 // MalibrationCam::SetSkipPinDiodeFits() (skip all PIN Diode fits) // 70 70 // // 71 71 ////////////////////////////////////////////////////////////////////////////// … … 94 94 95 95 #include "MTime.h" 96 #include "TMath.h" 96 97 97 98 ClassImp(MCalibrationCalc); … … 115 116 AddToBranchList("MRawEvtData.fLoGainFadcSamples"); 116 117 117 SETBIT(fFlags, kUseT Fits);118 SETBIT(fFlags, kUseB PFit);119 SETBIT(fFlags, kUseP DFit);118 SETBIT(fFlags, kUseTimeFits); 119 SETBIT(fFlags, kUseBlindPixelFit); 120 SETBIT(fFlags, kUsePinDiodeFit); 120 121 } 121 122 … … 219 220 { 220 221 MCalibrationPix &pix = (*fCalibrations)[i]; 221 pix. ChangePixId(i);222 pix.DefinePixId(i); 222 223 } 223 224 … … 244 245 MRawEvtPixelIter pixel(fRawEvt); 245 246 247 // Create a first loop to sort out the cosmics ... 248 // 249 // This is a very primitive check for the number of cosmicpixs 250 // The cut will be applied in the fit, but for the blind pixel, 251 // we need to remove this event 252 // 253 // FIXME: In the future need a much more sophisticated one!!! 254 // 255 246 256 while (pixel.Next()) 247 257 { 248 258 259 const Int_t pixid = pixel.GetPixelId(); 260 261 Int_t sum = pixel.GetSumHiGainSamples(); 262 263 MPedestalPix &ped = (*fPedestals)[pixid]; 264 265 Float_t pedes = ped.GetPedestal(); 266 Float_t pedrms = ped.GetPedestalRms(); 267 268 if ((float)sum < (pedes*fNumHiGainSamples)+(1.5*pedrms) ) 269 cosmicpix++; 270 } 271 272 273 if (cosmicpix > 50.) 274 { 275 fCosmics++; 276 return kTRUE; 277 } 278 279 pixel.Reset(); 280 281 while (pixel.Next()) 282 { 283 249 284 UShort_t sat = 0; 285 UShort_t lowgainoverflow = 0; 286 250 287 const Int_t pixid = pixel.GetPixelId(); 251 288 … … 269 306 // performed in the data?!? 270 307 // 271 sum = (max > gkSaturationLimit // overflow of LoGain ??? -> GimmeABreak!!! 272 ? fHistOverFlow++, gkLoGainOverFlow // OUCH (Florian was maybe right) 273 : sum ); // OUFF (Florian was wrong) !! 274 // : sum*gkConversionHiLo ); // OUFF (Florian was wrong) !! 275 276 if (fHistOverFlow) 277 *fLog << err << dbginf << "Warning: Saturation of LoGain reached! " 278 << err << dbginf << "sum = " << sum << endl; 279 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 } 280 319 } 281 320 … … 293 332 pedrms *= (sat ? fNumLoGainSamples : fNumHiGainSamples ); 294 333 295 //296 // This is a very primitive check for the number of cosmicpixs297 // The cut will be applied in the fit, but for the blind pixel,298 // we need to remove this event299 //300 // FIXME: In the future need a much more sophisticated one!!!301 //302 303 if ((float)sum < pedes+4.*pedrms)304 cosmicpix++;305 306 334 Float_t rsum = (float)sum - pedes; 307 335 … … 315 343 // the rest of the pixels (which is the case right now) 316 344 // 317 if (cosmicpix < 100.) 318 { 319 if (!blindpixel.FillQ(sum)) 320 *fLog << warn << 321 "Overflow or Underflow occurred filling Blind Pixel sum = " << sum << endl; 322 323 if (!blindpixel.FillT((int)mid)) 324 *fLog << warn << 325 "Overflow or Underflow occurred filling Blind Pixel time = " << (int)mid << endl; 326 327 if (!blindpixel.FillRQvsT(rsum,fEvents)) 328 *fLog << warn << 329 "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl; 330 } 345 if (!blindpixel.FillCharge(sum)) 346 *fLog << warn << 347 "Overflow or Underflow occurred filling Blind Pixel sum = " << sum << endl; 348 349 if (!blindpixel.FillTime((int)mid)) 350 *fLog << warn << 351 "Overflow or Underflow occurred filling Blind Pixel time = " << (int)mid << endl; 352 353 if (!blindpixel.FillRChargevsTime(rsum,fEvents)) 354 *fLog << warn << 355 "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl; 331 356 332 357 case gkCalibrationPINDiodeId: 333 if (!pindiode.Fill Q(sum))358 if (!pindiode.FillCharge(sum)) 334 359 *fLog << warn << 335 "Overflow or Underflow occurred filling H Q: means = " << sum << endl;336 if (!pindiode.FillT ((int)mid))360 "Overflow or Underflow occurred filling HCharge: means = " << sum << endl; 361 if (!pindiode.FillTime((int)mid)) 337 362 *fLog << warn << 338 "Overflow or Underflow occurred filling HT : time = " << (int)mid << endl;339 if (!pindiode.FillR QvsT(rsum,fEvents))363 "Overflow or Underflow occurred filling HTime: time = " << (int)mid << endl; 364 if (!pindiode.FillRChargevsTime(rsum,fEvents)) 340 365 *fLog << warn << 341 "Overflow or Underflow occurred filling H QvsN: eventnr = " << fEvents << endl;366 "Overflow or Underflow occurred filling HChargevsN: eventnr = " << fEvents << endl; 342 367 343 368 default: 344 369 345 if (!pix.Fill Q(sum))346 *fLog << warn << "Could not fill Qof pixel: " << pixid370 if (!pix.FillCharge(sum)) 371 *fLog << warn << "Could not fill Charge of pixel: " << pixid 347 372 << " signal = " << sum << endl; 348 373 … … 350 375 // Fill the reduced charge into the control histo for better visibility 351 376 // 352 if (!pix.FillR QvsT(rsum,fEvents))353 *fLog << warn << "Could not fill red. Qvs. EvtNr of pixel: " << pixid377 if (!pix.FillRChargevsTime(rsum,fEvents)) 378 *fLog << warn << "Could not fill red. Charge vs. EvtNr of pixel: " << pixid 354 379 << " signal = " << rsum << " event Nr: " << fEvents << endl; 355 380 356 381 357 if (!pix.FillT ((int)mid))358 *fLog << warn << "Could not fill T of pixel: " << pixid << " time = " << (int)mid << endl;382 if (!pix.FillTime((int)mid)) 383 *fLog << warn << "Could not fill Time of pixel: " << pixid << " time = " << (int)mid << endl; 359 384 360 385 … … 362 387 363 388 } /* while (pixel.Next()) */ 364 365 if (cosmicpix > 300.)366 fCosmics++;367 389 368 390 return kTRUE; … … 389 411 // Fit the blind pixel 390 412 // 391 if (TESTBIT(fFlags,kUseB PFit))413 if (TESTBIT(fFlags,kUseBlindPixelFit)) 392 414 { 393 if (!blindpixel.FitQ()) 415 if (blindpixel.FitCharge()) 416 if (!fCalibrations->CalcNrPhotInnerPixel()) 417 *fLog << err << dbginf << "Could not calculate Number of photons from the blind pixel " << endl; 418 else 394 419 *fLog << err << dbginf << "Could not fit the blind pixel " << endl; 395 420 396 if (!blindpixel.FitT ())421 if (!blindpixel.FitTime()) 397 422 *fLog << warn << "Could not the Times of the blind pixel " << endl; 398 423 … … 412 437 413 438 const Float_t ped = (*fPedestals)[pixid].GetPedestal() * fNumHiGainSamples; 414 const Float_t prms = (*fPedestals)[pixid].GetPedestalRms() * fNumHiGainSamples;439 const Float_t prms = (*fPedestals)[pixid].GetPedestalRms() * TMath::Sqrt((float)fNumHiGainSamples); 415 440 416 441 pix.SetPedestal(ped,prms); 417 442 418 if (TESTBIT(fFlags,kUseT Fits))419 pix.FitT ();443 if (TESTBIT(fFlags,kUseTimeFits)) 444 pix.FitTime(); 420 445 421 pix.Fit Q();446 pix.FitCharge(); 422 447 } 423 448 -
trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.h
r2581 r2603 47 47 enum 48 48 { 49 kUseT Fits = 1,50 kUseB PFit = 2,51 kUseP DFit = 349 kUseTimeFits = 1, 50 kUseBlindPixelFit = 2, 51 kUsePinDiodeFit = 3 52 52 }; 53 53 … … 69 69 MCalibrationCalc(const char *name=NULL, const char *title=NULL); 70 70 71 void SetSkipT Fits(Bool_t b=kTRUE)72 {b ? CLRBIT(fFlags, kUseT Fits) : SETBIT(fFlags, kUseTFits);}73 void SetSkipB PFit(Bool_t b=kTRUE)74 {b ? CLRBIT(fFlags, kUseB PFit) : SETBIT(fFlags, kUseBPFit);}75 void SetSkipP DFit(Bool_t b=kTRUE)76 {b ? CLRBIT(fFlags, kUseP DFit) : SETBIT(fFlags, kUsePDFit);}71 void SetSkipTimeFits(Bool_t b=kTRUE) 72 {b ? CLRBIT(fFlags, kUseTimeFits) : SETBIT(fFlags, kUseTimeFits);} 73 void SetSkipBlindPixelFit(Bool_t b=kTRUE) 74 {b ? CLRBIT(fFlags, kUseBlindPixelFit) : SETBIT(fFlags, kUseBlindPixelFit);} 75 void SetSkipPinDiodeFit(Bool_t b=kTRUE) 76 {b ? CLRBIT(fFlags, kUsePinDiodeFit) : SETBIT(fFlags, kUsePinDiodeFit);} 77 77 78 78 void SetPulserColor(PulserColor_t color) { fColor = color; } -
trunk/MagicSoft/Mars/manalysis/MCalibrationCam.cc
r2599 r2603 56 56 // 57 57 MCalibrationCam::MCalibrationCam(const char *name, const char *title) 58 : fMeanNrPhotAvailable(kFALSE) 58 : fMeanNrPhotAvailable(kFALSE), 59 fMeanNrPhotInnerPix(-1.) 59 60 { 60 61 fName = name ? name : "MCalibrationCam"; … … 128 129 return NULL; 129 130 130 // return (*this)[idx];131 131 return (MCalibrationPix*)fPixels->At(idx); 132 132 } … … 148 148 return kFALSE; 149 149 150 return (&(*this)[idx]);150 return kTRUE; 151 151 } 152 152 153 153 Bool_t MCalibrationCam::IsPixelFitted(Int_t idx) const 154 154 { 155 return ((*this)[idx].GetR Q() > 0. && (*this)[idx].GetErrRQ() > 0.);155 return ((*this)[idx].GetRCharge() > 0. && (*this)[idx].GetErrRCharge() > 0.); 156 156 } 157 157 … … 170 170 // The number of succesful fits is returned 171 171 // 172 UShort_t MCalibrationCam::Fit Q(Int_t i)172 UShort_t MCalibrationCam::FitCharge(Int_t i) 173 173 { 174 174 … … 189 189 while ((pix=(MCalibrationPix*)Next())) 190 190 { 191 if (pix->Fit Q())191 if (pix->FitCharge()) 192 192 nsuccess++; 193 193 } … … 195 195 else // fit only the pixel with index i 196 196 { 197 if((*this)[i].Fit Q())197 if((*this)[i].FitCharge()) 198 198 nsuccess++; 199 199 } … … 209 209 // The number of succesful fits is returned 210 210 // 211 UShort_t MCalibrationCam::FitAll Q()211 UShort_t MCalibrationCam::FitAllCharge() 212 212 { 213 213 … … 222 222 while ((pix=(MCalibrationPix*)Next())) 223 223 { 224 if (pix->Fit Q())225 nsuccess++; 226 } 227 228 if (fBlindPixel->Fit Q())229 nsuccess++; 230 231 if (fPINDiode->Fit Q())224 if (pix->FitCharge()) 225 nsuccess++; 226 } 227 228 if (fBlindPixel->FitCharge()) 229 nsuccess++; 230 231 if (fPINDiode->FitCharge()) 232 232 nsuccess++; 233 233 … … 245 245 // The number of succesful fits is returned 246 246 // 247 UShort_t MCalibrationCam::FitT (Int_t i)247 UShort_t MCalibrationCam::FitTime(Int_t i) 248 248 { 249 249 … … 264 264 while ((pix=(MCalibrationPix*)Next())) 265 265 { 266 if (pix->FitT ())266 if (pix->FitTime()) 267 267 nsuccess++; 268 268 } … … 270 270 else // fit only the pixel with index i 271 271 { 272 if((*this)[i].FitT ())272 if((*this)[i].FitTime()) 273 273 nsuccess++; 274 274 } … … 285 285 // The number of succesful fits is returned 286 286 // 287 UShort_t MCalibrationCam::FitAllT ()287 UShort_t MCalibrationCam::FitAllTime() 288 288 { 289 289 … … 298 298 while ((pix=(MCalibrationPix*)Next())) 299 299 { 300 if (pix->FitT ())301 nsuccess++; 302 } 303 304 if (fBlindPixel->FitT ())305 nsuccess++; 306 307 if (fPINDiode->FitT ())300 if (pix->FitTime()) 301 nsuccess++; 302 } 303 304 if (fBlindPixel->FitTime()) 305 nsuccess++; 306 307 if (fPINDiode->FitTime()) 308 308 nsuccess++; 309 309 … … 364 364 { 365 365 366 *fLog << id << ": " << pix->GetPed() << " " << pix->GetPedRms() << " Charges: " ; 367 *fLog << pix->GetQ() << " " << pix->GetRQ() << endl; 366 *fLog << id << " Pedestals: " << pix->GetPed() << " +- " << pix->GetPedRms() << " Charge: " 367 << pix->GetCharge() << " Reduced Charge: " << pix->GetRCharge() << " +- " 368 << pix->GetSigmaCharge() << " Reduced Sigma: " << pix->GetRSigma() << endl; 368 369 369 370 id++; … … 378 379 { 379 380 case 0: 380 val = (*this)[idx].Get Q();381 val = (*this)[idx].GetCharge(); 381 382 break; 382 383 case 1: 383 val = (*this)[idx].GetErr Q();384 val = (*this)[idx].GetErrCharge(); 384 385 break; 385 386 case 2: 386 val = (*this)[idx].GetSigma Q();387 val = (*this)[idx].GetSigmaCharge(); 387 388 break; 388 389 case 3: 389 val = (*this)[idx].GetErrSigma Q();390 val = (*this)[idx].GetErrSigmaCharge(); 390 391 break; 391 392 case 4: 392 val = (*this)[idx].Get QProb();393 val = (*this)[idx].GetChargeProb(); 393 394 break; 394 395 case 5: 395 val = (*this)[idx].GetT ();396 val = (*this)[idx].GetTime(); 396 397 break; 397 398 case 6: 398 val = (*this)[idx].GetSigmaT ();399 val = (*this)[idx].GetSigmaTime(); 399 400 break; 400 401 case 7: 401 val = (*this)[idx].GetT Prob();402 val = (*this)[idx].GetTimeProb(); 402 403 break; 403 404 case 8: … … 408 409 break; 409 410 case 10: 410 val = (*this)[idx].GetR Q();411 411 val = (*this)[idx].GetRCharge(); 412 break; 412 413 case 11: 413 val = (*this)[idx].Get ErrRQ();414 val = (*this)[idx].GetRSigma(); 414 415 break; 415 416 case 12: … … 419 420 val = (*this)[idx].GetConversionFFactorMethod(); 420 421 break; 422 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.; 430 break; 421 431 default: 422 432 return kFALSE; … … 443 453 { 444 454 case kECGreen: 445 fMeanNrPhotInnerPix = mean / 446 (gkCalibrationBlindPixelQEGreen 447 *TMath::Power(10,gkCalibrationBlindPixelAttGreen) 448 *gkCalibrationBlindPixelArea); 455 fMeanNrPhotInnerPix = (mean / gkCalibrationBlindPixelQEGreen) // real photons 456 *TMath::Power(10,gkCalibrationBlindPixelAttGreen) // correct for absorption 457 / gkCalibrationBlindPixelArea; // correct for area 449 458 break; 450 459 case kECBlue: 451 fMeanNrPhotInnerPix = mean / 452 (gkCalibrationBlindPixelQEBlue 460 fMeanNrPhotInnerPix = (mean / gkCalibrationBlindPixelQEBlue ) 453 461 *TMath::Power(10,gkCalibrationBlindPixelAttBlue) 454 *gkCalibrationBlindPixelArea);462 / gkCalibrationBlindPixelArea; 455 463 break; 456 464 case kECUV: 457 fMeanNrPhotInnerPix = mean / 458 (gkCalibrationBlindPixelQEUV 465 fMeanNrPhotInnerPix = (mean / gkCalibrationBlindPixelQEUV ) 459 466 *TMath::Power(10,gkCalibrationBlindPixelAttUV) 460 *gkCalibrationBlindPixelArea);467 / gkCalibrationBlindPixelArea; 461 468 break; 462 469 } … … 478 485 return kFALSE; 479 486 480 mean = fMeanNrPhotInnerPix / (*this)[ipx].GetR Q();487 mean = fMeanNrPhotInnerPix / (*this)[ipx].GetRCharge(); 481 488 482 489 // -
trunk/MagicSoft/Mars/manalysis/MCalibrationCam.h
r2599 r2603 33 33 34 34 Int_t fNumPixels; 35 TClonesArray *fPixels; // FIXME: Change TClonesArray away from a pointer?35 TClonesArray *fPixels; //! FIXME: Change TClonesArray away from a pointer? 36 36 37 MCalibrationBlindPix *fBlindPixel; // containing blind pixel data with fitresults38 MCalibrationPINDiode *fPINDiode; // containing PIN Diode data with fit results37 MCalibrationBlindPix *fBlindPixel; //! containing blind pixel data with fitresults 38 MCalibrationPINDiode *fPINDiode; //! containing PIN Diode data with fit results 39 39 40 40 Float_t fMeanNrPhotInnerPix; // The mean number of photons in an inner pixel … … 42 42 Bool_t fMeanNrPhotAvailable; 43 43 44 Bool_t CalcNrPhotInnerPixel();45 46 44 public: 47 45 … … 70 68 MCalibrationPix &operator[](Int_t i) const; 71 69 72 UShort_t Fit Q(Int_t i=-1);73 UShort_t FitAll Q();74 UShort_t FitT (Int_t i=-1);75 UShort_t FitAllT ();70 UShort_t FitCharge(Int_t i=-1); 71 UShort_t FitAllCharge(); 72 UShort_t FitTime(Int_t i=-1); 73 UShort_t FitAllTime(); 76 74 77 75 Bool_t CheckBounds(Int_t i) const; … … 81 79 void CutEdges(); 82 80 81 Bool_t CalcNrPhotInnerPixel(); 83 82 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 84 83 void DrawPixelContent(Int_t num) const; -
trunk/MagicSoft/Mars/manalysis/MCalibrationConfig.h
r2525 r2603 15 15 16 16 // The conversion factor between High Gain and Low Gain 17 const UShort_t gkConversionHiLo = 10 ;17 const UShort_t gkConversionHiLo = 10.; 18 18 19 19 // The penalty constant to produce overflow in the histogram … … 26 26 27 27 // Average QE of Blind Pixel (three colours) 28 const Float_t gkCalibrationBlindPixelQEGreen = 15.4;29 const Float_t gkCalibrationBlindPixelQEBlue = 22.6;30 const Float_t gkCalibrationBlindPixelQEUV = 24.7;28 const Float_t gkCalibrationBlindPixelQEGreen = 0.154; 29 const Float_t gkCalibrationBlindPixelQEBlue = 0.226; 30 const Float_t gkCalibrationBlindPixelQEUV = 0.247; 31 31 32 32 // Attenuation factor Blind Pixel (three colours) -
trunk/MagicSoft/Mars/manalysis/MCalibrationPINDiode.cc
r2525 r2603 43 43 // 44 44 MCalibrationPINDiode::MCalibrationPINDiode(const char *name, const char *title) 45 : fHist(NULL) 45 : fHist(NULL), 46 fCharge(-1.), 47 fErrCharge(-1.), 48 fPed(-1.), 49 fPedRms(-1.), 50 fSigmaCharge(-1.), 51 fErrSigmaCharge(-1.), 52 fTime(-1.), 53 fErrTime(-1.), 54 fRCharge(-1.), 55 fErrRCharge(-1.) 46 56 { 47 57 … … 50 60 51 61 fHist = new MHCalibrationPINDiode(); 52 53 fQ = fErrQ = 0.;54 fPed = fPedRms = 0.;55 fT = fErrT = 0.;56 fRQ = fErrRQ = 0.;57 fSigmaQ = fErrSigmaQ = 0.;58 62 59 63 } … … 73 77 } 74 78 75 Bool_t MCalibrationPINDiode::Fit Q()79 Bool_t MCalibrationPINDiode::FitCharge() 76 80 { 77 if(!fHist->Fit Q())81 if(!fHist->FitCharge()) 78 82 return kFALSE; 79 83 80 f Q = fHist->GetQMean();81 fErr Q = fHist->GetQMeanErr();82 fSigma Q = fHist->GetQSigma();83 fErrSigma Q = fHist->GetQSigmaErr();84 fCharge = fHist->GetChargeMean(); 85 fErrCharge = fHist->GetChargeMeanErr(); 86 fSigmaCharge = fHist->GetChargeSigma(); 87 fErrSigmaCharge = fHist->GetChargeSigmaErr(); 84 88 85 89 return kTRUE; … … 87 91 } 88 92 89 Bool_t MCalibrationPINDiode::FitT ()93 Bool_t MCalibrationPINDiode::FitTime() 90 94 { 91 95 92 if(!fHist->FitT ())96 if(!fHist->FitTime()) 93 97 return kFALSE; 94 98 95 fT = fHist->GetT();96 fErrT = fHist->GetErrT();99 fTime = fHist->GetTime(); 100 fErrTime = fHist->GetErrTime(); 97 101 98 102 return kTRUE; -
trunk/MagicSoft/Mars/manalysis/MCalibrationPINDiode.h
r2525 r2603 12 12 private: 13 13 14 Float_t fQ; // The mean charge after the fit 15 Float_t fErrQ; // The error of mean charge after the fit 14 MHCalibrationPINDiode *fHist; // Pointer to the histograms performing the fits, etc. 15 16 Float_t fCharge; // The mean charge after the fit 17 Float_t fErrCharge; // The error of mean charge after the fit 16 18 Float_t fPed; // The mean pedestal (from MPedestalPix) 17 19 Float_t fPedRms; // The pedestal RMS (from MPedestalPix) 18 Float_t fSigma Q; // The sigma of the mean charge after the fit19 Float_t fErrSigma Q; // The error of the sigma of the mean charge after the fit20 Float_t fT ; // The mean arrival time after the fit21 Float_t fErrT ; // The error of the mean arrival time after the fit20 Float_t fSigmaCharge; // The sigma of the mean charge after the fit 21 Float_t fErrSigmaCharge; // The error of the sigma of the mean charge after the fit 22 Float_t fTime; // The mean arrival time after the fit 23 Float_t fErrTime; // The error of the mean arrival time after the fit 22 24 23 Float_t fRQ; // The reduced mean charge after the fit 24 Float_t fErrRQ; // The error of the reduced mean charge after the fit 25 26 MHCalibrationPINDiode *fHist; // Pointer to the histograms performing the fits, etc. 25 Float_t fRCharge; // The reduced mean charge after the fit 26 Float_t fErrRCharge; // The error of the reduced mean charge after the fit 27 27 28 28 public: … … 36 36 void SetPedRms(Float_t pedrms) { fPedRms = pedrms; } 37 37 38 Bool_t IsValid() const { return fR Q >=0 || fErrRQ>= 0; }38 Bool_t IsValid() const { return fRCharge >=0 || fErrRCharge >= 0; } 39 39 40 Bool_t Fill Q(Int_t q) { return fHist->FillQ(q); }41 Bool_t FillT (Int_t t) { return fHist->FillT(t); }42 Bool_t FillR QvsT(Float_t rq, Int_t t) { return fHist->FillQvsN(rq,t); }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); } 43 43 44 Bool_t Fit Q();45 Bool_t FitT ();44 Bool_t FitCharge(); 45 Bool_t FitTime(); 46 46 47 47 MHCalibrationPINDiode *GetHist() const { return fHist; } -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc
r2599 r2603 25 25 ///////////////////////////////////////////////////////////////////////////// 26 26 // // 27 // MCalibrationPix 27 // MCalibrationPix // 28 28 // // 29 29 // This is the storage container to hold informations about the pedestal // … … 46 46 MCalibrationPix::MCalibrationPix(const char *name, const char *title) 47 47 : fPixId(-1), 48 f Q(-1.),49 fErr Q(-1.),50 fSigma Q(-1.),51 fErrSigma Q(-1.),52 f QProb(-1.),48 fCharge(-1.), 49 fErrCharge(-1.), 50 fSigmaCharge(-1.), 51 fErrSigmaCharge(-1.), 52 fChargeProb(-1.), 53 53 fPed(-1.), 54 54 fPedRms(-1.), 55 fT(-1.), 56 fSigmaT(-1.), 57 fTProb(-1.), 58 fRQ(-1.), 59 fErrRQ(-1.), 55 fTime(-1.), 56 fSigmaTime(-1.), 57 fTimeProb(-1.), 58 fRCharge(-1.), 59 fErrRCharge(-1.), 60 fRSigma(-1.), 60 61 fFactor(1.3), 61 62 fPheFFactorMethod(-1.), … … 66 67 fTitle = title ? title : "Container of the MHCalibrationPixels and the fit results"; 67 68 68 fHist = new MHCalibrationPixel("MHCalibrationPixel","Calibration Histograms Pixel"); 69 fHist = new MHCalibrationPixel("MHCalibrationPixel","Calibration Histograms Pixel "); 70 69 71 } 70 72 … … 75 77 76 78 77 void MCalibrationPix:: ChangePixId(Int_t i)79 void MCalibrationPix::DefinePixId(Int_t i) 78 80 { 79 81 … … 93 95 } 94 96 95 Bool_t MCalibrationPix::Fit Q()97 Bool_t MCalibrationPix::FitCharge() 96 98 { 97 99 98 if (fHist->IsFit ted())100 if (fHist->IsFitOK()) 99 101 return kTRUE; 100 102 101 103 if (fPed && fPedRms) 102 fHist->SetLowerFitRange(fPed + 2.0*fPedRms);104 fHist->SetLowerFitRange(fPed + 1.5*fPedRms); 103 105 else 104 106 *fLog << warn << "Cannot set lower fit range to suppress cosmics: Pedestals not available" << endl; 105 107 106 if(!fHist->Fit Q())108 if(!fHist->FitCharge()) 107 109 { 108 110 *fLog << warn << "Could not fit charges of pixel " << fPixId << endl; 109 fHist->Print QFitResult();111 fHist->PrintChargeFitResult(); 110 112 return kFALSE; 111 113 } 112 114 113 f Q = fHist->GetQMean();114 fErr Q = fHist->GetQMeanErr();115 fSigma Q = fHist->GetQSigma();116 fErrSigma Q = fHist->GetQSigmaErr();117 f QProb = fHist->GetQProb();115 fCharge = fHist->GetChargeMean(); 116 fErrCharge = fHist->GetChargeMeanErr(); 117 fSigmaCharge = fHist->GetChargeSigma(); 118 fErrSigmaCharge = fHist->GetChargeSigmaErr(); 119 fChargeProb = fHist->GetChargeProb(); 118 120 119 121 if ((fPed > 0.) && (fPedRms > 0.)) 120 122 { 121 123 122 fR Q = fQ- fPed;123 fErrR Q = TMath::Sqrt(fErrQ*fErrQ+ fPedRms*fPedRms);124 fRCharge = fCharge - fPed; 125 fErrRCharge = TMath::Sqrt(fErrCharge*fErrCharge + fPedRms*fPedRms); 124 126 125 fPheFFactorMethod = 126 fFactor 127 * fRQ * fRQ 128 / (fSigmaQ * fSigmaQ - fPedRms*fPedRms) ; 127 fRSigma = (fSigmaCharge*fSigmaCharge) - (fPedRms*fPedRms); 129 128 130 fConversionFFactorMethod = fPheFFactorMethod / fRQ ; 131 129 if (fRSigma > 0. ) 130 { 131 fPheFFactorMethod = fFactor * fRCharge*fRCharge / fRSigma; 132 fConversionFFactorMethod = fPheFFactorMethod / fRCharge ; 133 } 134 else 135 { 136 *fLog << warn << "Cannot apply F-Factor method: Reduced Sigmas are smaller than 0 in pixel: " 137 << fPixId << endl; 138 } 139 132 140 } 133 141 … … 142 150 fPedRms = pedrms; 143 151 144 if (( !fRQ) && fQ)145 fR Q = fQ- fPed;146 if (( !fErrRQ) && fErrQ)147 fErrR Q = TMath::Sqrt(fErrQ*fErrQ+ fPedRms*fPedRms);152 if ((fRCharge == -1.) && (fCharge > 0.)) 153 fRCharge = fCharge - fPed; 154 if ((fErrRCharge == -1.) && (fErrCharge > 0.)) 155 fErrRCharge = TMath::Sqrt(fErrCharge*fErrCharge + fPedRms*fPedRms); 148 156 149 157 } 150 158 151 Bool_t MCalibrationPix::FitT ()159 Bool_t MCalibrationPix::FitTime() 152 160 { 153 161 154 if(!fHist->FitT ())162 if(!fHist->FitTime()) 155 163 { 156 164 *fLog << warn << "Could not fit times of pixel " << fPixId << endl; 157 fHist->PrintT FitResult();165 fHist->PrintTimeFitResult(); 158 166 return kFALSE; 159 167 } 160 168 161 fT = fHist->GetTMean();162 fSigmaT = fHist->GetTSigma();163 fT Prob = fHist->GetTProb();169 fTime = fHist->GetTimeMean(); 170 fSigmaTime = fHist->GetTimeSigma(); 171 fTimeProb = fHist->GetTimeProb(); 164 172 165 173 return kTRUE; 166 167 174 } 168 175 -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h
r2599 r2603 14 14 Int_t fPixId; // the pixel Id 15 15 16 Float_t f Q;// The mean charge after the fit17 Float_t fErr Q;// The error of mean charge after the fit18 Float_t fSigma Q;// The sigma of the mean charge after the fit19 Float_t fErrSigma Q;// The error of the sigma of the mean charge after the fit20 Float_t f QProb;// The probability of the fit function16 Float_t fCharge; // The mean charge after the fit 17 Float_t fErrCharge; // The error of mean charge after the fit 18 Float_t fSigmaCharge; // The sigma of the mean charge after the fit 19 Float_t fErrSigmaCharge; // The error of the sigma of the mean charge after the fit 20 Float_t fChargeProb; // The probability of the fit function 21 21 22 Float_t fPed; // The mean pedestal (from MPedestalPix)23 Float_t fPedRms; // The pedestal RMS (from MPedestalPix)22 Float_t fPed; // The mean pedestal (from MPedestalPix) 23 Float_t fPedRms; // The pedestal RMS (from MPedestalPix) 24 24 25 Float_t fT ; // The mean arrival time after the fit26 Float_t fSigmaT ; // The error of the mean arrival time after the fit27 Float_t fT Prob; // The probability of the fit function25 Float_t fTime; // The mean arrival time after the fit 26 Float_t fSigmaTime; // The error of the mean arrival time after the fit 27 Float_t fTimeProb; // The probability of the fit function 28 28 29 Float_t fRQ; // The reduced mean charge after the fit 30 Float_t fErrRQ; // The error of the reduced mean charge after the fit 29 Float_t fRCharge; // The reduced mean charge after the fit 30 Float_t fErrRCharge; // The error of the reduced mean charge after the fit 31 Float_t fRSigma; // The reduced squares of sigmas after the fit 32 33 Float_t fFactor; // The laboratory F-factor 34 Float_t fPheFFactorMethod; // The number of Phe's calculated after the F-factor method 35 Float_t fConversionFFactorMethod; // The conversion factor to Phe's calculated after the F-factor method 31 36 32 Float_t fFactor; // The F-factor 33 Float_t fPheFFactorMethod; // The number of Phe's calculated after the F-factor method 34 Float_t fConversionFFactorMethod; // The conversion factor to Phe's calculated after the F-factor method 35 36 MHCalibrationPixel *fHist; // Pointer to the histograms performing the fits, etc. 37 MHCalibrationPixel *fHist; //! Pointer to the histograms performing the fits, etc. 37 38 38 39 public: … … 43 44 void Clear(Option_t *o=""); 44 45 45 Float_t GetQ() const { return fQ; } 46 Float_t GetRQ() const { return fRQ; } 46 Float_t GetCharge() const { return fCharge; } 47 Float_t GetRCharge() const { return fRCharge; } 48 Float_t GetRSigma() const { return fRSigma; } 47 49 48 Float_t GetErr Q() const { return fErrQ;}49 Float_t GetErrR Q() const { return fErrRQ;}50 Float_t Get QProb() const { return fQProb;}50 Float_t GetErrCharge() const { return fErrCharge; } 51 Float_t GetErrRCharge() const { return fErrRCharge; } 52 Float_t GetChargeProb() const { return fChargeProb; } 51 53 52 Float_t GetSigma Q() const { return fSigmaQ; }53 Float_t GetErrSigma Q() const { return fErrSigmaQ; }54 Float_t GetT () const { return fT; }55 Float_t GetSigmaT () const { return fSigmaT; }56 Float_t GetT Prob() const { return fTProb;}54 Float_t GetSigmaCharge() const { return fSigmaCharge; } 55 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; } 57 59 58 Float_t GetPed() const { return fPed;}59 Float_t GetPedRms() const { return fPedRms; }60 Float_t GetPed() const { return fPed; } 61 Float_t GetPedRms() const { return fPedRms; } 60 62 61 void SetPedestal(Float_t ped, Float_t pedrms); 63 void SetPedestal(Float_t ped, Float_t pedrms); 62 64 63 Bool_t Fill Q(Int_t q) { return fHist->FillQ(q); }64 Bool_t FillT (Int_t t) { return fHist->FillT(t); }65 Bool_t FillR QvsT(Float_t rq, Int_t t) { return fHist->FillQvsN(rq,t); }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); } 66 68 67 Bool_t IsValid() const { return fRQ >=0 || fErrRQ>= 0; }68 Int_t GetPixId() const{ return fPixId; }69 void ChangePixId(Int_t i);69 Bool_t IsValid() const { return fRCharge >=0 || fErrRCharge >= 0; } 70 Int_t GetPixId() const { return fPixId; } 71 void DefinePixId(Int_t i); 70 72 71 Bool_t Fit Q();72 Bool_t FitT ();73 Bool_t FitCharge(); 74 Bool_t FitTime(); 73 75 74 MHCalibrationPixel *GetHist() 75 virtual void Draw(Option_t *opt="") 76 MHCalibrationPixel *GetHist() const { return fHist; } 77 virtual void Draw(Option_t *opt="") { fHist->Draw(opt); } 76 78 77 Float_t GetPheFFactorMethod() const { return fPheFFactorMethod;}78 Float_t GetConversionFFactorMethod() const { return fConversionFFactorMethod;}79 Float_t GetPheFFactorMethod() const { return fPheFFactorMethod; } 80 Float_t GetConversionFFactorMethod() const { return fConversionFFactorMethod; } 79 81 80 82 ClassDef(MCalibrationPix, 1) // Storage Container for Calibration information of one pixel
Note:
See TracChangeset
for help on using the changeset viewer.