StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BichselA.C
1 class Bichsel;
2 //Bichsel *m_Bichsel = Bichsel::instance();
3 Bichsel *m_Bichsel = 0;
4 //________________________________________________________________________________
5 Double_t bichsel70(Double_t *x,Double_t *par) {
6  Double_t poverm = TMath::Power(10.,x[0])/par[0];
7  Int_t k = par[1];
8  Double_t charge2 = 1;
9  if (k == 1) {
10  charge2 = 4;
11  poverm *= 2;
12  }
13  Double_t val = m_Bichsel->GetI70M(TMath::Log10(poverm),1.)*TMath::Exp(par[2]);
14  // cout << "pove\t" << pove << "\t" << val1 << "\tpoverm\t" << val2 << "\t" << val << endl;
15  return TMath::Log10(val);
16 }
17 //________________________________________________________________________________
18 
19 void BichselA(const Char_t *tag="", Int_t hyp = 7) {
20 #if 1
21  if (!m_Bichsel) {
22  gSystem->Load("libTable");
23  gSystem->Load("St_base");
24  gSystem->Load("StarClassLibrary");
25  gSystem->Load("StBichsel");
26  m_Bichsel = Bichsel::Instance();
27  }
28 #endif
29  TLegend *leg = new TLegend(0.7,0.4,0.9,0.9,"");//TLegend(0.79,0.91,0.89,0.89,"");
30  Char_t *names[8] = { "K", "e", "p", "pi", "mu", "d", "t", "He3"};
31  Char_t *Names[8] = { "K", "e", "p", "#pi", "#mu", "d", "t", "He3"};
32  Double_t masses[8] = {0.493677,0.51099907e-3,0.93827231,0.13956995,0.1056584,0.1876E+01,0.2809E+01,0.2809E+01};
33  for (int l = 0; l < 5; l++) {
34  if (hyp >= 0 && hyp != l) continue;
35  for (int k = -1; k <= 1; k++) {
36  TString Name(Form("%sb70%s_%i",tag,names[l],k+2)); cout << Name.Data() << endl;
37  TF1 *fb70 = new TF1(Name,bichsel70,-1,4,3);
38  fb70->SetParameter(0,masses[l]);
39  fb70->SetParameter(1,0);
40  if (l == 7) fb70->SetParameter(1,1);
41  fb70->SetLineColor(l+1);
42  fb70->SetLineStyle(1);
43  TString Name(Names[l]);
44  fb70->SetParameter(2,k*0.08);
45  if (k == -1) Name += " -8%";
46  if (k == 1) Name += " +8%";
47  leg->AddEntry(fb70,Form("%s %s I70",Name.Data(),tag),"L");
48  fb70->Draw("same");
49  }
50  }
51  leg->Draw();
52 }