test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DatabasePDG.h
Go to the documentation of this file.
1 /*
2  Copyright : The FASTMC and SPHMC Collaboration
3  Author : Ionut Cristian Arsene
4  Affiliation : Oslo University, Norway & Institute for Space Sciences, Bucharest, Romania
5  e-mail : i.c.arsene@fys.uio.no
6  Date : 2007/05/30
7 
8  This class is using the particle and decay lists provided by the
9  THERMINATOR (Computer Physics Communications 174 669 (2006)) and
10  SHARE (Computer Physics Communications 167 229 (2005)) collaborations.
11 */
12 
13 #ifndef DATABASE_PDG
14 #define DATABASE_PDG
15 
16 #include "Rtypes.h"
17 
18 #ifndef PARTICLE_PDG
19 #include "ParticlePDG.h"
20 #endif
21 
31 
32 const int kMaxParticles = 1000;
33 
34 class DatabasePDG {
35  private:
36  int fNParticles; // no. of particles in database
37  ParticlePDG *fParticles[kMaxParticles]; // array of particle pointers
38  bool fStatus[kMaxParticles]; // status of each particle
39  char fParticleFilename[256]; // particle list filename
40  char fDecayFilename[256]; // decay channels filename
41  bool fUseCharmParticles; // flag for using (or not) charm particles
42  double fMinimumWidth; // minimum allowed width for resonances
43  double fMaximumWidth; // maximum allowed width for resonances
44  double fMinimumMass; // minimum allowed mass for resonances
45  double fMaximumMass; // maximum allowed mass for resonances
46 
47  bool LoadParticles();
48  bool LoadDecays();
49  void SortParticles(); // put the good status particles at the beggining of the list
50  public:
51  DatabasePDG();
52  ~DatabasePDG();
53 
54  // Load the particle PDG information from the particle and decay files
55  bool LoadData();
56 
57  // Set particle and decay filenames
58  void SetParticleFilename(char *filename);
59  void SetDecayFilename(char *filename);
60  // Set criteria for using particles. Those particle which do not match
61  // these criteria will be flagged with FALSE in the fStatus array.
62  void SetUseCharmParticles(bool flag);
63  void SetMinimumWidth(double value);
64  void SetMaximumWidth(double value);
65  void SetMinimumMass(double value);
66  void SetMaximumMass(double value);
67  void SetWidthRange(double min, double max);
68  void SetMassRange(double min, double max);
69 
70  // Read a list of pdg codes from a specified file. The corresponding particles
71  // will be flagged as good particles. If the exclusive flag is TRUE than
72  // only this criteria will be used in selecting particles and, in consequence,
73  // all the other particles will be flagged as NOT good. If the exclusive flag
74  // is FALSE than we will take into account all the previous applied criterias
75  // and we will flag as good only particles in this list which match also the mass, width and
76  // charmness criteria.
77  // Note: In order for the exclusive=FALSE to be effective, this function must be called after
78  // calling all the width, mass and charmness criteria functions.
79  void UseThisListOfParticles(char *filename, bool exclusive = kTRUE);
80 
82  char* GetDecayFilename() {return fDecayFilename;}
83  int GetNParticles(bool all = kFALSE); // true - no. of all particles; false - no. of good status particles
86  ParticlePDG* GetPDGParticle(int pdg);
87  bool GetPDGParticleStatus(int pdg);
89  bool GetPDGParticleStatus(char *name);
91  double GetMinimumWidth() {return fMinimumWidth;};
92  double GetMaximumWidth() {return fMaximumWidth;};
93  double GetMinimumMass() {return fMinimumMass;};
94  double GetMaximumMass() {return fMaximumMass;};
95  void DumpData(bool dumpAll = kFALSE); // print the PDG information in the console
96  int CheckImpossibleDecays(bool dump = kFALSE); // print all impossible decays included in the database
97  bool IsChannelAllowed(DecayChannel *channel, double motherMass);
98  int GetNAllowedChannels(ParticlePDG *particle, double motherMass);
99 };
100 #endif
void SetParticleFilename(char *filename)
Definition: DatabasePDG.cc:58
void UseThisListOfParticles(char *filename, bool exclusive=kTRUE)
Definition: DatabasePDG.cc:584
ParticlePDG * GetPDGParticle(int pdg)
Definition: DatabasePDG.cc:222
double fMinimumWidth
Definition: DatabasePDG.h:42
int GetNParticles(bool all=kFALSE)
Definition: DatabasePDG.cc:574
int fNParticles
Definition: DatabasePDG.h:36
char * GetParticleFilename()
Definition: DatabasePDG.h:81
char * GetDecayFilename()
Definition: DatabasePDG.h:82
const int kMaxParticles
Definition: DatabasePDG.h:32
void SetMassRange(double min, double max)
Definition: DatabasePDG.cc:514
bool GetPDGParticleStatusByIndex(int index)
Definition: DatabasePDG.cc:212
int CheckImpossibleDecays(bool dump=kFALSE)
Definition: DatabasePDG.cc:372
ParticlePDG * GetPDGParticleByIndex(int index)
Definition: DatabasePDG.cc:202
char fParticleFilename[256]
Definition: DatabasePDG.h:39
void SetUseCharmParticles(bool flag)
Definition: DatabasePDG.cc:419
void SetMaximumMass(double value)
Definition: DatabasePDG.cc:499
void SortParticles()
Definition: DatabasePDG.cc:537
T min(T a, T b)
Definition: MathUtil.h:58
double fMaximumMass
Definition: DatabasePDG.h:45
void DumpData(bool dumpAll=kFALSE)
Definition: DatabasePDG.cc:318
double GetMinimumWidth()
Definition: DatabasePDG.h:91
ParticlePDG * fParticles[kMaxParticles]
Definition: DatabasePDG.h:37
double fMaximumWidth
Definition: DatabasePDG.h:43
void SetMinimumMass(double value)
Definition: DatabasePDG.cc:484
bool LoadData()
Definition: DatabasePDG.cc:66
bool GetPDGParticleStatus(int pdg)
Definition: DatabasePDG.cc:246
void SetDecayFilename(char *filename)
Definition: DatabasePDG.cc:62
bool IsChannelAllowed(DecayChannel *channel, double motherMass)
Definition: DatabasePDG.cc:641
void SetWidthRange(double min, double max)
Definition: DatabasePDG.cc:464
double GetMaximumMass()
Definition: DatabasePDG.h:94
bool GetUseCharmParticles()
Definition: DatabasePDG.h:90
bool LoadDecays()
Definition: DatabasePDG.cc:142
tuple filename
Definition: lut2db_cfg.py:20
bool fStatus[kMaxParticles]
Definition: DatabasePDG.h:38
double GetMaximumWidth()
Definition: DatabasePDG.h:92
bool fUseCharmParticles
Definition: DatabasePDG.h:41
void SetMinimumWidth(double value)
Definition: DatabasePDG.cc:434
double fMinimumMass
Definition: DatabasePDG.h:44
int GetNAllowedChannels(ParticlePDG *particle, double motherMass)
Definition: DatabasePDG.cc:650
void SetMaximumWidth(double value)
Definition: DatabasePDG.cc:449
char fDecayFilename[256]
Definition: DatabasePDG.h:40
double GetMinimumMass()
Definition: DatabasePDG.h:93
bool LoadParticles()
Definition: DatabasePDG.cc:70