11 #include "TEfficiency.h"
13 #include "TGraphAsymmErrors.h"
16 TChain *all =
new TChain(treename.c_str());
18 for (
int i = 0;
i < filecount; ++
i)
23 temp = name+
string(s.str())+extension;
24 all->Add(temp.c_str());
31 float electron_pt[200];
32 float positron_pt[200];
33 float electron_reco_pt[200];
34 float positron_reco_pt[200];
42 string treePath =
"/sphenix/user/vassalli/gammasample/fourembededonlineanalysis";
43 string treeExtension =
".root";
44 unsigned int nFiles=100;
45 TChain *ttree =
handleFile(treePath,treeExtension,
"ttree",nFiles);
46 ttree->SetBranchAddress(
"electron_pt", &electron_pt );
47 ttree->SetBranchAddress(
"electron_reco_pt",&electron_reco_pt );
48 ttree->SetBranchAddress(
"positron_pt", &positron_pt );
49 ttree->SetBranchAddress(
"positron_reco_pt",&positron_reco_pt );
50 ttree->SetBranchAddress(
"nTpair", &truth_n );
51 ttree->SetBranchAddress(
"nRpair", &reco_n );
52 ttree->SetBranchAddress(
"fLayer", &b_layer );
53 ttree->SetBranchAddress(
"nVtx", &nVtx );
54 ttree->SetBranchAddress(
"rVtx", &rVtx );
57 string outfilename =
"pTeffdists.root";
58 TFile *
out =
new TFile(outfilename.c_str(),
"RECREATE");
60 TH1F *h_TepT =
new TH1F(
"TepT",
"",100,0,30);
61 TH1F *h_RepT =
new TH1F(
"RepT",
"",100,0,30);
63 TH1F *h_rvtx =
new TH1F(
"rvtx",
"",100,0,30);
64 TH1F *h_layer =
new TH1F(
"layer",
"",24,-.5,23.5);
66 h_TepT->GetXaxis()->SetTitle(
"pT");
67 h_TepT->GetYaxis()->SetTitle(
"N");
68 h_RepT->GetXaxis()->SetTitle(
"pT");
69 h_RepT->GetYaxis()->SetTitle(
"N");
71 h_rvtx->GetXaxis()->SetTitle(
"radius [cm]");
72 h_rvtx->GetYaxis()->SetTitle(
"N");
74 for (
int event = 0;
event < ttree->GetEntries(); ++
event)
76 ttree->GetEvent(
event);
77 for (
int i = 0;
i < truth_n; ++
i)
79 h_RepT->Fill(electron_reco_pt[
i]);
80 h_RepT->Fill(positron_reco_pt[i]);
82 for (
int i = 0;
i < nVtx; ++
i)
84 h_TepT->Fill(electron_pt[
i]);
85 h_TepT->Fill(positron_pt[i]);
86 h_rvtx->Fill(rVtx[i]);
88 for (
int i = 0;
i < reco_n; ++
i)
90 h_layer->Fill(b_layer[
i]);