BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
Pdt Class Reference

#include <Pdt.h>

Static Public Member Functions

static PdtEntrylookup (const std::string &name)
 
static PdtEntrylookup (PdtLund::LundType id)
 
static PdtEntrylookup (PdtGeant::GeantType id)
 
static PdtEntrylookup (PdtPdg::PdgType id)
 
static PdtEntrylookup (PdtPid::PidType id, int charge=-1)
 
static PdtEntrylookup (PdtPid::PidNeutralType id, int charge=0)
 
static bool sameOrConj (PdtLund::LundType id1, PdtLund::LundType id2)
 
static bool sameOrConj (PdtPdg::PdgType id1, PdtPdg::PdgType id2)
 
static bool sameOrConj (PdtEntry *id1, PdtEntry *id2)
 
static const PdtEntryconjugate (const PdtEntry *)
 
static float mass (PdtLund::LundType id)
 
static float mass (PdtGeant::GeantType id)
 
static float mass (PdtPid::PidType id)
 
static float mass (PdtPid::PidNeutralType id)
 
static float mass (const char *name)
 
static float width (PdtLund::LundType id)
 
static float width (PdtGeant::GeantType id)
 
static float width (PdtPid::PidType id)
 
static float width (PdtPid::PidNeutralType id)
 
static float width (const char *name)
 
static float lifetime (PdtLund::LundType id)
 
static float lifetime (PdtGeant::GeantType id)
 
static float lifetime (PdtPid::PidType id)
 
static float lifetime (PdtPid::PidNeutralType id)
 
static float lifetime (const char *name)
 
static float spin (PdtLund::LundType id)
 
static float spin (PdtGeant::GeantType id)
 
static float spin (PdtPid::PidType id)
 
static float spin (PdtPid::PidNeutralType id)
 
static float spin (const char *name)
 
static float charge (PdtLund::LundType id)
 
static float charge (PdtGeant::GeantType id)
 
static float charge (const char *name)
 
static PdtLund::LundType antiCode (PdtLund::LundType)
 
static void readMCppTable (std::string filenm)
 
static void deleteAll ()
 
static void printOn (std::ostream &)
 
static void addParticle (const char *pname, PdtLund::LundType id, float spin, float charge, float mass, float width=0.0, float cut=0.0)
 
static void addParticle (const char *pname, PdtGeant::GeantType id, float spin, float charge, float mass, float width=0.0, float cut=0.0)
 
static void addDecay (const char *pname, float bf, const char *child1, const char *child2=0, const char *child3=0, const char *child4=0, const char *child5=0)
 
static void addDecay (PdtLund::LundType id, float bf, PdtLund::LundType child1, PdtLund::LundType child2=PdtLund::null, PdtLund::LundType child3=PdtLund::null, PdtLund::LundType child4=PdtLund::null, PdtLund::LundType child5=PdtLund::null)
 
static PdtLund::LundType lundId (const PdtGeant::GeantType)
 
static PdtLund::LundType lundId (const PdtPdg::PdgType)
 
static PdtLund::LundType lundId (const PdtPid::PidType, int charge=-1)
 
static PdtLund::LundType lundId (const PdtPid::PidNeutralType, int charge=0)
 
static PdtPdg::PdgType pdgId (const PdtLund::LundType)
 
static PdtPdg::PdgType pdgId (const PdtPid::PidType pid, int charge=-1)
 
static PdtPdg::PdgType pdgId (const PdtPid::PidNeutralType pid, int charge=0)
 
static PdtPdg::PdgType pdgPid (const PdtGeant::GeantType geant)
 
static PdtGeant::GeantType geantId (const PdtLund::LundType)
 
static PdtGeant::GeantType geantId (const PdtPid::PidType, int charge=-1)
 
static PdtGeant::GeantType geantId (const PdtPid::PidNeutralType, int charge=0)
 
static PdtGeant::GeantType geantId (const PdtPdg::PdgType pdg)
 
static PdtPid::PidType pidId (const PdtLund::LundType)
 
static PdtPid::PidType pidId (const PdtGeant::GeantType)
 
static PdtPid::PidType pidId (const PdtPdg::PdgType pdg)
 
static PdtPid::PidNeutralType pidNeutId (const PdtLund::LundType)
 
static PdtPid::PidNeutralType pidNeutId (const PdtGeant::GeantType)
 
static PdtPid::PidNeutralType pidNeutId (const PdtPdg::PdgType pdg)
 
static PdtLund::LundType lundId (const int id)
 
static PdtGeant::GeantType geantId (const int id)
 
static PdtPid::PidType pidId (const int id)
 
static PdtPid::PidNeutralType pidNeutId (const int id)
 
static PdtPdg::PdgType pdgId (const int id)
 

Detailed Description

Definition at line 49 of file Pdt.h.

Member Function Documentation

◆ addDecay() [1/2]

void Pdt::addDecay ( const char *  pname,
float  bf,
const char *  child1,
const char *  child2 = 0,
const char *  child3 = 0,
const char *  child4 = 0,
const char *  child5 = 0 
)
static

