Functions
levy_func_problem.C File Reference

Go to the source code of this file.

Functions

double integrand (double *x, double *par)
 
double prob_method0 (double n, double nav, double c)
 
double prob_method1 (double n, double nav, double c)
 
double prob_method2 (double n, double nav, double c)
 
double kno_func (double z, double c)
 
void plot_multiplicity_prob (double c)
 
void levy_func_problem (double c, int method)
 

Function Documentation

double integrand ( double *  x,
double *  par 
)

Definition at line 198 of file levy_func_problem.C.

199 {
200 // preasymptotic multiplicity distribution reconstructed from the
201 // asymptotic scaling function via Poisson transform
202 
203  // inputs
204  double xx = x[0];
205 
206  // parameters
207  double n = par[0];
208  double nav = par[1];
209  double c = par[2];
210 
211  // compute integrand
212 
213  double psi = 0;
214  if(c<0) {
215  if(n==0) psi = 0;
216  else psi = TMath::Gamma(xx);
217  }
218  else psi = kno_func(xx,c);
219 
220  double fct = TMath::Factorial((int)n);
221  double pwr = TMath::Power(nav*xx,n);
222  double expn = TMath::Exp(-nav*xx);
223 
224  double f = psi * (pwr/fct) * expn;
225  return f;
226 }
PYTHON x
Definition: diff.txt:3
FILE * f
Definition: loadlibs.C:26
double kno_func(double z, double c)
double kno_func ( double  z,
double  c 
)

Definition at line 228 of file levy_func_problem.C.

229 {
230 // z reduced multiplicity:
231 // c KNO param
232 
233  double x = c*z+1;
234  double psi = 2*TMath::Exp(-c)*TMath::Power(c,x)/TMath::Gamma(x);
235 
236  return psi;
237 }
PYTHON x
Definition: diff.txt:3
double z
void levy_func_problem ( double  c,
int  method 
)

Definition at line 25 of file levy_func_problem.C.

