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