ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
example.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file example.C
1 #include "DrcPidFast.cxx"
2 
3 void example(int pdg = 211, double mom = 6) {
4 
6 
7  TVector3 momentum(0, 0, mom);
8  momentum.RotateX(20 / 180. * TMath::Pi());
9 
10  TH1F *hPi = new TH1F("hPi", ";#Delta Ln;entries", 200, -10, 10);
11  TH1F *hK = new TH1F("hK", ";#Delta Ln;entries", 200, -10, 10);
12 
14  for (int i = 0; i < 1000; i++) {
15  info = pid.GetInfo(pdg, momentum, 0.5);
16  hPi->Fill(info.sigma[2]);
17  hK->Fill(info.sigma[3]);
18  }
19 
20  auto r1 = hPi->Fit("gaus", "S");
21  double m1 = r1->Parameter(1);
22  double s1 = r1->Parameter(2);
23 
24  auto r2 = hK->Fit("gaus", "S");
25  double m2 = r2->Parameter(1);
26  double s2 = r2->Parameter(2);
27 
28  double sep = (fabs(m1 - m2)) / (0.5 * (s1 + s2));
29 
30  std::cout<<"separation "<<sep<<std::endl;
31 
32  hPi->Draw();
33  hPi->SetLineColor(kBlue);
34  hK->SetLineColor(kRed);
35  hK->Draw("same");
36 }