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

Reweighter of thin target nC interactions. More...

#include <ThinTargetnCPionReweighter.h>

Inheritance diagram for NeutrinoFluxReweight::ThinTargetnCPionReweighter:
NeutrinoFluxReweight::IInteractionReweighting

Public Member Functions

 ThinTargetnCPionReweighter (int iuniv, const ParameterTable &cv_pars, const ParameterTable &univ_pars)
 
virtual ~ThinTargetnCPionReweighter ()
 
virtual bool canReweight (const InteractionData &aa)
 can the particular instance of this class reweight this interaction? More...
 
virtual double calculateWeight (const InteractionData &aa)
 calculate a weight for this interaction 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 More...
 
- Public Member Functions inherited from NeutrinoFluxReweight::IInteractionReweighting
virtual ~IInteractionReweighting ()
 

Private Attributes

int iUniv
 
const ParameterTablecvPars
 
const ParameterTableunivPars
 
ThinTargetpCPionReweightertt_pCPionRew
 

Detailed Description

Reweighter of thin target nC interactions.

Definition at line 20 of file ThinTargetnCPionReweighter.h.

Constructor & Destructor Documentation

NeutrinoFluxReweight::ThinTargetnCPionReweighter::ThinTargetnCPionReweighter ( int  iuniv,
const ParameterTable cv_pars,
const ParameterTable univ_pars 
)
NeutrinoFluxReweight::ThinTargetnCPionReweighter::~ThinTargetnCPionReweighter ( )
virtual

Definition at line 12 of file ThinTargetnCPionReweighter.cpp.

12  {
13 
14  }

Member Function Documentation

double NeutrinoFluxReweight::ThinTargetnCPionReweighter::calculateWeight ( const InteractionData inter_data)
virtual

calculate a weight for this interaction 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

Implements NeutrinoFluxReweight::IInteractionReweighting.

Definition at line 44 of file ThinTargetnCPionReweighter.cpp.

44  {
45 
46  MakeReweight* makerew = MakeReweight::getInstance();
47  if(iUniv==-1)tt_pCPionRew = (makerew->cv_rw)->THINTARGET_PC_PION_Universe;
48  else tt_pCPionRew = (makerew->vec_rws[iUniv])->THINTARGET_PC_PION_Universe;
49 
50  double inc_mom[3] = {aa.Inc_P4[0], aa.Inc_P4[1], aa.Inc_P4[2]};
51  double prod_mom[3] = {aa.Prod_P4[0],aa.Prod_P4[1],aa.Prod_P4[2]};
52  double vtx_int[3] = {aa.Vtx[0],aa.Vtx[1],aa.Vtx[2]};
53  InteractionData intData(aa.gen, inc_mom,2212,prod_mom,-1*aa.Prod_pdg,aa.Vol,aa.Proc,vtx_int);
54 
55  double wgt = tt_pCPionRew->calculateWeight(intData);
56 
57  if(wgt<0)std::cout<<"TTNCPI check wgt(<0) "<<iUniv<<" "<<aa.Inc_P<<" "<<aa.xF<<" "<<aa.Pt<<" "<<aa.Prod_pdg<<std::endl;
58  return wgt;
59 
60  }
static MakeReweight * getInstance()
virtual double calculateWeight(const InteractionData &inter_data)
calculate a weight for this interaction given the central value parameters and the parameters for thi...
QTextStream & endl(QTextStream &s)
bool NeutrinoFluxReweight::ThinTargetnCPionReweighter::canReweight ( const InteractionData aa)
virtual

can the particular instance of this class reweight this interaction?

Implements NeutrinoFluxReweight::IInteractionReweighting.

Definition at line 15 of file ThinTargetnCPionReweighter.cpp.

15  {
16 
17  MakeReweight* makerew = MakeReweight::getInstance();
18  if(iUniv==-1)tt_pCPionRew = (makerew->cv_rw)->THINTARGET_PC_PION_Universe;
19  else tt_pCPionRew = (makerew->vec_rws[iUniv])->THINTARGET_PC_PION_Universe;
20 
21  //checking:
22  std::string mode(getenv("MODE"));
23  if(aa.Inc_pdg != 2112)return false;
24  if(aa.Inc_P < 12.0)return false;
25  //volume check:
26  bool is_wrong_volume = aa.Vol != "TGT1" && aa.Vol != "BudalMonitor" && aa.Vol != "Budal_HFVS" && aa.Vol != "Budal_VFHS";
27  if( (mode=="REF") || (mode=="OPT") ){
28  // is_wrong_volume = aa.Vol != "TargetFinHorizontal" && aa.Vol != "TargetNoSplitSegment";
29  is_wrong_volume = aa.Vol != "TargetFinHorizontal" && aa.Vol != "TargetNoSplitSegment" && aa.Vol!="tCoreLog";
30  }
31  if(is_wrong_volume)return false;
32  //
33  if(aa.Prod_pdg != 211 && aa.Prod_pdg != -211)return false;
34 
35  double inc_mom[3] = {aa.Inc_P4[0], aa.Inc_P4[1], aa.Inc_P4[2]};
36  double prod_mom[3] = {aa.Prod_P4[0],aa.Prod_P4[1],aa.Prod_P4[2]};
37  double vtx_int[3] = {aa.Vtx[0],aa.Vtx[1],aa.Vtx[2]};
38 
39  InteractionData intData(aa.gen, inc_mom,2212,prod_mom,-1*aa.Prod_pdg,aa.Vol,aa.Proc,vtx_int);
40  return tt_pCPionRew->canReweight(intData);
41 
42  }
std::string string
Definition: nybbler.cc:12
static MakeReweight * getInstance()
std::string getenv(std::string const &name)
Definition: getenv.cc:15
virtual bool canReweight(const InteractionData &aa)
can the particular instance of this class reweight this interaction?

Member Data Documentation

const ParameterTable& NeutrinoFluxReweight::ThinTargetnCPionReweighter::cvPars
private

Definition at line 30 of file ThinTargetnCPionReweighter.h.

int NeutrinoFluxReweight::ThinTargetnCPionReweighter::iUniv
private

Definition at line 29 of file ThinTargetnCPionReweighter.h.

ThinTargetpCPionReweighter* NeutrinoFluxReweight::ThinTargetnCPionReweighter::tt_pCPionRew
private

Definition at line 33 of file ThinTargetnCPionReweighter.h.

const ParameterTable& NeutrinoFluxReweight::ThinTargetnCPionReweighter::univPars
private

Definition at line 31 of file ThinTargetnCPionReweighter.h.


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