Definition at line 160 of file Pdt.cxx.

162 {
163
164 PdtEntry *primary = lookup(pname);
165 if (primary == 0) return;
166 const char *children[5] = {child1, child2, child3, child4, child5};
167
168 vector<PdtEntry*> *kids = new vector<PdtEntry*>;
169
170 int nkids;
171 for(nkids=0; nkids<5 && children[nkids]!=0; nkids++ )
172 {
173 PdtEntry* secondary = lookup(children[nkids]);
174 if( secondary ==0 ) break;
175 kids->push_back(secondary);
176 }
177
178 primary->addDecay(bf, kids );
179
180}
void addDecay(float bf, vector< PdtEntry * > *kids)
Definition: PdtEntry.cxx:105
static PdtEntry * lookup(const std::string &name)
Definition: Pdt.cxx:207

◆ addDecay() [2/2]

void Pdt::addDecay ( PdtLund::LundType  id,
float  bf,
PdtLund::LundType  child1,
PdtLund::LundType  child2 = PdtLund::null,
PdtLund::LundType  child3 = PdtLund::null,
PdtLund::LundType  child4 = PdtLund::null,
PdtLund::LundType  child5 = PdtLund::null 
)
static

Definition at line 182 of file Pdt.cxx.

187 {
188
189 PdtEntry *primary = lookup(id);
190 if (primary == 0) return;
191
192 PdtLund::LundType children[5] = {child1, child2, child3, child4, child5};
193 vector<PdtEntry*> *kids = new vector<PdtEntry*>;
194
195 int nkids;
196 for(nkids=0; nkids<5 && children[nkids]!=0; nkids++ )
197 {
198 PdtEntry* secondary = lookup(children[nkids]);
199 if( secondary ==0 ) break;
200 kids->push_back(secondary);
201 }
202
203 primary->addDecay(bf, kids );
204
205}
LundType
Definition: PdtLund.h:11

◆ addParticle() [1/2]

void Pdt::addParticle ( const char *  pname,
PdtGeant::GeantType  id,
float  spin,
float  charge,
float  mass,
float  width = 0.0,
float  cut = 0.0 
)
static

Definition at line 125 of file Pdt.cxx.

127 {
128
129 PdtEntry* nentry = new PdtEntry(pname, id, spin, charge, mass, width, cut);
130
131 (*_entries)[pdgId(id)]=nentry;
132 if ( (*_entriesn)[pname] != 0 ) {
133 //cout << "Pdt::addParticle:adding existing particle:"<<pname<<endl;
134 }
135
136 _entriesn->insert( pname )=nentry;
137 if(PdtGeant::null!=nentry->geantId()){
138 (*_entriesg)[id]=nentry;
139 }
140
141 (*_entriesl)[lundId(id)]=nentry;
142
143 if(PdtPid::null!=nentry->pidId()) {
144 if(nentry->charge()>0) {
145 _positiveEntries[nentry->pidId()]=nentry;
146 }else{
147 _negativeEntries[nentry->pidId()]=nentry;
148 }
149
150 }
151
152 if(PdtPid::none!=nentry->pidNeutId()){
153 if(nentry->charge()==0) {
154 _neutralEntries[nentry->pidNeutId()]=nentry;
155 }
156 }
157
158}
double mass
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared cut
Definition: KarFin.h:27
virtual T *& insert(const std::string &key)
PdtPid::PidNeutralType pidNeutId() const
Definition: PdtEntry.h:67
PdtGeant::GeantType geantId() const
Definition: PdtEntry.h:65
PdtPid::PidType pidId() const
Definition: PdtEntry.h:66
float charge() const
Definition: PdtEntry.h:54
@ null
Definition: PdtGeant.h:69
@ null
Definition: PdtPid.h:12
@ none
Definition: PdtPid.h:23
static float width(PdtLund::LundType id)
Definition: Pdt.h:82
static float charge(PdtLund::LundType id)
Definition: Pdt.h:103
static PdtPdg::PdgType pdgId(const PdtLund::LundType)
Definition: Pdt.cxx:608
static PdtLund::LundType lundId(const PdtGeant::GeantType)
Definition: Pdt.cxx:413
static float spin(PdtLund::LundType id)
Definition: Pdt.h:96

◆ addParticle() [2/2]

void Pdt::addParticle ( const char *  pname,
PdtLund::LundType  id,
float  spin,
float  charge,
float  mass,
float  width = 0.0,
float  cut = 0.0 
)
static

Definition at line 91 of file Pdt.cxx.

