100#include "EvtGenModels/EvtFitXsection.dat"
104 xx.clear();yy.clear();er.clear();
11899 xx.clear();yy.clear();er.clear();
11900 ifstream file(
"xs_user.txt");
11902 cout <<
"EvtXsection.cc: The input file not found. The default file name should be xs_user.txt!"<<std::endl;
11905 double xm,xs,xs_er;
11906 while(!
file.eof()){
11907 file>>xm>>xs>>xs_er;
11911 er.push_back(xs_er);
11938 int pp[2]={-2212,2212};
11939 int nn[2]={-2112,2112};
11940 int pipi[2]={-211,211};
11941 int pi3[3]={-211,111,211};
11942 int kkpi0[3]={-321,111,321};
11943 int kskpi[3]={-211,310,321};
11945 std::vector<int> vson;vson.clear();
11946 for(
int i=0;i<evtdaugs.size();i++){vson.push_back(
EvtPDL::getStdHep(evtdaugs[i]) );}
11947 sort(vson.begin(),vson.end(),
mysort);
11949 if(vson.size() ==2 ){
11950 if(vson[0]==pp[0] && vson[1]==pp[1] ) {
return 0;}
11951 if(vson[0]==nn[0] && vson[1]==nn[1] ) {
return 1;}
11952 if(vson[0]==pipi[0] && vson[1]==pipi[1] ) {
return 2;}
11953 }
else if(vson.size()==3){
11973 if (mx <= xx[0])
return 0.;
11974 if (mx > xx[nbins])
return 0.;
11982 if (mx <= xx[0])
return 0.;
11983 if (mx > xx[nbins-1])
return 0.;
11985 double ylow = yy[thebin];
11986 double yup = yy[thebin+1];
11988 double xlow = xx[thebin];
11989 double xup = xx[thebin+1];
11991 double yi=ylow + (yup-ylow)/(xup-xlow)*(mx-xlow);
11997 if(_mode == -1)
return 0.;
11998 if (mx <= xx[0])
return er[0];
11999 if (mx > xx[nbins])
return 0.;
12007 if (mx <= xx[0])
return er[0];
12008 if (mx > xx[nbins-1])
return 0.;
12010 double ylow = er[thebin];
12011 double yup = er[thebin+1];
12013 double xlow = xx[thebin];
12014 double xup = xx[thebin+1];
12016 double yi=ylow + (yup-ylow)/(xup-xlow)*(mx-xlow);
12024 if(mx <= xx[0])
return 0;
12025 if(mx > xx[nbins])
return nbins;
12026 for(
int i=0;i<
nbins;i++){
12027 if(mx <= xx[i+1] && mx > xx[i])
return i;
12032 if(mx <= xx[0])
return 0;
12033 if(mx > xx[nbins-1])
return nbins;
12034 for(
int i=0;i<nbins-1;i++){
12035 if(mx <= xx[i+1] && mx > xx[i])
return i;
12040 double nbins = vy.size();
12041 if(vy[0]<mx || mx<vy[
nbins-1]) {std::cout<<
"Outside vacuum pol. value"<<std::endl;abort();}
12042 for(
int i=0;i<
nbins-1;i++){
12043 if(mx <= vy[i+1] && mx > vy[i])
return i;
12048 double pi=3.1415926;
12054 double width2 = width*width;
12055 double br = (
s - mass2)*(
s - mass2) + mass2 * width2;
12057 double sigma = 12*
pi*bree*width2/br;
12058 double nbar = 4E05;
12059 double thexs = sigma*nbar;
12075 double xstp=(maxM-minM)/100.;
12076 xx.clear();yy.clear();er.clear();
12077 for(
int i=0;i<100;i++){
12080 EvtComplex bw=1./(m*m-meanM*meanM+im*m*width);
12081 double amps =
abs2(bw);
12082 xx.push_back(m); yy.push_back(amps); er.push_back(0.);
double abs2(const EvtComplex &c)
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)
int getMode(std::vector< EvtId > evtdaugs)
double getXsection(double mx)
double Xsection_c(double mx)
bool operator()(int i, int j)