1 void vertEff(
char *file){
3 gSystem->Load(
"$HOME/MyEvent/MyEvent");
5 TFile *f=
new TFile(file,
"OPEN");
6 TTree *myEventTree=(TTree*)f->Get(
"mEventTree");
8 myEventTree->SetBranchAddress(
"branch",&ev);
11 TH1F *h_vert_all=
new TH1F(
"h_vert_all",
"vertex hijing",160,-80.,80.);
12 TH1F *h_vert_no=
new TH1F(
"h_vert_no",
"vertex hijing, no prim.",160,-80.,80.);
13 TH1F *h_pion_all=
new TH1F(
"h_pion_all",
"hijing pions",12,0.,6.);
14 TH1F *h_pion_no=
new TH1F(
"h_pion_no",
"hijing pions, no prim",12,0.,6.);
15 TH1F *h_pion_reco=
new TH1F(
"h_pion_reco",
"hijing pions, prim",12,0.,6.);
16 TH1F *h_vert_res=
new TH1F(
"h_vert_res",
"vertex resolution",200,-50.,50.);
18 TH1F *h_gg_all=
new TH1F(
"h_gg_all",
"good globals",100,0.,100.);
19 TH1F *h_gg_reco=
new TH1F(
"h_gg_reco",
"good globals (vtx reco.)",100,0.,100.);
33 while(myEventTree->GetEntry(i)){
38 TVector3 vert=ev->vertex();
40 h_gg_all->Fill(ev->goodGlobals());
41 if(fabs(vert.Z())>0.0000001){
42 h_gg_reco->Fill(ev->goodGlobals());
46 TClonesArray *clP=ev->getMcPionArray();
47 if(fabs(vert.Z())>0.0000001){
48 h_vert_res->Fill(vert.Z()-ev->zdcVertexZ());
51 h_vert_all->Fill(ev->zdcVertexZ());
52 for(
int i_p=0;i_p<ev->numberOfMcPions();i_p++){
54 if(pion->momentum().PseudoRapidity()>0.&&pion->momentum().PseudoRapidity()<1.){
55 h_pion_all->Fill(pion->momentum().Pt());
56 if(fabs(vert.Z())<0.0000001){
57 h_pion_no->Fill(pion->momentum().Pt());
59 else h_pion_reco->Fill(pion->momentum().Pt());
65 if(fabs(vert.Z())<0.0000001){
67 h_vert_no->Fill(ev->zdcVertexZ());
73 TCanvas *c=
new TCanvas(
"c",
"c",600,900);
78 h_vert_all->SetMinimum(1.);
79 h_vert_no->SetLineColor(4);
80 h_vert_no->DrawCopy(
"same");
82 h_vert_no->Divide(h_vert_all);
86 h_pion_all->Scale(1./n_ev);
88 h_pion_no->Scale(1./n_ev_no);
89 h_pion_no->SetLineColor(4);
90 h_pion_no->DrawCopy(
"same");
92 h_pion_reco->Scale(1./n_ev);
93 h_pion_reco->Divide(h_pion_all);
98 c->SaveAs(
"hijing_vert.root");