Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EvtPDL Class Reference

#include <EvtPDL.hh>

List of all members.

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


Constructor & Destructor Documentation

EvtPDL::EvtPDL  ) 
 

00043                {
00044 
00045   if (first!=0) { 
00046     first=0;
00047     _nentries=0;
00048     _firstAlias=999999;
00049   }
00050 
00051 }

EvtPDL::~EvtPDL  ) 
 

00054                {
00055   
00056 }


Member Function Documentation

void EvtPDL::addFactorPn EvtId  i,
double  factor
[inline, static]
 

00075 {partlist()[i.getId()].addFactorPn(factor);}

void EvtPDL::alias EvtId  num,
const std::string &  newname
[static]
 

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 }

void EvtPDL::aliasChgConj EvtId  a,
EvtId  abar
[static]
 

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 }

void EvtPDL::changeLS EvtId  i,
std::string &  newLS
[inline, static]
 

00076 { partlist()[i.getId()].newLineShape(newLS);}

EvtId EvtPDL::chargeConj EvtId  id  )  [static]
 

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 }

int EvtPDL::chg3 EvtId  i  )  [inline, static]
 

00060 {return partlist()[i.getId()].getChg3();}

int EvtPDL::entries  )  [inline, static]
 

00067 { return partlist().size();}

EvtId EvtPDL::evtIdFromStdHep int  stdhep  )  [static]
 

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 }

void EvtPDL::fixLSForSP8 EvtId  i  )  [inline, static]
 

00079 { partlist()[i.getId()].fixLSForSP8();}

double EvtPDL::getctau EvtId  i  )  [inline, static]
 

00055 {return partlist()[i.getId()].getctau();}

EvtId EvtPDL::getId const std::string &  name  )  [static]
 

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 }

int EvtPDL::getLundKC EvtId  id  )  [inline, static]
 

00057 {return partlist()[id.getId()].getLundKC();}

double EvtPDL::getMass EvtId  i  )  [inline, static]
 

00046 {return partlist()[i.getId()].rollMass();}

double EvtPDL::getMassProb EvtId  i,
double  mass,
double  massPar,
int  nDaug,
double *  massDau
[inline, static]
 

00048 { return partlist()[i.getId()].getMassProb(mass,massPar,nDaug,massDau);}

double EvtPDL::getMaxMass EvtId  i  )  [inline, static]
 

00050 {return partlist()[i.getId()].getMassMax();}

double EvtPDL::getMaxRange EvtId  i  )  [inline, static]
 

00053 {return partlist()[i.getId()].getMaxRange();}

double EvtPDL::getMeanMass EvtId  i  )  [inline, static]
 

00045 { return partlist()[i.getId()].getMass(); }

double EvtPDL::getMinMass EvtId  i  )  [inline, static]
 

00051 {return partlist()[i.getId()].getMassMin();}

double EvtPDL::getRandMass EvtId  i,
EvtId parId,
int  nDaug,
EvtId dauId,
EvtId othDaugId,
double  maxMass,
double *  dauMasses
[inline, static]
 

00047 {return partlist()[i.getId()].getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses);}

EvtSpinType::spintype EvtPDL::getSpinType EvtId  i  )  [inline, static]
 

00062               {return partlist()[i.getId()].getSpinType();}

int EvtPDL::getStdHep EvtId  id  )  [inline, static]
 

00056 {return partlist()[id.getId()].getStdHep();}

double EvtPDL::getWidth EvtId  i  )  [inline, static]
 

00054 {return partlist()[i.getId()].getWidth();}

void EvtPDL::includeBirthFactor EvtId  i,
bool  yesno
[inline, static]
 

00073 {partlist()[i.getId()].includeBirthFactor(yesno);}

void EvtPDL::includeDecayFactor EvtId  i,
bool  yesno
[inline, static]
 

00074 {partlist()[i.getId()].includeDecayFactor(yesno);}

std::string EvtPDL::name EvtId  i  )  [inline, static]
 

00064 {return partlist()[i.getAlias()].getName();}

std::vector<EvtPartProp>& EvtPDL::partlist  )  [inline, static, private]
 

00087                                             {
00088     static std::vector<EvtPartProp> s_partlist;
00089     return s_partlist;
00090   }

void EvtPDL::read const char *  fname  ) 
 

00059 {
00060   readPDT(fname);
00061 }

void EvtPDL::readPDT const std::string  fname  ) 
 

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 }

void EvtPDL::reSetBlatt EvtId  i,
double  blatt
[inline, static]
 

00072 {partlist()[i.getId()].reSetBlatt(blatt);}

void EvtPDL::reSetMass EvtId  i,
double  mass
[inline, static]
 

00068 { partlist()[i.getId()].reSetMass(mass);}

void EvtPDL::reSetMassMax EvtId  i,
double  mass
[inline, static]
 

00071 { partlist()[i.getId()].reSetMassMax(mass);}

void EvtPDL::reSetMassMin EvtId  i,
double  mass
[inline, static]
 

00070 { partlist()[i.getId()].reSetMassMin(mass);}

void EvtPDL::reSetWidth EvtId  i,
double  width
[inline, static]
 

00069 { partlist()[i.getId()].reSetWidth(width);}

void EvtPDL::setPWForBirthL EvtId  i,
int  spin,
EvtId  par,
EvtId  othD
[static]
 

void EvtPDL::setPWForDecay EvtId  i,
int  spin,
EvtId  d1,
EvtId  d2
[inline, static]
 

00077 {  partlist()[i.getId()].setPWForDecay(spin,d1,d2);}

void EvtPDL::setUpConstsPdt  )  [private]
 

00296                            {
00297 
00298 }


Member Data Documentation

int EvtPDL::_firstAlias [static, private]
 

int EvtPDL::_nentries [static, private]
 

std::map< std::string, int > EvtPDL::_particleNameLookup [static, private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:08:21 2011 for BOSS6.5.5 by  doxygen 1.3.9.1