AbsorptionICReweighter.cpp
Go to the documentation of this file.
1 
2 
5 
6 #include <cstdlib>
7 
8 #include <iostream>
9 
10 namespace NeutrinoFluxReweight{
11 
12  AbsorptionICReweighter::AbsorptionICReweighter(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  inel_kapAl_xsec_lowP = univPars.getParameterValue("inel_kapAl_xsec_lowP");
17  inel_kapAl_xsec_highP = univPars.getParameterValue("inel_kapAl_xsec_highP");
18  inel_kamAl_xsec_lowP = univPars.getParameterValue("inel_kamAl_xsec_lowP");
19  inel_kamAl_xsec_highP = univPars.getParameterValue("inel_kamAl_xsec_highP");
20 
21  }
23 
24  }
26 
27  std::vector<bool> this_nodes;
28  int index_vol = 0;
29  double low_val = 1.E-20;
30 
31  std::vector<ParticlesThroughVolumesData> vec_ptv = aa.ptv_info;
32 
33  bool passVOL = false;
34  //Cheking at least one ancestor with amount of materail value:
35  for(int ii=0;ii<3;ii++){
36  passVOL = passVOL || (vec_ptv[index_vol].AmountMat[ii] >low_val && (abs(vec_ptv[index_vol].Pdgs[ii])==211 || abs(vec_ptv[index_vol].Pdgs[ii])==321));
37  }
38  this_nodes.push_back(passVOL);
39  return this_nodes;
40 
41  }
43 
44  std::vector<ParticlesThroughVolumesData> vec_ptv = aa.ptv_info;
45  std::string namepar;
46  double NA_mb = 6.02E-4;
47  double wgt = 1.0;
48  double tot_dist = 0.0;
49  double low_val = 1.E-20;
50  int index_vol = 0;
51 
52  for(int ii=0;ii<3;ii++){
53  float shift = 0.0;
54  tot_dist = vec_ptv[index_vol].AmountMat[ii];
55  if(tot_dist<low_val)continue;
56  if(abs(vec_ptv[index_vol].Pdgs[ii])!=321 && abs(vec_ptv[index_vol].Pdgs[ii])!=211)continue;
57 
58  if(abs(vec_ptv[index_vol].Pdgs[ii])== 211)shift = inel_piAl_xsec;
59  else if(vec_ptv[index_vol].Pdgs[ii]== 321 && vec_ptv[index_vol].Moms[ii]<2.0)shift = inel_kapAl_xsec_lowP;
60  else if(vec_ptv[index_vol].Pdgs[ii]== 321 && vec_ptv[index_vol].Moms[ii]>2.0)shift = inel_kapAl_xsec_highP;
61  else if(vec_ptv[index_vol].Pdgs[ii]==-321 && vec_ptv[index_vol].Moms[ii]<2.0)shift = inel_kamAl_xsec_lowP;
62  else if(vec_ptv[index_vol].Pdgs[ii]==-321 && vec_ptv[index_vol].Moms[ii]>2.0)shift = inel_kamAl_xsec_highP;
63 
64  tot_dist *= NA_mb;
65  tot_dist *= shift;
66 
67  wgt *= exp(-1.0*tot_dist);
68  }
69 
70  return wgt;
71 
72  }
73 
74 }
virtual double calculateWeight(const InteractionChainData &aa)
calculate a weight for this interaction chain given the central value parameters and the parameters f...
A list/table of parameter names and values.
std::string string
Definition: nybbler.cc:12
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 ...
AbsorptionICReweighter(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...
T abs(T value)
std::vector< ParticlesThroughVolumesData > ptv_info
Information about all particles that pass through volumes without interacting.