117#include "EvtGenModels/EvtXsection.hh"
118#include "EvtGenBase/EvtPDL.hh"
123#include "EvtGenModels/EvtFitXsection.dat"
128 xx.clear();yy.clear();er.clear();
135 xx.clear();yy.clear();er.clear();
137 ifstream file(
"xs_user.txt");
140 cout <<
"EvtXsection.cc: The input file not found. The default file name should be xs_user.txt!"<<std::endl;
165 xx.clear();yy.clear();er.clear();
167 if(_vmd.size()==0){std::cout<<
"EvtXsection::ini_data_multimode: No mode indexes are available"<<std::endl; abort();}
172 for(
int i=0;i<_vmd.size();i++){
180 std::cout<<
"The low and up end of multimodes: "<<xL<<
" ~ "<<xU<<std::endl;
186 std::vector<double>uxx,uyy,uer;
187 uxx.clear();uyy.clear();uer.clear();
188 for(
double xxm=xL;xxm<xU;xxm+=stp){
192 for(
int i=0;i<_vmd.size();i++){
195 if(myunit==
"pb"){ mypb=0.001;}
else{mypb=1;}
202 uer.push_back(xs_er);
205 xx.clear();yy.clear();er.clear();
206 for(
int i=0;i<uxx.size();i++){
207 xx.push_back(uxx[i]);yy.push_back(uyy[i]);er.push_back(uer[i]);
215 msg=
"multi-exclusive mode";
233 int pp[2]={-2212,2212};
234 int nn[2]={-2112,2112};
235 int pipi[2]={-211,211};
236 int pi3[3]={-211,111,211};
237 int kkpi0[3]={-321,111,321};
238 int kskpi[3]={-211,310,321};
240 std::vector<int> vson;vson.clear();
241 for(
int i=0;i<evtdaugs.size();i++){vson.push_back(
EvtPDL::getStdHep(evtdaugs[i]) );}
242 sort(vson.begin(),vson.end(),
mysort);
244 if(vson.size() ==2 ){
245 if(vson[0]==pp[0] && vson[1]==pp[1] ) {
return 0;}
246 if(vson[0]==nn[0] && vson[1]==nn[1] ) {
return 1;}
247 if(vson[0]==pipi[0] && vson[1]==pipi[1] ) {
return 2;}
248 }
else if(vson.size()==3){
268 if (mx <= xx[0])
return 0.;
269 if (mx > xx[nbins])
return 0.;
277 if (mx <= xx[0])
return 0.;
278 if (mx > xx[nbins-1])
return 0.;
280 double ylow = yy[thebin];
281 double yup = yy[thebin+1];
283 double xlow = xx[thebin];
284 double xup = xx[thebin+1];
292 if(_mode == -1)
return 0.;
293 if (mx <= xx[0])
return er[0];
294 if (mx > xx[nbins])
return 0.;
302 if (mx <= xx[0])
return er[0];
303 if (mx > xx[nbins-1])
return 0.;
305 double ylow = er[thebin];
306 double yup = er[thebin+1];
308 double xlow = xx[thebin];
309 double xup = xx[thebin+1];
316 if(mx <= xx[0])
return 0;
317 if(mx > xx[nbins])
return nbins;
318 for(
int i=0;i<
nbins;i++){
319 if(mx <= xx[i+1] && mx > xx[i])
return i;
324 if(mx <= xx[0])
return 0;
325 if(mx > xx[nbins-1])
return nbins;
326 for(
int i=0;i<nbins-1;i++){
327 if(mx <= xx[i+1] && mx > xx[i])
return i;
332 double nbins = vy.size();
333 if(vy[0]<mx || mx<vy[
nbins-1]) {std::cout<<
"Outside vacuum pol. value"<<std::endl;abort();}
334 for(
int i=0;i<
nbins-1;i++){
335 if(mx <= vy[i+1] && mx > vy[i])
return i;
346 double width2 = width*width;
347 double br = (
s - mass2)*(
s - mass2) + mass2 * width2;
349 double sigma = 12*
pi*bree*width2/br;
351 double thexs =
sigma*nbar;
366 double xstp=(maxM-minM)/100.;
367 xx.clear();yy.clear();er.clear();
368 for(
int i=0;i<100;i++){
371 EvtComplex bw=1./(m*m-meanM*meanM+im*m*width);
372 double amps =
abs2(bw);
373 xx.push_back(m); yy.push_back(amps); er.push_back(0.);
380 for(
int i=0;i<vmd.size();i++){
381 _vmd.push_back(vmd[i]);
double abs2(const EvtComplex &c)
DOUBLE_PRECISION xlow[20]
static double getWidth(EvtId i)
static int getStdHep(EvtId id)
static double getMeanMass(EvtId i)
static EvtId evtIdFromStdHep(int stdhep)
static double getMinMass(EvtId i)
static double getMaxMass(EvtId i)
int getXBin(double mx, std::vector< double > vy)
double Xsection_b(double mx)
double Xsection_a(double mx)
void setModes(std::vector< int > vmd)
int getMode(std::vector< EvtId > evtdaugs)
void ini_data_multimode()
double getXsection(double mx)
double Xsection_c(double mx)
bool operator()(int i, int j)