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);
45 sprintf(namepar,
"ThinTargetBarton_pC_%s_%d",
"pip",ii);
49 sprintf(namepar,
"ThinTargetBarton_pC_%s_%d",
"pim",ii);
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;
82 if(bin<0 && bart_bin<0)
return false;
89 double low_value = 1.e-18;
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;
122 if(mc_cv<1.
e-12)
return wgt;
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;
A class to manage the bin definitions for MIPP Numi Yields.
A list/table of parameter names and values.
virtual ~ThinTargetpCPionReweighter()
double getMCval_pC_X(double incP, double xf, double pt, int pdgcode)
MC value for this HP production.
std::vector< std::vector< TH2F * > > hTTScl
Vector of the scaling histograms:
int Prod_pdg
pdg code of the produced particle
double Pt
Transversal momentum (GeV/c) of the produced particle.
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 ...
The information about a hadronic interaction needed to calculate weights.
double calculateDataScale(int inc_pdg, double inc_mom, int prod_pdg, double xf, double pt)
const ParameterTable & cvPars
int GetNbins_pC_piX_NA49()
double xF
Feynmann-x of the produced particle: .
virtual double calculateWeight(const InteractionData &inter_data)
calculate a weight for this interaction given the central value parameters and the parameters for thi...
A class to manage the MC value for thin target.
std::string getenv(std::string const &name)
double Inc_P
Momentum magnitude of the incident particle.
std::string Vol
Interaction volume.
std::vector< float > bart_vbin_data_pip
virtual bool canReweight(const InteractionData &aa)
can the particular instance of this class reweight this interaction?
int Inc_pdg
pdg code of the incident particle
double getMCxs_pC_piK(int genid, double inc_mom)
Get the MC roduction cross-section pC->pi, K:
ThinTargetpCPionReweighter(int iuniv, const ParameterTable &cv_pars, const ParameterTable &univ_pars)
int GetNbins_pC_piX_Barton()
int BinID_pC_pi(double xf, double pt, int pdgcode)
Return the Bin ID for this data.
static ThinTargetBins * getInstance()
int barton_BinID_pC_pi(double xf, double pt, int pdgcode)
Return the Bin ID for this data.
std::vector< float > vbin_data_pip
QTextStream & bin(QTextStream &s)
const ParameterTable & univPars
std::vector< float > vbin_data_pim
std::vector< float > bart_vbin_data_pim
QTextStream & endl(QTextStream &s)
static ThinTargetMC * getInstance()