ATLAS Offline Software
Loading...
Searching...
No Matches
HitStatistics Class Reference
Inheritance diagram for HitStatistics:
Collaboration diagram for HitStatistics:

Public Member Functions

 HitStatistics (char *, bool)

Detailed Description

Definition at line 144 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ HitStatistics()

HitStatistics::HitStatistics ( char * infile,
bool isAr = false )

Definition at line 150 of file TRTCalib_makeplots.cxx.

151{
152
153 TFile *file = new TFile(infile);
154 cout << " In HitStatistics infile: " << infile << endl;
155 file->cd();
156 TNtuple *Strawtuple = nullptr;
157 TNtuple *Chiptuple = nullptr;
158 TNtuple *Boardtuple = nullptr;
159 TNtuple *Moduletuple = nullptr;
160 TNtuple *Layertuple = nullptr;
161 TNtuple *Detectortuple = nullptr;
162 TNtuple *conftup = nullptr;
163
164 if (!isAr)
165 {
166 Strawtuple = (TNtuple *)file->Get("Strawtuple");
167 Chiptuple = (TNtuple *)file->Get("Chiptuple");
168 Boardtuple = (TNtuple *)file->Get("Boardtuple");
169 Moduletuple = (TNtuple *)file->Get("Moduletuple");
170 Layertuple = (TNtuple *)file->Get("Layertuple");
171 Detectortuple = (TNtuple *)file->Get("Detectortuple");
172 conftup = (TNtuple *)file->Get("configs");
173 }
174 else
175 {
176 Strawtuple = (TNtuple *)file->Get("Straw_Artuple");
177 Chiptuple = (TNtuple *)file->Get("Chip_Artuple");
178 Boardtuple = (TNtuple *)file->Get("Board_Artuple");
179 Moduletuple = (TNtuple *)file->Get("Module_Artuple");
180 Layertuple = (TNtuple *)file->Get("Layer_Artuple");
181 Detectortuple = (TNtuple *)file->Get("Detector_Artuple");
182 conftup = (TNtuple *)file->Get("configs");
183 }
184
185 float mint0 = 500, minrt = 10000;
186 if (conftup)
187 {
188 conftup->SetBranchAddress("mint0", &mint0);
189 conftup->SetBranchAddress("minrt", &minrt);
190 conftup->GetEntry(0);
191 }
192
193 this->SetName("c1");
194 this->cd();
195 this->Divide(3, 2, 0.01, 0.01);
196
197 ((TPad *)this->GetPrimitive("c1_1"))->SetFrameFillColor(0);
198 ((TPad *)this->GetPrimitive("c1_2"))->SetFrameFillColor(0);
199 ((TPad *)this->GetPrimitive("c1_3"))->SetFrameFillColor(0);
200 ((TPad *)this->GetPrimitive("c1_4"))->SetFrameFillColor(0);
201 ((TPad *)this->GetPrimitive("c1_5"))->SetFrameFillColor(0);
202 ((TPad *)this->GetPrimitive("c1_6"))->SetFrameFillColor(0);
203
204 ((TPad *)this->GetPrimitive("c1_1"))->SetLogy();
205 ((TPad *)this->GetPrimitive("c1_2"))->SetLogy();
206 ((TPad *)this->GetPrimitive("c1_3"))->SetLogy();
207 ((TPad *)this->GetPrimitive("c1_4"))->SetLogy();
208 ((TPad *)this->GetPrimitive("c1_5"))->SetLogy();
209 ((TPad *)this->GetPrimitive("c1_6"))->SetLogy();
210
211 TLegend *leg = new TLegend(0.95, 0.6, 0.35, 0.35);
212
213 this->cd(1);
214 this->SetLogx();
215 NHitStack *hsStraw = new NHitStack(Strawtuple, leg, false, (int)mint0, (int)minrt);
216 hsStraw->SetTitle("Hit Statistics (Straw)");
217 if (isAr)
218 hsStraw->SetTitle("Hit Statistics (Argon Straw)");
219 hsStraw->Draw();
220 hsStraw->GetHistogram()->GetXaxis()->SetTitle("No. Hits");
221 hsStraw->GetHistogram()->GetYaxis()->SetTitle("No. Straws");
222 hsStraw->GetHistogram()->GetXaxis()->SetNdivisions(-4);
223 this->cd(2);
224 this->SetLogx();
225 NHitStack *hsChip = new NHitStack(Chiptuple, leg, false, (int)mint0, (int)minrt);
226 hsChip->SetTitle("Hit Statistics (Chip)");
227 if (isAr)
228 hsChip->SetTitle("Hit Statistics (Argon chip)");
229 hsChip->Draw();
230 hsChip->GetHistogram()->GetXaxis()->SetTitle("No. Hits");
231 hsChip->GetHistogram()->GetYaxis()->SetTitle("No. Chips");
232 hsChip->GetHistogram()->GetXaxis()->SetNdivisions(-4);
233 this->cd(3);
234 this->SetLogx();
235 NHitStack *hsBoard = new NHitStack(Boardtuple, leg, false, (int)mint0, (int)minrt);
236 hsBoard->SetTitle("Hit Statistics (Board)");
237 if (isAr)
238 hsBoard->SetTitle("Hit Statistics (Argon Board)");
239 hsBoard->Draw();
240 hsBoard->GetHistogram()->GetXaxis()->SetTitle("No. Hits");
241 hsBoard->GetHistogram()->GetYaxis()->SetTitle("No. Boards");
242 hsBoard->GetHistogram()->GetXaxis()->SetNdivisions(-4);
243 this->cd(4);
244 this->SetLogx();
245 NHitStack *hsModule = new NHitStack(Moduletuple, leg, false, (int)mint0, (int)minrt);
246 hsModule->SetTitle("Hit Statistics (Phi Sector)");
247 if (isAr)
248 hsModule->SetTitle("Hit Statistics (Argon Phi Sector)");
249 hsModule->Draw();
250 hsModule->GetHistogram()->GetXaxis()->SetTitle("No. Hits");
251 hsModule->GetHistogram()->GetYaxis()->SetTitle("No. Phi Sectors");
252 hsModule->GetHistogram()->GetXaxis()->SetNdivisions(-4);
253 this->cd(5);
254 this->SetLogx();
255 NHitStack *hsLayer = new NHitStack(Layertuple, leg, false, (int)mint0, (int)minrt);
256 hsLayer->SetTitle("Hit Statistics (Layer/wheel)");
257 if (isAr)
258 hsLayer->SetTitle("Hit Statistics (Argon Layer/wheel)");
259 hsLayer->Draw();
260 hsLayer->GetHistogram()->GetXaxis()->SetTitle("No. Hits");
261 hsLayer->GetHistogram()->GetYaxis()->SetTitle("No. Layers/wheel");
262 hsLayer->GetHistogram()->GetXaxis()->SetNdivisions(-4);
263 this->cd(6);
264 this->SetLogx();
265 NHitStack *hsDetector = new NHitStack(Detectortuple, leg, true, (int)mint0, (int)minrt);
266 hsDetector->SetTitle("Hit Statistics (Detector)");
267 if (isAr)
268 hsDetector->SetTitle("Argon Hit Statistics (Detector)");
269 hsDetector->Draw();
270 hsDetector->GetHistogram()->GetXaxis()->SetTitle("No. Hits");
271 hsDetector->GetHistogram()->GetYaxis()->SetTitle("No. Detectors");
272 hsDetector->GetHistogram()->GetXaxis()->SetNdivisions(-4);
273
274 leg->Draw();
275}
str infile
Definition run.py:13
TFile * file

The documentation for this class was generated from the following file: