FairRoot/PandaRoot
Functions
tutorials/analysis/ana_dsinc.C File Reference
#include "TCanvas.h"
#include "TTree.h"

Go to the source code of this file.

Functions

void ana_dsinc (TString fname, int nevts=0)
 

Function Documentation

void ana_dsinc ( TString  fname,
int  nevts = 0 
)

Definition at line 4 of file tutorials/analysis/ana_dsinc.C.

References c1, cm, PndEventInfo::CmFrame(), ctime, Double_t, i, phi, pi, printf(), rootlogon(), rtime, and timer.

5 {
6  gROOT->Reset();
7  TStopwatch timer;
8  timer.Start();
9 
10  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");rootlogon();
11 
12  TCanvas *c1=new TCanvas("c1","c1",600,600);
13  c1->Divide(2,2);
14 
15  TH1F *mphi=new TH1F("mphi","m(phi)",100,0.98,1.06);
16  TH1F *mds=new TH1F("meta","m(ds)",100,1.9685-0.10,1.9685+0.10);
17  TH1F *miss=new TH1F("miss","miss mass",200,2.317-0.2,2.317+0.2);
18  TH1F *sum=new TH1F("sum","m(ds)+miss",200,1.9685+2.317-0.05,1.9685+2.317+0.01);
19 
20  PndEventReader evr(fname);
21 
22  if (nevts==0) nevts=evr.GetEntries();
23  int i=0,j;
24 
25  TCandList kp,km,pi,phi,ds;
26 
27  TPidMassSelector *phiMassSel=new TPidMassSelector("phi",1.0195,0.03);
28 
29  while (evr.GetEvent() && i++<nevts)
30  {
31  if (0==i%100) cout <<"evt "<<i<<endl;
32 
33  PndEventInfo *evtinfo=evr.GetEventInfo();
34 
35  TLorentzVector cm=evtinfo->CmFrame();
36 
37  evr.FillList(kp,"KaonVeryLoosePlus");
38  evr.FillList(km,"KaonVeryLooseMinus");
39  evr.FillList(pi,"PionVeryLoose");
40 
41  phi.Combine(kp,km);
42  phi.Select(phiMassSel);
43  for (j=0;j<phi.GetLength();++j) mphi->Fill(phi[j].M());
44 
45  ds.Combine(phi,pi);
46  for (j=0;j<ds.GetLength();++j)
47  {
48  double dsmass=ds[j].M();
49  mds->Fill(dsmass);
50  double missmass=(cm-ds[j].P4()).M();
51  miss->Fill(missmass);
52  sum->Fill(missmass+dsmass);
53  }
54  }
55 
56  c1->cd(1); mphi->Draw();
57  c1->cd(2); mds->Draw();
58  c1->cd(3); miss->Draw();
59  c1->cd(4); sum->Draw();
60  c1->cd();
61 
62  timer.Stop();
63  Double_t rtime = timer.RealTime();
64  Double_t ctime = timer.CpuTime();
65 
66  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
67 
68 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
Int_t i
Definition: run_full.C:25
Double_t const cm
#define pi
Definition: createSTT.C:60
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
const TLorentzVector & CmFrame() const
Definition: PndEventInfo.h:47