93 {
94
95 PdtEntry* nentry = new PdtEntry(pname, id, spin, charge, mass, width, cut);
96 (*_entries)[pdgId(id)]=nentry;
97
98 if ( (*_entriesn)[pname] != 0 ) {
99 //cout << "Pdt::addParticle:adding existing particle:"<<pname<<endl;
100 }
101
102 _entriesn->insert( pname )=nentry;
103 if(PdtGeant::null!=nentry->geantId()){
104 (*_entriesg)[nentry->geantId()]=nentry;
105 }
106
107 (*_entriesl)[id]=nentry;
108
109 if(PdtPid::null!=nentry->pidId()) {
110 if(nentry->charge()>0) {
111 _positiveEntries[nentry->pidId()]=nentry;
112 }else{
113 _negativeEntries[nentry->pidId()]=nentry;
114 }
115 }
116
117 if(PdtPid::none!=nentry->pidNeutId()){
118 if(nentry->charge()==0){
119 _neutralEntries[nentry->pidNeutId()]=nentry;
120 }
121 }
122
123}

Referenced by readMCppTable().

◆ antiCode()

PdtLund::LundType Pdt::antiCode ( PdtLund::LundType  kf_id)
static

Definition at line 73 of file Pdt.cxx.

73 {
74
75 int kf = (int) kf_id;
76
77 int i2 = (kf/10) % 10;
78 int i3 = (kf/100) % 10;
79 int i4 = (kf/1000) % 10;
80
81 if (i2 == i3 && i4 == 0 && kf > 100)
82 return lundId(kf);
83 else if (kf >= 21 && kf <= 23) return lundId(kf);
84
85 else if (kf == 310) return lundId(130);
86 else if (kf == 130) return lundId(310);
87
88 else return lundId(-kf);
89}

◆ charge() [1/3]

static float Pdt::charge ( const char *  name)
inlinestatic

Definition at line 105 of file Pdt.h.

105{ return lookup(name)->charge(); }

◆ charge() [2/3]

static float Pdt::charge ( PdtGeant::GeantType  id)
inlinestatic

Definition at line 104 of file Pdt.h.

104{ return lookup(id)->charge(); }

◆ charge() [3/3]

static float Pdt::charge ( PdtLund::LundType  id)
inlinestatic

Definition at line 103 of file Pdt.h.

103{ return lookup(id)->charge(); }

Referenced by addParticle(), geantId(), lookup(), lundId(), pdgId(), and readMCppTable().

◆ conjugate()

const PdtEntry * Pdt::conjugate ( const PdtEntry pdt)
static

Definition at line 681 of file Pdt.cxx.

682{
683 if( pdt==0 ) return 0;
684 PdtEntry* conjPdt = (PdtEntry*) pdt;
685
686 // get the key
687 int key = (int) pdt->pdgId();
688
689 // switch the key
690 key *= -1;
691
692 // look for an entry in the dictionary
693
694 map<int, PdtEntry*>::iterator iter=_entries->find(key);
695
696 if ( iter!=_entries->end() ) {
697 //found a match.
698 conjPdt=iter->second;
699 }
700 //otherwise its self conjugate - we should just return..
701
702 // return the conjugate
703 return conjPdt;
704}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Definition: Taupair.h:42
PdtPdg::PdgType pdgId() const
Definition: PdtEntry.h:64

Referenced by PdtEntry::conjugate(), and printOn().

◆ deleteAll()

void Pdt::deleteAll ( )
static

Definition at line 393 of file Pdt.cxx.

393 {
394
395 PdtEntry *p;
396
397 map<int, PdtEntry*>::iterator iter=_entries->begin();
398
399 while ( iter != _entries->end()) {
400 p = iter->second;
401 assert(0!=p);
402 delete p;
403 ++iter;
404 }
405
406 _entries->clear();
407 _entriesn->clear();
408 _entriesg->clear();
409 _entriesl->clear();
410}
virtual void clear()

◆ geantId() [1/5]

static PdtGeant::GeantType Pdt::geantId ( const int  id)
inlinestatic

Definition at line 181 of file Pdt.h.

181{ return (PdtGeant::GeantType) id; };

◆ geantId() [2/5]

PdtGeant::GeantType Pdt::geantId ( const PdtLund::LundType  lId)
static

Definition at line 427 of file Pdt.cxx.

427 {
428
429 //
430 // special case:
431 // GEANT has only one neutrino
432 //
433 if (lId == PdtLund::nu_e ||
434 lId == PdtLund::anti_nu_e ||
435 lId == PdtLund::nu_mu ||
436 lId == PdtLund::anti_nu_mu ||
437 lId == PdtLund::nu_tau ||
438 lId == PdtLund::anti_nu_tau )
439 { return PdtGeant::nu_e; }
440 else
441 {
442 int i;
443 for(i = 0; i< PdtGeant::_nGeantId; i++)
444 { if (PdtGeant::_lundId[i] == lId) return geantId(i); }
445 return PdtGeant::null;
446 }
447}
@ nu_e
Definition: PdtGeant.h:16
static const PdtLund::LundType _lundId[52]
Definition: PdtGeant.h:74
static const int _nGeantId
Definition: PdtGeant.h:73
@ nu_mu
Definition: PdtLund.h:35
@ nu_tau
Definition: PdtLund.h:39
@ anti_nu_e
Definition: PdtLund.h:32
@ nu_e
Definition: PdtLund.h:31
@ anti_nu_tau
Definition: PdtLund.h:40
@ anti_nu_mu
Definition: PdtLund.h:36
static PdtGeant::GeantType geantId(const PdtLund::LundType)
Definition: Pdt.cxx:427

