3 #include <boost/property_tree/ptree.hpp> 4 #include <boost/property_tree/xml_parser.hpp> 19 using boost::property_tree::ptree;
21 read_xml(filename,top,2);
23 bins = top.get_child(
"mcbin.MIPPNuMI_MC_pip");
26 double cv,pzmin,pzmax,ptmin,ptmax;
28 for(it = bins.begin(); it!=bins.end(); ++it){
34 std::stringstream ss1(cv_string);
35 std::stringstream ss2(pz_string);
36 std::stringstream ss3(pt_string);
38 ss2 >> pzmin >> pzmax;
39 ss3 >> ptmin >> ptmax;
55 using boost::property_tree::ptree;
57 read_xml(filename,top,2);
59 bins = top.get_child(
"mcbin.MIPPNuMI_MC_pim");
62 double cv,pzmin,pzmax,ptmin,ptmax;
64 for(it = bins.begin(); it!=bins.end(); ++it){
70 std::stringstream ss1(cv_string);
71 std::stringstream ss2(pz_string);
72 std::stringstream ss3(pt_string);
74 ss2 >> pzmin >> pzmax;
75 ss3 >> ptmin >> ptmax;
90 using boost::property_tree::ptree;
92 read_xml(filename,top,2);
94 bins = top.get_child(
"mcbin.MIPPNuMI_MC_kap");
97 double cv,pzmin,pzmax,ptmin,ptmax;
99 for(it = bins.begin(); it!=bins.end(); ++it){
105 std::stringstream ss1(cv_string);
106 std::stringstream ss2(pz_string);
107 std::stringstream ss3(pt_string);
109 ss2 >> pzmin >> pzmax;
110 ss3 >> ptmin >> ptmax;
124 using boost::property_tree::ptree;
126 read_xml(filename,top,2);
128 bins = top.get_child(
"mcbin.MIPPNuMI_MC_kam");
131 double cv,pzmin,pzmax,ptmin,ptmax;
133 for(it = bins.begin(); it!=bins.end(); ++it){
138 std::stringstream ss1(cv_string);
139 std::stringstream ss2(pz_string);
140 std::stringstream ss3(pt_string);
142 ss2 >> pzmin >> pzmax;
143 ss3 >> ptmin >> ptmax;
157 using boost::property_tree::ptree;
159 read_xml(filename,top,2);
161 bins = top.get_child(
"mcbin.MIPPNuMI_MC_k0l");
164 double cv,pzmin,pzmax,ptmin,ptmax;
166 for(it = bins.begin(); it!=bins.end(); ++it){
171 std::stringstream ss1(cv_string);
172 std::stringstream ss2(pz_string);
173 std::stringstream ss3(pt_string);
175 ss2 >> pzmin >> pzmax;
176 ss3 >> ptmin >> ptmax;
190 using boost::property_tree::ptree;
192 read_xml(filename,top,2);
194 bins = top.get_child(
"mcbin.MIPPNuMI_MC_k0s");
197 double cv,pzmin,pzmax,ptmin,ptmax;
199 for(it = bins.begin(); it!=bins.end(); ++it){
204 std::stringstream ss1(cv_string);
205 std::stringstream ss2(pz_string);
206 std::stringstream ss3(pt_string);
208 ss2 >> pzmin >> pzmax;
209 ss3 >> ptmin >> ptmax;
225 if(
abs(pdgcode)!=211 &&
abs(pdgcode)!=321 && pdgcode!=130 && pdgcode!=310)
return cvmc;
231 for(
int ii=0;ii<
size;++ii){
241 for(
int ii=0;ii<
size;++ii){
251 for(
int ii=0;ii<
size;++ii){
261 for(
int ii=0;ii<
size;++ii){
270 for(
int ii=0;ii<
size;++ii){
280 for(
int ii=0;ii<
size;++ii){
std::vector< double > kap_cv
double getMCval(double pz, double pt, int pdgcode)
MC value for this HP production.
bool ranges_already_filled
A class to manage the MC value for MIPP NuMI.
static MIPPNumiMC * instance
std::vector< double > kam_cv
void k0l_mc_from_xml(const char *filename)
Read a xml file name to get the mc value for k0l.
std::vector< double > pip_cv
std::vector< double > k0l_cv
std::vector< double > v_ptmin
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
static MIPPNumiMC * getInstance()
void pim_mc_from_xml(const char *filename)
Read a xml file name to get the mc value for pim.
double proton_no_interacting
void kam_mc_from_xml(const char *filename)
Read a xml file name to get the mc value for kam.
void kap_mc_from_xml(const char *filename)
Read a xml file name to get the mc value for kap.
std::vector< double > v_pzmin
std::vector< double > v_pzmax
void pip_mc_from_xml(const char *filename)
Read a xml file name to get the mc value for pip.
std::vector< double > v_ptmax
std::vector< double > k0s_cv
void k0s_mc_from_xml(const char *filename)
Read a xml file name to get the mc value for k0s.
std::vector< double > pim_cv