ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_RDOAnalysis.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#include "TRT_RDOAnalysis.h"
8
9#include "TTree.h"
10#include "TString.h"
11
12#include <algorithm>
13#include <math.h>
14#include <functional>
15#include <iostream>
16
17TRT_RDOAnalysis::TRT_RDOAnalysis(const std::string& name, ISvcLocator *pSvcLocator)
18 : AthAlgorithm(name, pSvcLocator)
19 , m_inputKey("TRT_RDOs")
20 , m_inputTruthKey("TRT_SDO_Map")
21 , m_trtID(nullptr)
22 , m_rdoID(0)
23 , m_rdoWord(0)
25 , m_phiModule(0)
26 , m_layerWheel(0)
27 , m_strawLayer(0)
28 , m_straw(0)
29 , m_highLevel(0)
32 , m_trailEdge(0)
33 , m_firstBin(0)
34 , m_lastBin(0)
35 , m_sdoID(0)
36 , m_sdoWord(0)
41 , m_straw_sdo(0)
42 , m_aboveThresh(0)
43 , m_deadChan(0)
44 , m_RODdata(0)
45 , m_validStraw(0)
46 , m_hit(0)
47 , m_barcode(0)
48 , m_eventIndex(0)
49 , m_charge(0)
50 , m_barcode_vec(0)
52 , m_charge_vec(0)
53
54 , m_h_rdoID(0)
55 , m_h_rdoWord(0)
57 , m_h_phiModule(0)
60 , m_h_straw(0)
61 , m_h_ToT(0)
62 , m_h_ToT_HL(0)
64 , m_h_trailEdge(0)
65 , m_h_brlPhiMod(0)
66 , m_h_brlLayer(0)
68 , m_h_brlStraw(0)
69 , m_h_brlToT(0)
70 , m_h_brlToT_HL(0)
73 , m_h_ecPhiMod(0)
74 , m_h_ecWheel(0)
76 , m_h_ecStraw(0)
77 , m_h_ecToT(0)
78 , m_h_ecToT_HL(0)
81 , m_h_sdoID(0)
82 , m_h_sdoWord(0)
87 , m_h_straw_sdo(0)
88 , m_h_barcode(0)
90 , m_h_charge(0)
91
92 , m_tree(0)
93 , m_ntupleFileName("/ntuples/file1")
94 , m_ntupleDirName("/TRT_RDOAnalysis/")
95 , m_ntupleTreeName("TRT_RDOAna")
96 , m_path("/TRT_RDOAnalysis/")
97 , m_thistSvc("THistSvc", name)
98{
99 declareProperty("InputKey", m_inputKey);
100 declareProperty("InputTruthKey", m_inputTruthKey);
101 declareProperty("NtupleFileName", m_ntupleFileName);
102 declareProperty("NtupleDirectoryName", m_ntupleDirName);
103 declareProperty("NtupleTreeName", m_ntupleTreeName);
104 declareProperty("HistPath", m_path);
105}
106
108 ATH_MSG_DEBUG( "Initializing TRT_RDOAnalysis" );
109
110 // This will check that the properties were initialized
111 // properly by job configuration.
112 ATH_CHECK( m_inputKey.initialize() );
113 ATH_CHECK( m_inputTruthKey.initialize() );
114
115 // Grab TRT_ID helper
116 ATH_CHECK(detStore()->retrieve(m_trtID, "TRT_ID"));
117
118 // Grab Ntuple and histogramming service for tree
119 ATH_CHECK(m_thistSvc.retrieve());
120
121 // ntuple branches
122 m_tree = new TTree(TString(m_ntupleTreeName), "TRT_RDOAna");
123 std::string fullNtupleName = m_ntupleFileName + m_ntupleDirName + m_ntupleTreeName;
124 ATH_CHECK(m_thistSvc->regTree(fullNtupleName,m_tree));
125 if (m_tree) {
126 // TRT RDO
127 m_tree->Branch("rdoID", &m_rdoID);
128 m_tree->Branch("rdoWord", &m_rdoWord);
129 m_tree->Branch("barrelEndcap", &m_barrelEndcap);
130 m_tree->Branch("phiModule", &m_phiModule);
131 m_tree->Branch("layerWheel", &m_layerWheel);
132 m_tree->Branch("strawLayer", &m_strawLayer);
133 m_tree->Branch("straw", &m_straw);
134 m_tree->Branch("highLevel", &m_highLevel);
135 m_tree->Branch("timeOverThreshold", &m_timeOverThreshold);
136 m_tree->Branch("driftTimeBin", &m_driftTimeBin);
137 m_tree->Branch("trailEdge", &m_trailEdge);
138 m_tree->Branch("firstBin", &m_firstBin);
139 m_tree->Branch("lastBin", &m_lastBin);
140 // TRT SDO deposits
141 m_tree->Branch("sdoID", &m_sdoID);
142 m_tree->Branch("sdoWord", &m_sdoWord);
143 m_tree->Branch("barrelEndcap_sdo", &m_barrelEndcap_sdo);
144 m_tree->Branch("phiModule_sdo", &m_phiModule_sdo);
145 m_tree->Branch("layerWheel_sdo", &m_layerWheel_sdo);
146 m_tree->Branch("strawLayer_sdo", &m_strawLayer_sdo);
147 m_tree->Branch("straw_sdo", &m_straw_sdo);
148 m_tree->Branch("aboveThresh", &m_aboveThresh);
149 m_tree->Branch("deadChan", &m_deadChan);
150 m_tree->Branch("RODdata", &m_RODdata);
151 m_tree->Branch("validStraw", &m_validStraw);
152 m_tree->Branch("hit", &m_hit);
153 m_tree->Branch("barcode", &m_barcode);
154 m_tree->Branch("eventIndex", &m_eventIndex);
155 m_tree->Branch("charge", &m_charge);
156 m_tree->Branch("barcode_vec", &m_barcode_vec);
157 m_tree->Branch("eventIndex_vec", &m_eventIndex_vec);
158 m_tree->Branch("charge_vec", &m_charge_vec);
159 }
160 else {
161 ATH_MSG_ERROR("No tree found!");
162 }
163
164 // HISTOGRAMS
165 m_h_rdoID = new TH1F("h_rdoID", "rdoID", 100, 0, 2e18);
166 m_h_rdoID->StatOverflows();
167 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_rdoID->GetName(), m_h_rdoID));
168
169 m_h_rdoWord = new TH1F("h_rdoWord", "rdoWord", 100, 0, 1.5e8);
170 m_h_rdoWord->StatOverflows();
171 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_rdoWord->GetName(), m_h_rdoWord));
172
173 m_h_barrelEndcap = new TH1F("h_barrelEndcap", "Barrel or Endcap", 100, -3.5, 3.5);
174 m_h_barrelEndcap->StatOverflows();
176
177 m_h_phiModule = new TH1F("h_phiModule", "Phi module", 100, 0, 35);
178 m_h_phiModule->StatOverflows();
179 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_phiModule->GetName(), m_h_phiModule));
180
181 m_h_layerWheel = new TH1F("h_layerWheel", "Barrel layer or Endcap wheel", 100, 0, 20);
182 m_h_layerWheel->StatOverflows();
184
185 m_h_strawLayer = new TH1F("h_strawLayer", "Straw layer", 100, 0, 35);
186 m_h_strawLayer->StatOverflows();
188
189 m_h_straw = new TH1F("h_straw", "Straw", 100, 0, 1000);
190 m_h_straw->StatOverflows();
191 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_straw->GetName(), m_h_straw));
192
193 m_h_ToT = new TH1F("h_ToT", "Time over Threshold", 100, 0, 100);
194 m_h_ToT->StatOverflows();
195 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_ToT->GetName(), m_h_ToT));
196
197 m_h_ToT_HL = new TH1F("h_ToT_HL", "Time over Threshold (highLevel)", 100, 0, 100);
198 m_h_ToT_HL->StatOverflows();
199 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_ToT_HL->GetName(), m_h_ToT_HL));
200
201 m_h_driftTimeBin = new TH1F("h_driftTimeBin", "Drift Time Bin", 100, 0, 30);
202 m_h_driftTimeBin->StatOverflows();
204
205 m_h_trailEdge = new TH1F("h_trailEdge", "Trailing Edge", 100, 0, 30);
206 m_h_trailEdge->StatOverflows();
207 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_trailEdge->GetName(), m_h_trailEdge));
208
209 m_h_brlPhiMod = new TH1F("h_brlPhiMod", "Barrel phi module", 100, 0, 35);
210 m_h_brlPhiMod->StatOverflows();
211 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_brlPhiMod->GetName(), m_h_brlPhiMod));
212
213 m_h_brlLayer = new TH1F("h_brlLayer", "Barrel layer", 100, 0, 20);
214 m_h_brlLayer->StatOverflows();
215 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_brlLayer->GetName(), m_h_brlLayer));
216
217 m_h_brlStrawLayer = new TH1F("h_brlStrawLayer", "Barrel straw layer", 100, 0, 35);
218 m_h_brlStrawLayer->StatOverflows();
220
221 m_h_brlStraw = new TH1F("h_brlStraw", "Barrel straw", 100, 0, 1000);
222 m_h_brlStraw->StatOverflows();
223 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_brlStraw->GetName(), m_h_brlStraw));
224
225 m_h_brlToT = new TH1F("h_brlToT", "Barrel Time over Threshold", 100, 0, 100);
226 m_h_brlToT->StatOverflows();
227 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_brlToT->GetName(), m_h_brlToT));
228
229 m_h_brlToT_HL = new TH1F("h_brlToT_HL", "Barrel Time over Threshold (highLevel)", 100, 0, 100);
230 m_h_brlToT_HL->StatOverflows();
231 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_brlToT_HL->GetName(), m_h_brlToT_HL));
232
233 m_h_brlDriftTimeBin = new TH1F("h_brlDriftTimeBin", "Barrel Drift Time Bin", 100, 0, 30);
234 m_h_brlDriftTimeBin->StatOverflows();
236
237 m_h_brlTrailEdge = new TH1F("h_brlTrailEdge", "Barrel Trailing Edge", 100, 0, 30);
238 m_h_brlTrailEdge->StatOverflows();
240
241 m_h_ecPhiMod = new TH1F("h_ecPhiMod", "Endcap phi module", 100, 0, 35);
242 m_h_ecPhiMod->StatOverflows();
243 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_ecPhiMod->GetName(), m_h_ecPhiMod));
244
245 m_h_ecWheel = new TH1F("h_ecWheel", "Endcap wheel", 100, 0, 20);
246 m_h_ecWheel->StatOverflows();
247 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_ecWheel->GetName(), m_h_ecWheel));
248
249 m_h_ecStrawLayer = new TH1F("h_ecStrawLayer", "Endcap straw layer", 100, 0, 35);
250 m_h_ecStrawLayer->StatOverflows();
252
253 m_h_ecStraw = new TH1F("h_ecStraw", "Endcap straw", 100, 0, 1000);
254 m_h_ecStraw->StatOverflows();
255 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_ecStraw->GetName(), m_h_ecStraw));
256
257 m_h_ecToT = new TH1F("h_ecToT", "Endcap Time over Threshold", 100, 0, 100);
258 m_h_ecToT->StatOverflows();
259 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_ecToT->GetName(), m_h_ecToT));
260
261 m_h_ecToT_HL = new TH1F("h_ecToT_HL", "Endcap Time over Threshold (highLevel)", 100, 0, 100);
262 m_h_ecToT_HL->StatOverflows();
263 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_ecToT_HL->GetName(), m_h_ecToT_HL));
264
265 m_h_ecDriftTimeBin = new TH1F("h_ecDriftTimeBin", "Endcap Drift Time Bin", 100, 0, 30);
266 m_h_ecDriftTimeBin->StatOverflows();
268
269 m_h_ecTrailEdge = new TH1F("h_ecTrailEdge", "Endcap Trailing Edge", 100, 0, 30);
270 m_h_ecTrailEdge->StatOverflows();
272
273 m_h_sdoID = new TH1F("h_sdoID", "sdoID", 100, 0, 2.5e18);
274 m_h_sdoID->StatOverflows();
275 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_sdoID->GetName(), m_h_sdoID));
276
277 m_h_sdoWord = new TH1F("h_sdoWord", "sdoWord", 100, 0, 10);
278 m_h_sdoWord->StatOverflows();
279 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_sdoWord->GetName(), m_h_sdoWord));
280
281 m_h_barrelEndcap_sdo = new TH1F("h_barrelEndcap_sdo", "Barrel or Endcap (sdo)", 100, -3.5, 3.5);
282 m_h_barrelEndcap_sdo->StatOverflows();
284
285 m_h_phiModule_sdo = new TH1F("h_phiModule_sdo", "Phi module (sdo)", 100, 0, 35);
286 m_h_phiModule_sdo->StatOverflows();
288
289 m_h_layerWheel_sdo = new TH1F("h_layerWheel_sdo", "Barrel layer or Endcap wheel (sdo)", 100, 0, 20);
290 m_h_layerWheel_sdo->StatOverflows();
292
293 m_h_strawLayer_sdo = new TH1F("h_strawLayer_sdo", "Straw layer (sdo)", 100, 0, 35);
294 m_h_strawLayer_sdo->StatOverflows();
296
297 m_h_straw_sdo = new TH1F("h_straw_sdo", "Straw (sdo)", 100, 0, 1000);
298 m_h_straw_sdo->StatOverflows();
299 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_straw_sdo->GetName(), m_h_straw_sdo));
300
301 m_h_barcode = new TH1F("h_barcode", "Barcode (sdo)", 100, 0, 2.2e5);
302 m_h_barcode->StatOverflows();
303 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_barcode->GetName(), m_h_barcode));
304
305 m_h_eventIndex = new TH1F("h_eventIndex", "Event index (sdo)", 100, 0, 10);
306 m_h_eventIndex->StatOverflows();
308
309 m_h_charge = new TH1F("h_charge", "Charge (sdo)", 100, 0, 500);
310 m_h_charge->StatOverflows();
311 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_charge->GetName(), m_h_charge));
312
313 return StatusCode::SUCCESS;
314}
315
317 ATH_MSG_DEBUG( "In TRT_RDOAnalysis::execute()" );
318
319 m_rdoID->clear();
320 m_rdoWord->clear();
321 m_barrelEndcap->clear();
322 m_phiModule->clear();
323 m_layerWheel->clear();
324 m_strawLayer->clear();
325 m_straw->clear();
326 m_highLevel->clear();
327 m_timeOverThreshold->clear();
328 m_driftTimeBin->clear();
329 m_trailEdge->clear();
330 m_firstBin->clear();
331 m_lastBin->clear();
332 m_sdoID->clear();
333 m_sdoWord->clear();
334 m_barrelEndcap_sdo->clear();
335 m_phiModule_sdo->clear();
336 m_layerWheel_sdo->clear();
337 m_strawLayer_sdo->clear();
338 m_straw_sdo->clear();
339 m_aboveThresh->clear();
340 m_deadChan->clear();
341 m_RODdata->clear();
342 m_validStraw->clear();
343 m_hit->clear();
344 m_barcode->clear();
345 m_eventIndex->clear();
346 m_charge->clear();
347 m_barcode_vec->clear();
348 m_eventIndex_vec->clear();
349 m_charge_vec->clear();
350
351 // RawData
353 if(p_TRT_RDO_cont.isValid()) {
354 // loop over RDO container
355 TRT_RDO_Container::const_iterator rdoCont_itr(p_TRT_RDO_cont->begin());
356 const TRT_RDO_Container::const_iterator rdoCont_end(p_TRT_RDO_cont->end());
357
358 for ( ; rdoCont_itr != rdoCont_end; ++rdoCont_itr ) {
359 const TRT_RDO_Collection* p_TRT_RDO_coll(*rdoCont_itr);
360 TRT_RDO_Collection::const_iterator rdo_itr(p_TRT_RDO_coll->begin());
361 const TRT_RDO_Collection::const_iterator rdo_end(p_TRT_RDO_coll->end());
362
363 for ( ; rdo_itr != rdo_end; ++rdo_itr ) {
364 const Identifier rdoID((*rdo_itr)->identify());
365 const unsigned int rdoWord((*rdo_itr)->getWord());
366 const int trtBrlEc(m_trtID->barrel_ec(rdoID));
367 const int trtPhiMod(m_trtID->phi_module(rdoID));
368 const int trtLayerWheel(m_trtID->layer_or_wheel(rdoID));
369 const int trtStrawLayer(m_trtID->straw_layer(rdoID));
370 const int trtStraw(m_trtID->straw(rdoID));
371 const bool trtHL((*rdo_itr)->highLevel());
372 const double trtToT((*rdo_itr)->timeOverThreshold());
373 const int trtDriftTimeBin((*rdo_itr)->driftTimeBin());
374 const int trtTrailEdge = dynamic_cast<const TRT_LoLumRawData*>(*rdo_itr)->trailingEdge();
375 const bool trtFirstBin = dynamic_cast<const TRT_LoLumRawData*>(*rdo_itr)->firstBinHigh();
376 const bool trtLastBin = dynamic_cast<const TRT_LoLumRawData*>(*rdo_itr)->lastBinHigh();
377
378 const unsigned long long rdoID_int = rdoID.get_compact();
379 m_rdoID->push_back(rdoID_int);
380 m_rdoWord->push_back(rdoWord);
381 m_barrelEndcap->push_back(trtBrlEc);
382 m_phiModule->push_back(trtPhiMod);
383 m_layerWheel->push_back(trtLayerWheel);
384 m_strawLayer->push_back(trtStrawLayer);
385 m_straw->push_back(trtStraw);
386 m_highLevel->push_back(trtHL);
387 m_timeOverThreshold->push_back(trtToT);
388 m_driftTimeBin->push_back(trtDriftTimeBin);
389 m_trailEdge->push_back(trtTrailEdge);
390 m_firstBin->push_back(trtFirstBin);
391 m_lastBin->push_back(trtLastBin);
392
393 m_h_rdoID->Fill(rdoID_int);
394 m_h_rdoWord->Fill(rdoWord);
395 m_h_barrelEndcap->Fill(trtBrlEc);
396 m_h_phiModule->Fill(trtPhiMod);
397 m_h_layerWheel->Fill(trtLayerWheel);
398 m_h_strawLayer->Fill(trtStrawLayer);
399 m_h_straw->Fill(trtStraw);
400 m_h_ToT->Fill(trtToT);
401 if (trtHL) {
402 m_h_ToT_HL->Fill(trtToT);
403 }
404 m_h_driftTimeBin->Fill(trtDriftTimeBin);
405 m_h_trailEdge->Fill(trtTrailEdge);
406
407 if (abs(trtBrlEc) == 1) {
408 m_h_brlPhiMod->Fill(trtPhiMod);
409 m_h_brlLayer->Fill(trtLayerWheel);
410 m_h_brlStrawLayer->Fill(trtStrawLayer);
411 m_h_brlStraw->Fill(trtStraw);
412 m_h_brlToT->Fill(trtToT);
413 if (trtHL) {
414 m_h_brlToT_HL->Fill(trtToT);
415 }
416 m_h_brlDriftTimeBin->Fill(trtDriftTimeBin);
417 m_h_brlTrailEdge->Fill(trtTrailEdge);
418 }
419 else if (abs(trtBrlEc) == 2) {
420 m_h_ecPhiMod->Fill(trtPhiMod);
421 m_h_ecWheel->Fill(trtLayerWheel);
422 m_h_ecStrawLayer->Fill(trtStrawLayer);
423 m_h_ecStraw->Fill(trtStraw);
424 m_h_ecToT->Fill(trtToT);
425 if (trtHL) {
426 m_h_ecToT_HL->Fill(trtToT);
427 }
428 m_h_ecDriftTimeBin->Fill(trtDriftTimeBin);
429 m_h_ecTrailEdge->Fill(trtTrailEdge);
430 }
431 }
432 }
433 }
434
435 // SimData
437 if(simDataMapTRT.isValid()) {
438 // loop over SDO container
439 InDetSimDataCollection::const_iterator sdo_itr(simDataMapTRT->begin());
440 const InDetSimDataCollection::const_iterator sdo_end(simDataMapTRT->end());
441
442 std::vector<int> barcode_vec;
443 std::vector<int> eventIndex_vec;
444 std::vector<float> charge_vec;
445 for ( ; sdo_itr != sdo_end; ++sdo_itr ) {
446 const Identifier sdoID((*sdo_itr).first);
447 const InDetSimData& sdo((*sdo_itr).second);
448
449 const unsigned long long sdoID_int = sdoID.get_compact();
450 const int sdoWord(sdo.word());
451 const int trtBrlEc_sdo(m_trtID->barrel_ec(sdoID));
452 const int trtPhiMod_sdo(m_trtID->phi_module(sdoID));
453 const int trtLayerWheel_sdo(m_trtID->layer_or_wheel(sdoID));
454 const int trtStrawLayer_sdo(m_trtID->straw_layer(sdoID));
455 const int trtStraw_sdo(m_trtID->straw(sdoID));
456 const bool aboveThresh(TRT_SimHelper::isAboveTR_Thresh(sdo));
457 const bool deadChan(TRT_SimHelper::isDeadChannel(sdo));
458 const bool rodData(TRT_SimHelper::isRodData(sdo));
459 const bool validStraw(TRT_SimHelper::isValidStraw(sdo));
460 const bool hit(TRT_SimHelper::HasHit(sdo));
461
462 m_sdoID->push_back(sdoID_int);
463 m_sdoWord->push_back(sdoWord);
464 m_barrelEndcap_sdo->push_back(trtBrlEc_sdo);
465 m_phiModule_sdo->push_back(trtPhiMod_sdo);
466 m_layerWheel_sdo->push_back(trtLayerWheel_sdo);
467 m_strawLayer_sdo->push_back(trtStrawLayer_sdo);
468 m_straw_sdo->push_back(trtStraw_sdo);
469 m_aboveThresh->push_back(aboveThresh);
470 m_deadChan->push_back(deadChan);
471 m_RODdata->push_back(rodData);
472 m_validStraw->push_back(validStraw);
473 m_hit->push_back(hit);
474
475 m_h_sdoID->Fill(sdoID_int);
476 m_h_sdoWord->Fill(sdoWord);
477 m_h_barrelEndcap_sdo->Fill(trtBrlEc_sdo);
478 m_h_phiModule_sdo->Fill(trtPhiMod_sdo);
479 m_h_layerWheel_sdo->Fill(trtLayerWheel_sdo);
480 m_h_strawLayer_sdo->Fill(trtStrawLayer_sdo);
481 m_h_straw_sdo->Fill(trtStraw_sdo);
482
483 // loop over deposits
484 // InDetSimData::Deposit typedef for std::pair<HepMcParticleLink, float>
485 const std::vector<InDetSimData::Deposit>& deposits = sdo.getdeposits();
486 std::vector<InDetSimData::Deposit>::const_iterator dep_itr(deposits.begin());
487 const std::vector<InDetSimData::Deposit>::const_iterator dep_end(deposits.end());
488
489 for ( ; dep_itr != dep_end; ++dep_itr ) {
490 const HepMcParticleLink& particleLink = (*dep_itr).first;
491 const int bar(HepMC::barcode(particleLink)); // FIXME barcode-based
492 const int eventIx(particleLink.eventIndex());
493 const float charge((*dep_itr).second);
494
495 m_barcode->push_back(bar);
496 m_eventIndex->push_back(eventIx);
497 m_charge->push_back(charge);
498
499 m_h_barcode->Fill(bar);
500 m_h_eventIndex->Fill(eventIx);
501 m_h_charge->Fill(charge);
502
503 barcode_vec.push_back(bar);
504 eventIndex_vec.push_back(eventIx);
505 charge_vec.push_back(charge);
506 }
507 m_barcode_vec->push_back(barcode_vec);
508 m_eventIndex_vec->push_back(eventIndex_vec);
509 m_charge_vec->push_back(charge_vec);
510 barcode_vec.clear();
511 eventIndex_vec.clear();
512 charge_vec.clear();
513 }
514 }
515
516 if (m_tree) {
517 m_tree->Fill();
518 }
519
520 return StatusCode::SUCCESS;
521}
522
524
525 return StatusCode::SUCCESS;
526
527}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
double charge(const T &p)
Definition AtlasPID.h:997
Handle class for reading from StoreGate.
InDetRawDataCollection< TRT_RDORawData > TRT_RDO_Collection
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
const_iterator begin() const noexcept
value_type get_compact() const
Get the compact id.
int word() const
const std::vector< Deposit > & getdeposits() const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
bool firstBinHigh() const
bool lastBinHigh() const
int trailingEdge() const
std::vector< unsigned long long > * m_sdoID
std::vector< int > * m_strawLayer
std::vector< bool > * m_RODdata
virtual StatusCode finalize() override final
std::string m_ntupleFileName
std::string m_ntupleTreeName
std::vector< bool > * m_aboveThresh
std::vector< bool > * m_highLevel
std::vector< int > * m_phiModule_sdo
std::string m_ntupleDirName
std::vector< int > * m_sdoWord
const TRT_ID * m_trtID
std::vector< unsigned long long > * m_rdoID
SG::ReadHandleKey< InDetSimDataCollection > m_inputTruthKey
std::vector< std::vector< int > > * m_eventIndex_vec
SG::ReadHandleKey< TRT_RDO_Container > m_inputKey
std::vector< std::vector< float > > * m_charge_vec
std::vector< bool > * m_hit
std::vector< int > * m_driftTimeBin
std::vector< int > * m_barrelEndcap
std::vector< double > * m_timeOverThreshold
std::vector< int > * m_eventIndex
std::vector< int > * m_straw_sdo
std::vector< bool > * m_deadChan
std::vector< bool > * m_validStraw
std::vector< std::vector< int > > * m_barcode_vec
std::vector< int > * m_straw
std::vector< unsigned int > * m_rdoWord
std::vector< int > * m_barrelEndcap_sdo
std::vector< int > * m_barcode
std::vector< int > * m_phiModule
std::vector< int > * m_strawLayer_sdo
TRT_RDOAnalysis(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< int > * m_layerWheel
virtual StatusCode execute() override final
ServiceHandle< ITHistSvc > m_thistSvc
std::vector< int > * m_layerWheel_sdo
std::vector< float > * m_charge
std::vector< bool > * m_firstBin
std::vector< int > * m_trailEdge
virtual StatusCode initialize() override final
std::vector< bool > * m_lastBin
static bool HasHit(const InDetSimData &sdo)
static bool isDeadChannel(const InDetSimData &sdo)
static bool isAboveTR_Thresh(const InDetSimData &sdo)
static bool isValidStraw(const InDetSimData &sdo)
static bool isRodData(const InDetSimData &sdo)
int barcode(const T *p)
Definition Barcode.h:16