Pluto v6.3.0
Loading...
Searching...
No Matches
PDynamicData.h
Go to the documentation of this file.
1// Author: IF
2// Written: 25.05.2007
3// Revised:
4// PDynamicData Class Header
5
6#ifndef _PDYNAMICDATA_H_
7#define _PDYNAMICDATA_H_
8
9#define MAX_PCHANNEL_OBJECTS 10000
10
11#include "TROOT.h"
12#include "TF1.h"
13#include <iostream>
14
15#include "PDataBase.h"
16#include "PDistribution.h"
17#include "PMesh.h"
18#include "PChannelModel.h"
19#include "PParticle.h"
20
21
22class PDynamicData;
25
26class PDynamicData : public TObject {
27
28 public:
29
31
32 //**** Decays
33 Double_t GetDecayPartialWidth(Double_t mass,Int_t didx);
34
37 PChannelModel *GetDecayModelByKey(Int_t key, Int_t defkey);
38 bool SetDecayModel(Int_t didx, PChannelModel *model);
39 bool SetDecayModelByKey(Int_t didx, PChannelModel *model);
40 Double_t GetDecaySCFactor(Int_t didx);
41 void SetDecaySCFactor(Int_t didx, Double_t factor);
42 bool CheckSCAbort(Int_t didx); //to stop endless loops
43 double GetDecayBR(int , double);
44 // branching ratio by mode index & mass (GeV/c^2)
45
46 void ListDecayBR(const Char_t *pid, double mass) {
47 ListDecayBR(makeStaticData()->IsParticleValid(pid), mass);
48 }
49 void ListDecayBR(int pid, double mass);
50 // list branching ratios by particle id & mass (GeV/c^2)
51
52 int PickDecayChannel(const int &, const double &);
53 // decay index for particle pid of given mass (GeV/c**2),
54 // randomly selected consistent with the branching ratios
55
56 int PickDecayChannel(const char *id, const double &m) {
57 // as above, by particle name
58 return PickDecayChannel(makeStaticData()->IsParticleValid(id), m);
59 }
60
61 int PickDecayChannel(const int &, const double &, int *);
62 // number and pids of decay products for the decay of particle
63 // pid of given mass(GeV/c**2), via a randomly selected mode
64
65 int PickDecayChannel(const char *id, const double &m, int *array) {
66 // as above, by particle name
67 return PickDecayChannel(makeStaticData()->IsParticleValid(id), m, array);
68 }
69
70 //**** Particles
72 PChannelModel *GetParticleSecondaryModel(const char *name, const char *modelname);
73
74 Double_t GetParticleTotalWidth(Double_t mass, Int_t pid);
75 // mass-dependent total resonance decay width by id (units GeV/c**2)
76
77 Double_t GetParticleTotalWidthSum(Double_t mass, Int_t id, Int_t flag=0);
78 // same as above but by resumming the partial width (slower but more precise)
79 // flag=1: take into account only hadronic decays
80
81 Double_t GetParticleTotalWeight(Double_t mass, Int_t pid, Int_t didx=-1);
82 Double_t GetParticleScalingFactor(Int_t didx);
83 void SetParticleScalingFactor(Int_t didx, Double_t factor);
84
85 int GetParticleDepth(const int &id, int flag=0);
86
87 int GetParticleDepth(const char *id, int i=0) {
88 return GetParticleDepth(makeStaticData()->IsParticleValid(id), i);
89 }
90
91 double GetParticleLife(const int &id, double m=0, int idx=-1);
92 // mean life
93 // Arguments: 1. id=particle id
94 // 2. m=mass (GeV/c**2)
95 // 3. idx=decay-mode index
96
97 double GetParticleLife(const char *id, double m=0, int idx=-1) {
98 // as above, by particle name
99 return GetParticleLife(makeStaticData()->IsParticleValid(id), m, idx);
100 }
101
102 //Debug info... similar to PStaticData
103 void PrintParticle(int pid);
104 void PrintParticleByKey(int key);
105 void PrintDecayByKey(int key);
106
107 PParticle * GetBatchParticle(const char *name, Int_t make_val=1);
108 TH1 *GetBatchHistogram(const char *name);
109 Bool_t SetBatchHistogram(const char *name, TH1 *histo);
110
111 void PushPChannel(TObject *obj) {
112 if (num_pchannels == MAX_PCHANNEL_OBJECTS) {
113 Warning("Push", "MAX_PCHANNEL_OBJECTS reached");
114 return;
115 }
116 pchannel_list[num_pchannels++]=obj;
117 };
118
119 TObject **GetPChannels(Int_t *num) {
120 *num = num_pchannels;
121 if (num_pchannels) return pchannel_list;
122 return NULL;
123 };
124
125 void DumpPChannels(void) {
126 for (int i=0; i<num_pchannels; i++)
127 pchannel_list[i]->Print();
128 };
129
130
131 private:
132 Int_t *i_result;
133 char *c_result;
134 Double_t *d_result;
135 TObject *t_result;
136 Int_t pid_param, enhance_br_param;
137 Int_t name_param, model_param, didx_param, scfactor_param, sccount_param;
138 Int_t pnmodes_param, link_param;
139
140 TObject *pchannel_list[MAX_PCHANNEL_OBJECTS]; //list of all created PChannels for bookkeeping
141 Int_t num_pchannels;
142
143 ClassDef(PDynamicData, 0) //Pluto Dynamic Data Interface (for mass-dependent values)
144};
145
146#endif // _PDATAUTIL_H_
PDynamicData & fDynamicData()
PDynamicData * makeDynamicData()
#define MAX_PCHANNEL_OBJECTS
Definition PDynamicData.h:9
PStaticData * makeStaticData()
void PrintDecayByKey(int key)
double GetParticleLife(const char *id, double m=0, int idx=-1)
int PickDecayChannel(const int &, const double &, int *)
int PickDecayChannel(const char *id, const double &m)
bool SetDecayModelByKey(Int_t didx, PChannelModel *model)
void ListDecayBR(int pid, double mass)
TH1 * GetBatchHistogram(const char *name)
bool SetDecayModel(Int_t didx, PChannelModel *model)
void ListDecayBR(const Char_t *pid, double mass)
TObject ** GetPChannels(Int_t *num)
Double_t GetDecayPartialWidth(Double_t mass, Int_t didx)
int GetParticleDepth(const char *id, int i=0)
void SetParticleScalingFactor(Int_t didx, Double_t factor)
int PickDecayChannel(const int &, const double &)
Double_t GetParticleTotalWeight(Double_t mass, Int_t pid, Int_t didx=-1)
PChannelModel * GetDecayModelByKey(Int_t key)
PChannelModel * GetDecayModelByKey(Int_t key, Int_t defkey)
PChannelModel * GetParticleSecondaryModel(const char *name, const char *modelname)
PChannelModel * GetDecayModel(Int_t didx)
Double_t GetParticleTotalWidth(Double_t mass, Int_t pid)
void DumpPChannels(void)
void PrintParticleByKey(int key)
int GetParticleDepth(const int &id, int flag=0)
Double_t GetDecaySCFactor(Int_t didx)
PChannelModel * GetParticleModel(Int_t pid)
double GetParticleLife(const int &id, double m=0, int idx=-1)
void SetDecaySCFactor(Int_t didx, Double_t factor)
PParticle * GetBatchParticle(const char *name, Int_t make_val=1)
Bool_t SetBatchHistogram(const char *name, TH1 *histo)
bool CheckSCAbort(Int_t didx)
void PushPChannel(TObject *obj)
int PickDecayChannel(const char *id, const double &m, int *array)
double GetDecayBR(int, double)
Double_t GetParticleTotalWidthSum(Double_t mass, Int_t id, Int_t flag=0)
Double_t GetParticleScalingFactor(Int_t didx)
void PrintParticle(int pid)
my_reaction Print()
Double_t mass
TH1F * histo