Referenced by geantId().

◆ geantId() [3/5]

static PdtGeant::GeantType Pdt::geantId ( const PdtPdg::PdgType  pdg)
inlinestatic

Definition at line 160 of file Pdt.h.

161 { return geantId(lundId(pdg)); }

◆ geantId() [4/5]

PdtGeant::GeantType Pdt::geantId ( const PdtPid::PidNeutralType  pId,
int  charge = 0 
)
static

Definition at line 504 of file Pdt.cxx.

504 {
505 return geantId(lundId(pId, charge));
506}

◆ geantId() [5/5]

PdtGeant::GeantType Pdt::geantId ( const PdtPid::PidType  pId,
int  charge = -1 
)
static

Definition at line 500 of file Pdt.cxx.

500 {
501 return geantId(lundId(pId, charge));
502}

◆ lifetime() [1/5]

static float Pdt::lifetime ( const char *  name)
inlinestatic

Definition at line 93 of file Pdt.h.

93{ return lookup(name)->lifetime(); }
float lifetime() const
Definition: PdtEntry.h:58

◆ lifetime() [2/5]

static float Pdt::lifetime ( PdtGeant::GeantType  id)
inlinestatic

Definition at line 90 of file Pdt.h.

90{ return lookup(id)->lifetime(); }

◆ lifetime() [3/5]

static float Pdt::lifetime ( PdtLund::LundType  id)
inlinestatic

Definition at line 89 of file Pdt.h.

89{ return lookup(id)->lifetime(); }

Referenced by readMCppTable().

◆ lifetime() [4/5]

static float Pdt::lifetime ( PdtPid::PidNeutralType  id)
inlinestatic

Definition at line 92 of file Pdt.h.

92{ return lookup(id)->lifetime(); }

◆ lifetime() [5/5]

static float Pdt::lifetime ( PdtPid::PidType  id)
inlinestatic

Definition at line 91 of file Pdt.h.

91{ return lookup(id)->lifetime(); }

◆ lookup() [1/6]

PdtEntry * Pdt::lookup ( const std::string &  name)
static

◆ lookup() [2/6]

PdtEntry * Pdt::lookup ( PdtGeant::GeantType  id)
static

Definition at line 216 of file Pdt.cxx.

216 {
217 // look for the particle by GEANT id
218 return (*_entriesg)[id];
219}

◆ lookup() [3/6]

PdtEntry * Pdt::lookup ( PdtLund::LundType  id)
static

Definition at line 211 of file Pdt.cxx.

211 {
212 // look for the particle by Particle Data Group id
213 return (*_entriesl)[id];
214}

◆ lookup() [4/6]

PdtEntry * Pdt::lookup ( PdtPdg::PdgType  id)
static

Definition at line 221 of file Pdt.cxx.

221 {
222 // look for the particle by PDG id
223 return (*_entries)[id];
224}

◆ lookup() [5/6]

PdtEntry * Pdt::lookup ( PdtPid::PidNeutralType  id,
int  charge = 0 
)
static

Definition at line 235 of file Pdt.cxx.

235 {
236
237 // look for the particle by PID code id and charge
238
239 if(id==PdtPid::none) return lookup(PdtLund::null);
240 return _neutralEntries[id];
241
242}
@ null
Definition: PdtLund.h:522

◆ lookup() [6/6]

PdtEntry * Pdt::lookup ( PdtPid::PidType  id,
int  charge = -1 
)
static

Definition at line 226 of file Pdt.cxx.

226 {
227
228 // look for the particle by PID code id and charge
229 if(id==PdtPid::null) return lookup(PdtLund::null);
230 if(charge>0) return _positiveEntries[id];
231 return _negativeEntries[id];
232
233}

◆ lundId() [1/5]

static PdtLund::LundType Pdt::lundId ( const int  id)
inlinestatic

Definition at line 180 of file Pdt.h.

180{ return (PdtLund::LundType) id; };

◆ lundId() [2/5]

PdtLund::LundType Pdt::lundId ( const PdtGeant::GeantType  gId)
static

Definition at line 413 of file Pdt.cxx.

413 {
414
415 if (gId == PdtGeant::deuteron ||
416 gId == PdtGeant::tritium ||
417 gId == PdtGeant::alpha ||
418 gId == PdtGeant::geantino ||
419 gId == PdtGeant::He3 ||
420 gId == PdtGeant::Cerenkov)
421 { return PdtLund::null; }
422 else
424
425}
@ deuteron
Definition: PdtGeant.h:57
@ alpha
Definition: PdtGeant.h:59
@ geantino
Definition: PdtGeant.h:60
@ Cerenkov
Definition: PdtGeant.h:62
@ tritium
Definition: PdtGeant.h:58
static const GeantType _firstGeantId
Definition: PdtGeant.h:72

