OtherAbsorptionOutOfTargetReweighter.cpp
Go to the documentation of this file.
1 
2 
5 
6 #include <cstdlib>
7 
8 #include <iostream>
9 
10 namespace NeutrinoFluxReweight{
11 
12  OtherAbsorptionOutOfTargetReweighter::OtherAbsorptionOutOfTargetReweighter(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_kapAl_xsec_lowP = univPars.getParameterValue("inel_kapAl_xsec_lowP");
16  inel_kapAl_xsec_highP = univPars.getParameterValue("inel_kapAl_xsec_highP");
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 
32  for(int index_vol=0;index_vol<3;index_vol++){
33  for(int ii=0;ii<3;ii++){
34  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 && vec_ptv[index_vol].Pdgs[ii]!=2212 && vec_ptv[index_vol].Pdgs[ii]!=2112 && abs(vec_ptv[index_vol].Pdgs[ii])>99));
35  }
36  }
37  this_nodes.push_back(passVOL);
38  return this_nodes;
39 
40  }
42 
43  std::vector<ParticlesThroughVolumesData> vec_ptv = aa.ptv_info;
44 
45  double shift_lowP = inel_kapAl_xsec_lowP;
46  double shift_highP = inel_kapAl_xsec_highP;
47 
48  double NA_mb = 6.02E-4;
49  double wgt = 1.0;
50  double tot_dist = 0.0;
51  double low_val = 1.E-20;
52 
53  for(int index_vol=0;index_vol<3;index_vol++){
54  for(int ii=0;ii<3;ii++){
55 
56  tot_dist = vec_ptv[index_vol].AmountMat[ii];
57  if(tot_dist<low_val)continue;
58  if(abs(vec_ptv[index_vol].Pdgs[ii])==321 || abs(vec_ptv[index_vol].Pdgs[ii])==211 || vec_ptv[index_vol].Pdgs[ii]==2212 || vec_ptv[index_vol].Pdgs[ii]==2112 || abs(vec_ptv[index_vol].Pdgs[ii])<100)continue;
59 
60  tot_dist *= NA_mb;
61  if(vec_ptv[index_vol].Moms[ii]<2.0){
62  tot_dist *= shift_lowP;
63  }
64  else if(vec_ptv[index_vol].Moms[ii]>=2.0){
65  tot_dist *= shift_highP;
66  }
67  wgt *= exp(-1.0*tot_dist);
68  }
69  }
70  return wgt;
71 
72  }
73 
74 }
A list/table of parameter names and values.
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 ...
virtual double calculateWeight(const InteractionChainData &aa)
calculate a weight for this interaction chain given the central value parameters and the parameters f...
T abs(T value)
std::vector< ParticlesThroughVolumesData > ptv_info
Information about all particles that pass through volumes without interacting.
virtual std::vector< bool > canReweight(const InteractionChainData &aa)
Look through the InteractionChainData input and identify those Interactions that can be reweighted as...
OtherAbsorptionOutOfTargetReweighter(int iuniv, const ParameterTable &cv_pars, const ParameterTable &univ_pars)