25 sprintf(namepar,
"ThinTarget_pC_%s_sys_%d",
"p",ii);
28 sprintf(namepar,
"ThinTarget_pC_%s_stats_%d",
"p",ii);
30 vbin_data_p.push_back(data_sta + data_sys - data_cv);
36 sprintf(namepar,
"ThinTarget_pC_%s_sys_%d",
"n",ii);
39 sprintf(namepar,
"ThinTarget_pC_%s_stats_%d",
"n",ii);
41 vbin_data_n.push_back(data_sta + data_sys - data_cv);
55 if(aa.
Inc_pdg != 2212)
return false;
56 if(aa.
Inc_P < 12.0)
return false;
58 bool is_wrong_volume = aa.
Vol !=
"TGT1" && aa.
Vol !=
"BudalMonitor" && aa.
Vol !=
"Budal_HFVS" && aa.
Vol !=
"Budal_VFHS";
59 if( (mode==
"REF") || (mode==
"OPT") ){
60 is_wrong_volume = aa.
Vol !=
"TargetFinHorizontal" && aa.
Vol !=
"TargetNoSplitSegment" && aa.
Vol!=
"tCoreLog";
62 if(is_wrong_volume)
return false;
69 if(bin_p < 0 && bin_n < 0)
return false;
81 if(bin_p < 0 && bin_n < 0){
103 dataval *= data_scale;
109 if(mc_cv<1.
e-12)
return wgt;
121 double scaling_violation = 1.0;
125 const int moms[Nscl] = {12,20,31,40,50,60,70,80,100,120,158};
128 if(prod_pdg == 2212)idx_part = 4;
129 else if(prod_pdg == 2112)idx_part = 5;
131 std::cout<<
"Error in the prod particle"<<
std::endl;
137 for(
int i=0;i<Nscl-1;i++){
138 if(inc_mom>=
double(moms[i]) && inc_mom<
double(moms[i+1])){
143 if(idx_lowp<0 || idx_hip<0){
144 std::cout<<
"Error calculating the scaling"<<
std::endl;
148 double scl_ref158 = -1.0;
152 int binid = dtH->
hTTScl[idx_part][Nscl-1]->FindBin(xf,pt);
153 scl_ref158 = dtH->
hTTScl[idx_part][Nscl-1]->GetBinContent(binid);
156 binid = dtH->
hTTScl[idx_part][Nscl-1]->FindBin(0.89,pt);
157 scl_ref158 = dtH->
hTTScl[idx_part][Nscl-1]->GetBinContent(binid);
159 double scl_low = dtH->
hTTScl[idx_part][idx_lowp]->GetBinContent(binid);
160 double scl_hi = dtH->
hTTScl[idx_part][idx_hip]->GetBinContent(binid);
161 scl_m = scl_low + (inc_mom-double(moms[idx_lowp]))*(scl_hi-scl_low)/(double(moms[idx_hip])-double(moms[idx_lowp]));
163 else if(idx_part==5){
164 int binid = dtH->
hTTScl_n[Nscl-1]->FindBin(xf);
165 scl_ref158 = (double)dtH->
hTTScl_n[Nscl-1]->GetBinContent(binid);
166 double scl_low = dtH->
hTTScl_n[idx_lowp]->GetBinContent(binid);
167 double scl_hi = dtH->
hTTScl_n[idx_hip]->GetBinContent(binid);
168 scl_m = scl_low + (inc_mom-double(moms[idx_lowp]))*(scl_hi-scl_low)/(double(moms[idx_hip])-double(moms[idx_lowp]));
171 std::cout<<
"still error, not expected here!!"<<
std::endl;
175 if(scl_ref158 < 1.
e-10 || scl_m<1.
e-10){
176 std::cout<<
"scale problems: "<<scl_ref158<<
" "<<scl_m<<
" "<<inc_pdg<<
" "<<inc_mom<<
" "<<prod_pdg<<
" "<<xf<<
" "<<pt<<
std::endl;
179 scaling_violation = scl_m/scl_ref158;
180 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...
int BinID_pC_n(double xf, int pdgcode)
Return the Bin ID for this data.
std::vector< TH1F * > hTTScl_n
Vector of the scaling histograms for neutrons:
double getMCval_pC_X(double incP, double xf, double pt, int pdgcode)
MC value for this HP production.
virtual ~ThinTargetpCNucleonReweighter()
std::vector< std::vector< TH2F * > > hTTScl
Vector of the scaling histograms:
double getMCxs_pC_nucleon(int genid, int pdg, double inc_mom)
Get the MC roduction cross-section pC->n, p:
double calculateDataScale(int inc_pdg, double inc_mom, int prod_pdg, double xf, double pt)
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 xF
Feynmann-x of the produced particle: .
A class to manage the MC value for thin target.
int BinID_pC_p(double xf, double pt, int pdgcode)
Return the Bin ID for this data.
std::string getenv(std::string const &name)
virtual bool canReweight(const InteractionData &aa)
can the particular instance of this class reweight this interaction?
double Inc_P
Momentum magnitude of the incident particle.
std::string Vol
Interaction volume.
std::vector< float > vbin_data_p
int GetNbins_pC_nX_NA49()
ThinTargetpCNucleonReweighter(int iuniv, const ParameterTable &cv_pars, const ParameterTable &univ_pars)
int Inc_pdg
pdg code of the incident particle
const ParameterTable & cvPars
static ThinTargetBins * getInstance()
int GetNbins_pC_pX_NA49()
std::vector< float > vbin_data_n
QTextStream & endl(QTextStream &s)
const ParameterTable & univPars
static ThinTargetMC * getInstance()