10 bool plotBool =
false;
13 TFile fin(inputFile.c_str());
16 fin.GetObject(
"ntp_residuals",ntuple);
33 ntuple->SetBranchAddress(
"seed_id",&seed_id);
34 ntuple->SetBranchAddress(
"layer",&layer);
35 ntuple->SetBranchAddress(
"dphi",&dphi);
36 ntuple->SetBranchAddress(
"dz",&dz);
37 ntuple->SetBranchAddress(
"x",&x);
38 ntuple->SetBranchAddress(
"y",&y);
39 ntuple->SetBranchAddress(
"z",&z);
40 ntuple->SetBranchAddress(
"pt",&pt);
41 ntuple->SetBranchAddress(
"px",&px);
42 ntuple->SetBranchAddress(
"py",&py);
43 ntuple->SetBranchAddress(
"pz",&pz);
44 ntuple->SetBranchAddress(
"crossing",&crossing);
45 ntuple->SetBranchAddress(
"isSilicon",&isSilicon);
46 ntuple->SetBranchAddress(
"isTpc",&isTpc);
49 int entries = ntuple->GetEntries();
51 TH2D *
xy =
new TH2D(
"xy",
"cluster x vs. y",5000,-80,80,5000,-80,80);
52 TH2D *tpc_xy =
new TH2D(
"tpc_xy",
"tpc cluster x vs. y",5000,-80,80,5000,-80,80);
53 TH2D *si_xy =
new TH2D(
"si_xy",
"si cluster x vs. y",5000,-10,10,5000,-10,10);
54 TH2D *dphiLayer =
new TH2D(
"dphiLayer",
"dphi vs. layer",5000,-0.02,0.02,5000,0,56);
55 TH2D *dzLayer =
new TH2D(
"dzLayer",
"dz vs. layer",5000,-1,1,5000,0,56);
56 TH2D *resLayer =
new TH2D(
"resLayer",
"residual vs. layer",5000,0,1,5000,0,56);
57 TH2D *dphiPt =
new TH2D(
"dphiPt",
"dphi vs. pt",5000,-0.02,0.02,5000,0,7);
58 TH2D *dphiPz =
new TH2D(
"dphiPz",
"dphi vs. pz",5000,-0.02,0.02,5000,0,5);
71 for(
int i=0;
i<entries; ++
i)
75 float r = sqrt(pow(x,2)+pow(y,2)+pow(z,2));
76 float residual = sqrt(pow(r*dphi,2)+pow(dz,2));
78 resLayer->Fill(residual,layer);
79 dphiLayer->Fill(dphi,layer);
80 dzLayer->Fill(dz,layer);
82 dphiPt->Fill(dphi,pt);
83 dphiPz->Fill(dphi,pz);
97 TCanvas *c1 =
new TCanvas(
"c1",
"",10,10,800,800);
100 TCanvas *
c2 =
new TCanvas(
"c2",
"",10,10,800,800);
103 TCanvas *c3 =
new TCanvas(
"c3",
"",10,10,600,600);
106 TCanvas *c4 =
new TCanvas(
"c4",
"",10,10,800,800);
107 dphiLayer->DrawCopy();
109 TCanvas *c5 =
new TCanvas(
"c5",
"",10,10,800,800);
112 TCanvas *c6 =
new TCanvas(
"c6",
"",10,10,800,800);
113 resLayer->DrawCopy();
115 TCanvas *c7 =
new TCanvas(
"c7",
"",10,10,800,800);
118 TCanvas *c8 =
new TCanvas(
"c8",
"",10,10,800,800);
124 std::unique_ptr<TFile> residualsFile(TFile::Open(outputFile.c_str(),
"recreate"));
125 residualsFile->WriteObject(xy,
"cluster_xvy");
126 residualsFile->WriteObject(tpc_xy,
"tpc_cluster_xvy ");
127 residualsFile->WriteObject(si_xy,
"si_cluster_xvy");
128 residualsFile->WriteObject(dphiLayer,
"dphi_v_layer");
129 residualsFile->WriteObject(dzLayer,
"dz_v_layer");
130 residualsFile->WriteObject(resLayer,
"residual_v_layer");
131 residualsFile->WriteObject(dphiPt,
"dphi_v_pt");
132 residualsFile->WriteObject(dphiPz,
"dphi_v_pz");