Referenced by addParticle(), antiCode(), geantId(), lundId(), pdgId(), pdgPid(), pidId(), pidNeutId(), and readMCppTable().

◆ lundId() [3/5]

PdtLund::LundType Pdt::lundId ( const PdtPdg::PdgType  pdg)
static

Definition at line 580 of file Pdt.cxx.

580 {
581
582 int ret;
583 switch ( (int) pdg ) {
584 case 551: // chi_0b
585 ret = 10551 ;
586 case 10443: // chi_1c
587 ret = 20443 ;
588 case 20443: // psi(2S)
589 ret = 30443 ;
590 case 30443: // psi(3770)
591 ret = 40443 ;
592 case 20553: // Upsilon(2S)
593 ret = 30553 ;
594 case 4322: // Xi_c+
595 ret = 4232 ;
596 case -4322: // Anti Xi_c+
597 ret = -4232 ;
598 case 4232: // Xi'_c+
599 ret = 4322 ;
600 case -4232: // Anti Xi'_c+
601 ret = -4322 ;
602 default: // All the rest is the same (hopefully)
603 ret = (int) pdg;
604 }
605 return lundId(ret);
606}

◆ lundId() [4/5]

PdtLund::LundType Pdt::lundId ( const PdtPid::PidNeutralType  pId,
int  charge = 0 
)
static

Definition at line 553 of file Pdt.cxx.

553 {
554
555 if (charge == 0)
556 {
557 switch(pId)
558 {
559 case PdtPid::gamma:
560 return PdtLund::gamma;
561 case PdtPid::pi0:
562 return PdtLund::pi0;
563 case PdtPid::K0L:
564 return PdtLund::K_L0;
565 case PdtPid::neutron:
566 return PdtLund::n0;
568 return PdtLund::anti_n0;
569 default:
570 return PdtLund::null;
571 }
572 }
573 else
574 {
575 cerr << "error: wrong charge; must be +1 or -1" << endl;
576 return PdtLund::null;
577 }
578}
@ anti_n0
Definition: PdtLund.h:321
@ gamma
Definition: PdtLund.h:45
@ K_L0
Definition: PdtLund.h:144
@ n0
Definition: PdtLund.h:320
@ pi0
Definition: PdtLund.h:94
@ pi0
Definition: PdtPid.h:25
@ neutron
Definition: PdtPid.h:27
@ gamma
Definition: PdtPid.h:24
@ anti_neutron
Definition: PdtPid.h:28
@ K0L
Definition: PdtPid.h:26

◆ lundId() [5/5]

PdtLund::LundType Pdt::lundId ( const PdtPid::PidType  pId,
int  charge = -1 
)
static

Definition at line 508 of file Pdt.cxx.

508 {
509
510 if(charge == -1)
511 {
512 switch(pId)
513 {
514 case PdtPid::electron:
515 return PdtLund::e_minus;
516 case PdtPid::muon:
517 return PdtLund::pi_minus;
518 case PdtPid::pion:
519 return PdtLund::pi_minus;
520 case PdtPid::kaon:
521 return PdtLund::K_minus;
522 case PdtPid::proton:
524 default:
525 return PdtLund::null;
526 }
527 }
528 else if (charge == 1)
529 {
530 switch(pId)
531 {
532 case PdtPid::electron:
533 return PdtLund::e_plus;
534 case PdtPid::muon:
535 return PdtLund::pi_plus;
536 case PdtPid::pion:
537 return PdtLund::pi_plus;
538 case PdtPid::kaon:
539 return PdtLund::K_plus;
540 case PdtPid::proton:
541 return PdtLund::p_plus;
542 default:
543 return PdtLund::null;
544 }
545 }
546 else
547 {
548 cerr << "error: wrong charge; must be +1 or -1" << endl;
549 return PdtLund::null;
550 }
551}
@ pi_minus
Definition: PdtLund.h:96
@ K_minus
Definition: PdtLund.h:146
@ pi_plus
Definition: PdtLund.h:95
@ anti_p_minus
Definition: PdtLund.h:327
@ p_plus
Definition: PdtLund.h:326
@ e_minus
Definition: PdtLund.h:29
@ e_plus
Definition: PdtLund.h:30
@ K_plus
Definition: PdtLund.h:145
@ pion
Definition: PdtPid.h:15
@ proton
Definition: PdtPid.h:17
@ electron
Definition: PdtPid.h:13
@ muon
Definition: PdtPid.h:14
@ kaon
Definition: PdtPid.h:16

◆ mass() [1/5]

static float Pdt::mass ( const char *  name)
inlinestatic

Definition at line 79 of file Pdt.h.

79{ return lookup(name)->mass(); }
float mass() const
Definition: PdtEntry.h:55

◆ mass() [2/5]

static float Pdt::mass ( PdtGeant::GeantType  id)
inlinestatic

Definition at line 76 of file Pdt.h.

