Reweighter of thin target pion production.
More...
#include <ThinTargetpCPionReweighter.h>
Reweighter of thin target pion production.
Definition at line 18 of file ThinTargetpCPionReweighter.h.
NeutrinoFluxReweight::ThinTargetpCPionReweighter::ThinTargetpCPionReweighter |
( |
int |
iuniv, |
|
|
const ParameterTable & |
cv_pars, |
|
|
const ParameterTable & |
univ_pars |
|
) |
| |
Definition at line 11 of file ThinTargetpCPionReweighter.cpp.
26 for(
int ii=0;ii<Thinbins->GetNbins_pC_piX_NA49();ii++){
28 sprintf(namepar,
"ThinTarget_pC_%s_sys_%d",
"pip",ii);
31 sprintf(namepar,
"ThinTarget_pC_%s_stats_%d",
"pip",ii);
35 sprintf(namepar,
"ThinTarget_pC_%s_sys_%d",
"pim",ii);
38 sprintf(namepar,
"ThinTarget_pC_%s_stats_%d",
"pim",ii);
43 for(
int ii=0;ii<Thinbins->GetNbins_pC_piX_Barton();ii++){
45 sprintf(namepar,
"ThinTargetBarton_pC_%s_%d",
"pip",ii);
49 sprintf(namepar,
"ThinTargetBarton_pC_%s_%d",
"pim",ii);
double getParameterValue(const std::string &name) const
get the value of a parameter. throw an exception of a well defined type if we don't have it ...
const ParameterTable & cvPars
std::vector< float > bart_vbin_data_pip
static ThinTargetBins * getInstance()
std::vector< float > vbin_data_pip
const ParameterTable & univPars
std::vector< float > vbin_data_pim
std::vector< float > bart_vbin_data_pim
NeutrinoFluxReweight::ThinTargetpCPionReweighter::~ThinTargetpCPionReweighter |
( |
| ) |
|
|
virtual |
double NeutrinoFluxReweight::ThinTargetpCPionReweighter::calculateDataScale |
( |
int |
inc_pdg, |
|
|
double |
inc_mom, |
|
|
int |
prod_pdg, |
|
|
double |
xf, |
|
|
double |
pt |
|
) |
| |
Definition at line 133 of file ThinTargetpCPionReweighter.cpp.
134 double scaling_violation = 1.0;
138 const int moms[Nscl] = {12,20,31,40,50,60,70,80,100,120,158};
141 if(prod_pdg == 211)idx_part = 0;
142 if(prod_pdg ==-211)idx_part = 1;
144 std::cout<<
"Error in the prod particle"<<
std::endl;
148 int binid = dtH->hTTScl[idx_part][Nscl-1]->FindBin(xf,pt);
149 double scl_ref158 = dtH->hTTScl[idx_part][Nscl-1]->GetBinContent(binid);
153 for(
int i=0;i<Nscl-1;i++){
154 if(inc_mom>=
double(moms[i]) && inc_mom<
double(moms[i+1])){
159 if(idx_lowp<0 || idx_hip<0){
160 std::cout<<
"Error calculating the scaling"<<
std::endl;
163 double scl_low = dtH->hTTScl[idx_part][idx_lowp]->GetBinContent(binid);
164 double scl_hi = dtH->hTTScl[idx_part][idx_hip]->GetBinContent(binid);
165 double scl_m = scl_low + (inc_mom-double(moms[idx_lowp]))*(scl_hi-scl_low)/(double(moms[idx_hip])-double(moms[idx_lowp]));
166 if(scl_ref158<1.
e-10){
170 scaling_violation = scl_m/scl_ref158;
171 return scaling_violation;
QTextStream & endl(QTextStream &s)
static ThinTargetMC * getInstance()
double NeutrinoFluxReweight::ThinTargetpCPionReweighter::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 86 of file ThinTargetpCPionReweighter.cpp.
89 double low_value = 1.e-18;
91 int bin = Thinbins->BinID_pC_pi(aa.xF,aa.Pt,aa.Prod_pdg);
92 int bart_bin = Thinbins->barton_BinID_pC_pi(aa.xF,aa.Pt,aa.Prod_pdg);
93 if(bin<0 && bart_bin<0)
return aux_par;
109 else if(aa.gen>0)dataval /= 1.0;
111 std::cout<<
"Something is wrong with gen "<<
std::endl;
115 dataval *= data_scale;
118 double mc_cv = mc->getMCval_pC_X(aa.Inc_P,aa.xF,aa.Pt,aa.Prod_pdg);
119 double mc_prod = mc->getMCxs_pC_piK(aa.gen,aa.Inc_P);
122 if(mc_cv<1.
e-12)
return wgt;
double calculateDataScale(int inc_pdg, double inc_mom, int prod_pdg, double xf, double pt)
std::vector< float > bart_vbin_data_pip
static ThinTargetBins * getInstance()
std::vector< float > vbin_data_pip
QTextStream & bin(QTextStream &s)
std::vector< float > vbin_data_pim
std::vector< float > bart_vbin_data_pim
QTextStream & endl(QTextStream &s)
static ThinTargetMC * getInstance()
bool NeutrinoFluxReweight::ThinTargetpCPionReweighter::canReweight |
( |
const InteractionData & |
aa | ) |
|
|
virtual |
can the particular instance of this class reweight this interaction?
Implements NeutrinoFluxReweight::IInteractionReweighting.
Definition at line 63 of file ThinTargetpCPionReweighter.cpp.
67 if(aa.Inc_pdg != 2212)
return false;
68 if(aa.Inc_P < 12.0)
return false;
70 bool is_wrong_volume = aa.Vol !=
"TGT1" && aa.Vol !=
"BudalMonitor" && aa.Vol !=
"Budal_HFVS" && aa.Vol !=
"Budal_VFHS";
71 if( (mode==
"REF") || (mode==
"OPT") ){
72 is_wrong_volume = aa.Vol !=
"TargetFinHorizontal" && aa.Vol !=
"TargetNoSplitSegment" && aa.Vol!=
"tCoreLog";
74 if(is_wrong_volume)
return false;
76 if(aa.Prod_pdg != 211 && aa.Prod_pdg != -211)
return false;
79 int bin = Thinbins->BinID_pC_pi(aa.xF,aa.Pt,aa.Prod_pdg);
80 int bart_bin = Thinbins->barton_BinID_pC_pi(aa.xF,aa.Pt,aa.Prod_pdg);
82 if(bin<0 && bart_bin<0)
return false;
std::string getenv(std::string const &name)
static ThinTargetBins * getInstance()
QTextStream & bin(QTextStream &s)
float NeutrinoFluxReweight::ThinTargetpCPionReweighter::aux_par |
|
private |
std::vector<float> NeutrinoFluxReweight::ThinTargetpCPionReweighter::bart_vbin_data_pim |
std::vector<float> NeutrinoFluxReweight::ThinTargetpCPionReweighter::bart_vbin_data_pip |
const ParameterTable& NeutrinoFluxReweight::ThinTargetpCPionReweighter::cvPars |
|
private |
double NeutrinoFluxReweight::ThinTargetpCPionReweighter::data_prod_xs |
int NeutrinoFluxReweight::ThinTargetpCPionReweighter::iUniv |
|
private |
const ParameterTable& NeutrinoFluxReweight::ThinTargetpCPionReweighter::univPars |
|
private |
std::vector<float> NeutrinoFluxReweight::ThinTargetpCPionReweighter::vbin_data_pim |
std::vector<float> NeutrinoFluxReweight::ThinTargetpCPionReweighter::vbin_data_pip |
The documentation for this class was generated from the following files: