1 |
{
|
2 |
gROOT->Reset();
|
3 |
#include "Riostream.h"
|
4 |
#include "TStyle.h"
|
5 |
|
6 |
TFile * theFile1 = new TFile("simLevelPlots.root");
|
7 |
|
8 |
std::cout<<"Reading histos for ECAL"<<std::endl;
|
9 |
|
10 |
TH1F * simHitsEcalEnergyHistEB_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalEnergyOfSimHitsEB"));
|
11 |
TH1F * simHitsEcalEnergyHistEE_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalEnergyOfSimHitsEE"));
|
12 |
TH1F * simHitsEcalTimeHistEB_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalTimingOfSimHitsEB"));
|
13 |
TH1F * simHitsEcalTimeHistEE_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalTimingOfSimHitsEE"));
|
14 |
TH1F * simHitsEcalNumHistEB_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalNumberOfSimHitsEB"));
|
15 |
TH1F * simHitsEcalNumHistEE_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalNumberOfSimHitsEE"));
|
16 |
TH2F * simHitsEcalEnergyVsTimeHistEB_ = (TH2F*) (theFile1->Get("hscpSimPlotsEcal/ecalEnergyVsTimeOfSimHitsEB"));
|
17 |
TH2F * simHitsEcalEnergyVsTimeHistEE_ = (TH2F*) (theFile1->Get("hscpSimPlotsEcal/ecalEnergyVsTimeOfSimHitsEE"));
|
18 |
TH1F * simHitsEcalDigiMatchEnergyHistEB_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalEnergyOfDigiMatSimHitsEB"));
|
19 |
TH1F * simHitsEcalDigiMatchEnergyHistEE_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalEnergyOfDigiMatSimHitsEE"));
|
20 |
TH1F * simHitsEcalDigiMatchTimeHistEB_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalTimingOfDigiMatSimHitsEB"));
|
21 |
TH1F * simHitsEcalDigiMatchTimeHistEE_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalTimingOfDigiMatSimHitsEE"));
|
22 |
TH2F * simHitsEcalDigiMatchEnergyVsTimeHistEB_ = (TH2F*) (theFile1->Get("hscpSimPlotsEcal/ecalEnergyVsTimeOfDigiMatSimHitsEB"));
|
23 |
TH2F * simHitsEcalDigiMatchEnergyVsTimeHistEE_ = (TH2F*) (theFile1->Get("hscpSimPlotsEcal/ecalEnergyVsTimeOfDigiMatSimHitsEE"));
|
24 |
TH1F * simHitsEcalDigiMatchIEtaHist_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalIEtaOfDigiMatchSimHits"));
|
25 |
TH1F * simHitsEcalDigiMatchIPhiHist_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalIPhiOfDigiMatchSimHits"));
|
26 |
TH1F * digisEcalNumHistEB_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalDigisNumberEB"));
|
27 |
TH1F * digisEcalNumHistEE_ = (TH1F*) (theFile1->Get("hscpSimPlotsEcal/ecalDigisNumberEE"));
|
28 |
TH2F * digiOccupancyMapEB_ = (TH2F*) (theFile1->Get("hscpSimPlotsEcal/ecalDigiOccupancyMapEB"));
|
29 |
TH2F * digiOccupancyMapEEP_ = (TH2F*) (theFile1->Get("hscpSimPlotsEcal/ecalDigiOccupancyMapEEM"));
|
30 |
TH2F * digiOccupancyMapEEM_ = (TH2F*) (theFile1->Get("hscpSimPlotsEcal/ecalDigiOccupancyMapEEP"));
|
31 |
|
32 |
std::string command = "mkdir sim";
|
33 |
system(command.c_str());
|
34 |
std::string command = "mkdir digi";
|
35 |
system(command.c_str());
|
36 |
|
37 |
|
38 |
TStyle* thisStyle = new TStyle("myStyle", "NewStyle");
|
39 |
thisStyle->SetOptStat(2222211);
|
40 |
thisStyle->SetPalette(1);
|
41 |
thisStyle->cd();
|
42 |
|
43 |
system(command.c_str());
|
44 |
|
45 |
TCanvas t;
|
46 |
t.cd();
|
47 |
|
48 |
simHitsEcalEnergyHistEB_->Draw();
|
49 |
t.Print("sim/simHitsEnergyEB.png");
|
50 |
simHitsEcalEnergyHistEE_->Draw();
|
51 |
t.Print("sim/simHitsEnergyEE.png");
|
52 |
simHitsEcalTimeHistEB_->Draw();
|
53 |
t.Print("sim/simHitsTimeEB.png");
|
54 |
simHitsEcalTimeHistEE_->Draw();
|
55 |
t.Print("sim/simHitsTimeEE.png");
|
56 |
simHitsEcalNumHistEB_->Draw();
|
57 |
t.Print("sim/simHitsNumberEB.png");
|
58 |
simHitsEcalNumHistEE_->Draw();
|
59 |
t.Print("sim/simHitsNumberEE.png");
|
60 |
simHitsEcalEnergyVsTimeHistEB_->Draw("colz");
|
61 |
t.Print("sim/simHitsEnergyVsTimeEB.png");
|
62 |
simHitsEcalEnergyVsTimeHistEE_->Draw("colz");
|
63 |
t.Print("sim/simHitsEnergyVsTimeEE.png");
|
64 |
|
65 |
simHitsEcalDigiMatchEnergyHistEB_->Draw();
|
66 |
t.Print("sim/digiMatchedSimHitsEnergyEB.png");
|
67 |
simHitsEcalDigiMatchEnergyHistEE_->Draw();
|
68 |
t.Print("sim/digiMatchedSimHitsEnergyEE.png");
|
69 |
simHitsEcalDigiMatchTimeHistEB_->Draw();
|
70 |
t.Print("sim/digiMatchedSimHitsTimeEB.png");
|
71 |
simHitsEcalDigiMatchTimeHistEE_->Draw();
|
72 |
t.Print("sim/digiMatchedSimHitsTimeEE.png");
|
73 |
simHitsEcalDigiMatchEnergyVsTimeHistEB_->Draw("colz");
|
74 |
t.Print("sim/digiMatchedSimHitsEnergyVsTimeEB.png");
|
75 |
simHitsEcalDigiMatchEnergyVsTimeHistEE_->Draw("colz");
|
76 |
t.Print("sim/digiMatchedSimHitsEnergyVsTimeEE.png");
|
77 |
|
78 |
simHitsEcalDigiMatchIEtaHist_->Draw();
|
79 |
t.Print("sim/digiMatchedSimHitsIeta.png");
|
80 |
simHitsEcalDigiMatchIPhiHist_->Draw();
|
81 |
t.Print("sim/digiMatchedSimHitsIphi.png");
|
82 |
|
83 |
digisEcalNumHistEB_->Draw();
|
84 |
t.Print("sim/numDigisEB.png");
|
85 |
digisEcalNumHistEE_->Draw();
|
86 |
t.Print("sim/numDigisEE.png");
|
87 |
|
88 |
thisStyle->SetOptStat(11);
|
89 |
thisStyle->cd();
|
90 |
|
91 |
digiOccupancyMapEB_->Draw("colz");
|
92 |
t.Print("digi/digiOccupancyEB.png");
|
93 |
digiOccupancyMapEEP_->Draw("colz");
|
94 |
t.Print("digi/digiOccupancyEEP.png");
|
95 |
digiOccupancyMapEEM_->Draw("colz");
|
96 |
t.Print("digi/digiOccupancyEEM.png");
|
97 |
|
98 |
|
99 |
|
100 |
//The RPC Part
|
101 |
|
102 |
|
103 |
TH1F* residualsRPCRecHitSimDigis_;
|
104 |
TH1F* efficiencyRPCRecHitSimDigis_;
|
105 |
TH1F* cluSizeDistribution_;
|
106 |
TH1F* rpcTimeOfFlightBarrel_[6];
|
107 |
TH1F* rpcBXBarrel_[6];
|
108 |
TH1F* rpcTimeOfFlightEndCap_[3];
|
109 |
TH1F* rpcBXEndCap_[3];
|
110 |
|
111 |
|
112 |
|
113 |
residualsRPCRecHitSimDigis_ = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/residualsRPCRecHitSimDigis"));
|
114 |
efficiencyRPCRecHitSimDigis_= (TH1F*) (theFile1->Get("hscpSimPlotsRPC/efficiencyRPCRecHitSimDigis"));
|
115 |
cluSizeDistribution_ = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCCluSizeDistro"));
|
116 |
rpcTimeOfFlightBarrel_[0] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCToFLayer1"));
|
117 |
rpcTimeOfFlightBarrel_[1] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCToFLayer2"));
|
118 |
rpcTimeOfFlightBarrel_[2] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCToFLayer3"));
|
119 |
rpcTimeOfFlightBarrel_[3] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCToFLayer4"));
|
120 |
rpcTimeOfFlightBarrel_[4] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCToFLayer5"));
|
121 |
rpcTimeOfFlightBarrel_[5] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCToFLayer6"));
|
122 |
rpcBXBarrel_[0] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCBXLayer1"));
|
123 |
rpcBXBarrel_[1] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCBXLayer2"));
|
124 |
rpcBXBarrel_[2] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCBXLayer3"));
|
125 |
rpcBXBarrel_[3] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCBXLayer4"));
|
126 |
rpcBXBarrel_[4] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCBXLayer5"));
|
127 |
rpcBXBarrel_[5] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCBXLayer6"));
|
128 |
rpcTimeOfFlightEndCap_[0] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCToFDisk1"));
|
129 |
rpcTimeOfFlightEndCap_[1] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCToFDisk2"));
|
130 |
rpcTimeOfFlightEndCap_[2] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCToFDisk3"));
|
131 |
rpcBXEndCap_[0] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCBXDisk1"));
|
132 |
rpcBXEndCap_[1] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCBXDisk2"));
|
133 |
rpcBXEndCap_[2] = (TH1F*) (theFile1->Get("hscpSimPlotsRPC/RPCBXDisk3"));
|
134 |
|
135 |
residualsRPCRecHitSimDigis_->Draw();
|
136 |
t.Print("digi/rpcresiduals.png");
|
137 |
|
138 |
efficiencyRPCRecHitSimDigis_->Draw();
|
139 |
t.Print("digi/rpcefficiency.png");
|
140 |
|
141 |
cluSizeDistribution_->Draw();
|
142 |
t.Print("digi/cluRPCSize.png");
|
143 |
|
144 |
TLegend *leg = new TLegend(0.6,0.85,0.9,0.3);
|
145 |
rpcTimeOfFlightBarrel_[0]->SetFillColor(1);
|
146 |
rpcTimeOfFlightBarrel_[0]->Draw();
|
147 |
rpcTimeOfFlightBarrel_[0]->GetXaxis()->SetTitle("ToF (ns)");
|
148 |
std::stringstream legend;
|
149 |
legend.str("");
|
150 |
legend<<"ToF Layer 1 Mean "<<rpcTimeOfFlightBarrel_[0]->GetMean()<<"ns";
|
151 |
leg->AddEntry(rpcTimeOfFlightBarrel_[0],legend.str().c_str(),"f");
|
152 |
float max = rpcTimeOfFlightBarrel_[0]->GetBinContent(rpcTimeOfFlightBarrel_[0]->GetMaximumBin());
|
153 |
for(int i=1; i<6;i++){
|
154 |
rpcTimeOfFlightBarrel_[i]->SetFillColor(i+1);
|
155 |
legend.str("");
|
156 |
legend<<"ToF Layer "<<i+1<<" Mean "<<rpcTimeOfFlightBarrel_[i]->GetMean()<<"ns";
|
157 |
leg->AddEntry(rpcTimeOfFlightBarrel_[i],legend.str().c_str(),"f");
|
158 |
rpcTimeOfFlightBarrel_[i]->Draw("same");
|
159 |
float thismax = rpcTimeOfFlightBarrel_[i]->GetBinContent(rpcTimeOfFlightBarrel_[i]->GetMaximumBin());
|
160 |
if(thismax > max) max = thismax;
|
161 |
cout<<"max "<<max<<endl;
|
162 |
}
|
163 |
|
164 |
for(int i=0; i<6;i++) rpcTimeOfFlightBarrel_[i]->SetMaximum(max);
|
165 |
|
166 |
leg->Draw("same");
|
167 |
gStyle->SetOptStat(0);
|
168 |
gStyle->SetOptTitle(0);
|
169 |
t.Print("sim/RPCBToF.png");
|
170 |
|
171 |
leg->Clear();
|
172 |
|
173 |
rpcTimeOfFlightEndCap_[2]->Draw();
|
174 |
rpcTimeOfFlightEndCap_[2]->SetFillColor(3);
|
175 |
rpcTimeOfFlightEndCap_[2]->GetXaxis()->SetTitle("ToF (ns)");
|
176 |
|
177 |
legend.str("");
|
178 |
legend<<"ToF Disk 3 Mean "<<rpcTimeOfFlightEndCap_[2]->GetMean()<<"ns";
|
179 |
leg->AddEntry(rpcTimeOfFlightEndCap_[2],legend.str().c_str(),"f");
|
180 |
|
181 |
float max = rpcTimeOfFlightEndCap_[2]->GetBinContent(rpcTimeOfFlightEndCap_[2]->GetMaximumBin());
|
182 |
cout<<"max "<<max<<endl;
|
183 |
|
184 |
for(int i=1;i>=0;i--){
|
185 |
rpcTimeOfFlightEndCap_[i]->SetFillColor(i+1);
|
186 |
legend.str("");
|
187 |
legend<<"ToF Disk "<<i+1<<" Mean "<<rpcTimeOfFlightEndCap_[i]->GetMean()<<"ns";
|
188 |
leg->AddEntry(rpcTimeOfFlightEndCap_[i],legend.str().c_str(),"f");
|
189 |
rpcTimeOfFlightEndCap_[i]->Draw("same");
|
190 |
float thismax = rpcTimeOfFlightEndCap_[i]->GetBinContent(rpcTimeOfFlightEndCap_[i]->GetMaximumBin());
|
191 |
if(thismax > max) max = thismax;
|
192 |
cout<<"max "<<max<<endl;
|
193 |
}
|
194 |
|
195 |
rpcTimeOfFlightEndCap_[0]->SetMaximum(max);
|
196 |
rpcTimeOfFlightEndCap_[1]->SetMaximum(max);
|
197 |
rpcTimeOfFlightEndCap_[2]->SetMaximum(max);
|
198 |
|
199 |
|
200 |
leg->Draw("same");
|
201 |
gStyle->SetOptStat(0);
|
202 |
gStyle->SetOptTitle(0);
|
203 |
t.Print("sim/RPCEToF.png");
|
204 |
|
205 |
leg->Clear();
|
206 |
|
207 |
rpcBXBarrel_[0]->SetLineColor(1);
|
208 |
rpcBXBarrel_[0]->Draw();
|
209 |
rpcBXBarrel_[0]->GetXaxis()->SetTitle("BX Units(25ns)");
|
210 |
rpcBXBarrel_[0]->SetLineWidth(3);
|
211 |
|
212 |
legend.str("");
|
213 |
legend<<"BX Layer 1 Mean "<<rpcBXBarrel_[0]->GetMean();
|
214 |
leg->AddEntry(rpcBXBarrel_[0],legend.str().c_str(),"l");
|
215 |
|
216 |
float max = rpcBXBarrel_[0]->GetBinContent(rpcBXBarrel_[0]->GetMaximumBin());
|
217 |
|
218 |
for(int i=1; i<6;i++){
|
219 |
rpcBXBarrel_[i]->SetLineColor(i+1);
|
220 |
legend.str("");
|
221 |
legend<<"BX Layer "<<i+1<<" Mean "<<rpcBXBarrel_[i]->GetMean();
|
222 |
leg->AddEntry(rpcBXBarrel_[i],legend.str().c_str(),"l");
|
223 |
rpcBXBarrel_[i]->SetLineWidth(3);
|
224 |
rpcBXBarrel_[i]->Draw("same");
|
225 |
float thismax = rpcBXBarrel_[i]->GetBinContent(rpcBXBarrel_[i]->GetMaximumBin());
|
226 |
if(thismax > max) max = thismax;
|
227 |
}
|
228 |
|
229 |
for(int i=0; i<6;i++)rpcBXBarrel_[i]->SetMaximum(max);
|
230 |
|
231 |
leg->Draw("same");
|
232 |
gStyle->SetOptStat(0);
|
233 |
gStyle->SetOptTitle(0);
|
234 |
|
235 |
t.Print("digi/RPCBBX.png");
|
236 |
|
237 |
leg->Clear();
|
238 |
|
239 |
rpcBXEndCap_[0]->SetLineColor(1);
|
240 |
rpcBXEndCap_[0]->Draw();
|
241 |
rpcBXEndCap_[0]->GetXaxis()->SetTitle("BX Units(25ns)");
|
242 |
rpcBXEndCap_[0]->SetLineWidth(3);
|
243 |
|
244 |
legend.str("");
|
245 |
legend<<"BX Disk 1 Mean "<<rpcBXEndCap_[0]->GetMean();
|
246 |
leg->AddEntry(rpcBXEndCap_[0],legend.str().c_str(),"l");
|
247 |
|
248 |
float max = rpcBXEndCap_[0]->GetBinContent(rpcBXEndCap_[0]->GetMaximumBin());
|
249 |
|
250 |
for(int i=1; i<3;i++){
|
251 |
rpcBXEndCap_[i]->SetLineColor(i+1);
|
252 |
legend.str("");
|
253 |
legend<<"BX Disk "<<i+1<<" Mean "<<rpcBXEndCap_[i]->GetMean();
|
254 |
leg->AddEntry(rpcBXEndCap_[i],legend.str().c_str(),"l");
|
255 |
rpcBXEndCap_[i]->SetLineWidth(3);
|
256 |
rpcBXEndCap_[i]->Draw("same");
|
257 |
float thismax = rpcBXEndCap_[i]->GetBinContent(rpcBXEndCap_[i]->GetMaximumBin());
|
258 |
if(thismax > max) max = thismax;
|
259 |
}
|
260 |
|
261 |
for(int i=0; i<3;i++)rpcBXEndCap_[i]->SetMaximum(max);
|
262 |
|
263 |
leg->Draw("same");
|
264 |
gStyle->SetOptStat(0);
|
265 |
gStyle->SetOptTitle(0);
|
266 |
|
267 |
t.Print("digi/RPCEBX.png");
|
268 |
|
269 |
exit(0);
|
270 |
|
271 |
}
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|