Belle II Software  release-08-01-10
EvtGenDatabasePDG Class Reference

Replacement for TDatabasePDG that is filled from EvtGen's evt.pdl. More...

#include <EvtGenDatabasePDG.h>

Inheritance diagram for EvtGenDatabasePDG:
Collaboration diagram for EvtGenDatabasePDG:

Public Member Functions

void ReadEvtGenTable (const char *filename=nullptr)
 Read EvtGen table.
 
void WriteEvtGenTable (std::ostream &out)
 Write current database as EvtGen table to a stream.
 
void WriteEvtGenTable (const char *filename)
 Write current database as EvtGen table to a file.
 
TParticlePDG * AddParticle (const char *name, const char *title, Double_t mass, Bool_t stable, Double_t width, Double_t charge, const char *ParticleClass, Int_t PDGcode, Int_t Anti, Int_t TrackingCode) override
 override old AddParticle
 
EvtGenParticlePDGAddParticle (const char *name, const char *title, Double_t mass, Bool_t stable, Double_t width, Double_t charge, const char *ParticleClass, Int_t PDGcode, Int_t Anti, Int_t TrackingCode, Double_t Lifetime, Double_t Spin, Double_t maxWidth, Int_t pythiaID)
 Add new particle with additional attributes. More...
 

Static Public Member Functions

static EvtGenDatabasePDGInstance ()
 Instance method that loads the EvtGen table.
 

Private Member Functions

 EvtGenDatabasePDG ()
 singleton.
 
 EvtGenDatabasePDG (const EvtGenDatabasePDG &)=delete
 singleton, make sure there's no copy constructor
 
EvtGenDatabasePDGoperator= (const EvtGenDatabasePDG &)=delete
 singleton, make sure there's no assignment operator
 
 ClassDefOverride (EvtGenDatabasePDG, 1)
 Replacement for TDatabasePDG that is filled from EvtGen's evt.pdl.
 

Detailed Description

Replacement for TDatabasePDG that is filled from EvtGen's evt.pdl.

Definition at line 21 of file EvtGenDatabasePDG.h.

Member Function Documentation

◆ AddParticle()

EvtGenParticlePDG * AddParticle ( const char *  name,
const char *  title,
Double_t  mass,
Bool_t  stable,
Double_t  width,
Double_t  charge,
const char *  ParticleClass,
Int_t  PDGcode,
Int_t  Anti,
Int_t  TrackingCode,
Double_t  Lifetime,
Double_t  Spin,
Double_t  maxWidth,
Int_t  pythiaID 
)

Add new particle with additional attributes.

Copy&Paste from original but with more constructor arguments

Definition at line 44 of file EvtGenDatabasePDG.cc.

47 {
48  //
49  // Particle definition normal constructor. If the particle is set to be
50  // stable, the decay width parameter does have no meaning and can be set to
51  // any value. The parameters granularity, LowerCutOff and HighCutOff are
52  // used for the construction of the mean free path look up tables. The
53  // granularity will be the number of logwise energy points for which the
54  // mean free path will be calculated.
55  //
56 
57  TParticlePDG* old = GetParticle(PDGcode);
58 
59  if (old) {
60  B2ERROR("EvtGenDatabasePDG::AddParticle: particle with PDGcode=" << PDGcode << " already defined");
61  return nullptr;
62  }
63 
64  if (std::strpbrk(name, " \t\n\v\f\r")) {
65  B2ERROR("EvtGenDatabasePDG::AddParticle: invalid particle name '" << name << "'. Names may not contain Whitespace");
66  return nullptr;
67  }
68 
69  auto* p = new EvtGenParticlePDG(name, title, mass, stable, width, charge, ParticleClass,
70  PDGcode, Anti, TrackingCode, Lifetime, Spin, maxWidth, pythiaID);
71 
72  fParticleList->Add(p);
73  if (fPdgMap)
74  fPdgMap->Add((Long_t)PDGcode, (Long_t)p);
75 
76  TParticleClassPDG* pclass = GetParticleClass(ParticleClass);
77 
78  if (!pclass) {
79  pclass = new TParticleClassPDG(ParticleClass);
80  fListOfClasses->Add(pclass);
81  }
82 
83  pclass->AddParticle(p);
84 
85  return p;
86 }
Helper class for setting additional TParticlePDG members and storing the ones it doesn't have yet.

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