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++ );
60 std::string d = parser.
getToken( i++ );
64 dauV.push_back(
string( d.c_str() ) );
68 printf(
"Decay File defines mode %s\n", mode.
mode() );
89 std::string tok = parser.
getToken( i++ );
90 if ( tok == std::string( model ) )
break;
95 printf(
"No model %s found in decay file %s", model,
file );
101 std::vector<std::string>
v;
105 std::string tok = parser.
getToken( i++ );
106 if ( tok == std::string(
";" ) )
break;
107 else v.push_back( tok );
113 printf(
"No terminating ; found in decay file %s",
file );
127 if (
v[0] == std::string(
"MAXPDF" ) )
130 _pdfMax = strtod(
v[1].c_str(), tc );
133 printf(
"Bad pdfMax=%f\n", _pdfMax );
137 else if (
v[0] == std::string(
"SCANPDF" ) ) { _nScan = atoi(
v[1].c_str() ); }
141 printf(
"Error parsing decay file\n" );
147 bool conjugate =
false;
151 while ( i <
v.size() )
157 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 while ( !
isKeyword(
v[++i] ) ) params.push_back(
v[i] );
175 _amp.push_back( params );
178 _ampCoef.push_back( c );
179 _coefFormat.push_back( format );
182 else if ( conjugate &&
v[i] == std::string(
"AMPLITUDE" ) )
185 while ( !
isKeyword(
v[++i] ) ) params.push_back(
v[i] );
186 _ampConj.push_back( params );
188 _ampConjCoef.push_back( c );
189 _coefConjFormat.push_back( format );
195 printf(
"Expect keyword, found parameter %s\n",
v[i].c_str() );
202 printf(
"PARSING SUCCESSFUL\n" );
203 printf(
"%d amplitude terms\n", _amp.size() );
204 printf(
"%d conj amplitude terms\n", _ampConj.size() );
212 assert(
v[i++] == std::string(
"COEFFICIENT" ) );
214 if (
v[i] == std::string(
"POLAR_DEG" ) )
217 double mag = strtod(
v[i + 1].c_str(), tc );
218 double phaseRad = strtod(
v[i + 2].c_str(), tc ) *
EvtConst::pi / 180.0;
223 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" ) )
235 double re = strtod(
v[i + 1].c_str(), tc );
236 double im = strtod(
v[i + 2].c_str(), tc );
244 printf(
"Invalid format %s for complex coefficient\n",
v[i].c_str() );
254 if (
v[i] == std::string(
"COEFFICIENT" ) ) { value = strtod(
v[i + 1].c_str(), tc ); }
259 assert( value > 0. );
264 if (
s == std::string(
"AMPLITUDE" ) )
return true;
265 if (
s == std::string(
"CONJUGATE" ) )
return true;
266 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
const char * mode() const
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)