FairRoot/PandaRoot
tutorials/analysis/ana_chic.C
Go to the documentation of this file.
1 void ana_chic(TString fsig,int nevts=0)
2 {
3  TStopwatch timer;
4  timer.Start();
5 
6  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");rootlogon();
7  //gSystem->Load("libEGPythia6"); // needed for TDatabasePDG
8  //gSystem->Load("libRho");
9 
10  TCanvas *c1=new TCanvas("c1","c1",600,600);
11  c1->Divide(2,2);
12 
13  TH1F *m1=new TH1F("m1","#eta: m(#gamma #gamma)",100,0.547-0.15,0.547+0.15);
14  TH1F *m2=new TH1F("m2","J/#psi: m(e^{+} e^{-})",100,3.096-0.35,3.096+0.35);
15  TH1F *m3=new TH1F("m3","#chi_{c0}: m(J/#psi #gamma)",100,3.415-0.35,3.415+0.35);
16 
17  TH1F *nn=new TH1F("nn","n neutrals",20,0,20);
18  TH1F *nc=new TH1F("nc","n charged",20,0,20);
19 
20  PndEventReader evr(fsig);
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=0,nchrg=0;
39 
40  if (evtinfo)
41  {
42  nneut=evtinfo->GetNeutrals();
43  nchrg=evtinfo->GetCharged();
44  }
45 
46  nn->Fill(nneut);
47  nc->Fill(nchrg);
48 
49  evr.FillList(gam,"Neutral");
50  evr.FillList(pip,"PionVeryLoosePlus");
51  evr.FillList(pim,"PionVeryLooseMinus");
52 
53  eta.Combine(gam,gam);
54  for (j=0;j<eta.GetLength();++j) m1->Fill(eta[j].M());
55  eta.Select(etaMassSel);
56 
57  jpsi.Combine(gam, eta, pip, pim);
58  for (j=0;j<jpsi.GetLength();++j) m2->Fill(jpsi[j].M());
59  jpsi.Select(jpsiMassSel);
60 
61  chi_c.Combine(jpsi,gam);
62  for (j=0;j<chi_c.GetLength();++j) m3->Fill(chi_c[j].M());
63 
64  }
65 
66  c1->cd(1); m1->Draw();
67  c1->cd(2); m2->Draw();
68  c1->cd(3); m3->Draw();
69  c1->cd(4); nn->Draw();
70  c1->cd();
71 
72  timer.Stop();
73  Double_t rtime = timer.RealTime();
74  Double_t ctime = timer.CpuTime();
75 
76  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
77 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
Int_t i
Definition: run_full.C:25
int GetNeutrals()
Definition: PndEventInfo.h:54
void ana_chic(TString fsig, int nevts=0)
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
TH1F * nc