76{ return lookup(id)->mass(); }

◆ mass() [3/5]

static float Pdt::mass ( PdtLund::LundType  id)
inlinestatic

Definition at line 75 of file Pdt.h.

75{ return lookup(id)->mass(); }

◆ mass() [4/5]

static float Pdt::mass ( PdtPid::PidNeutralType  id)
inlinestatic

Definition at line 78 of file Pdt.h.

78{ return lookup(id)->mass();}

◆ mass() [5/5]

static float Pdt::mass ( PdtPid::PidType  id)
inlinestatic

Definition at line 77 of file Pdt.h.

77{ return lookup(id)->mass();}

◆ pdgId() [1/4]

static PdtPdg::PdgType Pdt::pdgId ( const int  id)
inlinestatic

Definition at line 184 of file Pdt.h.

184{ return (PdtPdg::PdgType) id; };
PdgType
Definition: PdtPdg.h:8

◆ pdgId() [2/4]

PdtPdg::PdgType Pdt::pdgId ( const PdtLund::LundType  lund)
static

Definition at line 608 of file Pdt.cxx.

608 {
609
610 int ret;
611 switch ( (int) lund ) {
612 case 551: // eta_b does not exist in PDG
613 ret = 0 ;
614 case 10551: // chi_0b
615 ret = 551 ;
616 case 10443: // h_1c does not exist in PDG
617 ret = 0 ;
618 case 20443: // chi_1c
619 ret = 10443 ;
620 case 30443: // psi(2S)
621 ret = 20443 ;
622 case 40443: // psi(3770)
623 ret = 30443 ;
624 case 30553: // Upsilon(2S)
625 ret = 20553 ;
626 case 4232: // Xi_c+
627 ret = 4322 ;
628 case -4232: // Anti Xi_c+
629 ret = -4322 ;
630 case 4322: // Xi'_c+
631 ret = 4232 ;
632 case -4322: // Anti Xi'_c+
633 ret = -4232 ;
634 default: // All the rest is the same (hopefully)
635 ret = (int) lund ;
636 }
637 return pdgId(ret);
638}

Referenced by addParticle(), pdgId(), and pdgPid().

◆ pdgId() [3/4]

static PdtPdg::PdgType Pdt::pdgId ( const PdtPid::PidNeutralType  pid,
int  charge = 0 
)
inlinestatic

Definition at line 152 of file Pdt.h.

153 { return pdgId(lundId(pid, charge)); }

◆ pdgId() [4/4]

static PdtPdg::PdgType Pdt::pdgId ( const PdtPid::PidType  pid,
int  charge = -1 
)
inlinestatic

Definition at line 150 of file Pdt.h.

151 { return pdgId(lundId(pid, charge)); }

◆ pdgPid()

static PdtPdg::PdgType Pdt::pdgPid ( const PdtGeant::GeantType  geant)
inlinestatic

Definition at line 154 of file Pdt.h.

155 { return pdgId(lundId(geant)); }

◆ pidId() [1/4]

static PdtPid::PidType Pdt::pidId ( const int  id)
inlinestatic

Definition at line 182 of file Pdt.h.

182{ return (PdtPid::PidType) id; };
PidType
Definition: PdtPid.h:11

◆ pidId() [2/4]

PdtPid::PidType Pdt::pidId ( const PdtGeant::GeantType  gId)
static

Definition at line 492 of file Pdt.cxx.

492 {
493 return pidId(lundId(gId));
494}
static PdtPid::PidType pidId(const PdtLund::LundType)
Definition: Pdt.cxx:449

◆ pidId() [3/4]

PdtPid::PidType Pdt::pidId ( const PdtLund::LundType  lId)
static

Definition at line 449 of file Pdt.cxx.

449 {
450
451 switch (lId)
452 {
453 case PdtLund::e_minus:
454 case PdtLund::e_plus:
455 return PdtPid::electron;
457 case PdtLund::mu_plus:
458 return PdtPid::muon;
460 case PdtLund::pi_plus:
461 return PdtPid::pion;
462 case PdtLund::K_minus:
463 case PdtLund::K_plus:
464 return PdtPid::kaon;
465 case PdtLund::p_plus:
467 return PdtPid::proton;
468 default:
469 return PdtPid::null;
470 }
471}
@ mu_plus
Definition: PdtLund.h:34
@ mu_minus
Definition: PdtLund.h:33

Referenced by pidId().

◆ pidId() [4/4]

static PdtPid::PidType Pdt::pidId ( const PdtPdg::PdgType  pdg)
inlinestatic

Definition at line 165 of file Pdt.h.

166 { return pidId(lundId(pdg)); }

◆ pidNeutId() [1/4]

static PdtPid::PidNeutralType Pdt::pidNeutId ( const int  id)
inlinestatic

Definition at line 183 of file Pdt.h.

183{ return (PdtPid::PidNeutralType) id; };
PidNeutralType
Definition: PdtPid.h:22

◆ pidNeutId() [2/4]

