38int EvtPDL::_firstAlias;
41std::map<std::string,int> EvtPDL::_particleNameLookup;
68 indec.open(fname.c_str());
85 report(
ERROR,
"EvtGen") <<
"Could not open:"<<fname.c_str()<<
"EvtPDL"<<endl;
96 if (ch==
'\n') indec.get(ch);
101 while (indec.get(ch1),ch1!=
'\n');
107 if (strcmp(cmnd,
"end")){
109 if (!strcmp(cmnd,
"add")){
124 i=
EvtId(_nentries,_nentries);
143 if (!strcmp(pname,
"string")){
147 if (!strcmp(pname,
"vpho")){
157 assert(_particleNameLookup.find(std::string(pname))==
158 _particleNameLookup.end());
159 _particleNameLookup[std::string(pname)]=_nentries;
167 partlist().push_back(tmp);
174 if (!strcmp(cmnd,
"set")){
184 }
while(strcmp(cmnd,
"end"));
196 report(
ERROR,
"EvtGen")<<
"Can't charge conjugate the two aliases:"
203 partlist()[a.
getAlias()].setIdChgConj(abar);
204 partlist()[abar.
getAlias()].setIdChgConj(a);
209 EvtId idchg=partlist()[
id.getAlias()].getIdChgConj();
211 if (idchg!=
EvtId(-1,-1))
return idchg;
213 if (
id.
getId()!=
id.getAlias()){
216 partlist()[
id.getAlias()].setIdChgConj(
id);
221 if (
id.getAlias()!=
id.
getId()) {
223 report(
ERROR,
"EvtGen")<<
"Trying to charge conjugate alias particle:"
224 <<
name(
id).c_str()<<
" without defining the alias!"<<endl;
232 for (i=0;i<partlist().size();i++){
233 if (partlist()[i].getStdHep()==-partlist()[
id.getId()].getStdHep()){
234 partlist()[
id.getId()].setIdChgConj(partlist()[i].
getId());
235 return partlist()[i].getId();
239 partlist()[
id.getId()].setIdChgConj(
id);
248 for (i=0;i<partlist().size();i++){
249 if (partlist()[i].getStdHep()==stdhep)
250 return partlist()[i].getId();
263 if ( _firstAlias < partlist().size() ) {
264 for(i=_firstAlias;i<partlist().size();i--){
265 if (newname==partlist()[i].getName()){
266 report(
WARNING,
"EvtGen")<<
"Redefining alias:"<<newname.c_str()<<
" will be ignored!"<<endl;
272 _firstAlias=partlist().size();
275 partlist().push_back(partlist()[
num.getId()]);
276 int entry=partlist().size()-1;
277 partlist()[entry].setName(newname);
278 assert(_particleNameLookup.find(std::string(newname))==
279 _particleNameLookup.end());
280 _particleNameLookup[std::string(newname)]=entry;
281 partlist()[entry].setId(
EvtId(
num.getId(),entry));
283 partlist()[entry].setIdChgConj(
EvtId(-1,-1));
289 std::map<std::string,int>::iterator it=_particleNameLookup.find(std::string(
name));
290 if (it==_particleNameLookup.end())
return EvtId(-1,-1);
292 return partlist()[it->second].getId();
296void EvtPDL::setUpConstsPdt(){
ostream & report(Severity severity, const char *facility)
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)