StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BichselP.C
1 class Bichsel;
2 //Bichsel *m_Bichsel = Bichsel::instance();
3 Bichsel *m_Bichsel = Bichsel::Instance();
4 TF1 *sipi = 0, *sie = 0, *sip = 0, *siK = 0, *sid = 0, *sit = 0, *sihe3 = 0;
5 //________________________________________________________________________________
6 Double_t sifunc(Double_t *x,Double_t *par) {
7  Double_t poverm = x[0]/par[0];
8  Int_t k = par[1];
9  Double_t charge2 = 1;
10  if (k == 1) {
11  charge2 = 4;
12  poverm *= 2;
13  }
14  return charge2*BetheBloch::Sirrf(poverm,60,k==3);
15 }
16 //________________________________________________________________________________
17 Double_t bichselZ(Double_t *x,Double_t *par) {
18  Double_t poverm = x[0]/par[0];
19  Int_t k = par[1];
20  Double_t charge2 = 1;
21  if (k == 1) {
22  charge2 = 4;
23  poverm *= 2;
24  }
25  Double_t val1 = m_Bichsel->GetMostProbableZ(TMath::Log10(poverm),1.);
26  // Double_t val2 = m_Bichsel->GetMostProbableZ(TMath::Log10(pove),1.);
27  Double_t val = TMath::Exp(val1);// - val2;
28  // cout << "pove\t" << pove << "\t" << val1 << "\tpoverm\t" << val2 << "\t" << val << endl;
29  return val;
30 }
31 //________________________________________________________________________________
32 Double_t bichsel70(Double_t *x,Double_t *par) {
33  Double_t poverm = x[0]/par[0];
34  Int_t k = par[1];
35  Double_t charge2 = 1;
36  if (k == 1) {
37  charge2 = 4;
38  poverm *= 2;
39  }
40  Double_t val = m_Bichsel->GetI70(TMath::Log10(poverm),1.);
41  return val;
42 }
43 //________________________________________________________________________________
44 
45 void BichselP() {// dE/dx versus momentum
46 #if 1
47  if (!m_Bichsel || gClassTable->GetID("StBichsel") < 0) {
48  gSystem->Load("libStar");
49  gSystem->Load("St_base");
50  gSystem->Load("StarClassLibrary");
51  gSystem->Load("StBichsel");
52  m_Bichsel = Bichsel::Instance();
53  }
54 #endif
55  TLegend *leg = new TLegend(0.7,0.4,0.9,0.9,"");//TLegend(0.79,0.91,0.89,0.89,"");
56  Char_t *names[8] = { "pi", "e", "p", "mu", "K", "d", "t", "He3"};
57  Char_t *Names[8] = { "#pi", "e", "p", "#mu", "K", "d", "t", "He3"};
58  Double_t masses[8] = {0.13956995,0.51099907e-3,0.93827231,0.1056584,0.493677,0.1876E+01,0.2809E+01,0.2809E+01};
59  for (int l = 0; l < 5; l++) {
60  TF1 *fbi = new TF1(Form("bi%s",names[l]),bichselZ,0.05,100.0,2);
61  fbi->SetParameter(0,masses[l]);
62  fbi->SetParameter(1,0);
63  fbi->SetLineColor(l+1);
64  fbi->SetLineStyle(1);
65  leg->AddEntry(fbi,Names[l],"L");
66  fbi->Draw("same");
67  TF1 *fb70 = new TF1(Form("b70%s",names[l]),bichsel70,0.05,100.0,2);
68  fb70->SetParameter(0,masses[l]);
69  fb70->SetParameter(1,0);
70  fb70->SetLineColor(l+1);
71  fb70->SetLineStyle(2);
72  leg->AddEntry(fb70,Form("%s I70",Names[l]),"L");
73  fb70->Draw("same");
74  TF1 *fsir = new TF1(Form("sir%s",names[l]),sifunc,0.05,100.0,2);
75  fsir->SetParameter(0,masses[l]);
76  fsir->SetParameter(1,0);
77  fsir->SetLineColor(l+1);
78  fsir->SetLineStyle(3);
79  leg->AddEntry(fsir,Form("%s Sirrf",Names[l]),"L");
80  fsir->Draw("same");
81  }
82  leg->Draw();
83 }