BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
PdtEntry Class Reference

#include <PdtEntry.h>

Public Member Functions

 PdtEntry (const char *name, PdtLund::LundType code, float spin, float charge, float mass, float width=0, float massCut=0)
 
 PdtEntry (const char *name, PdtGeant::GeantType code, float spin, float charge, float mass, float width=0, float massCut=0)
 
 PdtEntry (const char *name, PdtPdg::PdgType code, float spin, float charge, float mass, float width=0, float massCut=0)
 
virtual ~PdtEntry ()
 
void printOn (std::ostream &str) const
 
void printBFOn (std::ostream &str) const
 
const char * name () const
 
float charge () const
 
float mass () const
 
float width () const
 
float widthCut () const
 
float lifetime () const
 
float spin () const
 
float sumBR () const
 
const vector< DecayMode * > * decayList () const
 
void addDecay (float bf, vector< PdtEntry * > *kids)
 
PdtLund::LundType lundId () const
 
PdtPdg::PdgType pdgId () const
 
PdtGeant::GeantType geantId () const
 
PdtPid::PidType pidId () const
 
PdtPid::PidNeutralType pidNeutId () const
 
bool operator== (const PdtEntry &) const
 
bool operator< (const PdtEntry &) const
 
const PdtEntryconjugate () const
 

Protected Attributes

char * _name
 
float _mass
 
float _width
 
float _lifetime
 
float _spin
 
float _charge
 
float _widthCut
 
float _sumBR
 
vector< DecayMode * > * _decayList
 
PdtLund::LundType _lundId
 
PdtPdg::PdgType _pdgId
 
PdtGeant::GeantType _geantId
 
PdtPid::PidType _pidId
 
PdtPid::PidNeutralType _pidNeutId
 
const PdtEntry_conjugate
 

Detailed Description

Definition at line 36 of file PdtEntry.h.

Constructor & Destructor Documentation

◆ PdtEntry() [1/3]

PdtEntry::PdtEntry ( const char *  name,
PdtLund::LundType  code,
float  spin,
float  charge,
float  mass,
float  width = 0,
float  massCut = 0 
)

Definition at line 47 of file PdtEntry.cxx.

48 :
49 _name(new char[strlen(name) + 1]),
50 _mass(mass),
52 _lifetime( (width>0.0) ? (HBARC / width) : FLT_MAX ),
53 _spin(spin),
55 _widthCut( (massCut > 0.0) ? massCut : 2.0*width ),
56 _sumBR(0.0),
57 _decayList(new vector<DecayMode*>),
58 _lundId(code),
59 _pdgId(Pdt::pdgId(code)),
61 _pidId(Pdt::pidId(code)),
63 _conjugate(0)
64{ strcpy(_name, name); }
#define HBARC
Definition: Pdt.cxx:51
float _width
Definition: PdtEntry.h:77
PdtLund::LundType _lundId
Definition: PdtEntry.h:84
float _sumBR
Definition: PdtEntry.h:82
float _spin
Definition: PdtEntry.h:79
PdtGeant::GeantType _geantId
Definition: PdtEntry.h:86
float mass() const
Definition: PdtEntry.h:55
vector< DecayMode * > * _decayList
Definition: PdtEntry.h:83
float charge() const
Definition: PdtEntry.h:54
float _lifetime
Definition: PdtEntry.h:78
char * _name
Definition: PdtEntry.h:75
float spin() const
Definition: PdtEntry.h:59
float _widthCut
Definition: PdtEntry.h:81
const char * name() const
Definition: PdtEntry.h:53
PdtPdg::PdgType _pdgId
Definition: PdtEntry.h:85
float _charge
Definition: PdtEntry.h:80
PdtPid::PidType _pidId
Definition: PdtEntry.h:87
float _mass
Definition: PdtEntry.h:76
PdtPid::PidNeutralType _pidNeutId
Definition: PdtEntry.h:88
const PdtEntry * _conjugate
Definition: PdtEntry.h:89
float width() const
Definition: PdtEntry.h:56
static PdtPid::PidType pidId(const PdtLund::LundType)
Definition: Pdt.cxx:449
static PdtGeant::GeantType geantId(const PdtLund::LundType)
Definition: Pdt.cxx:427
static PdtPdg::PdgType pdgId(const PdtLund::LundType)
Definition: Pdt.cxx:608
static PdtPid::PidNeutralType pidNeutId(const PdtLund::LundType)
Definition: Pdt.cxx:473

◆ PdtEntry() [2/3]

PdtEntry::PdtEntry ( const char *  name,
PdtGeant::GeantType  code,
float  spin,
float  charge,
float  mass,
float  width = 0,
float  massCut = 0 
)

Definition at line 67 of file PdtEntry.cxx.