PdtPid::PidNeutralType Pdt::pidNeutId ( const PdtGeant::GeantType  gId)
static

Definition at line 496 of file Pdt.cxx.

496 {
497 return pidNeutId(lundId(gId));
498}
static PdtPid::PidNeutralType pidNeutId(const PdtLund::LundType)
Definition: Pdt.cxx:473

◆ pidNeutId() [3/4]

PdtPid::PidNeutralType Pdt::pidNeutId ( const PdtLund::LundType  lId)
static

Definition at line 473 of file Pdt.cxx.

473 {
474
475 switch (lId)
476 {
477 case PdtLund::gamma:
478 return PdtPid::gamma;
479 case PdtLund::pi0:
480 return PdtPid::pi0;
481 case PdtLund::K_L0:
482 return PdtPid::K0L;
483 case PdtLund::anti_n0:
485 case PdtLund::n0:
486 return PdtPid::neutron;
487 default:
488 return PdtPid::none;
489 }
490}

Referenced by pidNeutId().

◆ pidNeutId() [4/4]

static PdtPid::PidNeutralType Pdt::pidNeutId ( const PdtPdg::PdgType  pdg)
inlinestatic

Definition at line 169 of file Pdt.h.

170 { return pidNeutId(lundId(pdg)); }

◆ printOn()

void Pdt::printOn ( std::ostream &  )
static

Definition at line 244 of file Pdt.cxx.

244 {
245
246 //lange move printouts here
247 cout << "Number of particles in tables: "<<endl
248 << "By pdt number :" << _entries->size() <<endl
249 << "By name :" << _entriesn->size()<<endl
250 << "By geant number :" << _entriesg->size()<<endl
251 << "By lund number :" <<_entriesl->size()<<endl;
252
253 cout << '\n';
254 int i;
255 for (i=0;i<72;i++) cout << '-';
256 cout<<'\n';
257
258 cout << " Particle Data Table\n\n";
259 cout << " id name mass width spin charge lifetime\n";
260 cout << " (GeV) (GeV) (cm) \n";
261 for (i=0; i<72; i++) cout << '-';
262 cout << '\n';
263
264 PdtEntry *p;
265
266 map<int, PdtEntry*>::iterator iter=_entries->begin();
267
268 while ( iter != _entries->end()) {
269 p = iter->second;
270 assert(0!=p);
271 p->printOn(cout);
272 p->printBFOn(cout);
273 ++iter;
274 }
275 cout << '\n';
276 for (i=0; i<72; i++) cout << '-';
277 cout << '\n';
278
279 map<int, PdtEntry*>::iterator iter1=_entries->begin();
280
281 while ( iter1 != _entries->end()) {
282 p=iter1->second;
283 cout << "The conjuate of "<< p->name() << " is ";
284 cout << conjugate(p)->name() <<endl;
285 iter1++;
286 }
287}
virtual int size() const
const char * name() const
Definition: PdtEntry.h:53
void printOn(std::ostream &str) const
Definition: PdtEntry.cxx:112
void printBFOn(std::ostream &str) const
Definition: PdtEntry.cxx:157
static const PdtEntry * conjugate(const PdtEntry *)
Definition: Pdt.cxx:681

◆ readMCppTable()

void Pdt::readMCppTable ( std::string  filenm)
static

Definition at line 291 of file Pdt.cxx.

291 {
292
293 string path = filenm;
294 char line[512];
295 FILE *ifl = fopen(path.c_str(),"r");
296
297 if(0 == ifl) cout<<" Pdt::readMCppTable: please copy " <<
298 filenm << " in to your run directory!"<<
299 std::endl;
300 assert(0!=ifl);
301
302 while ( fgets(line,512,ifl) )
303 {
304 if (strlen(line) >= 511)
305 {
306 cerr << "Pdt.read : input line is too long\n";
307 assert(0);
308 }
309 istrstream linestr(line);
310 string opcode;
311 char subcode;
312 linestr >> opcode >> subcode;
313
314 if( opcode == "end" )
315 break;
316
317 else if( opcode == "add" )
318 {
319 switch (subcode)
320 {
321 case 'p':
322 {
323 string classname;
324 linestr >> classname;
325 // if (classname == "Collision" || classname == "Parton")
326 if (classname == "Collision" )
327 continue;
328
329 string name;
330 int type;
331 float mass, width, cut, charge, spin, lifetime;
332
333 linestr >> name >> type;
334 linestr >> mass >> width >> cut >> charge;
335 linestr >> spin >> lifetime;
336
337 charge /= 3.0;
338 if (classname != "Meson")
339 spin /= 2.0;
340
341 // lifetime is c*tau (mm)
342 if (lifetime > 0.0 && width < 1e-10)
343 width = HBARC / (lifetime/10.0);
344
345 addParticle(name.c_str(), lundId(type), spin, charge, mass, width, cut);
346 break;
347 }
348
349 case 'c':
350 {
351 int ptype, nchild;
352 float bf;
353 string decayer;
354
355 linestr >> ptype >> bf >> decayer >> nchild;
356 PdtEntry *parent = lookup(lundId(ptype));
357 if (parent == 0) continue;
358
359 vector<PdtEntry*> *kids = new vector<PdtEntry*>;
360
361 int i;
362 for(i=0; i<nchild; i++ )
363 {
364 int ctype;
365 linestr >> ctype;
366 PdtEntry* secondary = lookup(lundId(ctype));
367 if( secondary ==0 ) break;
368 kids->push_back(secondary);
369 }
370
371 parent->addDecay(bf, kids );
372 break;
373 }
374
375 case 'd':
376 break;
377
378 default:
379 cerr << "Pdt.readMCppTable : unknown subcode '" << subcode
380 << "' for operation add\n";
381 break;
382 }
383 }
384 }
385 // adding geantino for GEANT studies
386 //why why why why - shouldn't you do this in the tables?
387 //addParticle("geantino", PdtGeant::geantino, 0., 0., 0., 0., 0. );
388
389 fclose(ifl);
390
391}
string::const_iterator ptype
Definition: EvtMTree.hh:19
#define HBARC
Definition: Pdt.cxx:51
static float lifetime(PdtLund::LundType id)
Definition: Pdt.h:89
static void addParticle(const char *pname, PdtLund::LundType id, float spin, float charge, float mass, float width=0.0, float cut=0.0)
Definition: Pdt.cxx:91

