FairRoot/PandaRoot
Functions
macro/examples/fastsim/ana_chic.C File Reference

Go to the source code of this file.

Functions

int ana_chic (TString fsig, TString fbkg, int nevts=0)
 

Function Documentation

int ana_chic ( TString  fsig,
TString  fbkg,
int  nevts = 0 
)

Definition at line 1 of file macro/examples/fastsim/ana_chic.C.

References c1, ctime, Double_t, eta, gam, PndEventInfo::GetCharged(), PndEventInfo::GetNeutrals(), i, m2(), nc, printf(), rtime, and timer.

2 {
3  TStopwatch timer;
4  timer.Start();
5 
6  gSystem->Load("libEGPythia6"); // needed for TDatabasePDG
7  gSystem->Load("libRho");
8 
9  TCanvas *c1=new TCanvas("c1","c1",600,600);
10  c1->Divide(2,2);
11 
12  TH1F *m1=new TH1F("m1","m1",100,0.547-0.3,0.547+0.3);
13  TH1F *m2=new TH1F("m2","m2",100,3.096-0.35,3.096+0.35);
14  TH1F *m3=new TH1F("m3","m3",100,3.415-0.35,3.415+0.35);
15 
16  TH1F *nn=new TH1F("nn","n neutrals",20,0,20);
17  TH1F *nc=new TH1F("nc","n charged",20,0,20);
18 
19  PndEventReader evr(fsig);
20  evr.Add(fbkg);
21 
22  if (nevts==0) nevts=evr.GetEntries();
23  int i=0,j;
24 
25  TCandList gam, pip, pim, eta, jpsi, chi_c;
26 
27  TPidMassSelector *etaMassSel=new TPidMassSelector("eta",0.547,0.04);
28  TPidMassSelector *jpsiMassSel=new TPidMassSelector("jpsi",3.096,0.04);
29 
30  PndEventInfo *evtinfo=0;
31 
32  while (evr.GetEvent() && i++<nevts)
33  {
34  if (0==i%100) cout <<"evt "<<i<<endl;
35 
36  evtinfo=evr.GetEventInfo();
37 
38  int nneut=evtinfo->GetNeutrals();
39  int nchrg=evtinfo->GetCharged();
40 
41  nn->Fill(nneut);
42  nc->Fill(nchrg);
43 
44  //continue;
45 
46  //if (nneut<4 || nneut>12 || nchrg<2 || nchrg>3) continue;
47 
48  evr.FillList(gam,"Neutral");
49  evr.FillList(pip,"PionVeryLoosePlus");
50  evr.FillList(pim,"PionVeryLooseMinus");
51 
52  eta.Combine(gam,gam);
53  for (j=0;j<eta.GetLength();++j) m1->Fill(eta[j].M());
54  eta.Select(etaMassSel);
55 
56  jpsi.Combine(gam, eta, pip, pim);
57  for (j=0;j<jpsi.GetLength();++j) m2->Fill(jpsi[j].M());
58  jpsi.Select(jpsiMassSel);
59 
60  chi_c.Combine(jpsi,gam);
61  for (j=0;j<chi_c.GetLength();++j) m3->Fill(chi_c[j].M());
62 
63  }
64 
65  c1->cd(1); m1->Draw();
66  c1->cd(2); m2->Draw();
67  c1->cd(3); m3->Draw();
68  c1->cd(4); nn->Draw();
69  c1->cd();
70 
71  timer.Stop();
72  Double_t rtime = timer.RealTime();
73  Double_t ctime = timer.CpuTime();
74 
75  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
76  return 0;
77 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
Int_t i
Definition: run_full.C:25
TH1F * nc
Definition: plot_eta_c.C:38
int GetNeutrals()
Definition: PndEventInfo.h:54
TString m2(TString pts, TString exts="e px py pz")
Definition: invexp.C:117
Double_t
TStopwatch timer
Definition: hit_dirc.C:51
c1
Definition: plot_dirc.C:35
CandList gam
Double_t ctime
Definition: hit_dirc.C:114
TParticlePDG * eta
Double_t rtime
Definition: hit_dirc.C:113
int GetCharged()
Definition: PndEventInfo.h:53