26 {
27  cout << "Using method = " << method << ", Levy(c) = " << c << endl;
28 
29  const int nnav = 40;
30 
31  double nav_min = 0.25;
32  double nav_max = 3.00;
33  double dnav = (nav_max-nav_min)/(nnav-1);
34 
35  // canvas for plotting <n>_out = f(<n>_in)
36  TCanvas * canvas = new TCanvas("canvas","",20,20,700,700);
37  canvas->SetFillColor(0);
38  canvas->SetBorderMode(0);
39  TH1F * frame = (TH1F*) canvas->DrawFrame(nav_min,nav_min,nav_max,nav_max);
40  frame->Draw();
41 
42  double nav_in [nnav];
43  double nav_out[nnav];
44 
45  for(int i=0; i<nnav; i++) {
46 
47  double nav_input = nav_min + i*dnav;
48 
49  cout << "** nav(in) = " << nav_input << endl;
50 
51  double minmult = 0;
52  double maxmult = 10;
53  int nbins = TMath::Nint(maxmult-minmult+1);
54 
55  TH1D * mult_prob = new TH1D("mult_prob",
56  "hadronic multiplicity distribution", nbins, minmult-0.5, maxmult+0.5);
57  mult_prob->SetDirectory(0);
58 
59  int nbins = mult_prob->FindBin(maxmult);
60  for(int j=1; j<=nbins; j++) {
61  double n = mult_prob->GetBinCenter(j); // bin centre
62 
63  double P = 0;
64  if (method==0) P = prob_method0(n,nav_input,c);
65  else if (method==1) P = prob_method1(n,nav_input,c);
66  else if (method==2) P = prob_method2(n,nav_input,c);
67 
68  cout << " n = " << n << " -> P(n) = " << P << endl;
69  mult_prob->Fill(n,P);
70  }
71  double nav_output = mult_prob->GetMean();
72  delete mult_prob;
73 
74  cout << " ** nav(out) = " << nav_output << endl;
75 
76  nav_in[i] = nav_input;
77  nav_out[i] = nav_output;
78  }
79 
80  TGraph * gr = new TGraph(nnav,nav_in,nav_out);
81  gr->SetMarkerStyle(20);
82  gr->SetMarkerSize(1);
83 
84  TGraph * id = new TGraph(nnav,nav_in,nav_in);
85  id->SetLineStyle(1);
86  id->SetLineColor(2);
87 
88  gr->Draw("P");
89  id->Draw("L");
90 
91  canvas->Update();
92 }
double prob_method2(double n, double nav, double c)
size_t i(0)
the ParameterSet object passed in for the configuration of a destination should be the only source that can affect the behavior of that destination This is to eliminate the dependencies of configuring a destination from multiple mostly from the defaults It suppresses possible glitches about changing the configuration file somewhere outside of a destination segament might still affect the behavior of that destination In the previous configuration for a specific the value of a certain e may come from following and have been suppressed It the configuring ParameterSet object for each destination will be required to carry a parameter list as complete as possible If a parameter still cannot be found in the ParameterSet the configuration code will go look for a hardwired default directly The model is a great simplicity comparing with the previous especially when looking for default values Another great advantage is most of the parameters now have very limited places that allows to appear Usually they can only appear at one certain level in a configuration file For in the old configuring model or in a default ParameterSet object inside of a or in a category or in a severity object This layout of multiple sources for a single parameter brings great confusion in both writing a configuration and in processing the configuration file Under the new the only allowed place for the parameter limit to appear is inside of a category which is inside of a destination object Other improvements simplify the meaning of a destination name In the old a destination name has multiple folds of meanings the e cout and cerr have the special meaning of logging messages to standard output or standard error the name also serves as the output filename if the destination is a file these names are also references to look up for detailed configurations in configuring the MessageFacility The multi purpose of the destination name might cause some unwanted behavior in either writing or parsing the configuration file To amend in the new model the destination name is now merely a name for a which might represent the literal purpose of this or just an id All other meanings of the destinations names now go into the destination ParameterSet as individual such as the type parameter and filename parameter Following is the deatiled rule for the new configuring Everything that is related with MessageFacility configuration must be wrapped in a single ParameterSet object with the name MessageFacility The MessageFacility ParameterSet object contains a series of top level parameters These parameters can be chosen a vector of string listing the name of debug enabled models Or use *to enable debug messages in all modules a vector of string a vector of string a vector of string a ParameterSet object containing the list of all destinations The destinations ParameterSet object is a combination of ParameterSet objects for individual destinations There are two types of destinations that you can insert in the destinations ParameterSet ordinary including cout
double prob_method1(double n, double nav, double c)
double prob_method0(double n, double nav, double c)
void plot_multiplicity_prob ( double  c)

Definition at line 94 of file levy_func_problem.C.

95 {
96  const int nnav = 2;
97  double nav[nnav] = { 0.5, 4. };
98  TH1D * mult_prob[nnav][2];
99 
100  double minmult = 0;
101  double maxmult = 10;
102  int nbins = TMath::Nint(maxmult-minmult+1);
103 
104  // canvas for plotting sample multiplicity probability distributions
105  TCanvas * canvas = new TCanvas("canvas","",120,120,800,800);
106  canvas->SetFillColor(0);
107  canvas->SetBorderMode(0);
108 
109  for(int i=0; i<nnav; i++) {
110 
111  double nav_input = nav[i];
112 
113  cout << "** nav = " << nav_input << endl;
114 
115  for(int method=0; method<=1; method++) {
116  mult_prob[i][method] = new TH1D("mult_prob",
117  "hadronic multiplicity distribution", nbins, minmult-0.5, maxmult+0.5);
118  mult_prob[i][method]->SetDirectory(0);
119 
120  int nbins = mult_prob[i][method]->FindBin(maxmult);
121  for(int j=1; j<=nbins; j++) {
122  double n = mult_prob[i][method]->GetBinCenter(j); // bin centre
123 
124  double P = 0;
125  if (method==0) P = prob_method0(n,nav_input,c);
126  else if (method==1) P = prob_method1(n,nav_input,c);
127 
128  cout << " n = " << n << " -> P(n) = " << P << endl;
129  mult_prob[i][method]->Fill(n,P);
130  }//bins
131  mult_prob[i][method]->Scale(1/mult_prob[i][method]->Integral("width"));
132  }//meth
133  }//nnav
134 
135  for(int i=0; i<nnav; i++) {
136  for(int method=0; method<=1; method++) {
137  mult_prob[i][method]->SetLineStyle(1);
138  mult_prob[i][method]->SetLineWidth(1);
139  mult_prob[i][method]->SetLineColor(method+1);
140  }
141  }
142 
143  canvas->cd();
144  canvas->Divide(1,nnav);
145 
146  for(int i=0; i<nnav; i++) {
147  canvas->cd(1+i);
148  mult_prob[i][0]->Draw();
149  mult_prob[i][1]->Draw("SAME");
150  }
151  canvas->Update();
152 }
size_t i(0)
the ParameterSet object passed in for the configuration of a destination should be the only source that can affect the behavior of that destination This is to eliminate the dependencies of configuring a destination from multiple mostly from the defaults It suppresses possible glitches about changing the configuration file somewhere outside of a destination segament might still affect the behavior of that destination In the previous configuration for a specific the value of a certain e may come from following and have been suppressed It the configuring ParameterSet object for each destination will be required to carry a parameter list as complete as possible If a parameter still cannot be found in the ParameterSet the configuration code will go look for a hardwired default directly The model is a great simplicity comparing with the previous especially when looking for default values Another great advantage is most of the parameters now have very limited places that allows to appear Usually they can only appear at one certain level in a configuration file For in the old configuring model or in a default ParameterSet object inside of a or in a category or in a severity object This layout of multiple sources for a single parameter brings great confusion in both writing a configuration and in processing the configuration file Under the new the only allowed place for the parameter limit to appear is inside of a category which is inside of a destination object Other improvements simplify the meaning of a destination name In the old a destination name has multiple folds of meanings the e cout and cerr have the special meaning of logging messages to standard output or standard error the name also serves as the output filename if the destination is a file these names are also references to look up for detailed configurations in configuring the MessageFacility The multi purpose of the destination name might cause some unwanted behavior in either writing or parsing the configuration file To amend in the new model the destination name is now merely a name for a which might represent the literal purpose of this or just an id All other meanings of the destinations names now go into the destination ParameterSet as individual such as the type parameter and filename parameter Following is the deatiled rule for the new configuring Everything that is related with MessageFacility configuration must be wrapped in a single ParameterSet object with the name MessageFacility The MessageFacility ParameterSet object contains a series of top level parameters These parameters can be chosen a vector of string listing the name of debug enabled models Or use *to enable debug messages in all modules a vector of string a vector of string a vector of string a ParameterSet object containing the list of all destinations The destinations ParameterSet object is a combination of ParameterSet objects for individual destinations There are two types of destinations that you can insert in the destinations ParameterSet ordinary including cout
double prob_method1(double n, double nav, double c)
double prob_method0(double n, double nav, double c)
double prob_method0 ( double  n,
double  nav,
double  c 
)

Definition at line 188 of file levy_func_problem.C.

189 {
190 // compute P(n) from <n>P(n) = KNO(n/<n>)
191 //
192  double z = n/nav;
193  double kno = kno_func(z,c);
194  double P = kno/nav;
195  return P;
196 }
double kno_func(double z, double c)
double z
double prob_method1 ( double  n,
double  nav,
double  c 
)

Definition at line 171 of file levy_func_problem.C.

172 {
173 // Compute P(n) as in hep-ph/9608479 v1 29-Aug-1996, eq.5
174 //
175  TF1 * intg = new TF1("integrand",integrand,0,10,3);
176 
177  intg->SetParameter(0,n);
178  intg->SetParameter(1,nav);
179  intg->SetParameter(2,c);
180 
181  double P = intg->Integral(0,10);
182 
183  delete intg;
184 
185  return P;
186 }
double integrand(double *x, double *par)
double prob_method2 ( double  n,
double  nav,
double  c 
)

Definition at line 154 of file levy_func_problem.C.

155 {
156 // Compute P(n) as in hep-ph/9608479 v1 29-Aug-1996, eq.5
157 //
158  TF1 * intg = new TF1("integrand",integrand,0,10,3);
159 
160  intg->SetParameter(0,n);
161  intg->SetParameter(1,nav);
162  intg->SetParameter(2,-999999);
163 
164  double P = intg->Integral(0,10);
165 
166  delete intg;
167 
168  return P;
169 }
double integrand(double *x, double *par)