65 #if !defined(__CINT__)
68 #if !defined(__CINT__) || defined(__MAKECINT__)
75 #if !defined(__CINT__) || defined(__MAKECINT__)
76 #include "Riostream.h"
82 #include "TClassTable.h"
83 #include "StBichsel/Bichsel.h"
84 #include "StBichsel/StdEdxModel.h"
91 const Int_t NMasses = 11;
92 const Double_t Masses[NMasses] = {0.93827231,
102 0.93827231*6.94/1.008
104 const Int_t Index[NMasses] = { 4, 3, 2, 0, 5, 1, 6, 7, 8, -2, 9};
105 const Char_t *Names[NMasses] = {
"p",
"K",
"#pi",
"e",
"d",
"#mu",
"t",
"He3",
"#alpha",
"2#pi",
"Li"};
107 const Char_t *FNames[8] = {
"Girrf",
"Sirrf",
"Bz",
"B70",
"B60",
"B70M",
"dNdx",
"BzM"};
108 const Int_t Nlog2dx = 3;
109 const Double_t log2dx[Nlog2dx] = {0,1,2};
111 Double_t bichselZ(Double_t *x,Double_t *par) {
112 Double_t pove = x[0];
114 Double_t mass = par[0];
115 if (mass < 0) {mass = - mass; scale = 2;}
116 Double_t poverm = pove/mass;
117 Double_t charge = 1.;
122 dx2 = TMath::Log2(5.);
124 return (scale*charge*charge*TMath::Exp(m_Bichsel->GetMostProbableZ(TMath::Log10(poverm),dx2)));
128 Double_t bichselZM(Double_t *x,Double_t *par) {
129 Double_t pove = x[0];
131 Double_t mass = par[0];
132 if (mass < 0) {mass = - mass; scale = 2;}
133 Double_t poverm = pove/mass;
134 Double_t charge = 1.;
139 dx2 = TMath::Log2(5.);
141 return 1e6*(scale*charge*charge*TMath::Exp(m_Bichsel->GetMostProbableZM(TMath::Log10(poverm),dx2)));
145 Double_t bichsel70(Double_t *x,Double_t *par) {
146 Double_t pove = x[0];
148 Double_t mass = par[0];
149 if (mass < 0) {mass = - mass; scale = 2;}
150 Double_t poverm = pove/mass;
151 Double_t charge = 1.;
156 dx2 = TMath::Log2(5.);
159 return charge*charge*(m_Bichsel->GetI70(TMath::Log10(poverm),1.));
162 Double_t bichsel70M(Double_t *x,Double_t *par) {
163 Double_t pove = x[0];
165 Double_t mass = par[0];
166 if (mass < 0) {mass = - mass; scale = 2;}
167 Double_t poverm = pove/mass;
168 Double_t charge = 1.;
173 dx2 = TMath::Log2(5.);
175 return (scale*charge*charge*m_Bichsel->GetI70M(TMath::Log10(poverm),dx2));
178 Double_t dNdx(Double_t *x,Double_t *par) {
179 Double_t pove = x[0];
181 Double_t mass = par[0];
182 if (mass < 0) {mass = - mass; scale = 2;}
183 Double_t poverm = pove/mass;
184 Double_t charge = 1.;
186 if (par[1] > 1.0) charge = par[1];
188 return (scale*StdEdxModel::instance()->dNdx(poverm,charge));
190 #if !defined(__CINT__) && !defined(__CLING__)
192 Double_t aleph70P(Double_t *x,Double_t *par) {
199 Double_t b2inv = 1. + 1./(bg*bg);
200 Double_t beta = 1./TMath::Sqrt(b2inv);
201 Double_t dEdx = par[0]*(-1 + TMath::Power(beta,-par[3])*(par[1] - TMath::Log(TMath::Max(1e-10,par[2] + TMath::Power(bg,-par[4])))));
205 Double_t aleph70(Double_t *x,Double_t *par) {
206 static const Double_t dEdxMIP = 2.39761562607903311;
207 static Double_t MIPBetaGamma = 4.;
209 struct Par_t {Int_t h, N; Double_t xmin, xmax, pars[10];};
210 const Par_t Par[9] = {
212 { 0, 4, 3.0, 6.0,{ 0.14105, -0.09078, 0.01901, -0.00128, 0, 0, 0, 0, 0, 0}},
213 { 1, 2, 0.0, 4.5,{ -0.00689, 0.00256, 0, 0, 0, 0, 0, 0, 0, 0}},
214 { 2, -1, 0.0, 4.5,{ 0.00000, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
215 { 3, 9, -0.1, 3.7,{ 0.00869, 0.21918, -0.88919, 1.30023, -0.97075, 0.41298, -0.10214, 0.01379, -0.00079, 0}},
216 { 4, 9, -0.6, 3.3,{ 0.03052, -0.02423, -0.05636, -0.11585, 0.41292, -0.38956, 0.16837, -0.03494, 0.00283, 0}},
217 { 5, 8, -1.0, 2.9,{ 0.03523, -0.10625, 0.04182, 0.07820, -0.03816, -0.02735, 0.01940, -0.00304, 0, 0}},
218 { 6, 10, -1.0, 2.8,{ 0.03092, -0.07846, 0.01668, 0.00331, 0.12771, -0.05480, -0.13897, 0.13928, -0.04715, 0.00555}},
219 { 7, 9, -0.8, 2.9,{ 0.09158, -0.07816, 0.07039, 0.00578, -0.16160, 0.26547, -0.18728, 0.05988, -0.00710, 0}},
220 { 8, 10, -0.8, 2.9,{ 0.09366, -0.08276, 0.06191, 0.02631, -0.17044, 0.30536, -0.26867, 0.11847, -0.02505, 0.00201}}
223 static Double_t ppar[7] = { 0.0857988, 9.46138, 0.000206655, 2.12222, 0.974, -1, 0.13957};
227 static Double_t ppar[7] = {0.12337, 6.61371, 0.00201, 2.27381, 1.54174, -1.00000, 0 };
229 static Double_t Norm = dEdxMIP/aleph70P(&MIPBetaGamma,ppar);
230 Int_t hyp = (Int_t ) par[0];
231 Int_t h = Index[hyp];
232 Double_t ScaleL10 = 0;
235 ScaleL10 = TMath::Log10(2.);
237 Double_t pove = x[0];
238 Double_t mass = Masses[hyp];
239 Double_t poverm = pove/mass;
240 Double_t charge = 1.;
241 if (h > 6 && h > 9) charge = 2;
242 else if (h == 10) charge = 3;
244 Double_t bg = poverm;
250 Double_t dEdxL10 = TMath::Log10(Norm*aleph70P(&bg,ppar));
253 TString fName(Form(
"pol%i",Par[h].N-1));
254 TF1 *f = (TF1 *) gROOT->GetListOfFunctions()->FindObject(fName);
256 f =
new TF1(fName,fName,0,1);
258 f->SetParameters(&Par[h].pars[0]);
259 Double_t bgL10 = TMath::Log10(bg);
260 dEdxL10 += f->Eval(bgL10);
263 return 2*TMath::Log10(charge) + dEdxL10 + ScaleL10;
267 void bichselG(
const Char_t *type=
"I70m") {
268 if (gClassTable->GetID(
"StBichsel") < 0 || !m_Bichsel) {
269 gSystem->Load(
"libTable");
270 gSystem->Load(
"St_base");
271 gSystem->Load(
"StarClassLibrary");
272 gSystem->Load(
"StBichsel");
273 m_Bichsel = Bichsel::Instance();
276 TLegend *leg =
new TLegend(0.65,0.45,0.75,0.9,
"");
278 for (
int h = 0; h < NMasses; h++) {
281 if (Type.Contains(
"BzM",TString::kIgnoreCase)) f = 7;
282 else if (Type.Contains(
"Bz",TString::kIgnoreCase)) f = 2;
283 else if (Type.Contains(
"I70M",TString::kIgnoreCase)) f = 5;
284 else if (Type.Contains(
"I70",TString::kIgnoreCase)) f = 3;
285 else if (Type.Contains(
"I60",TString::kIgnoreCase)) f = 4;
286 else if (Type.Contains(
"N",TString::kIgnoreCase)) f = 6;
288 Char_t *FunName = Form(
"%s%s%i",FNames[f],Names[h],(
int)log2dx[dx]);
289 cout <<
"Make " << h <<
"\t" << FunName << endl;
292 if (f == 3) func =
new TF1(FunName,bichsel70,xmin, xmax,2);
293 else if (f == 2) func =
new TF1(FunName,bichselZ ,xmin, xmax,2);
294 else if (f == 5) func =
new TF1(FunName,bichsel70M ,xmin, xmax,2);
295 else if (f == 6) func =
new TF1(FunName,dNdx ,xmin, xmax,2);
296 else if (f == 7) func =
new TF1(FunName,bichselZM,xmin, xmax,2);
300 if (h == 9) func->SetParameter(0,-Masses[h]);
301 else func->SetParameter(0,Masses[h]);
302 func->SetParameter(1,1.);
303 if (h >= 7 && h < 9) func->SetParameter(1,2.);
304 if (h == 10) func->SetParameter(1,3.);
306 if (color > 8) color -= 8;
309 func->SetLineColor(color);
310 func->SetMarkerColor(color);
313 leg->AddEntry(func,Names[h]);
314 #if !defined( __CINT__) && defined(__Aleph__)
315 TF1 *fA =
new TF1(Form(
"Aleph%s",Names[h]),aleph70,xmin,xmax, 1);
316 fA->SetParameter(0,h);
317 fA->SetLineColor(color);
318 fA->SetMarkerColor(color);
321 leg->AddEntry(fA,Names[h]);