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());
34 ttree->SetBranchAddress(
"vtx_radius",&vtxR);
35 ttree->SetBranchAddress(
"tvtx_radius",&tvtxR);
36 ttree->SetBranchAddress(
"vtx_phi",&vtx_phi);
37 ttree->SetBranchAddress(
"tvtx_phi",&tvtx_phi);
39 TH2F *map =
new TH2F(
"recoMap",
"",100,-30,30,100,-30,30);
40 TH2F *tmap =
new TH2F(
"truthMap",
"",100,-30,30,100,-30,30);
44 for (
int event = 0;
event < ttree->GetEntries(); ++
event)
46 ttree->GetEvent(
event);
47 map->Fill(vtxR*TMath::Cos(vtx_phi),vtxR*TMath::Sin(vtx_phi));
48 tmap->Fill(tvtxR*TMath::Cos(tvtx_phi),tvtxR*TMath::Sin(tvtx_phi));
53 void makeDists(TChain *vtxTree, TChain *mainTree, TFile *outf){
54 TH1F *tmap =
new TH1F(
"truthDist",
"",60,0,30);
55 TH1F *rmap =
new TH1F(
"recoDist",
"",90,0,45);
56 TH1F *cmap =
new TH1F(
"correctedDist",
"",60,0,30);
62 vtxTree->SetBranchAddress(
"vtx_radius",&rvtx);
63 vtxTree->SetBranchAddress(
"tvtx_radius",&tvtx);
64 mainTree->SetBranchAddress(
"vtx_radius",&cvtx);
66 for (
int event = 0;
event < vtxTree->GetEntries(); ++
event)
68 vtxTree->GetEvent(
event);
72 for (
int event = 0;
event < mainTree->GetEntries(); ++
event)
74 mainTree->GetEvent(
event);
77 cmap->Scale(1./mainTree->GetEntries());
78 tmap->Scale(1./vtxTree->GetEntries());
79 rmap->Scale(1./vtxTree->GetEntries());
85 TFile *out_file =
new TFile(
"maps.root",
"RECREATE");
86 string treePath =
"/sphenix/user/vassalli/gammasample/truthconversionembededanalysis";
87 string treeExtension =
".root";
88 unsigned int nFiles=1000;
89 TChain *vtx_tree =
handleFile(treePath,treeExtension,
"vtxingTree",nFiles);
90 TChain *main_tree =
handleFile(treePath,treeExtension,
"cutTreeSignal",nFiles);
91 cout<<
"mapping with "<<vtx_tree->GetEntries()<<
" verticies"<<endl;