FairRoot/PandaRoot
Functions
ana_d0d0b.C File Reference
#include "TCanvas.h"
#include "TTree.h"
#include "TChain.h"

Go to the source code of this file.

Functions

int ana_d0d0b (TString fname, int num=1000000)
 

Function Documentation

int ana_d0d0b ( TString  fname,
int  num = 1000000 
)

Definition at line 5 of file ana_d0d0b.C.

References basiclibs(), c1, ctime, d0, Double_t, PndEventInfo::GetCharged(), PndEventInfo::GetNeutrals(), i, nc, num, printf(), rtime, and timer.

6 {
7  TStopwatch timer;
8  timer.Start();
9 
10  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
11  basiclibs();
12  gSystem->Load("libRho");
13 
14 
15  TCanvas *c1=new TCanvas("c1","c1",600,600);
16  c1->Divide(2,2);
17 
18  TH1F *d0mass=new TH1F("d0Mass","D0 mass",100,1.864-0.1,1.864+0.1);
19  TH1F *ppmass = new TH1F("ppmass","pbar p mass", 100, 4.4,4.6);
20  TH1F *nneut=new TH1F("nneut","neutrals",100,0,30);
21  TH1F *nchrg=new TH1F("nchrg","charged",100,0,10);
22 
23  PndEventReader evr(fname);
24 
25  TCandList kp,km,pip,pim;
26  TCandList d0,d0b,pp;
27 
28  int i=0,j,k;
29 
30  TPidMassSelector *msel=new TPidMassSelector("d0 mass",1.864,0.1);
31 
32  while (evr.GetEvent() && i<num)
33  {
34  if (!(++i%100)) cout <<"evt "<<i<<endl;
35 
36  int nn=0,nc=0;
37 
38  PndEventInfo *evtinfo=evr.GetEventInfo();
39 
40  if (evtinfo)
41  {
42  nn=evtinfo->GetNeutrals();
43  nc=evtinfo->GetCharged();
44  }
45 
46  nneut->Fill(nn);
47  nchrg->Fill(nc);
48 
49  if (nc!=6) continue;
50 
51  evr.FillList(kp,"KaonVeryLoosePlus");
52  evr.FillList(km,"KaonVeryLooseMinus");
53  evr.FillList(pip,"PionVeryLoosePlus");
54  evr.FillList(pim,"PionVeryLooseMinus");
55 
56  d0.Combine(km,pip);
57  d0b.Combine(kp,pim);
58 
59  for (j=0;j<d0.GetLength();j++) d0mass->Fill(d0[j].M());
60  for (j=0;j<d0b.GetLength();j++) d0mass->Fill(d0b[j].M());
61 
62  d0.Select(msel);
63  d0b.Select(msel);
64 
65  pp.Combine(d0,d0b,pip,pim);
66 
67  for (j=0;j<pp.GetLength();j++) ppmass->Fill(pp[j].M());
68  }
69 
70  c1->cd(1);
71  d0mass->Draw();
72  c1->cd(2);
73  ppmass->Draw();
74  c1->cd(3);
75  nneut->Draw();
76  c1->cd(4);
77  nchrg->Draw();
78 
79  timer.Stop();
80  Double_t rtime = timer.RealTime();
81  Double_t ctime = timer.CpuTime();
82 
83  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
84 
85  return 0;
86 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
basiclibs()
int num[96]
Definition: ranlxd.cxx:381
Int_t i
Definition: run_full.C:25
TH1F * nc
Definition: plot_eta_c.C:38
Double_t d0
Definition: checkhelixhit.C:59
int GetNeutrals()
Definition: PndEventInfo.h:54
Double_t
TStopwatch timer
Definition: hit_dirc.C:51
c1
Definition: plot_dirc.C:35
Double_t ctime
Definition: hit_dirc.C:114
Double_t rtime
Definition: hit_dirc.C:113
int GetCharged()
Definition: PndEventInfo.h:53