Pluto v6.3.0
Loading...
Searching...
No Matches
PStaticData.h
Go to the documentation of this file.
1// Author: M.A. Kagarlis
2// Written: 31.01.99
3// Revised: (IF)
4// PDataUtil Class Header
5
6#ifndef _PSTATICDATA_H_
7#define _PSTATICDATA_H_
8
9#include "TROOT.h"
10#include "TF1.h"
11#include <iostream>
12
13#include "PDataBase.h"
14#include "PMesh.h"
15
16
17#define MAX_DAUGHTERS 7
18
19using namespace std;
20
21class PStaticData;
24
25
26void listParticle(int id = -1);
27void listParticle(const char *id);
28void listModes(int id = -1);
29void listModes(const char *id);
30
31class PStaticData : public TObject {
32
33 public:
34
36
37 //Freeze out -> Important to check this
38 void SetFreezeOut(void) {
39 freeze = kTRUE;
40 };
41
42 void clearFreezeOut(void) {
43 //re-loop PStdModels
44 freeze = kFALSE;
45 };
46
47 bool GetFreezeOut(void) {
48 return freeze;
49 }
50
51 //Common stuff
52 int AddAlias(const char *old_name,
53 const char *new_name); //adds an alias, ret value is alias key
54 int GetAliasParent(const char *alias_name);
55 int GetAliasParent(int key);
56
57 int MakeDirectoryEntry(const char *name, const char *n, const char *l,
58 const char *ename); //adds a directory, ret value is key
59 Double_t *GetBatchValue(const char *name, Int_t make_val=1);
60 bool SetBatchValue(const char *name, Double_t val) {
61 Double_t *tmp = GetBatchValue(name);
62 if (!tmp) return kFALSE;
63 (*tmp) = val;
64 return kTRUE;
65 }
66
67 int GetSecondaryKey(int key, int defkey); //Loops over the alias entries and look for matching defkey
68
69 //Particle get methods
70 int GetParticleID(const char *id, int warn=1); // pid by name
71 int GetParticleIDByKey(int key); // pid by key
72 const char *GetParticleName(const int &id); // name by pid
73 const char *GetParticleNameByKey(const int &id) {
75 };
76 int GetParticleKey(const int &id); // data base key by pid
77 int GetParticleKey(const char *id) {
78 return GetParticleKey(GetParticleID(id));
79 };
80 int IsParticle(const int &id, const char *name); // does pid correspond to given name?
81 int IsParticleValid(const int &id); // check id range by id
82 int IsParticleValid(const char *n); // check id range by name
83
84 int AddParticle(int pid, const char *name, double mass);
85 void PrintParticle(int pid);
86 void PrintParticleByKey(int pid);
87 void PrintParticle(const char *id) {
89 };
90
91 int GetParticleKF(const int Id); // return Pythia6 kf code
92 int GetParticleIDbyKF(const int kf); // return Id corresponding to Pythia6 kf code
93
94 int IsParticleMeson(const int &id); // is meson?, by pid
95 void SetParticleMeson(const char* id, Int_t num=1); // set meson number
96
97 int IsParticleHadron(const int &id); // is hadron?, by pid
98 int GetParticleBaryon(const int &id); // baryon number by pid
99 void SetParticleBaryon(const char *id, Int_t num=1); // baryon number by name
100
101 int GetParticleLepton(const int &id); // lepton number by pid
102 void SetParticleLepton(const char *id, Int_t num=1);
103
104 int GetParticleCharge(const int &id); // charge by pid
105 int GetParticleCharge(const char *id); // charge by name
106 void SetParticleCharge(const char *id, Int_t charge);
107
108 int GetParticleSpin(const int &id); // 2 x J by pid
109 int GetParticleSpin(const char *id); // 2 x J by name
110 void SetParticleSpin(const char *id, Int_t spin);
111
112 int GetParticleIsospin(const int &id); // 2 x I by pid
113 int GetParticleIsospin(const char *id); // 2 x I by name
114 void SetParticleIsospin(const char *id, Int_t isospin);
115
116 int GetParticleParity(const int &id); // parity (0 if irrelevant)
117 int GetParticleParity(const char *id); // parity (0 if irrelevant)
118 void SetParticleParity(const char *id, Int_t parity);
119
120 double GetParticleMass(const int &id); // mass by id
121 double GetParticleMass(const char *id); // mass by name
122 double GetParticleMassByKey(const int &id);
123 void SetParticleMass(Int_t id, Float_t mass); //reset mass
124 void SetParticleMass(const char *id, Float_t mass); //reset mass
125
126 int GetParticleNChannels(const int &id); // number of decay channels by pid
127 int GetParticleNChannels(const char *id);// number of decay channels by name
129
130 void SetParticleTotalWidth(Int_t id, Float_t wid);
131 void SetParticleTotalWidth(const char *id, Float_t wid);
132 double GetParticleTotalWidth(const int &id); // -->PWidth[id]
133 double GetParticleTotalWidth(const char *id) {
135 };
136 double GetParticleTotalWidthByKey(const int &id);
137
138 double GetParticleEmin(const int &id); // Returns the energy threshold for the particle
139 void SetParticleEmin(const int &id, const double v);
140
141 //Change particle range:
142 double GetParticleLMass(const int &id); // Returns lower mass (used in all samplings)
143 double GetParticleLMass(const char *id) {
145 };
146 double GetParticleUMass(const int &id); // Returns upper mass (used in all samplings)
147 double GetParticleUMass(const char *id) {
149 };
150 void SetParticleLMass(const int &id, const double v) { // Set lower mass (used in all samplings)
152 };
153 void SetParticleLMass(const char *id, const double v); // Set lower mass (used in all samplings)
154
155 void SetParticleUMass(const int &id, const double v) { // Set upper mass (used in all samplings)
157 };
158 void SetParticleUMass(const char *id, const double v);// Set upper mass (used in all samplings)
159
160 bool NormParticleBR(Int_t id); // normalize branching ratios for particle id
161 bool NormParticleBRbyKey(Int_t key);
162 void SetTotalNormalization(char *p,int flag=1);
163
164 //Decay methods
165 void FreezeDecayBR(Int_t id, Int_t brn); // Set BR (BUGBUG->brn nomally unknown)
166 bool SetDecayBR(int didx, double br, int mode);
167 bool SetDecayBR(const char *parent, const char *daughters, double br, int mode);
168 bool SetDecayBRByKey(int key, double br, int mode);
169
170 Double_t GetDecayBR(Int_t id);
171 Double_t GetDecayPartialWidth(Int_t id);
172 Double_t GetDecayPartialWidthByKey(Int_t id);
173 const char *GetDecayName(Int_t id);
174 const char *GetDecayNameByKey(Int_t key);
175
176 Int_t IsDecayHadronic(Int_t didx);
177
178 int AddDecay(int didx, const char *name, const char *parent,
179 const char *daughters , double br);
180 int AddDecay(const char *name, const char *parent,
181 const char *daughters , double br) {
182 return AddDecay(-1, name, parent,
183 daughters , br); };
184 int AddDecay(int *ipid, int n);
185 void PrintDecayByKey(int key);
186
187 int GetDecayNProducts(const int &); // retrieve number of products by mode index
188 int GetDecayNProducts(const char *);// number of products by name
189 int GetDecayNProductsByKey(const int &key);
190
191 int GetDecayParent(const int &); // parent pid from decay mode index
192 int GetDecayParentByKey(const int &);
193 void GetDecayMode(const int, int *n); // retrieve product number, pids, by mode index
194 void GetDecayModeByKey(const int, int *n);
195
196 int GetDecayIdx(int *pid, int n); // decay-mode index from parent and product ids; ->getChannel
197 int GetDecayIdx(const char *parent, const char *daughters);
198 int GetDecayKey(int *pid, int n);
199 int GetDecayKey(const int &id);
200 int GetDecayIdxByKey(int key);
201
202 int GetDecayBRFlag(int didx);
203 void SetDecayBRFlag(int didx, int flag);
204
205 double GetDecayEmin(const int &idx); // Returns the energy threshold for the decay mode with index=idx
206 void SetDecayEmin(const int &idx, const double v);
207
208 void SetEnhanceChannelBR(const int id, const double factor); //enhance the BR for PickDecayChannel
209 void SetEnhanceChannelBR(const char *parent, const char *decay, Double_t factor = 1.);
210 void DisableAllChannelBR(const char *parent);
211 Double_t GetEnhanceChannelBR(const int id);
212
213 //for dynamic stuff
214 int GetTWidx(const int &); // total width flag from index
215 int GetPWidx(const int &); // partial width flag from index
216 void SetTWidx(const int &, const int &); // total width flag from index
217 void SetPWidx(const int &, const int &); // partial width flag from index
218
219 int GetTDepth(const int &);
220 void SetTDepth(const int &, const int &);
221 int GetHDepth(const int &);
222 void SetHDepth(const int &, const int &);
223
224 void SetTWidthMesh(const int &, PMesh *mesh);
225 PMesh * GetTWidthMesh(const int &);
226
227 void SetPWidthMesh(const int &, PMesh *mesh);
228 PMesh * GetPWidthMesh(const int &);
229
230 void SetTF1(const int &, TF1 *mesh);
231 TF1 * GetTF1(const int &);
232
233 //global friend functions
234 //Keeping for backward compatibility
235
236 friend void listParticle(int id);
237 // list particles in data base and their properties, by particle pid
238
239 friend void listParticle(const char *id) {
241 };
242 // list particles in data base and their properties, by particle code name
243
244 friend void listModes(int id);
245 // list decay modes in data base, by particle pid
246
247 friend void listModes(const char *id){
249 };
250 // list decay modes in data base, by particle name
251
252
253
254 private:
255 Int_t *i_result;
256 const char *c_result;
257 Double_t *d_result;
258 TObject *t_result;
259 Int_t pid_param;
260 Int_t name_param;
261 Int_t meson_param, baryon_param, lepton_param;
262 Int_t charge_param, spin_param, ispin_param;
263 Int_t parity_param, mass_param, width_param;
264 Int_t pkf_param, didx_param, enhance_br_param;
265 Int_t widx_param, mesh_param, tf1_param, ethreshold_param, lmass_param, umass_param;
266 Int_t tdepth_param, hdepth_param, br_param, brorig_param, count_param;
267 Int_t d1_param, d2_param, d3_param, pnmodes_param, ppid_param;
268 Int_t d4_param, d5_param, d6_param, d7_param;
269 Int_t brflag_param;
270 Int_t nalias_param, lalias_param, defkey_param;
271
272 Bool_t freeze;
273
274 Double_t *system_alloc_verbosity;
275
276 ClassDef(PStaticData, 0) //Pluto Static Data Wrapper
277
278};
279
280#endif // _PDATAUTIL_H_
281
282
283
284
285
286
287
288
PStaticData * makeStaticData()
void listParticle(int id=-1)
PStaticData & fStaticData()
void listModes(int id=-1)
Definition PMesh.h:13
int AddDecay(int didx, const char *name, const char *parent, const char *daughters, double br)
int GetParticleCharge(const int &id)
void SetParticleIsospin(const char *id, Int_t isospin)
double GetParticleTotalWidthByKey(const int &id)
void SetEnhanceChannelBR(const int id, const double factor)
void SetEnhanceChannelBR(const char *parent, const char *decay, Double_t factor=1.)
void SetParticleSpin(const char *id, Int_t spin)
double GetParticleTotalWidth(const char *id)
int GetDecayBRFlag(int didx)
const char * GetParticleName(const int &id)
void SetParticleLMass(const char *id, const double v)
int GetDecayNProducts(const int &)
bool SetDecayBRByKey(int key, double br, int mode)
int GetParticleParity(const char *id)
int GetDecayNProductsByKey(const int &key)
int IsParticle(const int &id, const char *name)
void SetTDepth(const int &, const int &)
int GetParticleIDByKey(int key)
void SetTWidx(const int &, const int &)
Double_t GetDecayPartialWidth(Int_t id)
void SetPWidthMesh(const int &, PMesh *mesh)
double GetDecayEmin(const int &idx)
int MakeDirectoryEntry(const char *name, const char *n, const char *l, const char *ename)
double GetParticleMass(const int &id)
void SetParticleTotalWidth(const char *id, Float_t wid)
bool SetDecayBR(int didx, double br, int mode)
void SetParticleMass(Int_t id, Float_t mass)
int GetDecayIdxByKey(int key)
double GetParticleLMass(const char *id)
double GetParticleMass(const char *id)
bool NormParticleBRbyKey(Int_t key)
int IsParticleValid(const char *n)
int GetDecayIdx(int *pid, int n)
void SetDecayBRFlag(int didx, int flag)
int GetParticleID(const char *id, int warn=1)
int GetParticleNChannels(const char *id)
double GetParticleTotalWidth(const int &id)
int IsParticleMeson(const int &id)
double GetParticleUMass(const char *id)
void SetTWidthMesh(const int &, PMesh *mesh)
int GetDecayNProducts(const char *)
void SetTotalNormalization(char *p, int flag=1)
int GetParticleIsospin(const int &id)
void SetParticleLMass(const int &id, const double v)
void SetParticleLepton(const char *id, Int_t num=1)
void SetParticleMeson(const char *id, Int_t num=1)
double GetParticleLMass(const int &id)
int GetParticleCharge(const char *id)
int GetSecondaryKey(int key, int defkey)
PMesh * GetTWidthMesh(const int &)
int GetDecayParentByKey(const int &)
void FreezeDecayBR(Int_t id, Int_t brn)
int GetParticleLepton(const int &id)
int GetAliasParent(int key)
int GetParticleIsospin(const char *id)
int GetHDepth(const int &)
int GetParticleSpin(const char *id)
void SetParticleTotalWidth(Int_t id, Float_t wid)
bool SetDecayBR(const char *parent, const char *daughters, double br, int mode)
Int_t IsDecayHadronic(Int_t didx)
void SetParticleCharge(const char *id, Int_t charge)
int GetPWidx(const int &)
const char * GetDecayNameByKey(Int_t key)
int GetParticleNChannels(const int &id)
PMesh * GetPWidthMesh(const int &)
int GetAliasParent(const char *alias_name)
int GetDecayKey(const int &id)
void PrintParticle(int pid)
int GetTWidx(const int &)
int GetParticleKey(const int &id)
int GetDecayParent(const int &)
double GetParticleMassByKey(const int &id)
friend void listParticle(int id)
void SetTF1(const int &, TF1 *mesh)
int IsParticleValid(const int &id)
double GetParticleEmin(const int &id)
int GetParticleKey(const char *id)
Definition PStaticData.h:77
double GetParticleUMass(const int &id)
Double_t * GetBatchValue(const char *name, Int_t make_val=1)
void clearFreezeOut(void)
Definition PStaticData.h:42
void SetParticleBaryon(const char *id, Int_t num=1)
void SetParticleEmin(const int &id, const double v)
bool GetFreezeOut(void)
Definition PStaticData.h:47
int GetParticleBaryon(const int &id)
void SetParticleUMass(const char *id, const double v)
void SetParticleMass(const char *id, Float_t mass)
friend void listModes(const char *id)
int GetTDepth(const int &)
int AddDecay(const char *name, const char *parent, const char *daughters, double br)
void SetPWidx(const int &, const int &)
Double_t GetEnhanceChannelBR(const int id)
friend void listParticle(const char *id)
Double_t GetDecayBR(Int_t id)
int GetParticleKF(const int Id)
void GetDecayModeByKey(const int, int *n)
int GetParticleIDbyKF(const int kf)
void GetDecayMode(const int, int *n)
const char * GetDecayName(Int_t id)
void SetDecayEmin(const int &idx, const double v)
int GetParticleNChannelsByKey(int id)
int GetParticleSpin(const int &id)
void SetParticleParity(const char *id, Int_t parity)
int AddParticle(int pid, const char *name, double mass)
bool NormParticleBR(Int_t id)
void SetHDepth(const int &, const int &)
void PrintParticleByKey(int pid)
int GetParticleParity(const int &id)
int GetDecayIdx(const char *parent, const char *daughters)
void DisableAllChannelBR(const char *parent)
int GetDecayKey(int *pid, int n)
void SetParticleUMass(const int &id, const double v)
TF1 * GetTF1(const int &)
int AddAlias(const char *old_name, const char *new_name)
bool SetBatchValue(const char *name, Double_t val)
Definition PStaticData.h:60
void PrintDecayByKey(int key)
int IsParticleHadron(const int &id)
void SetFreezeOut(void)
Definition PStaticData.h:38
int AddDecay(int *ipid, int n)
const char * GetParticleNameByKey(const int &id)
Definition PStaticData.h:73
void PrintParticle(const char *id)
Definition PStaticData.h:87
Double_t GetDecayPartialWidthByKey(Int_t id)
friend void listModes(int id)
PParticle * p
Definition dp_mult.C:24
Int_t n
Definition etap+omeg.C:21
PCommandList * l
Double_t mass
Bool_t freeze
PDalitzDistribution * decay