00001 #include "Riostream.h"
00002 class Bichsel;
00003 Bichsel *m_Bichsel = 0;
00004 const Int_t NMasses = 5;
00005 const Double_t Masses[NMasses] = {0.93827231,
00006 0.493677,
00007 0.13956995,
00008 0.51099907e-3,
00009 1.87561339};
00010 const Char_t *Names[NMasses] = {"p", "K","pi","e","d"};
00011 const Int_t NF = 4;
00012 const Char_t *FNames[5] = {"Girrf","Sirrf","Bz","B70","B60"};
00013 const Int_t Nlog2dx = 1;
00014 const Double_t log2dx[Nlog2dx] = {1};
00015
00016 Double_t gfunc(Double_t *x,Double_t *par) {
00017 Double_t pove = x[0];
00018 Double_t poverm = pove/par[0];
00019 Int_t type = par[1];
00020 Int_t k = 0;
00021 if (type == 3) k = 1;
00022 Int_t type = par[1];
00023 Int_t k = 0;
00024 if (type == 3) k = 1;
00025
00026
00027 return BetheBloch::Girrf(poverm,par[4],k);
00028 }
00029
00030 Double_t sifunc(Double_t *x,Double_t *par) {
00031 Double_t pove = x[0];
00032 Double_t poverm = pove/par[0];
00033 Int_t type = par[1];
00034 Int_t k = 0;
00035 if (type == 3) k = 1;
00036 return BetheBloch::Sirrf(poverm,par[2],k);
00037 }
00038
00039
00040
00041
00042
00043
00044
00045
00046 Double_t bichselZ(Double_t *x,Double_t *par) {
00047 Double_t pove = x[0];
00048 Double_t poverm = pove/par[0];
00049 Int_t type = par[1];
00050 Int_t k = 0;
00051 if (type == 3) k = 1;
00052
00053
00054 return TMath::Exp(Bichsel::Instance()->GetMostProbableZ(TMath::Log10(poverm),par[3]));
00055 }
00056 Double_t bichsel70(Double_t *x,Double_t *par) {
00057 Double_t pove = x[0];
00058 Double_t poverm = pove/par[0];
00059 Int_t type = par[1];
00060 Int_t k = 0;
00061 if (type == 3) k = 1;
00062
00063
00064 return Bichsel::Instance()->GetI70(TMath::Log10(poverm),par[3]);
00065 }
00066 Double_t bichsel60(Double_t *x,Double_t *par) {
00067 Double_t pove = x[0];
00068 Double_t poverm = pove/par[0];
00069 Int_t type = par[1];
00070 Int_t k = 0;
00071 if (type == 3) k = 1;
00072
00073
00074 return Bichsel::Instance()->GetI60(TMath::Log10(poverm),par[3]);
00075 }
00076 void bichsel() {
00077 if (gClassTable->GetID("StBichsel") < 0) {
00078 gSystem->Load("libTable");
00079 gSystem->Load("St_base");
00080 gSystem->Load("StarClassLibrary");
00081 gSystem->Load("StBichsel");
00082 }
00083 if (!m_Bichsel) m_Bichsel = Bichsel::Instance();
00084 TCanvas *c1 = new TCanvas("c1");
00085 c1->SetLogx();
00086 c1->SetLogy();
00087 c1->SetGrid();
00088
00089
00090 TH1F *hr = c1->DrawFrame(1.e-1,1,1.e2,2.e2);
00091
00092 hr->SetTitle("dE/dx predictions");
00093 hr->SetXTitle("Momentum (GeV/c) ");
00094 hr->SetYTitle("dE/dx (keV/cm)");
00095 hr->Draw();
00096
00097 Double_t params[5] = { 1.0, 0., 60., 1., 1e-3};
00098 TLegend *leg = new TLegend(0.4,0.7,0.9,0.9,"");
00099 for (Int_t h = 0; h < 4; h++) {
00100 params[0] = Masses[h];
00101 params[1] = h;
00102 for (Int_t f = 0; f < NF; f++) {
00103 for (Int_t dx = 0; dx < Nlog2dx; dx++) {
00104 params[3] = log2dx[dx];
00105 Char_t *FunName = Form("%s%s%i",FNames[f],Names[h],(int)log2dx[dx]);
00106
00107 TF1 *func = 0;
00108 if (TString(FNames[f]) == "Sirrf") {
00109 func = new TF1(FunName,sifunc,1.e-2,1.e3,5);
00110 func->SetLineColor(2);
00111 }
00112 if (TString(FNames[f]) == "Girrf") {
00113 func = new TF1(FunName,gfunc,1.e-2,1.e3,5);
00114 params[4] = 1.e-3;
00115 if (dx == 1) params[4] = 1.e-2;
00116 if (dx == 2) params[4] = 1.e-3;
00117 if (dx == 3) params[4] = 1.e-4;
00118 func->SetLineColor(3);
00119 }
00120 else {if (TString(FNames[f]) == "Bz") {
00121 func = new TF1(FunName,bichselZ,1.e-2,1.e3,5);
00122 func->SetLineColor(4);
00123 }
00124 else {if (TString(FNames[f]) == "B70") {
00125 func = new TF1(FunName,bichsel70,1.e-2,1.e3,5);
00126 func->SetLineColor(6);
00127 }
00128 else {if (TString(FNames[f]) == "B60") {
00129 func = new TF1(FunName,bichsel60,1.e-2,1.e3,5);
00130 func->SetLineColor(7);
00131 }}}}
00132 if (! func) continue;
00133 func->SetParameters(params);
00134 func->Draw("same");
00135 if (dx == 0 && h == 0) {
00136 TString name(FNames[f]);
00137 if (name == "Sirrf") name += ": Fitted from Year 1 data";
00138 else if (name == "Girrf") name += ": Geant3 prediction";
00139 else if (name == "Bz") name += ": Bichsel most probable (dX = 2 cm)";
00140 else if (name == "B70") name += ": Bichsel, 30 % truncation (dX = 2 cm)";
00141 else if (name == "B60") name += ": Bichsel, 40 % truncation (dX = 2 cm)";
00142 leg->AddEntry(func,name.Data(),"L");
00143 }
00144 }
00145 }
00146 }
00147 leg->Draw();
00148 }