Changeset 2603 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 12/05/03 01:08:44 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
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.