Referenced by MdcTrkRecon::initialize(), and MdcxTrackFinder::initialize().

◆ sameOrConj() [1/3]

bool Pdt::sameOrConj ( PdtEntry id1,
PdtEntry id2 
)
static

Definition at line 671 of file Pdt.cxx.

671 {
672 if ( (pdt1==0) || (pdt2==0) ) return false;
673 if ( pdt1->pdgId() == pdt2->pdgId() ) return true;
674 if ( pdt1->conjugate()->pdgId() == pdt2->pdgId() ) return true;
675 return false;
676}

◆ sameOrConj() [2/3]

bool Pdt::sameOrConj ( PdtLund::LundType  id1,
PdtLund::LundType  id2 
)
static

Definition at line 663 of file Pdt.cxx.

663 {
664 return Pdt::sameOrConj(Pdt::lookup(id1),Pdt::lookup(id2));
665}
static bool sameOrConj(PdtLund::LundType id1, PdtLund::LundType id2)
Definition: Pdt.cxx:663

Referenced by sameOrConj().

◆ sameOrConj() [3/3]

bool Pdt::sameOrConj ( PdtPdg::PdgType  id1,
PdtPdg::PdgType  id2 
)
static

Definition at line 667 of file Pdt.cxx.

667 {
668 return Pdt::sameOrConj(Pdt::lookup(id1),Pdt::lookup(id2));
669}

◆ spin() [1/5]

static float Pdt::spin ( const char *  name)
inlinestatic

Definition at line 100 of file Pdt.h.

100{ return lookup(name)->spin(); }
float spin() const
Definition: PdtEntry.h:59

◆ spin() [2/5]

static float Pdt::spin ( PdtGeant::GeantType  id)
inlinestatic

Definition at line 97 of file Pdt.h.

97{ return lookup(id)->spin(); }

◆ spin() [3/5]

static float Pdt::spin ( PdtLund::LundType  id)
inlinestatic

Definition at line 96 of file Pdt.h.

96{ return lookup(id)->spin(); }

Referenced by addParticle(), and readMCppTable().

◆ spin() [4/5]

static float Pdt::spin ( PdtPid::PidNeutralType  id)
inlinestatic

Definition at line 99 of file Pdt.h.

99{ return lookup(id)->spin(); }

◆ spin() [5/5]

static float Pdt::spin ( PdtPid::PidType  id)
inlinestatic

Definition at line 98 of file Pdt.h.

98{ return lookup(id)->spin(); }

◆ width() [1/5]

static float Pdt::width ( const char *  name)
inlinestatic

Definition at line 86 of file Pdt.h.

86{ return lookup(name)->width(); }
float width() const
Definition: PdtEntry.h:56

◆ width() [2/5]

static float Pdt::width ( PdtGeant::GeantType  id)
inlinestatic

Definition at line 83 of file Pdt.h.

83{ return lookup(id)->width(); }

◆ width() [3/5]

static float Pdt::width ( PdtLund::LundType  id)
inlinestatic

Definition at line 82 of file Pdt.h.

82{ return lookup(id)->width(); }

Referenced by addParticle(), and readMCppTable().

◆ width() [4/5]

static float Pdt::width ( PdtPid::PidNeutralType  id)
inlinestatic

Definition at line 85 of file Pdt.h.

85{ return lookup(id)->width(); }

◆ width() [5/5]

static float Pdt::width ( PdtPid::PidType  id)
inlinestatic

Definition at line 84 of file Pdt.h.

84{ return lookup(id)->width(); }

The documentation for this class was generated from the following files: