Pluto v6.3.0
Loading...
Searching...
No Matches
PChannelModel.h
Go to the documentation of this file.
1// Author: I. Froehlich
2// Written: 23.5.2007
3// Revised:
4
5#ifndef _PCHANNELMODEL_H_
6#define _PCHANNELMODEL_H_
7
8#include "TComplex.h"
9
10#include "TF1.h"
11#include "TF2.h"
12#include "PDistribution.h"
13
14
16
17 public:
19 PChannelModel(const Char_t *id, const Char_t *de, Int_t key=-1);
20 PDistribution* Clone(const char*delme=NULL) const;
21
23
24 virtual Bool_t SampleMass(Double_t *mass, Int_t *didx=NULL);
25
26 Double_t SampleMass(Int_t didx) {
27 Double_t mass;
28 if (SampleMass(&mass, &didx)) return mass;
29 return 0.;
30 }
31 Double_t SampleTotalMass(void) {
32 return SampleMass(-1);
33 }
34
35
36 //weight/amplitude calculations: To avoid endless loops,
38 virtual Double_t GetWeight(Double_t *mass, Int_t *didx=NULL);
39
40 Double_t GetWeight(Double_t mass, Int_t *didx=NULL) {
41 //wrapper for models with single variable only
42 return GetWeight(&mass, didx);
43 };
44 Double_t GetWeight(Double_t mass, Double_t mass2, Int_t *didx=NULL) {
45 //wrapper for models with 2 variables only
46 Double_t m[2];
47 m[0] = mass;
48 m[1] = mass2;
49 return GetWeight(m, didx);
50 };
51 Double_t GetWeight(Double_t mass, Double_t mass2, Double_t mass3, Int_t *didx=NULL) {
52 //wrapper for models with 3 variables
53 Double_t m[3];
54 m[0] = mass;
55 m[1] = mass2;
56 m[2] = mass3;
57 return GetWeight(m, didx);
58 };
59 Double_t GetWeight(Double_t mass, Double_t mass2, Double_t mass3, Double_t mass4,
60 Int_t *didx=NULL) {
61 //wrapper for models with 4 variables
62 Double_t m[4];
63 m[0] = mass;
64 m[1] = mass2;
65 m[2] = mass3;
66 m[3] = mass4;
67 return GetWeight(m, didx);
68 };
69 Double_t GetWeight(Double_t mass, Double_t mass2, Double_t mass3, Double_t mass4, Double_t mass5,
70 Int_t *didx=NULL) {
71 //wrapper for models with 5 variables
72 Double_t m[5];
73 m[0] = mass;
74 m[1] = mass2;
75 m[2] = mass3;
76 m[3] = mass4;
77 m[4] = mass5;
78 return GetWeight(m, didx);
79 };
80
81 virtual TComplex GetAmplitude(Double_t *mass, Int_t *didx=NULL);
82
83 virtual Bool_t GetWidth(Double_t mass, Double_t *width, Int_t didx=-1);
84
85 Double_t GetWidth(Double_t mass) {
86 Double_t lWidth;
87 GetWidth(mass, &lWidth, -1);
88 return lWidth;
89 };
90
91
92 Double_t GetBR(Double_t mass) {
93 Double_t br;
94 Bool_t res = GetBR(mass, &br);
95 if (res) return br;
96 return 0.;
97 }
98
99
100 virtual Bool_t GetBR(Double_t mass, Double_t *br, Double_t totalwidth=-1.);
101
102 virtual int GetDepth(int i=0);
103 // Returns the total number of embedded recursive decays
104 // (TDepth if flag=0) or the number of embedded recursive
105 // hadronic decays (HDepth if flag=1).
106 // The default value 0 means the index has not been accessed yet.
107 // Zero depth corresponds to index -1.
108
109 virtual Double_t Eval(Double_t x, Double_t y = 0, Double_t z = 0, Double_t t = 0) const;
110 virtual Double_t EvalPar(const Double_t *x, const Double_t *params);
111 //TF1 wrapper
112
113 void SetDraw(Int_t opt) {
114 SetParameter(0, (Double_t)opt);
115 draw_option = opt;
116 };
117 void SetDidx(Int_t opt) {
118 SetParameter(1, (Double_t)opt);
119 didx_option = opt;
120 };
121
122 void SetDynamicRange(Double_t my_mmin,Double_t my_mmax) {
123 mmin = my_mmin;
124 mmax = my_mmax;
125 fXmin = mmin;
126 fXmax = mmax;
127 fIntegral.clear();
128 };
129
130 Double_t GetMin(void) {return mmin;};
131 Double_t GetMax(void) {return mmax;};
132 void SetMin(Double_t my_mmin){mmin = my_mmin;};
133 void SetMax(Double_t my_mmax){mmax = my_mmax;};
134
135 void ClearIntegral(void) {
136 if (!fIntegral.empty()) {
137 fIntegral.clear();
138 fAlpha.clear();
139 fBeta.clear();
140 fGamma.clear();
141 }
142 };
143
144 Int_t GetDef() {return model_def_key;};
145 void SetWidthInit (Int_t w) {width_init=w;};
146
147 protected:
148
149 Double_t width; //Mass-dependent width container
150 PMesh *mesh; //Linear mesh container for fast lookup
151 Int_t width_init; //flag for the 1st initialization in getWidth
153 Double_t mmin, mmax; //Dynamic range of the model
154 Int_t maxmesh;
156 int mc_max, mc; //Monte-Carlo intergration params
158 Double_t *unstable_width;
159
160 Int_t loop_flag; //To avoid endless loops of GetWidth/GetAmplitude calls
161
163
164 ClassDef(PChannelModel, 0) // Base class for coupled-channel distributions
165};
166
167#endif
168
169
TH1F * mass2
virtual Double_t EvalPar(const Double_t *x, const Double_t *params)
Double_t GetWeight(Double_t mass, Double_t mass2, Double_t mass3, Double_t mass4, Int_t *didx=NULL)
Double_t * unstable_width
PChannelModel(const Char_t *id, const Char_t *de, Int_t key=-1)
void SetWidthInit(Int_t w)
virtual TComplex GetAmplitude(Double_t *mass, Int_t *didx=NULL)
Double_t GetWeight(Double_t mass, Double_t mass2, Double_t mass3, Double_t mass4, Double_t mass5, Int_t *didx=NULL)
void ClearIntegral(void)
virtual Bool_t SampleMass(Double_t *mass, Int_t *didx=NULL)
virtual Double_t GetWeight(Double_t *mass, Int_t *didx=NULL)
Double_t GetBR(Double_t mass)
void SetMax(Double_t my_mmax)
virtual Bool_t SampleMass(void)
PDistribution * Clone(const char *delme=NULL) const
virtual Bool_t GetWidth(Double_t mass, Double_t *width, Int_t didx=-1)
virtual Double_t GetWeight(void)
Double_t GetWeight(Double_t mass, Double_t mass2, Double_t mass3, Int_t *didx=NULL)
Double_t GetMax(void)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
virtual Bool_t GetBR(Double_t mass, Double_t *br, Double_t totalwidth=-1.)
virtual int GetDepth(int i=0)
void SetDraw(Int_t opt)
Double_t GetMin(void)
Double_t GetWidth(Double_t mass)
PChannelModel * GetSecondaryModel(const char *)
Double_t GetWeight(Double_t mass, Int_t *didx=NULL)
void SetMin(Double_t my_mmin)
void SetDidx(Int_t opt)
Double_t SampleMass(Int_t didx)
void SetDynamicRange(Double_t my_mmin, Double_t my_mmax)
Double_t GetWeight(Double_t mass, Double_t mass2, Int_t *didx=NULL)
Double_t SampleTotalMass(void)
virtual Bool_t SampleMass(void)
virtual Double_t GetWeight(void)
Definition PMesh.h:13
phi2170 SetParameter(0, 0)
Double_t mass
PParticle * w