Public Member Functions | Public Attributes | Private Attributes | List of all members
NeutrinoFluxReweight::AbsorptionDVOLReweighter Class Reference

#include <AbsorptionDVOLReweighter.h>

Inheritance diagram for NeutrinoFluxReweight::AbsorptionDVOLReweighter:
NeutrinoFluxReweight::IInteractionChainReweighting

Public Member Functions

 AbsorptionDVOLReweighter (int iuniv, const ParameterTable &cv_pars, const ParameterTable &univ_pars)
 
virtual ~AbsorptionDVOLReweighter ()
 
virtual std::vector< boolcanReweight (const InteractionChainData &aa)
 Look through the InteractionChainData input and identify those Interactions that can be reweighted as part of a chain. We return a vector indicating which elements will be assigned a weight by calculateWeight. More...
 
virtual double calculateWeight (const InteractionChainData &aa)
 calculate a weight for this interaction chain given the central value parameters and the parameters for this universe. The weight is something like: f(cv)/f(MC) * f(univ)/f(cv) where cv in this case corresponds to the best value of the parameter, given the data. If univ_pars=cv_pars then we are calculating a central value weight. Note, canReweight() should be called to determine which elements of the chain are covered by the weight returned by calculateWeight() More...
 
- Public Member Functions inherited from NeutrinoFluxReweight::IInteractionChainReweighting
virtual ~IInteractionChainReweighting ()
 

Public Attributes

const ParameterTablecvPars
 
const ParameterTableunivPars
 

Private Attributes

int iUniv
 
float inel_piAl_xsec
 
float inel_kapAl_xsec_lowP
 
float inel_kapAl_xsec_highP
 
float inel_kamAl_xsec_lowP
 
float inel_kamAl_xsec_highP
 

Detailed Description

Definition at line 16 of file AbsorptionDVOLReweighter.h.

Constructor & Destructor Documentation

NeutrinoFluxReweight::AbsorptionDVOLReweighter::AbsorptionDVOLReweighter ( int  iuniv,
const ParameterTable cv_pars,
const ParameterTable univ_pars 
)

The constructor. Note, we pass central value and single universe parameters in this constructor only. There is thus a 1 to 1 correspondence between an instance of this class and a given universe.

Definition at line 12 of file AbsorptionDVOLReweighter.cpp.

12  :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  }
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 ...
NeutrinoFluxReweight::AbsorptionDVOLReweighter::~AbsorptionDVOLReweighter ( )
virtual

Definition at line 22 of file AbsorptionDVOLReweighter.cpp.

22  {
23 
24  }

Member Function Documentation

double NeutrinoFluxReweight::AbsorptionDVOLReweighter::calculateWeight ( const InteractionChainData aa)
virtual

calculate a weight for this interaction chain given the central value parameters and the parameters for this universe. The weight is something like: f(cv)/f(MC) * f(univ)/f(cv) where cv in this case corresponds to the best value of the parameter, given the data. If univ_pars=cv_pars then we are calculating a central value weight. Note, canReweight() should be called to determine which elements of the chain are covered by the weight returned by calculateWeight()

Implements NeutrinoFluxReweight::IInteractionChainReweighting.

Definition at line 42 of file AbsorptionDVOLReweighter.cpp.

42  {
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 = 2;
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  }
std::string string
Definition: nybbler.cc:12
T abs(T value)
std::vector< bool > NeutrinoFluxReweight::AbsorptionDVOLReweighter::canReweight ( const InteractionChainData aa)
virtual

Look through the InteractionChainData input and identify those Interactions that can be reweighted as part of a chain. We return a vector indicating which elements will be assigned a weight by calculateWeight.

Implements NeutrinoFluxReweight::IInteractionChainReweighting.

Definition at line 25 of file AbsorptionDVOLReweighter.cpp.

25  {
26 
27  std::vector<bool> this_nodes;
28  int index_vol = 2;
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  }
T abs(T value)

Member Data Documentation

const ParameterTable& NeutrinoFluxReweight::AbsorptionDVOLReweighter::cvPars

Definition at line 27 of file AbsorptionDVOLReweighter.h.

float NeutrinoFluxReweight::AbsorptionDVOLReweighter::inel_kamAl_xsec_highP
private

Definition at line 33 of file AbsorptionDVOLReweighter.h.

float NeutrinoFluxReweight::AbsorptionDVOLReweighter::inel_kamAl_xsec_lowP
private

Definition at line 33 of file AbsorptionDVOLReweighter.h.

float NeutrinoFluxReweight::AbsorptionDVOLReweighter::inel_kapAl_xsec_highP
private

Definition at line 32 of file AbsorptionDVOLReweighter.h.

float NeutrinoFluxReweight::AbsorptionDVOLReweighter::inel_kapAl_xsec_lowP
private

Definition at line 32 of file AbsorptionDVOLReweighter.h.

float NeutrinoFluxReweight::AbsorptionDVOLReweighter::inel_piAl_xsec
private

Definition at line 31 of file AbsorptionDVOLReweighter.h.

int NeutrinoFluxReweight::AbsorptionDVOLReweighter::iUniv
private

Definition at line 30 of file AbsorptionDVOLReweighter.h.

const ParameterTable& NeutrinoFluxReweight::AbsorptionDVOLReweighter::univPars

Definition at line 28 of file AbsorptionDVOLReweighter.h.


The documentation for this class was generated from the following files: