25 sprintf(namepar,
"ThinTargetLowxF_pC_%s_sys_%d",
"kap",ii);
28 sprintf(namepar,
"ThinTargetLowxF_pC_%s_stats_%d",
"kap",ii);
32 sprintf(namepar,
"ThinTargetLowxF_pC_%s_sys_%d",
"kam",ii);
35 sprintf(namepar,
"ThinTargetLowxF_pC_%s_stats_%d",
"kam",ii);
43 sprintf(namepar,
"ThinTarget_kap_pip_sys_%d",ii);
46 sprintf(namepar,
"ThinTarget_kap_pip_stats_%d",ii);
50 sprintf(namepar,
"ThinTarget_kam_pim_sys_%d",ii);
53 sprintf(namepar,
"ThinTarget_kam_pim_stats_%d",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;
81 if(bin>=0)
return true;
85 if(mipp_bin<0)
return false;
89 double vtx_int[3] = {aa.
Vtx[0],aa.
Vtx[1],aa.
Vtx[2]};
101 if(aa.
Prod_pdg == 321)
return there_is_pip;
102 else if(aa.
Prod_pdg ==-321)
return there_is_pim;
103 else if(aa.
Prod_pdg == 130 || aa.
Prod_pdg == 310)
return there_is_pim && there_is_pip;
116 if(bin<0 && mipp_bin<0)
return wgt;
131 else if(mipp_bin>=0){
139 double vtx_int[3] = {aa.
Vtx[0],aa.
Vtx[1],aa.
Vtx[2]};
140 double pip_data = -1.0;
141 double pim_data = -1.0;
146 if(bin_pi<0)
return 1.0;
150 else if(aux_aa.
xF>0.5){
152 if(bin_pi<0)
return 1.0;
170 else if(aa.
gen>0)dataval /= 1.0;
172 std::cout<<
"Something is wrong with gen "<<
std::endl;
176 double data_scale = -1.0;
184 dataval *= data_scale;
192 if(mc_cv<1.
e-12)
return wgt;
205 double scaling_violation = 1.0;
209 const int moms[Nscl] = {12,20,31,40,50,60,70,80,100,120,158};
212 if(prod_pdg == 321)idx_part = 2;
213 if(prod_pdg ==-321)idx_part = 3;
215 std::cout<<
"Error in the prod particle"<<
std::endl;
219 int binid = dtH->
hTTScl[idx_part][Nscl-1]->FindBin(xf,pt);
220 double scl_ref158 = dtH->
hTTScl[idx_part][Nscl-1]->GetBinContent(binid);
224 for(
int i=0;i<Nscl-1;i++){
225 if(inc_mom>=
double(moms[i]) && inc_mom<
double(moms[i+1])){
230 if(idx_lowp<0 || idx_hip<0){
231 std::cout<<
"Error calculating the scaling"<<
std::endl;
234 double scl_low = dtH->
hTTScl[idx_part][idx_lowp]->GetBinContent(binid);
235 double scl_hi = dtH->
hTTScl[idx_part][idx_hip]->GetBinContent(binid);
236 double scl_m = scl_low + (inc_mom-double(moms[idx_lowp]))*(scl_hi-scl_low)/(double(moms[idx_hip])-double(moms[idx_lowp]));
237 if(scl_ref158<1.
e-10){
241 scaling_violation = scl_m/scl_ref158;
242 return scaling_violation;
A class to manage the bin definitions for MIPP Numi Yields.
A list/table of parameter names and values.
virtual double calculateWeight(const InteractionData &aa)
calculate a weight for this interaction given the central value parameters and the parameters for thi...
double getMCval_pC_X(double incP, double xf, double pt, int pdgcode)
MC value for this HP production.
A class to make the reweight event by event.
std::vector< std::vector< TH2F * > > hTTScl
Vector of the scaling histograms:
int Prod_pdg
pdg code of the produced particle
static MakeReweight * getInstance()
double Pt
Transversal momentum (GeV/c) of the produced particle.
double Vtx[3]
Location of the interaction.
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 Pz
Longitudinal momentum (GeV/c) of the produced particle.
double Inc_P4[4]
Momentum 4 vector of the incident particle, E=p[3].
std::vector< float > vbin_data_kap
double xF
Feynmann-x of the produced particle: .
A class to manage the MC value for thin target.
ThinTargetpCPionReweighter * tt_pCPionRew
ThinTargetpCKaonReweighter(int iuniv, const ParameterTable &cv_pars, const ParameterTable &univ_pars)
double Prod_P4[4]
Momentum 4 vector of the produced particle, E=p[3].
int GetNbins_pC_KX_MIPP()
const ParameterTable & univPars
std::string getenv(std::string const &name)
const ParameterTable & cvPars
std::string Proc
Interaction process.
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 GetNbins_pC_KX_NA49()
int BinID_pC_k(double xf, double pt, int pdgcode)
Return the Bin ID for this data.
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:
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.
virtual ~ThinTargetpCKaonReweighter()
std::vector< float > vbin_data_pip
std::vector< ReweightDriver * > vec_rws
vector of Reweighter Drivers, one per universe
QTextStream & bin(QTextStream &s)
virtual bool canReweight(const InteractionData &aa)
can the particular instance of this class reweight this interaction?
std::vector< float > vbin_data_pim
int mipp_BinID_pC_k(double pz, double pt, int pdgcode)
Return the MIPP Thin Target Bin ID for this data.
ReweightDriver * cv_rw
Reweighter Drivers for the central value.
std::vector< float > bart_vbin_data_pim
std::vector< float > vbin_data_kam
double calculateDataScale(int inc_pdg, double inc_mom, int prod_pdg, double xf, double pt)
std::vector< float > mipp_vbin_data_kap_pip
QTextStream & endl(QTextStream &s)
std::vector< float > mipp_vbin_data_kam_pim
static ThinTargetMC * getInstance()