#include "TCanvas.h"
#include "TTree.h"
Go to the source code of this file.
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.
10 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/rootlogon.C");
rootlogon();
12 TCanvas *
c1=
new TCanvas(
"c1",
"c1",600,600);
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);
20 PndEventReader evr(fname);
22 if (nevts==0) nevts=evr.GetEntries();
25 TCandList kp,km,
pi,
phi,ds;
27 TPidMassSelector *phiMassSel=
new TPidMassSelector(
"phi",1.0195,0.03);
29 while (evr.GetEvent() && i++<nevts)
31 if (0==i%100) cout <<
"evt "<<i<<endl;
37 evr.FillList(kp,
"KaonVeryLoosePlus");
38 evr.FillList(km,
"KaonVeryLooseMinus");
39 evr.FillList(pi,
"PionVeryLoose");
42 phi.Select(phiMassSel);
43 for (j=0;j<phi.GetLength();++j) mphi->Fill(phi[j].M());
46 for (j=0;j<ds.GetLength();++j)
48 double dsmass=ds[j].M();
50 double missmass=(cm-ds[j].P4()).M();
52 sum->Fill(missmass+dsmass);
56 c1->cd(1); mphi->Draw();
57 c1->cd(2); mds->Draw();
58 c1->cd(3); miss->Draw();
59 c1->cd(4); sum->Draw();
66 printf(
"RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
68 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
const TLorentzVector & CmFrame() const