22 double m = 0, M = 7000;
25 for (
float pt = m;
pt < M; ++
pt)
29 cerr <<
"No threshold was found from " << m <<
" to " << M <<
".\nAborting.\n";
46 template<
typename STREAM>
56 int mbin = h->GetXaxis()->FindBin( from),
57 Mbin = h->GetXaxis()->FindBin(3*from);
58 float m = h->GetBinLowEdge(mbin+1), M = h->GetBinLowEdge(Mbin);
59 for (
int bin = 0; bin <= mbin; ++bin) {
60 h->SetBinContent(bin, 0);
61 h->SetBinError (bin, 0);
63 for (
int bin = Mbin+1; bin <= h->GetNbinsX()+1; ++bin) {
64 h->SetBinContent(bin, 0);
65 h->SetBinError (bin, 0);
68 cout <<
"Fitting trigger " << trigger <<
" from " << m <<
" to " << M << endl;
71 TF1 *
f =
new TF1(Form(
"sigmoid%d", trigger),
72 "[0]+0.5*(1-[0])*(1+erf((x-[1])/[2]))",
75 f->SetParNames(
"a",
"#mu",
"#sigma");
78 f->SetParameter(0,0.1);
79 f->SetParLimits(0,0,0.9);
81 f->SetParameter(1,1.1*trigger);
82 f->SetParLimits(1,m,M);
84 f->SetParameter(2,10);
85 f->SetParLimits(2,1,150);
90 float turnon =
GetX(
f);
92 Stream << trigger <<
'\t' << turnon <<
'\n';
107 int mbin = h->GetXaxis()->FindBin( from),
108 Mbin = h->GetXaxis()->FindBin(6*from);
109 for (
int bin = 0; bin < mbin; ++bin) {
110 h->SetBinContent(bin, 0);
111 h->SetBinError (bin, 0);
113 for (
int bin = Mbin+1; bin <= h->GetNbinsX()+1; ++bin) {
114 h->SetBinContent(bin, 0);
115 h->SetBinError (bin, 0);
117 for (
int bin = mbin; bin <= Mbin; ++bin) {
118 float content = h->GetBinContent(bin);
119 if (content < minEff)
continue;
120 float turnon = h->GetBinLowEdge(bin);
121 Stream << trigger <<
'\t' << turnon <<
'\n';