Changeset 2603
- Timestamp:
- 12/05/03 01:08:44 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2599 r2603 9 9 - implemented some of Thomas Bretz suggestions to make the code nicer 10 10 - implemented the possibility to have cosmics in the calibration data 11 and still fit it 12 - conversion HiGain/LoGain now left out (it seems to be already done in 13 the data) 11 and remove it 12 - implemented the conversion factors for the blind pixel method 14 13 15 14 * mhist/MHCalibration* -
trunk/MagicSoft/Mars/macros/calibration.C
r2599 r2603 184 184 MHCamera disp10 (geomcam, "MCalibrationCam;pedrms", "Pedestal RMS"); 185 185 MHCamera disp11 (geomcam, "MCalibrationCam;rq", "Reduced Charges"); 186 MHCamera disp12 (geomcam, "MCalibrationCam; errrq", "Error of Reduced Charges");186 MHCamera disp12 (geomcam, "MCalibrationCam;rsigma", "Reduced Sigmas"); 187 187 MHCamera disp13 (geomcam, "MCalibrationCam;phe", "Nr. of Phe's (F-Factor Method)"); 188 188 MHCamera disp14 (geomcam, "MCalibrationCam;convphe", "Conversion Factor (F-Factor Method)"); 189 MHCamera disp15 (geomcam, "MCalibrationCam;photons", "Nr. of Photons (Blind Pixel Method)"); 190 MHCamera disp16 (geomcam, "MCalibrationCam;convphot", "Conversion Factor (Blind Pixel Method)"); 189 191 190 192 disp1.SetCamContent(*cam, 0); … … 200 202 disp11.SetCamContent(*cam, 10); 201 203 disp12.SetCamContent(*cam, 11); 202 disp12.SetCamContent(*cam, 12); 203 disp13.SetCamContent(*cam, 13); 204 disp13.SetCamContent(*cam, 12); 205 disp14.SetCamContent(*cam, 13); 206 disp15.SetCamContent(*cam, 14); 207 disp16.SetCamContent(*cam, 15); 208 204 209 205 210 disp1.SetYTitle("Q [FADC counts]"); 206 disp2.SetYTitle("\\Delta _{Q}[FADC counts]");211 disp2.SetYTitle("\\Delta Q [FADC counts]"); 207 212 disp3.SetYTitle("\\sigma_{Q} [FADC counts]"); 208 disp4.SetYTitle("\\Delta _{\\sigma_{Q}} [FADC counts]");213 disp4.SetYTitle("\\Delta {\\sigma_{Q}} [FADC counts]"); 209 214 disp5.SetYTitle("P [au]"); 210 215 disp6.SetYTitle("T [FADC slices]"); 211 disp7.SetYTitle("\\Delta _{T}[FADC slices]");216 disp7.SetYTitle("\\Delta T [FADC slices]"); 212 217 disp8.SetYTitle("P [au]"); 213 218 disp9.SetYTitle("P [FADC counts/ slice ]"); 214 219 disp10.SetYTitle("RMS_{P} [FADC counts / slice ]"); 215 220 disp11.SetYTitle("Q [FADC counts]"); 216 disp12.SetYTitle("\\ Delta_{Q} [FADC counts]");221 disp12.SetYTitle("\\sigma^2_{Q} - RMS^2_{P} [FADC counts^2]"); 217 222 disp13.SetYTitle("Nr Phe's"); 218 223 disp14.SetYTitle("Conversion Factor [Phe/FADC count]"); 224 disp15.SetYTitle("Nr Photons"); 225 disp16.SetYTitle("Conversion Factor [Ph/FADC count]"); 219 226 220 227 MStatusDisplay *d2 = new MStatusDisplay; … … 350 357 obj->Draw(); 351 358 359 TCanvas *c6 = &d2->AddTab("Blind Pixel Method"); 360 c6->Divide(2, 2); 361 362 c6->cd(1); 363 gStyle->SetOptStat(1111); 364 obj=disp15.DrawCopy("hist"); 365 366 c6->cd(3); 367 obj->Draw(); 368 369 c6->cd(2); 370 gStyle->SetOptStat(1101); 371 obj=disp16.DrawCopy("hist"); 372 373 c6->cd(4); 374 obj->Draw(); 375 352 376 353 377 #endif -
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 -
trunk/MagicSoft/Mars/mhist/MHCalibrationBlindPixel.cc
r2599 r2603 69 69 70 70 // Create a large number of bins, later we will rebin 71 fBlindPixel Qfirst = 0;72 fBlindPixel Qlast = gkStartBlindPixelBinNr;73 fBlindPixel Qnbins = gkStartBlindPixelBinNr;74 75 fHBlindPixel Q = new TH1I("HBlindPixelQ","Distribution of Summed FADC Slices",fBlindPixelQnbins,fBlindPixelQfirst,fBlindPixelQlast);76 fHBlindPixel Q->SetXTitle("Sum FADC Slices");77 fHBlindPixel Q->SetYTitle("Nr. of events");78 fHBlindPixel Q->Sumw2();79 80 fErrBlindPixel Qfirst = 0.;81 fErrBlindPixel Qlast = gkStartBlindPixelBinNr;82 fErrBlindPixel Qnbins = gkStartBlindPixelBinNr;83 84 fHBlindPixelErr Q = new TH1F("HBlindPixelErrQ","Distribution of Variances of Summed FADC Slices",85 fErrBlindPixel Qnbins,fErrBlindPixelQfirst,fErrBlindPixelQlast);86 fHBlindPixelErr Q->SetXTitle("Variance Summed FADC Slices");87 fHBlindPixelErr Q->SetYTitle("Nr. of events");88 fHBlindPixelErr Q->Sumw2();71 fBlindPixelChargefirst = 0; 72 fBlindPixelChargelast = gkStartBlindPixelBinNr; 73 fBlindPixelChargenbins = gkStartBlindPixelBinNr; 74 75 fHBlindPixelCharge = new TH1I("HBlindPixelCharge","Distribution of Summed FADC Slices",fBlindPixelChargenbins,fBlindPixelChargefirst,fBlindPixelChargelast); 76 fHBlindPixelCharge->SetXTitle("Sum FADC Slices"); 77 fHBlindPixelCharge->SetYTitle("Nr. of events"); 78 fHBlindPixelCharge->Sumw2(); 79 80 fErrBlindPixelChargefirst = 0.; 81 fErrBlindPixelChargelast = gkStartBlindPixelBinNr; 82 fErrBlindPixelChargenbins = gkStartBlindPixelBinNr; 83 84 fHBlindPixelErrCharge = new TH1F("HBlindPixelErrCharge","Distribution of Variances of Summed FADC Slices", 85 fErrBlindPixelChargenbins,fErrBlindPixelChargefirst,fErrBlindPixelChargelast); 86 fHBlindPixelErrCharge->SetXTitle("Variance Summed FADC Slices"); 87 fHBlindPixelErrCharge->SetYTitle("Nr. of events"); 88 fHBlindPixelErrCharge->Sumw2(); 89 89 90 90 Axis_t tfirst = -0.5; … … 92 92 Int_t nbins = 16; 93 93 94 fHBlindPixelT = new TH1I("HBlindPixelT","Distribution of Mean Arrival Times",nbins,tfirst,tlast);95 fHBlindPixelT ->SetXTitle("Mean Arrival Times [FADC slice nr]");96 fHBlindPixelT ->SetYTitle("Nr. of events");97 fHBlindPixelT ->Sumw2();94 fHBlindPixelTime = new TH1I("HBlindPixelTime","Distribution of Mean Arrival Times",nbins,tfirst,tlast); 95 fHBlindPixelTime->SetXTitle("Mean Arrival Times [FADC slice nr]"); 96 fHBlindPixelTime->SetYTitle("Nr. of events"); 97 fHBlindPixelTime->Sumw2(); 98 98 99 99 // We define a reasonable number and later enlarge it if necessary … … 102 102 Axis_t nlast = (Axis_t)nbins - 0.5; 103 103 104 fHBlindPixel QvsN = new TH1I("HBlindPixelQvsN","Sum of Charges vs. Event Number",nbins,nfirst,nlast);105 fHBlindPixel QvsN->SetXTitle("Event Nr.");106 fHBlindPixel QvsN->SetYTitle("Sum of FADC slices");104 fHBlindPixelChargevsN = new TH1I("HBlindPixelChargevsN","Sum of Charges vs. Event Number",nbins,nfirst,nlast); 105 fHBlindPixelChargevsN->SetXTitle("Event Nr."); 106 fHBlindPixelChargevsN->SetYTitle("Sum of FADC slices"); 107 107 108 108 fgSinglePheFitFunc = &gfKto8; … … 113 113 { 114 114 115 delete fHBlindPixel Q;116 delete fHBlindPixelT ;117 delete fHBlindPixelErr Q;115 delete fHBlindPixelCharge; 116 delete fHBlindPixelTime; 117 delete fHBlindPixelErrCharge; 118 118 119 119 if (fSinglePheFit) … … 127 127 void MHCalibrationBlindPixel::ResetBin(Int_t i) 128 128 { 129 fHBlindPixel Q->SetBinContent (i, 1.e-20);130 fHBlindPixelErr Q->SetBinContent (i, 1.e-20);131 fHBlindPixelT ->SetBinContent(i, 1.e-20);129 fHBlindPixelCharge->SetBinContent (i, 1.e-20); 130 fHBlindPixelErrCharge->SetBinContent (i, 1.e-20); 131 fHBlindPixelTime->SetBinContent(i, 1.e-20); 132 132 } 133 133 … … 150 150 fFitLegend->SetTextSize(0.05); 151 151 152 c har line1[32];153 sprintf(line1,"Mean: #lambda = %2.2f #pm %2.2f",GetLambda(),GetLambdaErr());152 const TString line1 = 153 Form("Mean: #lambda = %2.2f #pm %2.2f",GetLambda(),GetLambdaErr()); 154 154 fFitLegend->AddText(line1); 155 155 156 c har line2[32];157 sprintf(line2,"Pedestal: #mu_{0} = %2.2f #pm %2.2f",GetMu0(),GetMu0Err());156 const TString line2 = 157 Form("Pedestal: #mu_{0} = %2.2f #pm %2.2f",GetMu0(),GetMu0Err()); 158 158 fFitLegend->AddText(line2); 159 159 160 c har line3[32];161 sprintf(line3,"Width Pedestal: #sigma_{0} = %2.2f #pm %2.2f",GetSigma0(),GetSigma0Err());160 const TString line3 = 161 Form("Width Pedestal: #sigma_{0} = %2.2f #pm %2.2f",GetSigma0(),GetSigma0Err()); 162 162 fFitLegend->AddText(line3); 163 163 164 c har line4[32];165 sprintf(line4,"1^{st} Phe-peak: #mu_{1} = %2.2f #pm %2.2f",GetMu1(),GetMu1Err());164 const TString line4 = 165 Form("1^{st} Phe-peak: #mu_{1} = %2.2f #pm %2.2f",GetMu1(),GetMu1Err()); 166 166 fFitLegend->AddText(line4); 167 167 168 c har line5[32];169 sprintf(line5,"Width 1^{st} Phe-peak: #sigma_{1} = %2.2f #pm %2.2f",GetSigma1(),GetSigma1Err());168 const TString line5 = 169 Form("Width 1^{st} Phe-peak: #sigma_{1} = %2.2f #pm %2.2f",GetSigma1(),GetSigma1Err()); 170 170 fFitLegend->AddText(line5); 171 171 172 c har line7[32];173 sprintf(line7,"#chi^{2} / N_{dof}: %4.2f / %3i",GetChiSquare(),GetNdf());172 const TString line7 = 173 Form("#chi^{2} / N_{dof}: %4.2f / %3i",GetChiSquare(),GetNdf()); 174 174 fFitLegend->AddText(line7); 175 175 176 c har line8[32];177 sprintf(line8,"Probability: %4.2f ",GetProb());176 const TString line8 = 177 Form("Probability: %4.2f ",GetProb()); 178 178 fFitLegend->AddText(line8); 179 179 … … 209 209 gPad->SetTicks(); 210 210 211 fHBlindPixel Q->DrawCopy(opt);211 fHBlindPixelCharge->DrawCopy(opt); 212 212 213 213 if (fSinglePheFit) … … 231 231 gPad->SetLogy(1); 232 232 gPad->SetBorderMode(0); 233 fHBlindPixelT ->DrawCopy(opt);234 235 if (fHBlindPixelT ->GetFunction("GausTime"))233 fHBlindPixelTime->DrawCopy(opt); 234 235 if (fHBlindPixelTime->GetFunction("GausTime")) 236 236 { 237 TF1 *tfit = fHBlindPixelT ->GetFunction("GausTime");237 TF1 *tfit = fHBlindPixelTime->GetFunction("GausTime"); 238 238 if (tfit->GetProb() < 0.01) 239 239 tfit->SetLineColor(kRed); … … 248 248 c->cd(4); 249 249 250 fHBlindPixel QvsN->DrawCopy(opt);250 fHBlindPixelChargevsN->DrawCopy(opt); 251 251 252 252 c->Modified(); … … 260 260 gRandom->SetSeed(); 261 261 262 if (fHBlindPixel Q->GetEntries() != 0)262 if (fHBlindPixelCharge->GetEntries() != 0) 263 263 { 264 *fLog << err << "Histogram " << fHBlindPixel Q->GetTitle() << " is already filled. " << endl;264 *fLog << err << "Histogram " << fHBlindPixelCharge->GetTitle() << " is already filled. " << endl; 265 265 *fLog << err << "Create new class MHCalibrationBlindPixel for simulation! " << endl; 266 266 return kFALSE; … … 268 268 269 269 TF1 *simulateSinglePhe = new TF1("simulateSinglePhe",fgSinglePheFitFunc, 270 fBlindPixel Qfirst,fBlindPixelQlast,fgSinglePheFitNPar);270 fBlindPixelChargefirst,fBlindPixelChargelast,fgSinglePheFitNPar); 271 271 272 272 simulateSinglePhe->SetParameters(lambda,mu0,mu1,sigma0,sigma1); 273 273 simulateSinglePhe->SetParNames("#lambda","#mu_0","#mu_1","#sigma_0","#sigma_1"); 274 simulateSinglePhe->SetNpx(fBlindPixel Qnbins);274 simulateSinglePhe->SetNpx(fBlindPixelChargenbins); 275 275 276 276 for (Int_t i=0;i<10000; i++) 277 277 { 278 fHBlindPixel Q->Fill(simulateSinglePhe->GetRandom());278 fHBlindPixelCharge->Fill(simulateSinglePhe->GetRandom()); 279 279 } 280 280 … … 303 303 // Get the fitting ranges 304 304 // 305 rmin = (rmin != 0.) ? rmin : fBlindPixel Qfirst;306 rmax = (rmax != 0.) ? rmax : fBlindPixel Qlast;305 rmin = (rmin != 0.) ? rmin : fBlindPixelChargefirst; 306 rmax = (rmax != 0.) ? rmax : fBlindPixelChargelast; 307 307 308 308 // … … 310 310 // otherwise the fit goes gaga because of high number of dimensions ... 311 311 // 312 const Stat_t entries = fHBlindPixel Q->GetSumOfWeights();312 const Stat_t entries = fHBlindPixelCharge->GetSumOfWeights(); 313 313 const Double_t lambda_guess = 0.2; 314 const Double_t mu_0_guess = fHBlindPixel Q->GetBinCenter(fHBlindPixelQ->GetMaximumBin());314 const Double_t mu_0_guess = fHBlindPixelCharge->GetBinCenter(fHBlindPixelCharge->GetMaximumBin()); 315 315 const Double_t si_0_guess = mu_0_guess/10.; 316 316 const Double_t mu_1_guess = mu_0_guess + 50.; … … 333 333 // ROOT gives us another nice example of user-unfriendly behavior: 334 334 // Although the normalization of the function fSinglePhe and the 335 // Histogram fHBlindPixel Qagree (!!), the fit does not normalize correctly INTERNALLY335 // Histogram fHBlindPixelCharge agree (!!), the fit does not normalize correctly INTERNALLY 336 336 // in the fitting procedure !!! 337 337 // … … 343 343 // 344 344 // const Int_t npx = fSinglePheFit->GetNpx(); 345 // const Int_t bins = fHBlindPixel Q->GetXaxis()->GetLast()-fHBlindPixelQ->GetXaxis()->GetFirst();346 // fHBlindPixel Q->Scale(gkSq2Pi*(float)bins/npx/entries);345 // const Int_t bins = fHBlindPixelCharge->GetXaxis()->GetLast()-fHBlindPixelCharge->GetXaxis()->GetFirst(); 346 // fHBlindPixelCharge->Scale(gkSq2Pi*(float)bins/npx/entries); 347 347 348 348 // … … 351 351 // mysteries of ROOT which takes you a whole day to find out :-) 352 352 // 353 // fSinglePheFit->SetNpx(f Qnbins);354 355 fHBlindPixel Q->Fit(fSinglePheFit,opt);353 // fSinglePheFit->SetNpx(fChargenbins); 354 355 fHBlindPixelCharge->Fit(fSinglePheFit,opt); 356 356 357 357 fLambda = fSinglePheFit->GetParameter(0); … … 405 405 Int_t nbins = 50; 406 406 407 *fLog << "New number of bins in HSin Q: " << CutEdges(fHBlindPixelQ,nbins) << endl;408 409 fBlindPixel Qfirst = fHBlindPixelQ->GetBinLowEdge(fHBlindPixelQ->GetXaxis()->GetFirst());410 fBlindPixel Qlast = fHBlindPixelQ->GetBinLowEdge(fHBlindPixelQ->GetXaxis()->GetLast())+fHBlindPixelQ->GetBinWidth(0);411 fBlindPixel Qnbins = nbins;412 413 *fLog << "New number of bins in HErr Q: " << CutEdges(fHBlindPixelErrQ,30) << endl;414 fErrBlindPixel Qfirst = fHBlindPixelErrQ->GetBinLowEdge(fHBlindPixelErrQ->GetXaxis()->GetFirst());415 fErrBlindPixel Qlast = fHBlindPixelErrQ->GetBinLowEdge(fHBlindPixelErrQ->GetXaxis()->GetLast())+fHBlindPixelErrQ->GetBinWidth(0);416 fErrBlindPixel Qnbins = nbins;417 418 CutEdges(fHBlindPixel QvsN,0);419 420 } 421 422 Bool_t MHCalibrationBlindPixel::FitT (Axis_t rmin, Axis_t rmax, Option_t *opt)407 *fLog << "New number of bins in HSinCharge: " << CutEdges(fHBlindPixelCharge,nbins) << endl; 408 409 fBlindPixelChargefirst = fHBlindPixelCharge->GetBinLowEdge(fHBlindPixelCharge->GetXaxis()->GetFirst()); 410 fBlindPixelChargelast = fHBlindPixelCharge->GetBinLowEdge(fHBlindPixelCharge->GetXaxis()->GetLast())+fHBlindPixelCharge->GetBinWidth(0); 411 fBlindPixelChargenbins = nbins; 412 413 *fLog << "New number of bins in HErrCharge: " << CutEdges(fHBlindPixelErrCharge,30) << endl; 414 fErrBlindPixelChargefirst = fHBlindPixelErrCharge->GetBinLowEdge(fHBlindPixelErrCharge->GetXaxis()->GetFirst()); 415 fErrBlindPixelChargelast = fHBlindPixelErrCharge->GetBinLowEdge(fHBlindPixelErrCharge->GetXaxis()->GetLast())+fHBlindPixelErrCharge->GetBinWidth(0); 416 fErrBlindPixelChargenbins = nbins; 417 418 CutEdges(fHBlindPixelChargevsN,0); 419 420 } 421 422 Bool_t MHCalibrationBlindPixel::FitTime(Axis_t rmin, Axis_t rmax, Option_t *opt) 423 423 { 424 424 … … 429 429 rmax = (rmax != 0.) ? rmax : 9.; 430 430 431 const Stat_t entries = fHBlindPixelT ->GetEntries();432 const Double_t mu_guess = fHBlindPixelT ->GetBinCenter(fHBlindPixelT->GetMaximumBin());431 const Stat_t entries = fHBlindPixelTime->GetEntries(); 432 const Double_t mu_guess = fHBlindPixelTime->GetBinCenter(fHBlindPixelTime->GetMaximumBin()); 433 433 const Double_t sigma_guess = (rmax - rmin)/2.; 434 434 const Double_t area_guess = entries/gkSq2Pi; … … 441 441 fTimeGausFit->SetParLimits(2,0.,rmax-rmin); 442 442 443 fHBlindPixelT ->Fit(fTimeGausFit,opt);443 fHBlindPixelTime->Fit(fTimeGausFit,opt); 444 444 445 445 rmin = fTimeGausFit->GetParameter(1) - 2.*fTimeGausFit->GetParameter(2); … … 447 447 fTimeGausFit->SetRange(rmin,rmax); 448 448 449 fHBlindPixelT ->Fit(fTimeGausFit,opt);450 451 452 fMeanT = fTimeGausFit->GetParameter(2);453 fSigmaT = fTimeGausFit->GetParameter(3);454 fMeanT Err = fTimeGausFit->GetParError(2);455 fSigmaT Err = fTimeGausFit->GetParError(3);449 fHBlindPixelTime->Fit(fTimeGausFit,opt); 450 451 452 fMeanTime = fTimeGausFit->GetParameter(2); 453 fSigmaTime = fTimeGausFit->GetParameter(3); 454 fMeanTimeErr = fTimeGausFit->GetParError(2); 455 fSigmaTimeErr = fTimeGausFit->GetParError(3); 456 456 457 457 Float_t prob = fTimeGausFit->GetProb(); -
trunk/MagicSoft/Mars/mhist/MHCalibrationBlindPixel.h
r2599 r2603 32 32 private: 33 33 34 TH1I* fHBlindPixel Q; //-> Histogram with the single Phe spectrum35 TH1F* fHBlindPixelErr Q; //-> Variance of summed FADC slices36 TH1I* fHBlindPixelT ; //-> Variance of summed FADC slices37 TH1I* fHBlindPixel QvsN; //-> Summed Charge vs. Event Nr.34 TH1I* fHBlindPixelCharge; //-> Histogram with the single Phe spectrum 35 TH1F* fHBlindPixelErrCharge; //-> Variance of summed FADC slices 36 TH1I* fHBlindPixelTime; //-> Variance of summed FADC slices 37 TH1I* fHBlindPixelChargevsN; //-> Summed Charge vs. Event Nr. 38 38 39 39 TF1 *fSinglePheFit; 40 40 TF1 *fTimeGausFit; 41 41 42 Axis_t fBlindPixel Qfirst;43 Axis_t fBlindPixel Qlast;44 Int_t fBlindPixel Qnbins;42 Axis_t fBlindPixelChargefirst; 43 Axis_t fBlindPixelChargelast; 44 Int_t fBlindPixelChargenbins; 45 45 46 Axis_t fErrBlindPixel Qfirst;47 Axis_t fErrBlindPixel Qlast;48 Int_t fErrBlindPixel Qnbins;46 Axis_t fErrBlindPixelChargefirst; 47 Axis_t fErrBlindPixelChargelast; 48 Int_t fErrBlindPixelChargenbins; 49 49 50 50 void ResetBin(Int_t i); … … 73 73 Int_t fNdf; 74 74 75 Double_t fMeanT ;76 Double_t fMeanT Err;77 Double_t fSigmaT ;78 Double_t fSigmaT Err;75 Double_t fMeanTime; 76 Double_t fMeanTimeErr; 77 Double_t fSigmaTime; 78 Double_t fSigmaTimeErr; 79 79 80 80 public: … … 83 83 ~MHCalibrationBlindPixel(); 84 84 85 Bool_t FillBlindPixel Q(Int_t q) { return fHBlindPixelQ->Fill(q) > -1; }86 Bool_t FillErrBlindPixel Q(Float_t errq) { return fHBlindPixelErrQ->Fill(errq) > -1; }87 Bool_t FillBlindPixelT (Int_t t) { return fHBlindPixelT->Fill(t) > -1; }88 Bool_t FillBlindPixel QvsN(Stat_t rq, Int_t t) { return fHBlindPixelQvsN->Fill(t,rq) > -1; }85 Bool_t FillBlindPixelCharge(Int_t q) { return fHBlindPixelCharge->Fill(q) > -1; } 86 Bool_t FillErrBlindPixelCharge(Float_t errq) { return fHBlindPixelErrCharge->Fill(errq) > -1; } 87 Bool_t FillBlindPixelTime(Int_t t) { return fHBlindPixelTime->Fill(t) > -1; } 88 Bool_t FillBlindPixelChargevsN(Stat_t rq, Int_t t) { return fHBlindPixelChargevsN->Fill(t,rq) > -1; } 89 89 90 90 const Double_t GetLambda() const { return fLambda; } … … 104 104 const Int_t GetNdf() const { return fNdf; } 105 105 106 const Double_t GetMeanT () const { return fMeanT; }107 const Double_t GetMeanT Err() const { return fMeanTErr; }108 const Double_t GetSigmaT () const { return fSigmaT; }109 const Double_t GetSigmaT Err() const { return fSigmaTErr; }106 const Double_t GetMeanTime() const { return fMeanTime; } 107 const Double_t GetMeanTimeErr() const { return fMeanTimeErr; } 108 const Double_t GetSigmaTime() const { return fSigmaTime; } 109 const Double_t GetSigmaTimeErr() const { return fSigmaTimeErr; } 110 110 111 const TH1F *GetHErr Q() { return fHBlindPixelErrQ; }112 const TH1F *GetHErr Q() const { return fHBlindPixelErrQ; }111 const TH1F *GetHErrCharge() { return fHBlindPixelErrCharge; } 112 const TH1F *GetHErrCharge() const { return fHBlindPixelErrCharge; } 113 113 114 114 Bool_t SimulateSinglePhe(Double_t lambda, … … 119 119 120 120 Bool_t FitSinglePhe(Axis_t rmin=0, Axis_t rmax=0, Option_t *opt="R0+"); 121 Bool_t FitT (Axis_t rmin=0., Axis_t rmax=0.,Option_t *opt="R0+");121 Bool_t FitTime(Axis_t rmin=0., Axis_t rmax=0.,Option_t *opt="R0+"); 122 122 123 123 void ChangeFitFunc(BlindPixelFitFunc fitfunc, Int_t par=5); -
trunk/MagicSoft/Mars/mhist/MHCalibrationConfig.h
r2599 r2603 20 20 const Int_t gkStartPINDiodeBinNr = 4000; 21 21 22 // Starting number of bins for the histo: (maximum possible by hardware = 40800)23 const Int_t gkStartPixelBinNr = 20000;24 25 // Starting number for the highest value of the Q-histo:26 const Axis_t gkStartQlast = 10000.;27 28 22 // Square root of 2 pi: 29 23 const Float_t gkSq2Pi = 2.506628274631; -
trunk/MagicSoft/Mars/mhist/MHCalibrationPINDiode.cc
r2525 r2603 67 67 68 68 // Create a large number of bins, later we will rebin 69 f Qfirst = 0;70 f Qlast = gkStartPINDiodeBinNr;71 f Qnbins = gkStartPINDiodeBinNr;69 fChargeFirst = 0; 70 fChargeLast = gkStartPINDiodeBinNr; 71 fChargeNbins = gkStartPINDiodeBinNr; 72 72 73 fHP Q = new TH1I("HPQ","Distribution of Summed FADC Slices",fQnbins,fQfirst,fQlast);74 fHP Q->SetXTitle("Sum FADC Slices");75 fHP Q->SetYTitle("Nr. of events");76 fHP Q->Sumw2();73 fHPCharge = new TH1I("HPCharge","Distribution of Summed FADC Slices",fChargeNbins,fChargeFirst,fChargeLast); 74 fHPCharge->SetXTitle("Sum FADC Slices"); 75 fHPCharge->SetYTitle("Nr. of events"); 76 fHPCharge->Sumw2(); 77 77 78 fErr Qfirst = 0.;79 fErr Qlast = gkStartPINDiodeBinNr;80 fErr Qnbins = gkStartPINDiodeBinNr;78 fErrChargeFirst = 0.; 79 fErrChargeLast = gkStartPINDiodeBinNr; 80 fErrChargeNbins = gkStartPINDiodeBinNr; 81 81 82 fHErr Q = new TH1F("HErrQ","Distribution of Variances of Summed FADC Slices",fErrQnbins,fErrQfirst,fErrQlast);83 fHErr Q->SetXTitle("Variance Summed FADC Slices");84 fHErr Q->SetYTitle("Nr. of events");85 fHErr Q->Sumw2();82 fHErrCharge = new TH1F("HErrCharge","Distribution of Variances of Summed FADC Slices",fErrChargeNbins,fErrChargeFirst,fErrChargeLast); 83 fHErrCharge->SetXTitle("Variance Summed FADC Slices"); 84 fHErrCharge->SetYTitle("Nr. of events"); 85 fHErrCharge->Sumw2(); 86 86 87 87 Int_t tfirst = 0; … … 89 89 Int_t nbins = 32; 90 90 91 fHPT = new TH1I("HPT","Distribution of Mean Arrival Times",nbins,tfirst,tlast);92 fHPT ->SetXTitle("Mean Arrival Times [FADC slice nr]");93 fHPT ->SetYTitle("Nr. of events");94 fHPT ->Sumw2();91 fHPTime = new TH1I("HPTime","Distribution of Mean Arrival Times",nbins,tfirst,tlast); 92 fHPTime->SetXTitle("Mean Arrival Times [FADC slice nr]"); 93 fHPTime->SetYTitle("Nr. of events"); 94 fHPTime->Sumw2(); 95 95 96 96 } … … 99 99 { 100 100 101 delete fHP Q;102 delete fHErr Q;101 delete fHPCharge; 102 delete fHErrCharge; 103 103 104 104 if (fVarGausFit) 105 105 delete fVarGausFit; 106 106 107 delete fHPT ;107 delete fHPTime; 108 108 109 109 } -
trunk/MagicSoft/Mars/mhist/MHCalibrationPINDiode.h
r2525 r2603 26 26 private: 27 27 28 TH1I* fHP Q; //-> Histogram containing the summed 32 PINDiode slices29 TH1F* fHErr Q; //-> Variance of summed FADC slices30 TH1I* fHPT ; //-> Histogram with time evolution of summed charges28 TH1I* fHPCharge; //-> Histogram containing the summed 32 PINDiode slices 29 TH1F* fHErrCharge; //-> Variance of summed FADC slices 30 TH1I* fHPTime; //-> Histogram with time evolution of summed charges 31 31 32 32 33 33 TF1 *fVarGausFit; 34 34 35 Float_t fErr Qfirst;36 Float_t fErr Qlast;37 UShort_t fErr Qnbins;35 Float_t fErrChargeFirst; 36 Float_t fErrChargeLast; 37 UShort_t fErrChargeNbins; 38 38 39 39 public: … … 42 42 ~MHCalibrationPINDiode(); 43 43 44 const Double_t GetT () const { return fVarGausFit->GetParameter(2); }45 const Double_t GetErrT () const { return fVarGausFit->GetParameter(3); }44 const Double_t GetTime() const { return fVarGausFit->GetParameter(2); } 45 const Double_t GetErrTime() const { return fVarGausFit->GetParameter(3); } 46 46 47 47 ClassDef(MHCalibrationPINDiode, 0) -
trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.cc
r2599 r2603 62 62 MHCalibrationPixel::MHCalibrationPixel(const char *name, const char *title) 63 63 : fPixId(-1), 64 f QGausFit(NULL),65 fT GausFit(NULL),64 fChargeGausFit(NULL), 65 fTimeGausFit(NULL), 66 66 fFitLegend(NULL), 67 67 fLowerFitRange(0.), 68 68 fFitOK(kFALSE), 69 f QChisquare(-1.),70 f QProb(-1.),71 f QNdf(-1),72 fT Chisquare(-1.),73 fT Prob(-1.),74 fT Ndf(-1)69 fChargeChisquare(-1.), 70 fChargeProb(-1.), 71 fChargeNdf(-1), 72 fTimeChisquare(-1.), 73 fTimeProb(-1.), 74 fTimeNdf(-1) 75 75 { 76 76 … … 78 78 fTitle = title ? title : "Fill the accumulated charges and times of all events and perform fits"; 79 79 80 TString qtitle = "Distribution of Summed FADC Slices Pixel ";81 82 80 // Create a large number of bins, later we will rebin 83 fQfirst = -0.5; 84 fQlast = gkStartQlast - 0.5; 85 fQnbins = gkStartPixelBinNr; 86 87 fHQ = new TH1I("HQ",qtitle.Data(), 88 fQnbins,fQfirst,fQlast); 89 fHQ->SetXTitle("Sum FADC Slices"); 90 fHQ->SetYTitle("Nr. of events"); 91 fHQ->Sumw2(); 92 93 fHQ->SetDirectory(NULL); 94 95 TString ttitle = "Distribution of Mean Arrival Times Pixel "; 81 fChargeFirst = -0.5; 82 fChargeLast = 10000. - 0.5; 83 fChargeNbins = 20000; 84 85 fHCharge = new TH1I("HCharge","Distribution of Summed FADC Slices Pixel ", 86 fChargeNbins,fChargeFirst,fChargeLast); 87 fHCharge->SetXTitle("Sum FADC Slices"); 88 fHCharge->SetYTitle("Nr. of events"); 89 fHCharge->Sumw2(); 90 91 fHCharge->SetDirectory(NULL); 96 92 97 93 Axis_t tfirst = -0.5; 98 94 Axis_t tlast = 15.5; 99 Int_t nbins= 16;100 101 fHT = new TH1I("HT",ttitle.Data(),102 n bins,tfirst,tlast);103 fHT ->SetXTitle("Mean Arrival Times [FADC slice nr]");104 fHT ->SetYTitle("Nr. of events");105 fHT ->Sumw2();106 107 fHT ->SetDirectory(NULL);95 Int_t ntbins = 16; 96 97 fHTime = new TH1I("HTime","Distribution of Mean Arrival Times Pixel ", 98 ntbins,tfirst,tlast); 99 fHTime->SetXTitle("Mean Arrival Times [FADC slice nr]"); 100 fHTime->SetYTitle("Nr. of events"); 101 fHTime->Sumw2(); 102 103 fHTime->SetDirectory(NULL); 108 104 109 105 TString qvsntitle = "Sum of Charges vs. Event Number Pixel "; 110 106 111 107 // We define a reasonable number and later enlarge it if necessary 112 nbins = 20000;108 Int_t nqbins = 20000; 113 109 Axis_t nfirst = -0.5; 114 Axis_t nlast = (Axis_t)n bins - 0.5;115 116 fH QvsN = new TH1I("HQvsN",qvsntitle.Data(),117 n bins,nfirst,nlast);118 fH QvsN->SetXTitle("Event Nr.");119 fH QvsN->SetYTitle("Sum of FADC slices");120 121 fH QvsN->SetDirectory(NULL);110 Axis_t nlast = (Axis_t)nqbins - 0.5; 111 112 fHChargevsN = new TH1I("HChargevsN",qvsntitle.Data(), 113 nqbins,nfirst,nlast); 114 fHChargevsN->SetXTitle("Event Nr."); 115 fHChargevsN->SetYTitle("Sum of FADC slices"); 116 117 fHChargevsN->SetDirectory(NULL); 122 118 123 119 } … … 126 122 { 127 123 128 delete fH Q;129 delete fHT ;130 delete fH QvsN;131 132 if (f QGausFit)133 delete f QGausFit;134 if (fT GausFit)135 delete fT GausFit;124 delete fHCharge; 125 delete fHTime; 126 delete fHChargevsN; 127 128 if (fChargeGausFit) 129 delete fChargeGausFit; 130 if (fTimeGausFit) 131 delete fTimeGausFit; 136 132 if (fFitLegend) 137 133 delete fFitLegend; … … 145 141 fPixId = id; 146 142 147 TString nameQ = TString(fH Q->GetName());143 TString nameQ = TString(fHCharge->GetName()); 148 144 nameQ += id; 149 fH Q->SetName(nameQ.Data());150 151 TString nameT = TString(fHT ->GetName());145 fHCharge->SetName(nameQ.Data()); 146 147 TString nameT = TString(fHTime->GetName()); 152 148 nameT += id; 153 fHT ->SetName(nameT.Data());154 155 TString nameQvsN = TString(fH QvsN->GetName());149 fHTime->SetName(nameT.Data()); 150 151 TString nameQvsN = TString(fHChargevsN->GetName()); 156 152 nameQvsN += id; 157 fHQvsN->SetName(nameQvsN.Data()); 153 fHChargevsN->SetName(nameQvsN.Data()); 154 155 TString titleQ = TString(fHCharge->GetTitle()); 156 titleQ += id; 157 fHCharge->SetTitle(titleQ.Data()); 158 159 TString titleT = TString(fHTime->GetTitle()); 160 titleT += id; 161 fHTime->SetTitle(titleT.Data()); 162 163 TString titleQvsN = TString(fHChargevsN->GetTitle()); 164 titleQvsN += id; 165 fHChargevsN->SetTitle(titleQvsN.Data()); 158 166 } 159 167 … … 162 170 { 163 171 164 for (Int_t i = fHQ->FindBin(fQfirst); i <= fHQ->FindBin(fQlast); i++) 165 fHQ->SetBinContent(i, 1.e-20); 172 for (Int_t i = fHCharge->FindBin(fChargeFirst); 173 i <= fHCharge->FindBin(fChargeLast); i++) 174 fHCharge->SetBinContent(i, 1.e-20); 166 175 167 176 for (Int_t i = 0; i < 16; i++) 168 fHT ->SetBinContent(i, 1.e-20);169 170 f Qlast = gkStartQlast;171 172 fH Q->GetXaxis()->SetRangeUser(0.,fQlast);177 fHTime->SetBinContent(i, 1.e-20); 178 179 fChargeLast = 9999.5; 180 181 fHCharge->GetXaxis()->SetRangeUser(0.,fChargeLast); 173 182 174 183 return; … … 183 192 { 184 193 185 fH Q->Reset();186 fHT ->Reset();194 fHCharge->Reset(); 195 fHTime->Reset(); 187 196 188 197 return kTRUE; … … 208 217 fFitLegend->SetTextSize(0.05); 209 218 210 char line1[32]; 211 sprintf(line1,"Mean: Q_{#mu} = %2.2f #pm %2.2f",fQMean,fQMeanErr); 219 const TString line1 = 220 Form("Mean: Q_{#mu} = %2.2f #pm %2.2f",fChargeMean,fChargeMeanErr); 221 212 222 fFitLegend->AddText(line1); 213 223 214 char line4[32]; 215 sprintf(line4,"Sigma: #sigma_{Q} = %2.2f #pm %2.2f",fQSigma,fQSigmaErr); 224 225 const TString line4 = 226 Form("Sigma: #sigma_{Q} = %2.2f #pm %2.2f",fChargeSigma,fChargeSigmaErr); 227 216 228 fFitLegend->AddText(line4); 217 229 218 char line7[32]; 219 sprintf(line7,"#chi^{2} / N_{dof}: %4.2f / %3i",fQChisquare,fQNdf); 230 231 const TString line7 = 232 Form("#chi^{2} / N_{dof}: %4.2f / %3i",fChargeChisquare,fChargeNdf); 233 220 234 fFitLegend->AddText(line7); 221 235 222 char line8[32]; 223 sprintf(line8,"Probability: %4.3f ",fQProb); 236 237 const TString line8 = 238 Form("Probability: %4.3f ",fChargeProb); 239 224 240 fFitLegend->AddText(line8); 241 225 242 226 243 if (fFitOK) … … 256 273 gPad->SetTicks(); 257 274 258 fH Q->DrawCopy(opt);275 fHCharge->Draw(opt); 259 276 260 if (f QGausFit)277 if (fChargeGausFit) 261 278 { 262 279 if (fFitOK) 263 f QGausFit->SetLineColor(kGreen);280 fChargeGausFit->SetLineColor(kGreen); 264 281 else 265 f QGausFit->SetLineColor(kRed);266 267 f QGausFit->DrawCopy("same");282 fChargeGausFit->SetLineColor(kRed); 283 284 fChargeGausFit->Draw("same"); 268 285 c->Modified(); 269 286 c->Update(); … … 279 296 280 297 gPad->SetLogy(1); 281 fHT ->DrawCopy(opt);282 283 if (fT GausFit)298 fHTime->Draw(opt); 299 300 if (fTimeGausFit) 284 301 { 285 if (fT Chisquare > 1.)286 fT GausFit->SetLineColor(kRed);302 if (fTimeChisquare > 1.) 303 fTimeGausFit->SetLineColor(kRed); 287 304 else 288 fT GausFit->SetLineColor(kGreen);289 290 fT GausFit->DrawCopy("same");305 fTimeGausFit->SetLineColor(kGreen); 306 307 fTimeGausFit->Draw("same"); 291 308 c->Modified(); 292 309 c->Update(); … … 297 314 298 315 c->cd(4); 299 fH QvsN->DrawCopy(opt);300 } 301 302 303 304 Bool_t MHCalibrationPixel::FitT (Axis_t rmin, Axis_t rmax, Option_t *option)305 { 306 307 if (fT GausFit)316 fHChargevsN->Draw(opt); 317 } 318 319 320 321 Bool_t MHCalibrationPixel::FitTime(Axis_t rmin, Axis_t rmax, Option_t *option) 322 { 323 324 if (fTimeGausFit) 308 325 return kFALSE; 309 326 … … 311 328 rmax = (rmax != 0.) ? rmax : 9.; 312 329 313 const Stat_t entries = fHT ->GetEntries();314 const Double_t mu_guess = fHT ->GetBinCenter(fHT->GetMaximumBin());330 const Stat_t entries = fHTime->GetEntries(); 331 const Double_t mu_guess = fHTime->GetBinCenter(fHTime->GetMaximumBin()); 315 332 const Double_t sigma_guess = (rmax - rmin)/2.; 316 333 const Double_t area_guess = entries/gkSq2Pi; … … 318 335 TString name = TString("GausTime"); 319 336 name += fPixId; 320 fT GausFit = new TF1(name.Data(),"gaus",rmin,rmax);321 322 if (!fT GausFit)337 fTimeGausFit = new TF1(name.Data(),"gaus",rmin,rmax); 338 339 if (!fTimeGausFit) 323 340 { 324 341 *fLog << err << dbginf << "Could not create fit function for Gauss fit" << endl; … … 326 343 } 327 344 328 fTGausFit->SetParameters(area_guess,mu_guess,sigma_guess); 329 fTGausFit->SetParNames("Area","#mu","#sigma"); 330 fTGausFit->SetParLimits(0,0.,entries); 331 fTGausFit->SetParLimits(1,rmin,rmax); 332 fTGausFit->SetParLimits(2,0.,(rmax-rmin)/2.); 333 fTGausFit->SetRange(rmin,rmax); 334 335 fHT->Fit(fTGausFit,option); 336 337 rmin = fTGausFit->GetParameter(1) - 3.*fTGausFit->GetParameter(2); 338 rmax = fTGausFit->GetParameter(1) + 3.*fTGausFit->GetParameter(2); 339 fTGausFit->SetRange(rmin,rmax); 340 341 fHT->Fit(fTGausFit,option); 342 343 fTChisquare = fTGausFit->GetChisquare(); 344 fTNdf = fTGausFit->GetNDF(); 345 fTProb = fTGausFit->GetProb(); 346 fTMean = fTGausFit->GetParameter(1); 347 fTSigma = fTGausFit->GetParameter(2); 348 349 if (fTChisquare > 1.) 345 fTimeGausFit->SetParameters(area_guess,mu_guess,sigma_guess); 346 fTimeGausFit->SetParNames("Area","#mu","#sigma"); 347 fTimeGausFit->SetParLimits(0,0.,entries); 348 fTimeGausFit->SetParLimits(1,rmin,rmax); 349 fTimeGausFit->SetParLimits(2,0.,(rmax-rmin)); 350 fTimeGausFit->SetRange(rmin,rmax); 351 352 fHTime->Fit(fTimeGausFit,option); 353 354 rmin = fTimeGausFit->GetParameter(1) - 3.*fTimeGausFit->GetParameter(2); 355 rmax = fTimeGausFit->GetParameter(1) + 3.*fTimeGausFit->GetParameter(2); 356 fTimeGausFit->SetRange(rmin,rmax); 357 358 fHTime->Fit(fTimeGausFit,option); 359 360 fTimeChisquare = fTimeGausFit->GetChisquare(); 361 fTimeNdf = fTimeGausFit->GetNDF(); 362 fTimeProb = fTimeGausFit->GetProb(); 363 364 fTimeMean = fTimeGausFit->GetParameter(1); 365 fTimeSigma = fTimeGausFit->GetParameter(2); 366 367 if (fTimeChisquare > 1.) 350 368 { 351 369 *fLog << warn << "Fit of the Arrival times failed ! " << endl; … … 357 375 } 358 376 359 Bool_t MHCalibrationPixel::Fit Q(Option_t *option)360 { 361 362 if (f QGausFit)377 Bool_t MHCalibrationPixel::FitCharge(Option_t *option) 378 { 379 380 if (fChargeGausFit) 363 381 return kFALSE; 364 382 … … 366 384 // Get the fitting ranges 367 385 // 368 Axis_t rmin = (fLowerFitRange != 0.) ? fLowerFitRange : f Qfirst;386 Axis_t rmin = (fLowerFitRange != 0.) ? fLowerFitRange : fChargeFirst; 369 387 Axis_t rmax = 0.; 370 388 … … 373 391 // otherwise the fit goes gaga because of high number of dimensions ... 374 392 // 375 const Stat_t entries = fHQ->GetEntries();376 const Double_t ar _guess = entries/gkSq2Pi;377 const Double_t mu_guess = fHQ->GetBinCenter(fHQ->GetMaximumBin());378 const Double_t si _guess = mu_guess/50.;379 380 TString name = TString(" QGausFit");393 const Stat_t entries = fHCharge->GetEntries(); 394 const Double_t area_guess = entries/gkSq2Pi; 395 const Double_t mu_guess = fHCharge->GetBinCenter(fHCharge->GetMaximumBin()); 396 const Double_t sigma_guess = mu_guess/15.; 397 398 TString name = TString("ChargeGausFit"); 381 399 name += fPixId; 382 400 383 f QGausFit = new TF1(name.Data(),"gaus",rmin,fQlast);384 385 if (!f QGausFit)401 fChargeGausFit = new TF1(name.Data(),"gaus",rmin,fChargeLast); 402 403 if (!fChargeGausFit) 386 404 { 387 405 *fLog << err << dbginf << "Could not create fit function for Gauss fit" << endl; … … 389 407 } 390 408 391 fQGausFit->SetParameters(ar_guess,mu_guess,si_guess); 392 fQGausFit->SetParNames("Area","#mu","#sigma"); 393 fQGausFit->SetParLimits(0,0.,entries); 394 fQGausFit->SetParLimits(1,rmin,fQlast); 395 fQGausFit->SetParLimits(2,0.,fQlast-rmin); 396 fQGausFit->SetRange(rmin,fQlast); 397 fQGausFit->Update(); 398 399 fHQ->Fit(fQGausFit,option); 400 401 rmin = fQGausFit->GetParameter(1) - 3.*fQGausFit->GetParameter(2); 402 rmax = fQGausFit->GetParameter(1) + 3.*fQGausFit->GetParameter(2); 403 404 fQGausFit->SetRange(rmin,rmax); 405 fHQ->Fit(fQGausFit,option); 406 407 rmin = fQGausFit->GetParameter(1) - 3.5*fQGausFit->GetParameter(2); 408 rmax = fQGausFit->GetParameter(1) + 3.5*fQGausFit->GetParameter(2); 409 410 fQGausFit->SetRange(rmin,rmax); 411 fHQ->Fit(fQGausFit,option); 412 413 fQChisquare = fQGausFit->GetChisquare(); 414 fQNdf = fQGausFit->GetNDF(); 415 fQProb = fQGausFit->GetProb(); 416 fQMean = fQGausFit->GetParameter(1); 417 fQMeanErr = fQGausFit->GetParError(1); 418 fQSigma = fQGausFit->GetParameter(2); 419 fQSigmaErr = fQGausFit->GetParError(2); 409 fChargeGausFit->SetParameters(area_guess,mu_guess,sigma_guess); 410 fChargeGausFit->SetParNames("Area","#mu","#sigma"); 411 fChargeGausFit->SetParLimits(0,0.,entries); 412 fChargeGausFit->SetParLimits(1,rmin,fChargeLast); 413 fChargeGausFit->SetParLimits(2,0.,fChargeLast-rmin); 414 fChargeGausFit->SetRange(rmin,fChargeLast); 415 416 fHCharge->Fit(fChargeGausFit,option); 417 418 Axis_t rtry = fChargeGausFit->GetParameter(1) - 2.5*fChargeGausFit->GetParameter(2); 419 420 rmin = (rtry < rmin ? rmin : rtry); 421 rmax = fChargeGausFit->GetParameter(1) + 2.5*fChargeGausFit->GetParameter(2); 422 fChargeGausFit->SetRange(rmin,rmax); 423 424 fHCharge->Fit(fChargeGausFit,option); 425 426 // rmin = fChargeGausFit->GetParameter(1) - 2.5*fChargeGausFit->GetParameter(2); 427 // rmax = fChargeGausFit->GetParameter(1) + 2.5*fChargeGausFit->GetParameter(2); 428 // fChargeGausFit->SetRange(rmin,rmax); 429 430 // fHCharge->Fit(fChargeGausFit,option); 431 432 fChargeChisquare = fChargeGausFit->GetChisquare(); 433 fChargeNdf = fChargeGausFit->GetNDF(); 434 fChargeProb = fChargeGausFit->GetProb(); 435 fChargeMean = fChargeGausFit->GetParameter(1); 436 fChargeMeanErr = fChargeGausFit->GetParError(1); 437 fChargeSigma = fChargeGausFit->GetParameter(2); 438 fChargeSigmaErr = fChargeGausFit->GetParError(2); 420 439 421 440 // … … 423 442 // The Probability is greater than gkProbLimit (default 0.01 == 99%) 424 443 // 425 if (f QProb < gkProbLimit)444 if (fChargeProb < gkProbLimit) 426 445 { 427 *fLog << warn << "Prob: " << f QProb << " is smaller than the allowed value: " << gkProbLimit << endl;446 *fLog << warn << "Prob: " << fChargeProb << " is smaller than the allowed value: " << gkProbLimit << endl; 428 447 fFitOK = kFALSE; 429 448 return kFALSE; … … 442 461 Int_t nbins = 50; 443 462 444 CutEdges(fH Q,nbins);445 446 f Qfirst = fHQ->GetBinLowEdge(fHQ->GetXaxis()->GetFirst());447 f Qlast = fHQ->GetBinLowEdge(fHQ->GetXaxis()->GetLast())+fHQ->GetBinWidth(0);448 f Qnbins = nbins;449 450 CutEdges(fH QvsN,0);451 452 } 453 454 void MHCalibrationPixel::Print QFitResult()455 { 456 457 *fLog << "Results of the Summed Charges Fit: " << endl;458 *fLog << "Chisquare: " << f QChisquare << endl;459 *fLog << "DoF: " << f QNdf << endl;460 *fLog << "Probability: " << f QProb << endl;461 *fLog << endl;462 463 } 464 465 void MHCalibrationPixel::PrintT FitResult()466 { 467 468 *fLog << "Results of the Arrival Time Slices Fit: "<< endl;469 *fLog << "Chisquare: " << fT Chisquare << endl;470 *fLog << "Ndf: " << fT Ndf << endl;471 *fLog << "Probability: " << fT Prob << endl;472 *fLog << endl;473 474 } 463 CutEdges(fHCharge,nbins); 464 465 fChargeFirst = fHCharge->GetBinLowEdge(fHCharge->GetXaxis()->GetFirst()); 466 fChargeLast = fHCharge->GetBinLowEdge(fHCharge->GetXaxis()->GetLast())+fHCharge->GetBinWidth(0); 467 fChargeNbins = nbins; 468 469 CutEdges(fHChargevsN,0); 470 471 } 472 473 void MHCalibrationPixel::PrintChargeFitResult() 474 { 475 476 *fLog << "Results of the Summed Charges Fit: " << endl; 477 *fLog << "Chisquare: " << fChargeChisquare << endl; 478 *fLog << "DoF: " << fChargeNdf << endl; 479 *fLog << "Probability: " << fChargeProb << endl; 480 *fLog << endl; 481 482 } 483 484 void MHCalibrationPixel::PrintTimeFitResult() 485 { 486 487 *fLog << "Results of the Time Slices Fit: " << endl; 488 *fLog << "Chisquare: " << fTimeChisquare << endl; 489 *fLog << "Ndf: " << fTimeNdf << endl; 490 *fLog << "Probability: " << fTimeProb << endl; 491 *fLog << endl; 492 493 } -
trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.h
r2599 r2603 31 31 protected: 32 32 33 TH1I* fHQ; //-> Summed FADC slices 34 TH1I* fHT; //-> Mean arrival time in number of FADC sice 35 36 TH1I* fHQvsN; //-> Summed Charge vs. Event Nr. 33 TH1I* fHCharge; //-> Summed FADC slices 34 TH1I* fHTime; //-> Mean arrival time in number of FADC sice 35 TH1I* fHChargevsN; //-> Summed Charge vs. Event Nr. 37 36 38 TF1* f QGausFit;39 TF1* fT GausFit;37 TF1* fChargeGausFit; 38 TF1* fTimeGausFit; 40 39 41 40 TPaveText *fFitLegend; 42 41 43 42 Axis_t fLowerFitRange; 44 Axis_t f Qfirst;45 Axis_t f Qlast;46 Int_t f Qnbins;43 Axis_t fChargeFirst; 44 Axis_t fChargeLast; 45 Int_t fChargeNbins; 47 46 48 47 Bool_t fFitOK; 49 48 50 Double_t f QChisquare;51 Double_t f QProb;52 Int_t f QNdf;49 Double_t fChargeChisquare; 50 Double_t fChargeProb; 51 Int_t fChargeNdf; 53 52 54 Double_t f QMean;55 Double_t f QMeanErr;56 Double_t f QSigma;57 Double_t f QSigmaErr;53 Double_t fChargeMean; 54 Double_t fChargeMeanErr; 55 Double_t fChargeSigma; 56 Double_t fChargeSigmaErr; 58 57 59 Double_t fT Chisquare;60 Double_t fT Prob;61 Int_t fT Ndf;58 Double_t fTimeChisquare; 59 Double_t fTimeProb; 60 Int_t fTimeNdf; 62 61 63 Double_t fT Mean;64 Double_t fT Sigma;62 Double_t fTimeMean; 63 Double_t fTimeSigma; 65 64 66 65 virtual void DrawLegend(); … … 76 75 Bool_t Fill(const MParContainer *, const Stat_t w=1) { return kTRUE; } 77 76 78 Bool_t Fill Q(Int_t q) { return fHQ->Fill(q) > -1;}79 Bool_t FillT (Int_t t) { return fHT->Fill(t) > -1;}80 Bool_t Fill QvsN(Float_t q, Int_t n) { return fHQvsN->Fill(n,q) > -1; }77 Bool_t FillCharge(Int_t q) { return fHCharge->Fill(q) > -1; } 78 Bool_t FillTime(Int_t t) { return fHTime->Fill(t) > -1; } 79 Bool_t FillChargevsN(Float_t q, Int_t n) { return fHChargevsN->Fill(n,q) > -1; } 81 80 82 const TH1I *GetH Q() { return fHQ;}83 const TH1I *GetH Q() const { return fHQ;}81 const TH1I *GetHCharge() { return fHCharge; } 82 const TH1I *GetHCharge() const { return fHCharge; } 84 83 85 const Double_t Get QMean() const { return fQMean;}86 const Double_t Get QMeanErr() const { return fQMeanErr; }87 const Double_t Get QSigma() const { return fQSigma;}88 const Double_t Get QSigmaErr() const { return fQSigmaErr; }89 const Double_t GetArea() const { return fQGausFit->GetParameter(0); }90 const Double_t GetAreaErr() const { return fQGausFit->GetParError(0);}84 const Double_t GetChargeMean() const { return fChargeMean; } 85 const Double_t GetChargeMeanErr() const { return fChargeMeanErr; } 86 const Double_t GetChargeSigma() const { return fChargeSigma; } 87 const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; } 88 const Double_t GetArea() const { return fChargeGausFit->GetParameter(0); } 89 const Double_t GetAreaErr() const { return fChargeGausFit->GetParError(0); } 91 90 92 const Double_t Get QChiSquare() const { return fQChisquare; }93 const Double_t Get QProb() const { return fQProb; }94 const Int_t Get QNdf() const { return fQNdf; }91 const Double_t GetChargeChiSquare() const { return fChargeChisquare; } 92 const Double_t GetChargeProb() const { return fChargeProb; } 93 const Int_t GetChargeNdf() const { return fChargeNdf; } 95 94 96 const Double_t GetT Mean() const { return fTMean;}97 const Double_t GetT Sigma() const { return fTSigma; }95 const Double_t GetTimeMean() const { return fTimeMean; } 96 const Double_t GetTimeSigma() const { return fTimeSigma; } 98 97 99 const Double_t GetT ChiSquare() const { return fTChisquare; }100 const Double_t GetT Prob() const { return fTProb;}101 const Int_t GetT Ndf() const { return fTNdf; }98 const Double_t GetTimeChiSquare() const { return fTimeChisquare; } 99 const Double_t GetTimeProb() const { return fTimeProb; } 100 const Int_t GetTimeNdf() const { return fTimeNdf; } 102 101 103 const TH1I *GetHT () { return fHT; }104 const TH1I *GetHT () const { return fHT; }102 const TH1I *GetHTime() { return fHTime; } 103 const TH1I *GetHTime() const { return fHTime; } 105 104 106 const TH1I *GetH QvsN() { return fHQvsN; }107 const TH1I *GetH QvsN() const { return fHQvsN; }105 const TH1I *GetHChargevsN() { return fHChargevsN; } 106 const TH1I *GetHChargevsN() const { return fHChargevsN; } 108 107 109 Bool_t Fit Q(Option_t *option="RQ0");110 Bool_t FitT (Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");108 Bool_t FitCharge(Option_t *option="RQ0"); 109 Bool_t FitTime(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0"); 111 110 112 111 virtual void Draw(Option_t *option=""); … … 116 115 void SetLowerFitRange(Axis_t min) { fLowerFitRange = min; } 117 116 118 void Print QFitResult();119 void PrintT FitResult();117 void PrintChargeFitResult(); 118 void PrintTimeFitResult(); 120 119 121 Bool_t IsFit ted() { return fFitOK; }120 Bool_t IsFitOK() { return fFitOK; } 122 121 123 122 ClassDef(MHCalibrationPixel, 1)
Note:
See TracChangeset
for help on using the changeset viewer.