39 for (
size_t i = 0; i < ndaug; ++i ) {
46 for (
size_t i = 0; i <
_root.size(); ++i )
54 for (
size_t i = 0; i < chars.size(); ++i ) {
55 ret = ret || ( chars[i] ==
arg );
63 vector<EvtMNode*> particles;
66 for (
size_t i = 0; i <
_lbltbl.size(); ++i ) {
68 labels.push_back( i );
71 if ( labels.size() == 0 ) {
73 <<
"Error unknown particle label " << strid << endl;
77 for (
size_t i = 0; i < labels.size(); ++i )
85 const vector<string>& lsarg,
const string& type,
86 const vector<EvtComplex>& amps,
87 const vector<EvtMNode*>& children )
92 if ( ls ==
"BREITWIGNER" ) {
94 }
else if ( ls ==
"TRIVIAL" ) {
98 <<
"Lineshape " << lineshape <<
" not recognized." << endl;
102 if ( type ==
"HELAMP" ) {
103 resonance =
new EvtMHelAmp(
id, lineshape, children, amps );
106 <<
"Model " << type <<
" not recognized." << endl;
110 lineshape->
setres( resonance );
122 while ( c_begin != c_end ) {
123 if ( c_begin == c_iter ) {
141 while ( c_iter != c_end ) {
143 if ( *c_iter ==
'(' ) {
159 while ( *c_iter !=
',' ) {
168 parseerror( c_iter == c_end, c_iter, c_begin, c_end );
177 if ( *c_iter !=
'[' )
186 if ( *c_iter ==
']' ) {
188 if ( temp.size() > 0 )
189 arg.push_back( temp );
193 if ( *c_iter ==
',' ) {
194 arg.push_back( temp );
203 parseerror( c_iter == c_end || *c_iter !=
',', c_iter, c_begin, c_end );
212 vector<string> parg =
parseArg( c_iter, c_begin, c_end );
213 parseerror( parg.size() == 0, c_iter, c_begin, c_end );
216 vector<string>::iterator amp_iter = parg.begin();
217 vector<string>::iterator amp_end = parg.end();
218 vector<EvtComplex> amps;
220 while ( amp_iter != amp_end ) {
223 double amp = 0.0, phase = 0.0;
225 nptr = ( *amp_iter ).c_str();
226 amp = strtod( nptr, &endptr );
227 parseerror( nptr == endptr, c_iter, c_begin, c_end );
230 parseerror( amp_iter == amp_end, c_iter, c_begin, c_end );
232 nptr = ( *amp_iter ).c_str();
233 phase = strtod( nptr, &endptr );
234 parseerror( nptr == endptr, c_iter, c_begin, c_end );
246 vector<EvtMNode*> newlist;
248 for (
size_t i = 0; i < list.size(); ++i )
249 newlist.push_back( list[i]->duplicate() );
256 vector<vector<EvtMNode*>>& cl1 )
258 vector<EvtMNode*> cl2 =
parsenode( nodestr,
false );
259 vector<vector<EvtMNode*>> cl;
261 if ( cl1.size() == 0 ) {
262 for (
size_t i = 0; i < cl2.size(); ++i ) {
263 vector<EvtMNode*> temp( 1, cl2[i] );
264 cl.push_back( temp );
270 for (
size_t i = 0; i < cl1.size(); ++i ) {
271 for (
size_t j = 0; j < cl2.size(); ++j ) {
272 vector<EvtMNode*> temp;
276 cl.push_back( temp );
280 for (
size_t i = 0; i < cl1.size(); ++i )
281 for (
size_t j = 0; j < cl1[i].size(); ++j )
283 for (
size_t i = 0; i < cl2.size(); ++i )
295 vector<vector<EvtMNode*>> children;
297 parseerror( c_iter == c_end || *c_iter !=
'[', c_iter, c_begin, c_end );
301 parseerror( c_iter == c_end || pcount < 0, c_iter, c_begin, c_end );
341 ptype c_iter, c_begin, c_end;
343 c_iter = c_begin = args.begin();
346 string strid =
parseId( c_iter, c_begin, c_end );
349 if ( c_iter == c_end )
357 vector<string> lsarg;
363 ls =
parseKey( c_iter, c_begin, c_end );
364 lsarg =
parseArg( c_iter, c_begin, c_end );
368 string type =
parseKey( c_iter, c_begin, c_end );
369 vector<EvtComplex> amps =
parseAmps( c_iter, c_begin, c_end );
372 vector<vector<EvtMNode*>> children =
parseChildren( c_iter, c_begin, c_end );
375 vector<EvtMNode*> resonances;
376 for (
size_t i = 0; i < children.size(); ++i ) {
377 resonances.push_back(
381 parseerror( c_iter == c_end || *c_iter !=
')', c_iter, c_begin, c_end );
389 vector<bool> check( res.size(), false );
391 for (
size_t i = 0; i < res.size(); ++i ) {
392 check[res[i]] =
true;
397 for (
size_t i = 0; i < check.size(); ++i ) {
398 ret = ret && check[i];
406 vector<EvtMNode*> roots =
parsenode( str,
true );
409 for (
size_t i = 0; i < roots.size(); ++i ) {
411 _root.push_back( roots[i] );
426 vector<EvtSpinType::spintype> types( 2, type );
430 rot( index ) = sd.
get( ( index[0] + twospin ) / 2,
431 ( index[1] + twospin ) / 2 );
439 vector<EvtVector4R> product;
440 for (
size_t i = 0; i < p->
getNDaug(); ++i )
443 if (
_root.size() == 0 ) {
445 <<
"No decay tree present." << endl;
450 for (
size_t i = 1; i <
_root.size(); ++i ) {
452 amp +=
_root[i]->amplitude( product );
vector< EvtMNode * > duplicate(const vector< EvtMNode * > &) const
static std::string name(EvtId i)
string parseId(ptype &, ptype &, ptype &)
vector< EvtComplex > parseAmps(ptype &, ptype &, ptype &)
EvtSpinAmp getrotation(EvtParticle *) const
bool iterateallowed(vector< int > &index) const
void extcont(const EvtSpinAmp &, int, int)
static EvtSpinType::spintype getSpinType(EvtId i)
bool validTree(const EvtMNode *) const
EvtVector4R getP4Lab() const
vector< vector< EvtMNode * > > parseChildren(ptype &, ptype &, ptype &)
bool parsecheck(char, const string &)
vector< int > iterallowedinit() const
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
string parseKey(ptype &, ptype &, ptype &)
const EvtComplex & get(int i, int j) const
EvtMRes * makeresonance(const EvtId &, const string &, const vector< string > &, const string &, const vector< EvtComplex > &, const vector< EvtMNode * > &)
void parseerror(bool, ptype &, ptype &, ptype &)
vector< vector< EvtMNode * > > unionChildren(const string &, vector< vector< EvtMNode * >> &)
vector< EvtMNode * > _root
EvtMTree(const EvtId *, unsigned int)
void addtree(const string &)
virtual EvtSpinDensity rotateToHelicityBasis() const =0
const vector< int > & getresonance() const
static EvtId getId(const std::string &name)
static int getSpin2(spintype stype)
vector< EvtMNode * > parsenode(const string &, bool)
EvtComplex exp(const EvtComplex &c)
EvtParticle * getDaug(int i)
vector< EvtMNode * > makeparticles(const string &)
string::const_iterator ptype
double arg(const EvtComplex &c)
vector< string > parseArg(ptype &, ptype &, ptype &)
EvtSpinAmp amplitude(EvtParticle *) const