68 :
69 _name(new char[strlen(name) + 1]),
70 _mass(mass),
72 _lifetime( (width>0.0) ? (HBARC / width) : FLT_MAX ),
73 _spin(spin),
75 _widthCut( (massCut > 0.0) ? massCut : 2.0*width ),
76 _sumBR(0.0),
77 _decayList(new vector<DecayMode*>),
78 _lundId(Pdt::lundId(code)),
79 _pdgId(Pdt::pdgId(code)),
80 _geantId(code),
81 _pidId(Pdt::pidId(code)),
83 _conjugate(0)
84{ strcpy(_name, name); }
static PdtLund::LundType lundId(const PdtGeant::GeantType)
Definition: Pdt.cxx:413

◆ PdtEntry() [3/3]

PdtEntry::PdtEntry ( const char *  name,
PdtPdg::PdgType  code,
float  spin,
float  charge,
float  mass,
float  width = 0,
float  massCut = 0 
)

Definition at line 86 of file PdtEntry.cxx.

87 :
88 _name(new char[strlen(name) + 1]),
89 _mass(mass),
91 _lifetime( (width>0.0) ? (HBARC / width) : FLT_MAX ),
92 _spin(spin),
94 _widthCut( (massCut > 0.0) ? massCut : 2.0*width ),
95 _sumBR(0.0),
96 _decayList(new vector<DecayMode*>),
97 _lundId(Pdt::lundId(code)),
98 _pdgId(code),
100 _pidId(Pdt::pidId(code)),
102 _conjugate(0)
103{ strcpy(_name, name); }

◆ ~PdtEntry()

PdtEntry::~PdtEntry ( )
virtual

Definition at line 164 of file PdtEntry.cxx.

165{
166 vector<DecayMode*>::iterator iter=_decayList->begin();
167 while ( iter != _decayList->end() ) { delete *iter; ++iter; }
168 _decayList->clear();
169 delete _decayList;
170 delete [] _name;
171}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)

Member Function Documentation

◆ addDecay()

void PdtEntry::addDecay ( float  bf,
vector< PdtEntry * > *  kids 
)

Definition at line 105 of file PdtEntry.cxx.

106{
107 _decayList->push_back(new DecayMode(bf, kids));
108 _sumBR += bf;
109}

Referenced by Pdt::addDecay(), and Pdt::readMCppTable().

◆ charge()

float PdtEntry::charge ( ) const
inline

Definition at line 54 of file PdtEntry.h.

54{return _charge;}

Referenced by Pdt::addParticle(), and Pdt::charge().

◆ conjugate()

const PdtEntry * PdtEntry::conjugate ( ) const

Definition at line 174 of file PdtEntry.cxx.

175{
176 if ( ! _conjugate ) {
177 const_cast<PdtEntry*>(this)->_conjugate = Pdt::conjugate( this );
178 }
179 return _conjugate ;
180}
static const PdtEntry * conjugate(const PdtEntry *)
Definition: Pdt.cxx:681

Referenced by Pdt::sameOrConj().

◆ decayList()

const vector< DecayMode * > * PdtEntry::decayList ( ) const
inline

Definition at line 61 of file PdtEntry.h.

61{ return _decayList; }

◆ geantId()

PdtGeant::GeantType PdtEntry::geantId ( ) const
inline

Definition at line 65 of file PdtEntry.h.

65{ return _geantId; };

Referenced by Pdt::addParticle().

◆ lifetime()

float PdtEntry::lifetime ( ) const
inline

Definition at line 58 of file PdtEntry.h.

58{return _lifetime;}

Referenced by Pdt::lifetime().

◆ lundId()

PdtLund::LundType PdtEntry::lundId ( ) const
inline

Definition at line 63 of file PdtEntry.h.

63{ return _lundId;};

◆ mass()

float PdtEntry::mass ( ) const
inline

Definition at line 55 of file PdtEntry.h.

55{return _mass;}

Referenced by TrkRep::arrivalTime(), TrkLineRep::arrivalTime(), and Pdt::mass().

◆ name()

const char * PdtEntry::name ( ) const
inline

◆ operator<()

bool PdtEntry::operator< ( const PdtEntry theOther) const

Definition at line 188 of file PdtEntry.cxx.

189{
190 return (_lundId < theOther._lundId ||
191 (_lundId == theOther._lundId && _geantId < theOther._geantId));
192}

◆ operator==()

bool PdtEntry::operator== ( const PdtEntry theOther) const

Definition at line 183 of file PdtEntry.cxx.

184{
185 return (theOther._lundId==_lundId && theOther._geantId==_geantId);
186}

◆ pdgId()

PdtPdg::PdgType PdtEntry::pdgId ( ) const
inline

Definition at line 64 of file PdtEntry.h.

64{ return _pdgId; }

Referenced by Pdt::conjugate(), and Pdt::sameOrConj().

◆ pidId()

PdtPid::PidType PdtEntry::pidId ( ) const
inline

Definition at line 66 of file PdtEntry.h.

