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

Reweight a MC survival probabiity when the particles through volumes. More...

#include <NucleonAbsorptionOutOfTargetReweighter.h>

Inheritance diagram for NeutrinoFluxReweight::NucleonAbsorptionOutOfTargetReweighter:
NeutrinoFluxReweight::IInteractionChainReweighting

Public Member Functions

 NucleonAbsorptionOutOfTargetReweighter (int iuniv, const ParameterTable &cv_pars, const ParameterTable &univ_pars)
 
virtual ~NucleonAbsorptionOutOfTargetReweighter ()
 
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
 

Detailed Description

Reweight a MC survival probabiity when the particles through volumes.

Definition at line 16 of file NucleonAbsorptionOutOfTargetReweighter.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file NucleonAbsorptionOutOfTargetReweighter.cpp.

18  {
19 
20  }

Member Function Documentation

double NeutrinoFluxReweight::NucleonAbsorptionOutOfTargetReweighter::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 40 of file NucleonAbsorptionOutOfTargetReweighter.cpp.

40  {
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  }
std::vector< bool > NeutrinoFluxReweight::NucleonAbsorptionOutOfTargetReweighter::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 21 of file NucleonAbsorptionOutOfTargetReweighter.cpp.

21  {
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  }

Member Data Documentation

const ParameterTable& NeutrinoFluxReweight::NucleonAbsorptionOutOfTargetReweighter::cvPars

Definition at line 27 of file NucleonAbsorptionOutOfTargetReweighter.h.

float NeutrinoFluxReweight::NucleonAbsorptionOutOfTargetReweighter::inel_piAl_xsec
private

Definition at line 31 of file NucleonAbsorptionOutOfTargetReweighter.h.

int NeutrinoFluxReweight::NucleonAbsorptionOutOfTargetReweighter::iUniv
private

Definition at line 30 of file NucleonAbsorptionOutOfTargetReweighter.h.

const ParameterTable& NeutrinoFluxReweight::NucleonAbsorptionOutOfTargetReweighter::univPars

Definition at line 28 of file NucleonAbsorptionOutOfTargetReweighter.h.


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