#include <EvtPDL.hh>
Public Member Functions | |
EvtPDL () | |
void | read (const char *fname) |
void | readPDT (const std::string fname) |
~EvtPDL () | |
Static Public Member Functions | |
void | addFactorPn (EvtId i, double factor) |
void | alias (EvtId num, const std::string &newname) |
void | aliasChgConj (EvtId a, EvtId abar) |
void | changeLS (EvtId i, std::string &newLS) |
EvtId | chargeConj (EvtId id) |
int | chg3 (EvtId i) |
int | entries () |
EvtId | evtIdFromStdHep (int stdhep) |
void | fixLSForSP8 (EvtId i) |
double | getctau (EvtId i) |
EvtId | getId (const std::string &name) |
int | getLundKC (EvtId id) |
double | getMass (EvtId i) |
double | getMassProb (EvtId i, double mass, double massPar, int nDaug, double *massDau) |
double | getMaxMass (EvtId i) |
double | getMaxRange (EvtId i) |
double | getMeanMass (EvtId i) |
double | getMinMass (EvtId i) |
double | getRandMass (EvtId i, EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses) |
EvtSpinType::spintype | getSpinType (EvtId i) |
int | getStdHep (EvtId id) |
double | getWidth (EvtId i) |
void | includeBirthFactor (EvtId i, bool yesno) |
void | includeDecayFactor (EvtId i, bool yesno) |
std::string | name (EvtId i) |
void | reSetBlatt (EvtId i, double blatt) |
void | reSetMass (EvtId i, double mass) |
void | reSetMassMax (EvtId i, double mass) |
void | reSetMassMin (EvtId i, double mass) |
void | reSetWidth (EvtId i, double width) |
void | setPWForBirthL (EvtId i, int spin, EvtId par, EvtId othD) |
void | setPWForDecay (EvtId i, int spin, EvtId d1, EvtId d2) |
Private Member Functions | |
void | setUpConstsPdt () |
Static Private Member Functions | |
std::vector< EvtPartProp > & | partlist () |
Static Private Attributes | |
int | _firstAlias |
int | _nentries |
std::map< std::string, int > | _particleNameLookup |
|
00043 { 00044 00045 if (first!=0) { 00046 first=0; 00047 _nentries=0; 00048 _firstAlias=999999; 00049 } 00050 00051 }
|
|
00054 { 00055 00056 }
|
|
|
|
00259 { 00260 00261 int i; 00262 00263 if ( _firstAlias < partlist().size() ) { 00264 for(i=_firstAlias;i<partlist().size();i--){ 00265 if (newname==partlist()[i].getName()){ 00266 report(WARNING,"EvtGen")<<"Redefining alias:"<<newname.c_str()<<" will be ignored!"<<endl; 00267 return; 00268 } 00269 } 00270 } 00271 else{ 00272 _firstAlias=partlist().size(); 00273 } 00274 00275 partlist().push_back(partlist()[num.getId()]); 00276 int entry=partlist().size()-1; 00277 partlist()[entry].setName(newname); 00278 assert(_particleNameLookup.find(std::string(newname))== 00279 _particleNameLookup.end()); 00280 _particleNameLookup[std::string(newname)]=entry; 00281 partlist()[entry].setId(EvtId(num.getId(),entry)); 00282 //Lange - Dec7, 2003. Unset the charge conjugate. 00283 partlist()[entry].setIdChgConj(EvtId(-1,-1)); 00284 00285 }
|
|
00191 { 00192 00193 if (EvtPDL::chargeConj(EvtId(a.getId(),a.getId()))!= 00194 EvtId(abar.getId(),abar.getId())) { 00195 00196 report(ERROR,"EvtGen")<<"Can't charge conjugate the two aliases:" 00197 <<EvtPDL::name(a).c_str()<<" and "<<EvtPDL::name(abar).c_str()<<endl; 00198 00199 ::abort(); 00200 00201 } 00202 00203 partlist()[a.getAlias()].setIdChgConj(abar); 00204 partlist()[abar.getAlias()].setIdChgConj(a); 00205 00206 }
|
|
|
|
00208 { 00209 EvtId idchg=partlist()[id.getAlias()].getIdChgConj(); 00210 00211 if (idchg!=EvtId(-1,-1)) return idchg; 00212 00213 if (id.getId()!=id.getAlias()){ 00214 if (chargeConj(EvtId(id.getId(),id.getId()))==EvtId(id.getId(),id.getId())){ 00215 00216 partlist()[id.getAlias()].setIdChgConj(id); 00217 return id; 00218 } 00219 } 00220 00221 if (id.getAlias()!=id.getId()) { 00222 00223 report(ERROR,"EvtGen")<<"Trying to charge conjugate alias particle:" 00224 <<name(id).c_str()<<" without defining the alias!"<<endl; 00225 00226 ::abort(); 00227 00228 } 00229 00230 int i; 00231 00232 for (i=0;i<partlist().size();i++){ 00233 if (partlist()[i].getStdHep()==-partlist()[id.getId()].getStdHep()){ 00234 partlist()[id.getId()].setIdChgConj(partlist()[i].getId()); 00235 return partlist()[i].getId(); 00236 } 00237 } 00238 00239 partlist()[id.getId()].setIdChgConj(id); 00240 return id; 00241 00242 }
|
|
|
|
00067 { return partlist().size();}
|
|
00244 { 00245 00246 int i; 00247 00248 for (i=0;i<partlist().size();i++){ 00249 if (partlist()[i].getStdHep()==stdhep) 00250 return partlist()[i].getId(); 00251 } 00252 00253 return EvtId(-1,-1); 00254 00255 }
|
|
|
|
|
|
00287 { 00288 00289 std::map<std::string,int>::iterator it=_particleNameLookup.find(std::string(name)); 00290 if (it==_particleNameLookup.end()) return EvtId(-1,-1); 00291 00292 return partlist()[it->second].getId(); 00293 00294 }
|
|
00057 {return partlist()[id.getId()].getLundKC();}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00056 {return partlist()[id.getId()].getStdHep();}
|
|
|
|
|
|
|
|
|
|
00087 { 00088 static std::vector<EvtPartProp> s_partlist; 00089 return s_partlist; 00090 }
|
|
00059 { 00060 readPDT(fname); 00061 }
|
|
00063 { 00064 00065 00066 ifstream indec; 00067 00068 indec.open(fname.c_str()); 00069 00070 char cmnd[100]; 00071 char xxxx[100]; 00072 00073 char pname[100]; 00074 int stdhepid; 00075 double mass; 00076 double pwidth; 00077 double pmaxwidth; 00078 int chg3; 00079 int spin2; 00080 double ctau; 00081 int lundkc; 00082 EvtId i; 00083 00084 if (!indec) { 00085 report(ERROR,"EvtGen") << "Could not open:"<<fname.c_str()<<"EvtPDL"<<endl; 00086 return; 00087 } 00088 00089 do{ 00090 00091 char ch,ch1; 00092 00093 do{ 00094 00095 indec.get(ch); 00096 if (ch=='\n') indec.get(ch); 00097 if (ch!='*') { 00098 indec.putback(ch); 00099 } 00100 else{ 00101 while (indec.get(ch1),ch1!='\n'); 00102 } 00103 } while(ch=='*'); 00104 00105 indec >> cmnd; 00106 00107 if (strcmp(cmnd,"end")){ 00108 00109 if (!strcmp(cmnd,"add")){ 00110 00111 indec >> xxxx; 00112 indec >> xxxx; 00113 indec >> pname; 00114 indec >> stdhepid; 00115 indec >> mass; 00116 indec >> pwidth; 00117 indec >> pmaxwidth; 00118 indec >> chg3; 00119 indec >> spin2; 00120 indec >> ctau; 00121 indec >> lundkc; 00122 00123 00124 i=EvtId(_nentries,_nentries); 00125 00126 EvtPartProp tmp; 00127 00128 tmp.setSpinType(EvtSpinType::SCALAR); 00129 00130 if (spin2==0) tmp.setSpinType(EvtSpinType::SCALAR); 00131 if (spin2==1) tmp.setSpinType(EvtSpinType::DIRAC); 00132 if (spin2==2) tmp.setSpinType(EvtSpinType::VECTOR); 00133 if (spin2==3) tmp.setSpinType(EvtSpinType::RARITASCHWINGER); 00134 if (spin2==4) tmp.setSpinType(EvtSpinType::TENSOR); 00135 if (spin2==5) tmp.setSpinType(EvtSpinType::SPIN5HALF); 00136 if (spin2==6) tmp.setSpinType(EvtSpinType::SPIN3); 00137 if (spin2==7) tmp.setSpinType(EvtSpinType::SPIN7HALF); 00138 if (spin2==8) tmp.setSpinType(EvtSpinType::SPIN4); 00139 if (spin2==2 && mass < 0.0001 ) tmp.setSpinType(EvtSpinType::PHOTON); 00140 if (spin2==1 && mass < 0.0001 ) tmp.setSpinType(EvtSpinType::NEUTRINO); 00141 00142 00143 if (!strcmp(pname,"string")){ 00144 tmp.setSpinType(EvtSpinType::STRING); 00145 } 00146 00147 if (!strcmp(pname,"vpho")){ 00148 tmp.setSpinType(EvtSpinType::VECTOR); 00149 } 00150 00151 00152 tmp.setId(i); 00153 tmp.setIdChgConj(EvtId(-1,-1)); 00154 tmp.setStdHep(stdhepid); 00155 tmp.setLundKC(lundkc); 00156 tmp.setName(pname); 00157 assert(_particleNameLookup.find(std::string(pname))== 00158 _particleNameLookup.end()); 00159 _particleNameLookup[std::string(pname)]=_nentries; 00160 tmp.setctau(ctau); 00161 tmp.setChg3(chg3); 00162 //report(INFO,"EvtGen") << "particle,chg3:"<<i<<","<<chg3<<endl; 00163 00164 tmp.initLineShape(mass,pwidth,pmaxwidth); 00165 00166 00167 partlist().push_back(tmp); 00168 _nentries++; 00169 00170 } 00171 00172 // if find a set read information and discard it 00173 00174 if (!strcmp(cmnd,"set")){ 00175 00176 indec >> xxxx; 00177 indec >> xxxx; 00178 indec >> xxxx; 00179 indec >> xxxx; 00180 } 00181 00182 } 00183 00184 }while(strcmp(cmnd,"end")); 00185 00186 setUpConstsPdt(); 00187 00188 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00296 { 00297 00298 }
|
|
|
|
|
|
|