StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Bichsel.C
1 class Bichsel;
2 //Bichsel *m_Bichsel = Bichsel::instance();
3 Bichsel *m_Bichsel = 0;
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 pove = pow(10.,x[0]);
8  Double_t ppion = pove*0.13956995;
9  Double_t poverm = ppion/par[0];
10  Int_t k = par[1];
11  Double_t charge2 = 1;
12  if (k == 1) {
13  charge2 = 4;
14  poverm *= 2;
15  }
16  return TMath::Log(charge2*BetheBloch::Sirrf(poverm,60,k==3)/BetheBloch::Sirrf(pove,60,0));
17 }
18 //________________________________________________________________________________
19 Double_t bichselZ(Double_t *x,Double_t *par) {
20  Double_t ppion = pow(10.,x[0]);
21  Double_t pove = ppion;
22  Double_t poverm = ppion/par[0];
23  Int_t k = par[1];
24  Double_t charge2 = 1;
25  if (k == 1) {
26  charge2 = 4;
27  poverm *= 2;
28  }
29  Double_t val1 = m_Bichsel->GetMostProbableZ(TMath::Log10(poverm),1.);
30  Double_t val2 = m_Bichsel->GetMostProbableZ(TMath::Log10(pove),1.);
31  Double_t val = val1 - val2;
32  // cout << "pove\t" << pove << "\t" << val1 << "\tpoverm\t" << val2 << "\t" << val << endl;
33  return val;
34 }
35 //________________________________________________________________________________
36 
37 void Bichsel(const Char_t *tag = "") {
38 #if 1
39  if (gClassTable->GetID("StBichsel")) {
40  gSystem->Load("libTable");
41  gSystem->Load("St_base");
42  gSystem->Load("StarClassLibrary");
43  gSystem->Load("StBichsel");
44  }
45 #endif
46  if (!m_Bichsel) m_Bichsel = Bichsel::Instance();
47  TLegend *leg = new TLegend(0.72,0.7,0.9,0.9,"");//TLegend(0.79,0.91,0.89,0.89,"");
48  sipi = new TF1(Form("%sbipi",tag),bichselZ,-1.,4.0,2);
49  sipi->SetParameter(0,0.13956995);
50  sipi->SetParameter(1,0);
51  sie = new TF1(Form("%sbie",tag),bichselZ,-1.,4.0,2);
52  sie->SetParameter(0,0.51099907e-3);
53  sie->SetParameter(1,3);
54  sie->SetLineColor(2);
55  leg->AddEntry(sie,"e-#pi","L");
56 // TF1 *sie1 = new TF1(Form("%sbie1",tag),bichselZ,-1.,4.0,2);
57 // sie1->SetParameter(0,0.51099907e-3);
58 // sie1->SetParameter(1,0);
59 // sie1->SetLineColor(2);
60  sip = new TF1(Form("%sbi",tag),bichselZ,-1.,4.0,2);
61  sip->SetParameter(0,0.93827231);
62  sip->SetParameter(1,0);
63  sip->SetLineColor(3);
64  leg->AddEntry(sip,"p-#pi","L");
65  sim = new TF1(Form("%sbim",tag),bichselZ,-1.,4.0,2);
66  sim->SetParameter(0,0.1056584);
67  sim->SetParameter(1,0);
68  sim->SetLineColor(8);
69  leg->AddEntry(sim,"#mu-#pi","L");
70  siK = new TF1(Form("%sbiK",tag),bichselZ,-1.,4.0,2);
71  siK->SetParameter(0,0.493677);
72  siK->SetParameter(1,0);
73  siK->SetLineColor(4);
74  leg->AddEntry(siK,"K-#pi","L");
75  sid = new TF1(Form("%sbid",tag),bichselZ,-1.,4.0,2);
76  sid->SetParameter(0,0.1876E+01);
77  sid->SetParameter(1,0);
78  sid->SetLineColor(6);
79  leg->AddEntry(sid,"d-#pi","L");
80  TF1 *sit = new TF1(Form("%sbit",tag),bichselZ,-1.,4.0,2);
81  sit->SetParameter(0,0.2809E+01);
82  sit->SetParameter(1,0);
83  sit->SetLineColor(7);
84  leg->AddEntry(sit,"t-#pi","L");
85 
86 // sihe3 = new TF1(Form("%sbihe3",tag),bichselZ,-1.,4.0,2);
87 // sihe3->SetParameter(0,0.2809E+01);
88 // sihe3->SetParameter(1,1);
89 // sihe3->SetLineColor(1);
90 // leg->AddEntry(sihe3,"He3-#pi","L");
91  sipi->Draw("same");
92  sim->Draw("same");
93  sie->Draw("same");
94  // sie1->Draw("same");
95  siK->Draw("same");
96  sip->Draw("same");
97  sid->Draw("same");
98  sit->Draw("same");
99 // sihe3->Draw("same");
100  leg->Draw();
101 }
102 Double_t Divation(Double_t *x,Double_t *par) {
103  Double_t val[7];
104  // val[0] = sipi->Eval(x);
105  TF1 *f;
106  f = (TF1 *) gROOT->GetListOfFunctions()->FindObject("bie"); if (f) val[1] = f->Eval(x);
107  f = (TF1 *) gROOT->GetListOfFunctions()->FindObject("biK"); if (f) val[2] = f->Eval(x);
108  f = (TF1 *) gROOT->GetListOfFunctions()->FindObject("bip"); if (f) val[3] = f->Eval(x);
109  f = (TF1 *) gROOT->GetListOfFunctions()->FindObject("bid"); if (f) val[4] = f->Eval(x);
110  f = (TF1 *) gROOT->GetListOfFunctions()->FindObject("bit"); if (f) val[5] = f->Eval(x);
111  f = (TF1 *) gROOT->GetListOfFunctions()->FindObject("bihe3");if (f) val[6] = f->Eval(x);
112  Double_t min = 9999.;
113  for (int i = 1; i <7; i++) {
114  Double_t dev = TMath::Abs(val[i]);
115  if (dev < min) min = dev;
116  }
117  return min;
118 }
Bichsel(const Char_t *tag="P10", Int_t keep3D=0)
last instance
Definition: Bichsel.cxx:10