56 srand (static_cast <unsigned> (
time(NULL)));
57 if (name ==
"TOF1" || name ==
"TRIG2"){
58 Float_t delta_t = 20.;
60 Float_t t_test = t - delta_t/2. + static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX/(delta_t)));
61 Float_t p_test = static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX));
63 while (p_test > p_gauss){
64 p_test = static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX));
65 t_test = t -delta_t/2. + static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX/(delta_t)));
70 if (name ==
"BPROFEXT" || name ==
"BPROF4"){
71 Float_t delta_x = 40.;
73 Float_t x_test = x -delta_x/2. + static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX/(delta_x)));
74 Float_t p_test = static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX));
76 while (p_test > p_gauss){
77 p_test = static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX));
78 x_test = x -delta_x/2. + static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX/(delta_x)));
83 Float_t delta_y = 40.;
85 Float_t
y_test = y -delta_y/2. + static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX/(delta_y)));
86 p_test = static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX));
88 while (p_test > p_gauss){
89 p_test = static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX));
90 y_test = y -delta_y + static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX/(delta_y)));
95 if (name ==
"CHERENKOV1"){
97 Float_t p_test = static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX));
100 Float_t Ptot =
pow(
pow(Px,2)+
pow(Py,2)+
pow(Pz,2),0.5)/1000.;
102 if (
abs(PDGid) == 2212 ||
abs(PDGid) == 310) fSmearedVar1 = 0;
103 if (
abs(PDGid) == 11) fSmearedVar1 = 1;
104 if (
abs(PDGid) == 211) fSmearedVar1 = 1;
106 if (Ptot <= 3.0 && Ptot >2.0){
107 if (
abs(PDGid) == 2212 ||
abs(PDGid) == 310) fSmearedVar1 = 0;
108 if (
abs(PDGid) == 11) fSmearedVar1 = 1;
109 if (
abs(PDGid) == 211) fSmearedVar1 = 1;
111 if (Ptot <= 5.0 && Ptot > 3.0){
112 if (
abs(PDGid) == 2212 ||
abs(PDGid) == 310) fSmearedVar1 = 0;
113 if (
abs(PDGid) == 11) fSmearedVar1 = 1;
114 if (
abs(PDGid) == 211) fSmearedVar1 = 1;
117 if (
abs(PDGid) == 2212 ||
abs(PDGid) == 310) fSmearedVar1 = 0;
118 if (
abs(PDGid) == 11) fSmearedVar1 = 0;
119 if (
abs(PDGid) == 211) fSmearedVar1 = 1;
123 std::cout <<
"Cherenkov 1: " << fSmearedVar1 <<
std::endl;
125 if (name ==
"CHERENKOV2"){
127 Float_t p_test = static_cast <
float> (rand()) /( static_cast <float> (RAND_MAX));
130 Float_t Ptot =
pow(
pow(Px,2)+
pow(Py,2)+
pow(Pz,2),0.5)/1000.;
132 if (
abs(PDGid) == 2212 ||
abs(PDGid) == 310) fSmearedVar1 = 0;
133 if (
abs(PDGid) == 11) fSmearedVar1 = 0;
134 if (
abs(PDGid) == 211) fSmearedVar1 = 1;
136 if (Ptot <= 3.0 && Ptot >2.0){
137 if (
abs(PDGid) == 2212 ||
abs(PDGid) == 310) fSmearedVar1 = 0;
138 if (
abs(PDGid) == 11) fSmearedVar1 = 0;
139 if (
abs(PDGid) == 211) fSmearedVar1 = 1;
141 if (Ptot <= 5.0 && Ptot > 3.0){
142 if (
abs(PDGid) == 2212 ||
abs(PDGid) == 310) fSmearedVar1 = 0;
143 if (
abs(PDGid) == 11) fSmearedVar1 = 0;
144 if (
abs(PDGid) == 211) fSmearedVar1 = 1;
147 if (
abs(PDGid) == 2212 ||
abs(PDGid) == 310) fSmearedVar1 = 0;
148 if (
abs(PDGid) == 11) fSmearedVar1 = 0;
149 if (
abs(PDGid) == 211) fSmearedVar1 = 1;
151 std::cout <<
"Cherenkov 2: " << fSmearedVar1 <<
std::endl;
167 fX = position[0];
fY = position[1];
fZ = position[2];
fT =
t;
168 fPx = momentum[0];
fPy = momentum[1];
fPz = momentum[2];
187 fX = position.X();
fY = position.Y();
fZ = position.Z();
fT =
t;
188 fPx = momentum.X();
fPy = momentum.Y();
fPz = momentum.Z();
~ProtoDUNEBeamInstrument()
ProtoDUNEBeamInstrument()
Code to link reconstructed objects back to the MC truth information.
std::string fInstrumentName
def momentum(x1, x2, x3, scale=1.)
QTextStream & endl(QTextStream &s)
Float_t UnitGauss(Float_t mean, Float_t value, Float_t sigma)