37 double maxbin = histo_q_vs_t->GetMaximumBin();
44 for(
int ibin = maxbin; ibin > 1; ibin--){
45 if(histo_q_vs_t->GetBinContent(ibin) < 0.1 * QMaxHisto) {
50 double startvalues[5] = {0};
51 double fitlimup[5] = {0};
52 double fitlimlow[5] = {0};
54 double meanfirstbin = (histo_q_vs_t->GetBinContent(minbin-1) + histo_q_vs_t->GetBinContent(minbin-2) + histo_q_vs_t->GetBinContent(minbin-3))/3.;
55 double sigma_MFB = TMath::Sqrt( ( pow(histo_q_vs_t->GetBinContent(minbin-1) - meanfirstbin, 2) + pow(histo_q_vs_t->GetBinContent(minbin-2) - meanfirstbin,2) + pow(histo_q_vs_t->GetBinContent(minbin-3)- meanfirstbin,2)) / 3.);
56 if(sigma_MFB < TMath::Abs(meanfirstbin)) sigma_MFB = TMath::Abs(meanfirstbin);
58 startvalues[0] = meanfirstbin;
59 startvalues[1] = QMaxHisto;
60 startvalues[2] = 0.5* (minbin + maxbin) *
tstep;
61 startvalues[3] = 0.5*
tstep;
64 fitlimlow[0] = startvalues[0] - 2 * sigma_MFB;
65 fitlimlow[1] = startvalues[1] - 0.3 * startvalues[1];
66 fitlimlow[2] = minbin *
tstep;
67 fitlimlow[3] = 0.1*
tstep;
69 fitlimup[0] = startvalues[0] + 2 * sigma_MFB;
70 fitlimup[1] = startvalues[1] + 0.3 * startvalues[1];
71 fitlimup[2] = maxbin *
tstep;
72 fitlimup[3] = 0.9*
tstep;
82 double minFD = minbin - 4;
83 double maxFD = maxbin + 0;
85 TF1 f_FD(
"f_FD",
"[0] + [1]/(1+TMath::Exp(-(x - [2])/[3]))", minFD*
tstep, maxFD*
tstep);
86 f_FD.SetParameters(startvalues[0], startvalues[1], startvalues[2], startvalues[3]);
87 f_FD.SetParLimits(0, fitlimlow[0], fitlimup[0]);
88 f_FD.SetParLimits(1, fitlimlow[1], fitlimup[1]);
89 f_FD.SetParLimits(2, fitlimlow[2], fitlimup[2]);
90 f_FD.SetParLimits(3, fitlimlow[3], fitlimup[3]);
92 gStyle->SetOptFit(1111);
93 histo_q_vs_t->Fit(
"f_FD",
"WQRB");
96 tFD = gRandom->Gaus(f_FD.GetParameter(2), 8);
98 dtFD = f_FD.GetParError(2);