119 simb::MCFlux kaon =
fGenTool->GetNext();
122 bool is_kaon = kaonp.kaon_pdg != 0;
126 std::cout <<
"Flux is kaon (" << is_kaon <<
"). Weight: " << kaonp.weight <<
". Produced with energy: " << kaonp.mom.E()
127 <<
" M=" << kaonp.mom.M() <<
" P=(" << kaonp.mom.Px() <<
", " << kaonp.mom.Py() <<
", " << kaonp.mom.Pz() <<
") At: ("
128 << kaonp.pos.X() <<
", " << kaonp.pos.Y() <<
", " << kaonp.pos.Z() <<
")" << std::endl;
136 success =
fFluxTool->MakeFlux(kaon, flux, flux_weight);
137 if (!success)
continue;
139 std::cout <<
"New flux. E=" << flux.
mom.E() <<
" At: (" << flux.
pos.X() <<
", " << flux.
pos.Y() <<
", " << flux.
pos.Z() <<
")" << std::endl;
140 std::cout <<
"P=(" << flux.
mom.Px() <<
", " << flux.
mom.Py() <<
", " << flux.
mom.Pz() <<
")" << std::endl;
141 std::cout <<
"Flux weight: " << flux_weight << std::endl;
146 TVector3 det(0., 0., 0.);
147 double costh = flux.
kmom.Vect().Unit().Dot((det - flux.
pos.Vect()).Unit());
148 std::cout <<
"COSTH CRIT: " << costh_crit <<
" DETECTOR COSTH: " << costh << std::endl;
149 if (costh < costh_crit)
continue;
154 std::vector<double> weightsum(
fRayTools.size(), 0.);
155 std::vector<double> time(
fRayTools.size(), 0.);
157 std::array<TVector3, 2> intersection;
161 for (
unsigned icall = 0; icall <
fNCall; icall++) {
162 success =
r->IntersectDetector(flux, intersection, ray_weight);
163 if (!success) ray_weight = 0.;
164 weightsum[iray] += ray_weight;
168 std::chrono::duration<double, std::milli> duration = t2 - t1;
169 time[iray] = duration.count();
175 for (
unsigned iray = 0; iray < fRayTools.size(); iray++) {
176 std::cout << fRayTools[iray]->Name() <<
" " << (time[iray] /
fNCall) <<
" " << (weightsum[iray] / fNCall) << std::endl;
180 std::array<TVector3, 2> intersection;
182 for (
unsigned iray = 0; iray < fRayTools.size(); iray++) {
std::vector< std::unique_ptr< evgen::ldm::IRayTrace > > fRayTools
std::unique_ptr< evgen::ldm::IMesonGen > fGenTool
std::unique_ptr< evgen::ldm::IMeVPrtlFlux > fFluxTool
double minKinematicCosTheta(double parentM, double secM, double prtlM, double parentE)
BEGIN_PROLOG could also be cout
std::vector< double > fBranchWeights