66{ return _pidId; };

Referenced by Pdt::addParticle().

◆ pidNeutId()

PdtPid::PidNeutralType PdtEntry::pidNeutId ( ) const
inline

Definition at line 67 of file PdtEntry.h.

67{ return _pidNeutId; };

Referenced by Pdt::addParticle().

◆ printBFOn()

void PdtEntry::printBFOn ( std::ostream &  str) const

Definition at line 157 of file PdtEntry.cxx.

158{
159 int l = _decayList->size();
160 for (int i=0; i<l; i++)
161 (*_decayList)[i]->printOn(str);
162}

Referenced by Pdt::printOn().

◆ printOn()

void PdtEntry::printOn ( std::ostream &  str) const

Definition at line 112 of file PdtEntry.cxx.

113{
114 // pkg coordinator: we need to see if form() really is part of
115 // iostream. In any case, i've recoded things below simply to
116 // avoid it. Perhaps this is good enough.
117 //
118
119 // str.form("%6d %-8s %8g ", (int) _lundId, _name, _mass);
120 // Not sure if the is exactly the same as using form(), but on
121 // sun, it's claimed that you get %g behavior from ios as default.
122 // I'm ignoring the left-field justification for now.
123 //
124 str << setw(6) << (int) _lundId << " " << setw(8) << _name << " "
125 << setw(8) << _mass << " ";
126
127 if (_width > 0.0)
128 str << " " << _width;
129 else
130 str << "Stable ";
131 str << setw(3) << _spin << " " << setw(2) <<_charge
132 << " ";
133 if (_width > 0.0)
134 str << " " << _lifetime << endl;
135 else
136 str << " Stable\n";
137}

Referenced by Pdt::printOn().

◆ spin()

float PdtEntry::spin ( ) const
inline

Definition at line 59 of file PdtEntry.h.

59{return _spin;}

Referenced by Pdt::spin().

◆ sumBR()

float PdtEntry::sumBR ( ) const
inline

Definition at line 60 of file PdtEntry.h.

60{return _sumBR;}

◆ width()

float PdtEntry::width ( ) const
inline

Definition at line 56 of file PdtEntry.h.

56{return _width;}

Referenced by Pdt::width().

◆ widthCut()

float PdtEntry::widthCut ( ) const
inline

Definition at line 57 of file PdtEntry.h.

57{return _widthCut;}

Member Data Documentation

◆ _charge

float PdtEntry::_charge
protected

Definition at line 80 of file PdtEntry.h.

Referenced by charge(), and printOn().

◆ _conjugate

const PdtEntry* PdtEntry::_conjugate
protected

Definition at line 89 of file PdtEntry.h.

Referenced by conjugate().

◆ _decayList

vector<DecayMode*>* PdtEntry::_decayList
protected

Definition at line 83 of file PdtEntry.h.

Referenced by addDecay(), decayList(), printBFOn(), and ~PdtEntry().

◆ _geantId

PdtGeant::GeantType PdtEntry::_geantId
protected

Definition at line 86 of file PdtEntry.h.

Referenced by geantId(), operator<(), and operator==().

◆ _lifetime

float PdtEntry::_lifetime
protected

Definition at line 78 of file PdtEntry.h.

Referenced by lifetime(), and printOn().

◆ _lundId

PdtLund::LundType PdtEntry::_lundId
protected

Definition at line 84 of file PdtEntry.h.

Referenced by lundId(), operator<(), operator==(), and printOn().

◆ _mass

float PdtEntry::_mass
protected

Definition at line 76 of file PdtEntry.h.

Referenced by mass(), and printOn().

◆ _name

char* PdtEntry::_name
protected

Definition at line 75 of file PdtEntry.h.

Referenced by name(), PdtEntry(), printOn(), and ~PdtEntry().

◆ _pdgId

PdtPdg::PdgType PdtEntry::_pdgId
protected

Definition at line 85 of file PdtEntry.h.

Referenced by pdgId().

◆ _pidId

PdtPid::PidType PdtEntry::_pidId
protected

Definition at line 87 of file PdtEntry.h.

Referenced by pidId().

◆ _pidNeutId

PdtPid::PidNeutralType PdtEntry::_pidNeutId
protected

Definition at line 88 of file PdtEntry.h.

Referenced by pidNeutId().

◆ _spin

float PdtEntry::_spin
protected

Definition at line 79 of file PdtEntry.h.

Referenced by printOn(), and spin().

◆ _sumBR

float PdtEntry::_sumBR
protected

Definition at line 82 of file PdtEntry.h.

Referenced by addDecay(), and sumBR().

◆ _width

float PdtEntry::_width
protected

Definition at line 77 of file PdtEntry.h.

Referenced by printOn(), and width().

◆ _widthCut

float PdtEntry::_widthCut
protected

Definition at line 81 of file PdtEntry.h.

Referenced by widthCut().


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