NucleonAbsorptionOutOfTargetReweighter.cpp
Go to the documentation of this file.
1 
2 
5 
6 #include <cstdlib>
7 
8 #include <iostream>
9 
10 namespace NeutrinoFluxReweight{
11 
12  NucleonAbsorptionOutOfTargetReweighter::NucleonAbsorptionOutOfTargetReweighter(int iuniv, const ParameterTable& cv_pars, const ParameterTable& univ_pars):cvPars(cv_pars),univPars(univ_pars),iUniv(iuniv){
13 
14  // const boost::interprocess::flat_map<std::string, double>& dsig_table = univPars.getMap();
15  inel_piAl_xsec = univPars.getParameterValue("inel_piAl_xsec");
16 
17  }
19 
20  }
22 
23  std::vector<bool> this_nodes;
24  //int index_vol = 0;
25  double low_val = 1.E-20;
26 
27  std::vector<ParticlesThroughVolumesData> vec_ptv = aa.ptv_info;
28 
29  bool passVOL = false;
30  //Cheking at least one ancestor with amount of materail value:
31  for(int index_vol =0;index_vol<3;index_vol++){
32  for(int ii=0;ii<3;ii++){
33  passVOL = passVOL || (vec_ptv[index_vol].AmountMat[ii] >low_val && (vec_ptv[index_vol].Pdgs[ii]==2212 || vec_ptv[index_vol].Pdgs[ii]==2112));
34  }
35  }
36  this_nodes.push_back(passVOL);
37  return this_nodes;
38 
39  }
41 
42  std::vector<ParticlesThroughVolumesData> vec_ptv = aa.ptv_info;
43  double shift = inel_piAl_xsec;
44 
45  double NA_mb = 6.02E-4;
46  double wgt = 1.0;
47  double tot_dist = 0.0;
48  double low_val = 1.E-20;
49 
50  for(int index_vol =0;index_vol<3;index_vol++){
51  for(int ii=0;ii<3;ii++){
52  tot_dist = vec_ptv[index_vol].AmountMat[ii];
53  if(tot_dist<low_val)continue;
54  if(vec_ptv[index_vol].Pdgs[ii]!=2212 && vec_ptv[index_vol].Pdgs[ii]!=2112) continue;
55  tot_dist *= NA_mb;
56  tot_dist *= shift;
57  wgt *= exp(-1.0*tot_dist);
58  }
59  }
60 
61  return wgt;
62 
63  }
64 
65 }
A list/table of parameter names and values.
virtual double calculateWeight(const InteractionChainData &aa)
calculate a weight for this interaction chain given the central value parameters and the parameters f...
Information about the chain of interactions leading to a neutrino.
double getParameterValue(const std::string &name) const
get the value of a parameter. throw an exception of a well defined type if we don&#39;t have it ...
std::vector< ParticlesThroughVolumesData > ptv_info
Information about all particles that pass through volumes without interacting.
NucleonAbsorptionOutOfTargetReweighter(int iuniv, const ParameterTable &cv_pars, const ParameterTable &univ_pars)
virtual std::vector< bool > canReweight(const InteractionChainData &aa)
Look through the InteractionChainData input and identify those Interactions that can be reweighted as...