CMS 3D CMS Logo

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
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
DatabasePDG::UseThisListOfParticles
void UseThisListOfParticles(char *filename, bool exclusive=kTRUE)
Definition: DatabasePDG.cc:593
DatabasePDG::fDecayFilename
char fDecayFilename[256]
Definition: DatabasePDG.h:40
DatabasePDG::GetDecayFilename
char * GetDecayFilename()
Definition: DatabasePDG.h:82
DatabasePDG::SetMinimumWidth
void SetMinimumWidth(double value)
Definition: DatabasePDG.cc:452
DatabasePDG::fMinimumMass
double fMinimumMass
Definition: DatabasePDG.h:44
ParticlePDG.h
DatabasePDG::fMinimumWidth
double fMinimumWidth
Definition: DatabasePDG.h:42
min
T min(T a, T b)
Definition: MathUtil.h:58
DatabasePDG::GetMinimumMass
double GetMinimumMass()
Definition: DatabasePDG.h:93
DatabasePDG::DatabasePDG
DatabasePDG()
Definition: DatabasePDG.cc:28
DatabasePDG::SetMassRange
void SetMassRange(double min, double max)
Definition: DatabasePDG.cc:527
EDAnalyzer.h
DatabasePDG::GetNParticles
int GetNParticles(bool all=kFALSE)
Definition: DatabasePDG.cc:582
DatabasePDG::~DatabasePDG
~DatabasePDG()
Definition: DatabasePDG.cc:52
DatabasePDG::fParticleFilename
char fParticleFilename[256]
Definition: DatabasePDG.h:39
DatabasePDG::fNParticles
int fNParticles
Definition: DatabasePDG.h:36
DatabasePDG::SetUseCharmParticles
void SetUseCharmParticles(bool flag)
Definition: DatabasePDG.cc:438
DatabasePDG::GetParticleFilename
char * GetParticleFilename()
Definition: DatabasePDG.h:81
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
GenParticle.h
DatabasePDG::CheckImpossibleDecays
int CheckImpossibleDecays(bool dump=kFALSE)
Definition: DatabasePDG.cc:385
DatabasePDG::GetPDGParticleByIndex
ParticlePDG * GetPDGParticleByIndex(int index)
Definition: DatabasePDG.cc:198
MakerMacros.h
Service.h
DatabasePDG::GetPDGParticleStatusByIndex
bool GetPDGParticleStatusByIndex(int index)
Definition: DatabasePDG.cc:208
DatabasePDG::fMaximumMass
double fMaximumMass
Definition: DatabasePDG.h:45
DecayChannel
Definition: DecayChannel.h:22
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
DatabasePDG::SortParticles
void SortParticles()
Definition: DatabasePDG.cc:546
ParticlePDG
Definition: ParticlePDG.h:24
DatabasePDG::GetPDGParticleStatus
bool GetPDGParticleStatus(int pdg)
Definition: DatabasePDG.cc:243
DatabasePDG::SetMaximumMass
void SetMaximumMass(double value)
Definition: DatabasePDG.cc:513
TFileService.h
DatabasePDG::SetWidthRange
void SetWidthRange(double min, double max)
Definition: DatabasePDG.cc:480
DatabasePDG::fParticles
ParticlePDG * fParticles[kMaxParticles]
Definition: DatabasePDG.h:37
DatabasePDG::fMaximumWidth
double fMaximumWidth
Definition: DatabasePDG.h:43
DatabasePDG::GetUseCharmParticles
bool GetUseCharmParticles()
Definition: DatabasePDG.h:90
DatabasePDG::SetMinimumMass
void SetMinimumMass(double value)
Definition: DatabasePDG.cc:499
Event.h
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
DatabasePDG::SetDecayFilename
void SetDecayFilename(char *filename)
Definition: DatabasePDG.cc:59
FrontierConditions_GlobalTag_cff.dump
dump
Definition: FrontierConditions_GlobalTag_cff.py:12
DatabasePDG::GetMinimumWidth
double GetMinimumWidth()
Definition: DatabasePDG.h:91
value
Definition: value.py:1
DatabasePDG::LoadData
bool LoadData()
Definition: DatabasePDG.cc:61
InputTag.h
DatabasePDG::IsChannelAllowed
bool IsChannelAllowed(DecayChannel *channel, double motherMass)
Definition: DatabasePDG.cc:648
DatabasePDG::DumpData
void DumpData(bool dumpAll=kFALSE)
Definition: DatabasePDG.cc:320
DatabasePDG::GetMaximumWidth
double GetMaximumWidth()
Definition: DatabasePDG.h:92
DatabasePDG::GetMaximumMass
double GetMaximumMass()
Definition: DatabasePDG.h:94
kMaxParticles
const int kMaxParticles
Definition: DatabasePDG.h:32
generator_cfi.exclusive
exclusive
Definition: generator_cfi.py:24
Frameworkfwd.h
DatabasePDG
Definition: DatabasePDG.h:34
DatabasePDG::SetMaximumWidth
void SetMaximumWidth(double value)
Definition: DatabasePDG.cc:466
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
pdg
Definition: pdg_functions.h:28
DatabasePDG::LoadParticles
bool LoadParticles()
Definition: DatabasePDG.cc:63
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
DatabasePDG::SetParticleFilename
void SetParticleFilename(char *filename)
Definition: DatabasePDG.cc:57
DatabasePDG::LoadDecays
bool LoadDecays()
Definition: DatabasePDG.cc:138
ParameterSet.h
DatabasePDG::GetNAllowedChannels
int GetNAllowedChannels(ParticlePDG *particle, double motherMass)
Definition: DatabasePDG.cc:657
DatabasePDG::GetPDGParticle
ParticlePDG * GetPDGParticle(int pdg)
Definition: DatabasePDG.cc:218
DatabasePDG::fStatus
bool fStatus[kMaxParticles]
Definition: DatabasePDG.h:38
DatabasePDG::fUseCharmParticles
bool fUseCharmParticles
Definition: DatabasePDG.h:41
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116