16#include "EvtGenBase/EvtPatches.hh"
24#include "EvtGenBase/EvtParser.hh"
25#include "EvtGenBase/EvtMultiChannelParser.hh"
26#include "EvtGenBase/EvtDecayMode.hh"
27#include "EvtGenBase/EvtPDL.hh"
45 std::string tok = parser.
getToken(i++);
46 if(tok == std::string(
"Decay"))
break;
51 string mother = string(parser.
getToken(i++).c_str());
52 std::string bf = parser.
getToken(i++);
59 std::string d = parser.
getToken(i++);
63 dauV.push_back(
string(d.c_str()));
67 printf(
"Decay File defines mode %s\n",mode.mode());
91 std::string tok = parser.
getToken(i++);
92 if(tok == std::string(model))
break;
96 printf(
"No model %s found in decay file %s",model,
file);
103 std::vector<std::string>
v;
106 std::string tok = parser.
getToken(i++);
107 if(tok == std::string(
";"))
break;
108 else v.push_back(tok);
113 printf(
"No terminating ; found in decay file %s",
file);
130 if(
v[0] == std::string(
"MAXPDF")) {
132 _pdfMax = strtod(
v[1].
c_str(),tc);
133 if(_pdfMax <= 0) { printf(
"Bad pdfMax=%f\n",_pdfMax); assert(0); }
136 if(
v[0] == std::string(
"SCANPDF")) {
138 _nScan = atoi(
v[1].
c_str());
142 printf(
"Error parsing decay file\n");
149 bool conjugate =
false;
153 while(i <
v.size()) {
158 if(
v[i] == std::string(
"CONJUGATE")) {
160 assert(conjugate ==
false);
163 _dm = strtod(
v[i].
c_str(),tc);
167 std::vector<std::string> params;
171 if(!conjugate &&
v[i] == std::string(
"AMPLITUDE")) {
174 _amp.push_back(params);
177 _ampCoef.push_back(c);
178 _coefFormat.push_back(format);
182 if(conjugate &&
v[i] == std::string(
"AMPLITUDE")) {
185 _ampConj.push_back(params);
187 _ampConjCoef.push_back(c);
188 _coefConjFormat.push_back(format);
193 printf(
"Expect keyword, found parameter %s\n",
v[i].
c_str());
201 printf(
"PARSING SUCCESSFUL\n");
202 printf(
"%d amplitude terms\n",_amp.size());
203 printf(
"%d conj amplitude terms\n",_ampConj.size());
214 assert(
v[i++] == std::string(
"COEFFICIENT"));
216 if(
v[i] == std::string(
"POLAR_DEG")) {
218 double mag = strtod(
v[i+1].
c_str(),tc);
224 else if(
v[i] == std::string(
"POLAR_RAD")) {
226 double mag = strtod(
v[i+1].
c_str(),tc);
227 double phaseRad = strtod(
v[i+2].
c_str(),tc);
232 else if(
v[i] == std::string(
"CARTESIAN")) {
234 double re = strtod(
v[i+1].
c_str(),tc);
235 double im = strtod(
v[i+2].
c_str(),tc);
242 printf(
"Invalid format %s for complex coefficient\n",
v[i].
c_str());
254 if(
v[i] == std::string(
"COEFFICIENT")) {
256 value = strtod(
v[i+1].
c_str(),tc);
269 if(
s == std::string(
"AMPLITUDE"))
return true;
270 if(
s == std::string(
"CONJUGATE"))
return true;
271 if(
s == std::string(
"COEFFICIENT"))
return true;
double sin(const BesAngle a)
double cos(const BesAngle a)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
static EvtDecayMode getDecayMode(const char *file)
void parse(const char *file, const char *model)
static void parseComplexCoef(int &i, const std::vector< std::string > &v, EvtComplex &c, int &format)
static bool isKeyword(const std::string &s)
static double parseRealCoef(int &i, const std::vector< std::string > &v)
static int getStdHep(EvtId id)
static EvtId getId(const std::string &name)
const std::string & getToken(int i)
int Read(const std::string filename)