]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TUHKMgen/UHKM/DatabasePDG.h
Fixing some warnings
[u/mrichter/AliRoot.git] / TUHKMgen / UHKM / DatabasePDG.h
CommitLineData
b1c2e580 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#ifndef PARTICLE_PDG
18#include "ParticlePDG.h"
19#endif
20
21const Int_t kMaxParticles = 500;
22
23class DatabasePDG {
b1c2e580 24 public:
25 DatabasePDG();
26 ~DatabasePDG();
27
28 // Load the particle PDG information from the particle and decay files
29 Bool_t LoadData();
30
31 // Set particle and decay filenames
32 void SetParticleFilename(Char_t *filename);
33 void SetDecayFilename(Char_t *filename);
34 // Set criteria for using particles. Those particle which do not match
35 // these criteria will be flagged with FALSE in the fStatus array.
36 void SetUseCharmParticles(Bool_t flag);
37 void SetMinimumWidth(Double_t value);
38 void SetMaximumWidth(Double_t value);
39 void SetMinimumMass(Double_t value);
40 void SetMaximumMass(Double_t value);
41 void SetWidthRange(Double_t min, Double_t max);
42 void SetMassRange(Double_t min, Double_t max);
43
44 // Read a list of pdg codes from a specified file. The corresponding particles
45 // will be flagged as good particles. If the exclusive flag is TRUE than
46 // only this criteria will be used in selecting particles and, in consequence,
47 // all the other particles will be flagged as NOT good. If the exclusive flag
48 // is FALSE than we will take into account all the previous applied criterias
49 // and we will flag as good only particles in this list which match also the mass, width and
50 // charmness criteria.
51 // Note: In order for the exclusive=FALSE to be effective, this function must be called after
52 // calling all the width, mass and charmness criteria functions.
53 void UseThisListOfParticles(Char_t *filename, Bool_t exclusive = kTRUE);
54
55 Char_t* GetParticleFilename() {return fParticleFilename;}
56 Char_t* GetDecayFilename() {return fDecayFilename;}
57 Int_t GetNParticles(Bool_t all = kFALSE); // true - no. of all particles; false - no. of good status particles
58 ParticlePDG* GetPDGParticleByIndex(Int_t index);
59 Bool_t GetPDGParticleStatusByIndex(Int_t index);
60 ParticlePDG* GetPDGParticle(Int_t pdg);
61 Bool_t GetPDGParticleStatus(Int_t pdg);
62 ParticlePDG* GetPDGParticle(Char_t *name);
63 Bool_t GetPDGParticleStatus(Char_t *name);
64 Bool_t GetUseCharmParticles() {return fUseCharmParticles;};
65 Double_t GetMinimumWidth() {return fMinimumWidth;};
66 Double_t GetMaximumWidth() {return fMaximumWidth;};
67 Double_t GetMinimumMass() {return fMinimumMass;};
68 Double_t GetMaximumMass() {return fMaximumMass;};
69 void DumpData(Bool_t dumpAll = kFALSE); // print the PDG information in the console
70 Int_t CheckImpossibleDecays(Bool_t dump = kFALSE); // print all impossible decays included in the database
71 Bool_t IsChannelAllowed(DecayChannel *channel, Double_t motherMass);
72 Int_t GetNAllowedChannels(ParticlePDG *particle, Double_t motherMass);
73 void SetStable(Int_t pdg, Bool_t value) {GetPDGParticle(pdg)->SetStable(value);}
74 Bool_t GetStableStatus(Int_t pdg) {return GetPDGParticle(pdg)->GetStableStatus();}
786056a2 75
76 private:
77 DatabasePDG(const DatabasePDG&);
78 DatabasePDG& operator=(const DatabasePDG&);
79
80 Int_t fNParticles; // no. of particles in database
81 ParticlePDG *fParticles[kMaxParticles]; // array of particle pointers
82 Bool_t fStatus[kMaxParticles]; // status of each particle
83 Char_t fParticleFilename[256]; // particle list filename
84 Char_t fDecayFilename[256]; // decay channels filename
85 Bool_t fUseCharmParticles; // flag for using (or not) charm particles
86 Double_t fMinimumWidth; // minimum allowed width for resonances
87 Double_t fMaximumWidth; // maximum allowed width for resonances
88 Double_t fMinimumMass; // minimum allowed mass for resonances
89 Double_t fMaximumMass; // maximum allowed mass for resonances
90
91 Bool_t LoadParticles();
92 Bool_t LoadDecays();
93 void SortParticles(); // put the good status particles at the beggining of the list
b1c2e580 94};
95
96#endif