38int EvtPDL::_firstAlias;
41std::map<std::string, int> EvtPDL::_particleNameLookup;
61 indec.open( fname.c_str() );
79 report(
ERROR,
"EvtGen" ) <<
"Could not open:" << fname.c_str() <<
"EvtPDL" << endl;
90 if ( ch ==
'\n' ) indec.get( ch );
91 if ( ch !=
'*' ) { indec.putback( ch ); }
94 while ( indec.get( ch1 ), ch1 !=
'\n' )
97 }
while ( ch ==
'*' );
101 if ( strcmp( cmnd,
"end" ) )
104 if ( !strcmp( cmnd,
"add" ) )
119 i =
EvtId( _nentries, _nentries );
146 assert( _particleNameLookup.find( std::string( pname ) ) ==
147 _particleNameLookup.end() );
148 _particleNameLookup[std::string( pname )] = _nentries;
155 partlist().push_back( tmp );
161 if ( !strcmp( cmnd,
"set" ) )
171 }
while ( strcmp( cmnd,
"end" ) );
182 report(
ERROR,
"EvtGen" ) <<
"Can't charge conjugate the two aliases:"
189 partlist()[a.
getAlias()].setIdChgConj( abar );
190 partlist()[abar.
getAlias()].setIdChgConj( a );
194 EvtId idchg = partlist()[
id.getAlias()].getIdChgConj();
196 if ( idchg !=
EvtId( -1, -1 ) )
return idchg;
198 if (
id.
getId() !=
id.getAlias() )
203 partlist()[
id.getAlias()].setIdChgConj(
id );
208 if (
id.getAlias() !=
id.
getId() )
211 report(
ERROR,
"EvtGen" ) <<
"Trying to charge conjugate alias particle:"
212 <<
name(
id ).c_str() <<
" without defining the alias!" << endl;
219 for ( i = 0; i < partlist().size(); i++ )
223 partlist()[
id.getId()].setIdChgConj( partlist()[i].
getId() );
224 return partlist()[i].getId();
228 partlist()[
id.getId()].setIdChgConj(
id );
236 for ( i = 0; i < partlist().size(); i++ )
238 if ( partlist()[i].
getStdHep() == stdhep )
return partlist()[i].getId();
241 return EvtId( -1, -1 );
248 if ( _firstAlias < partlist().size() )
250 for ( i = _firstAlias; i < partlist().size(); i-- )
252 if ( newname == partlist()[i].getName() )
255 <<
"Redefining alias:" << newname.c_str() <<
" will be ignored!" << endl;
260 else { _firstAlias = partlist().size(); }
262 partlist().push_back( partlist()[
num.getId()] );
263 int entry = partlist().size() - 1;
264 partlist()[entry].setName( newname );
265 assert( _particleNameLookup.find( std::string( newname ) ) == _particleNameLookup.end() );
266 _particleNameLookup[std::string( newname )] = entry;
267 partlist()[entry].setId(
EvtId(
num.getId(), entry ) );
269 partlist()[entry].setIdChgConj(
EvtId( -1, -1 ) );
274 std::map<std::string, int>::iterator it = _particleNameLookup.find( std::string(
name ) );
275 if ( it == _particleNameLookup.end() )
return EvtId( -1, -1 );
277 return partlist()[it->second].getId();
280void EvtPDL::setUpConstsPdt() {}
ostream & report(Severity severity, const char *facility)
static int getStdHep(EvtId id)
void read(const char *fname)
void readPDT(const std::string fname)
static EvtId evtIdFromStdHep(int stdhep)
static void alias(EvtId num, const std::string &newname)
static std::string name(EvtId i)
static EvtId chargeConj(EvtId id)
static void aliasChgConj(EvtId a, EvtId abar)
static EvtId getId(const std::string &name)
void initLineShape(double mass, double width, double maxRange)
void setName(std::string pname)
void setStdHep(int stdhep)
void setSpinType(EvtSpinType::spintype stype)
void setIdChgConj(EvtId idchgconj)
void setLundKC(int lundkc)