4 const Int_t NMasses = 5;
5 const Double_t Masses[NMasses] = {0.93827231,
10 const Char_t *Names[NMasses] = {
"p",
"K",
"pi",
"e",
"d"};
12 const Char_t *FNames[5] = {
"Girrf",
"Sirrf",
"Bz",
"B70",
"B60"};
13 const Int_t Nlog2dx = 1;
14 const Double_t log2dx[Nlog2dx] = {1};
16 Double_t gfunc(Double_t *x,Double_t *par) {
18 Double_t poverm = pove/par[0];
27 return BetheBloch::Girrf(poverm,par[4],k);
30 Double_t sifunc(Double_t *x,Double_t *par) {
32 Double_t poverm = pove/par[0];
36 return BetheBloch::Sirrf(poverm,par[2],k);
46 Double_t bichselZ(Double_t *x,Double_t *par) {
48 Double_t poverm = pove/par[0];
54 return TMath::Exp(Bichsel::Instance()->GetMostProbableZ(TMath::Log10(poverm),par[3]));
56 Double_t bichsel70(Double_t *x,Double_t *par) {
58 Double_t poverm = pove/par[0];
64 return Bichsel::Instance()->GetI70(TMath::Log10(poverm),par[3]);
66 Double_t bichsel60(Double_t *x,Double_t *par) {
68 Double_t poverm = pove/par[0];
74 return Bichsel::Instance()->GetI60(TMath::Log10(poverm),par[3]);
77 if (gClassTable->GetID(
"StBichsel") < 0) {
78 gSystem->Load(
"libTable");
79 gSystem->Load(
"St_base");
80 gSystem->Load(
"StarClassLibrary");
81 gSystem->Load(
"StBichsel");
83 if (!m_Bichsel) m_Bichsel = Bichsel::Instance();
84 TCanvas *c1 =
new TCanvas(
"c1");
90 TH1F *hr = c1->DrawFrame(1.e-1,1,1.e2,2.e2);
92 hr->SetTitle(
"dE/dx predictions");
93 hr->SetXTitle(
"Momentum (GeV/c) ");
94 hr->SetYTitle(
"dE/dx (keV/cm)");
97 Double_t
params[5] = { 1.0, 0., 60., 1., 1e-3};
98 TLegend *leg =
new TLegend(0.4,0.7,0.9,0.9,
"");
99 for (Int_t h = 0; h < 4; h++) {
100 params[0] = Masses[h];
102 for (Int_t f = 0; f < NF; f++) {
103 for (Int_t dx = 0; dx < Nlog2dx; dx++) {
104 params[3] = log2dx[dx];
105 Char_t *FunName = Form(
"%s%s%i",FNames[f],Names[h],(
int)log2dx[dx]);
108 if (TString(FNames[f]) ==
"Sirrf") {
109 func =
new TF1(FunName,sifunc,1.e-2,1.e3,5);
110 func->SetLineColor(2);
112 if (TString(FNames[f]) ==
"Girrf") {
113 func =
new TF1(FunName,gfunc,1.e-2,1.e3,5);
115 if (dx == 1) params[4] = 1.e-2;
116 if (dx == 2) params[4] = 1.e-3;
117 if (dx == 3) params[4] = 1.e-4;
118 func->SetLineColor(3);
120 else {
if (TString(FNames[f]) ==
"Bz") {
121 func =
new TF1(FunName,bichselZ,1.e-2,1.e3,5);
122 func->SetLineColor(4);
124 else {
if (TString(FNames[f]) ==
"B70") {
125 func =
new TF1(FunName,bichsel70,1.e-2,1.e3,5);
126 func->SetLineColor(6);
128 else {
if (TString(FNames[f]) ==
"B60") {
129 func =
new TF1(FunName,bichsel60,1.e-2,1.e3,5);
130 func->SetLineColor(7);
132 if (! func)
continue;
133 func->SetParameters(params);
135 if (dx == 0 && h == 0) {
136 TString name(FNames[f]);
137 if (name ==
"Sirrf") name +=
": Fitted from Year 1 data";
138 else if (name ==
"Girrf") name +=
": Geant3 prediction";
139 else if (name ==
"Bz") name +=
": Bichsel most probable (dX = 2 cm)";
140 else if (name ==
"B70") name +=
": Bichsel, 30 % truncation (dX = 2 cm)";
141 else if (name ==
"B60") name +=
": Bichsel, 40 % truncation (dX = 2 cm)";
142 leg->AddEntry(func,name.Data(),
"L");