265 std::map<int, int> myMap;
286 TVector3 P(myPx, myPy, myPz);
288 double myPmag = P.Mag();
290 int in = myMap.find(myPdg)->second;
292 if (model ==
"duneCdr")
295 double (*resolution_ptr_duneCdr[18])(double, double, double) = {
315 double resolution = (*resolution_ptr_duneCdr[in])(myE, myKE, myPmag);
317 if (resolution == -1)
328 var += pow((resolution * myKE), 2);
333 var += pow((resolution * myE), 2);
337 double m = log(eSq / (pow(var + eSq, 0.5)));
338 double s = pow(log(1 + (var / eSq)), 0.5);
340 std::lognormal_distribution<double> distLognorm(m, s);
346 std::uniform_real_distribution<double> distUni(0, 1);
348 if (distUni(
gen) < 0.1)
354 return 0.6 * (distLognorm(
gen));
359 return 0.6 * (distLognorm(
gen));
364 return distLognorm(
gen);
371 else if (model ==
"default")
373 double info[18][2] = {
394 double resolution = info[in][0];
395 double chanceToSee = info[in][1];
401 var += pow((resolution * myKE), 2);
406 var += pow((resolution * myE), 2);
410 double m = log(eSq / (pow(var + eSq, 0.5)));
411 double s = pow(log(1 + (var / eSq)), 0.5);
413 std::lognormal_distribution<double> distLognorm(m, s);
414 std::uniform_real_distribution<double> distUni(0, 1);
416 if (distUni(
gen) < chanceToSee)
420 return distLognorm(
gen);
434 std::cout <<
"Error: Resolution model not found./n";
double Gamma_Res_duneCdr(double myE, double myKE, double myPmag)
double Proton_Res_duneCdr(double myE, double myKE, double myPmag)
double AntiMuon_Res_duneCdr(double myE, double myKE, double myPmag)
double Electron_Res_duneCdr(double myE, double myKE, double myPmag)
static constexpr double s
double K0_Res_duneCdr(double myE, double myKE, double myPmag)
double Sigma0_Res_duneCdr(double myE, double myKE, double myPmag)
double KP_Res_duneCdr(double myE, double myKE, double myPmag)
double AntiK0_Res_duneCdr(double myE, double myKE, double myPmag)
double SigmaM_Res_duneCdr(double myE, double myKE, double myPmag)
double Positron_Res_duneCdr(double myE, double myKE, double myPmag)
double SigmaP_Res_duneCdr(double myE, double myKE, double myPmag)
double Pi0_Res_duneCdr(double myE, double myKE, double myPmag)
double PiP_Res_duneCdr(double myE, double myKE, double myPmag)
double Lambda_Res_duneCdr(double myE, double myKE, double myPmag)
double Neutron_Res_duneCdr(double myE, double myKE, double myPmag)
bool IsNeutronOrProton(int pdgc)
double PiM_Res_duneCdr(double myE, double myKE, double myPmag)
double Muon_Res_duneCdr(double myE, double myKE, double myPmag)
static constexpr double m
double KM_Res_duneCdr(double myE, double myKE, double myPmag)