5 #ifndef EFTRACKINGEMULATION_FAKETRACKSMEARER_H
6 #define EFTRACKINGEMULATION_FAKETRACKSMEARER_H
10 #include "TGraphErrors.h"
20 #include "FitFunctions/URD/d0Fitparam_N.C"
21 #include "FitFunctions/URD/z0Fitparam_N.C"
22 #include "FitFunctions/URD/effFitparam_N.C"
23 #include "FitFunctions/URD/effFitparam_LRT.C"
24 #include "FitFunctions/URD/ptqoptFitparam_N.C"
52 printf(
"Entering Prepare\n");
56 d0res_eta=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){return d0ResFunc(x[0],p[0]=10.,0); },0.0,4.0,1);
58 z0res_eta=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){return z0ResFunc(x[0],p[0]=10.,0); },0.0,4.0,1);
60 curvres_eta=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){return curvResFunc(x[0],p[0]=10.,0); },0.0,4.0,1);
63 d0ref_eta=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){return d0RefFunc(x[0],p[0]=10.,0); },0.0,4.0,1);
65 z0ref_eta=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){return z0RefFunc(x[0],p[0]=10.,0); },0.0,4.0,1);
69 d0res_pt=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){return d0ResFunc(p[0]=1.,x[0],0); },1.0,200.0,1);
71 z0res_pt=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){return z0ResFunc(p[0]=1.,x[0],0); },1.0,200.0,1);
73 curvres_pt=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){return curvResFunc(p[0]=1.,x[0],0); },1.0,200.0,1);
76 d0ref_pt=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){return d0RefFunc(p[0]=1.,x[0],0); },1.0,200.0,1);
78 z0ref_pt=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){return z0RefFunc(p[0]=1.,x[0],0); },1.0,200.0,1);
83 effLRT_d0=
new TF1(
name.c_str(),[&](
double*
x,
double*
p){p[0]=1.;return effFuncLRT(x[0],0); },0.,600.0,1);
91 return FitFunctions::getd0ResParam_N(
eta,
pt,
verbose)/1000.0;
97 return FitFunctions::getz0ResParam_N(
eta,
pt,
verbose)/1000.0;
160 for (
int i=0;
i<
n;
i++)
a[
i]=in[
i];
193 double abseta = std::abs(
eta);
194 double abspt = std::abs(1.0/
curv);
195 double absd0 = std::abs(
d0);
196 if (
verbose) printf(
"Smearer::AddTrack: Initial track: curv = %f, phi=%f, eta=%f, d0=%f, z0=%f (pt=%f)\n",
curv,
phi,
eta,
d0,
z0, abspt);
217 if (
verbose) printf(
"Smearer::AddTrack: Smearing parameters: curv = %f, phi=%f, eta=%f, d0=%f, z0=%f\n", curvres, phires, etares, d0res, z0res);
220 #ifdef STANDALONE_FAKETRACKSMEARER
226 #ifdef STANDALONE_FAKETRACKSMEARER
227 d0Sim->Fill(s_narrow_d0_model->Eval(abseta));
228 z0Sim->Fill(s_narrow_z0_model->Eval(abseta));
254 if (
verbose) printf(
"Smearer::AddTrack: Now producing %d tracks\n", ntracks);
255 for (
int i=0;
i<ntracks;
i++)
259 double gend0,genz0, geneta, genphi, gencurv;
272 curvres/gencurv/gencurv,
279 if (
verbose) printf(
"Smearer::AddTrack: Producing this track: curv = %f, phi=%f, eta=%f, d0=%f, z0=%f pt=%f (ptres=%f)\n",gencurv, genphi, geneta, gend0, genz0,
Track.pt(),
Track.sigma_pt());
284 if (
verbose) printf(
"Smearer::AddTrack: Adding track with pt=%f ==> track #%d\n",
Track.pt(),
m_ntracks);
286 else if (
verbose) printf(
"Smearer::AddTrack: No track added because of the output pt cut\n");
297 TCanvas *d0rescanvas=(TCanvas *)gROOT->FindObjectAny(
"d0rescanvas");
298 if (d0rescanvas==NULL) d0rescanvas=
new TCanvas(
"d0rescanvas");
311 printf(
"Smearer::EnableFakes: Warning: you are reconfiguring fakes production but it seems you have already processed events with this instance of FakeTracksSmearer\n");
318 printf(
"Smearer::FakeKillerEnable: Warning: you are reconfiguring fakes production but it seems you have already processed events with this instance of FakeTracksSmearer (FakeKillerEnable)\n");
325 printf(
"Smearer::IncludeFakesInResolutionCalculation: Warning: you are reconfiguring fakes production but it seems you have already processed events with this instance of FakeTracksSmearer (IncluldeFakesInResolutionCalculation)\n");
332 printf(
"Smearer::UseCoinToss: Warning: you are reconfiguring fakes production but it seems you have already processed events with this instance of FakeTracksSmearer (UseCoinToss)\n");
360 std::vector<EFTrackingSmearing::FTS_Track>
Tracks;