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