ATLAS Offline Software
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"
7 #include "StoreGate/ReadHandle.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 
17 TRT_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)
24  , m_barrelEndcap(0)
25  , m_phiModule(0)
26  , m_layerWheel(0)
27  , m_strawLayer(0)
28  , m_straw(0)
29  , m_highLevel(0)
30  , m_timeOverThreshold(0)
31  , m_driftTimeBin(0)
32  , m_trailEdge(0)
33  , m_firstBin(0)
34  , m_lastBin(0)
35  , m_sdoID(0)
36  , m_sdoWord(0)
37  , m_barrelEndcap_sdo(0)
38  , m_phiModule_sdo(0)
39  , m_layerWheel_sdo(0)
40  , m_strawLayer_sdo(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)
51  , m_eventIndex_vec(0)
52  , m_charge_vec(0)
53 
54  , m_h_rdoID(0)
55  , m_h_rdoWord(0)
56  , m_h_barrelEndcap(0)
57  , m_h_phiModule(0)
58  , m_h_layerWheel(0)
59  , m_h_strawLayer(0)
60  , m_h_straw(0)
61  , m_h_ToT(0)
62  , m_h_ToT_HL(0)
63  , m_h_driftTimeBin(0)
64  , m_h_trailEdge(0)
65  , m_h_brlPhiMod(0)
66  , m_h_brlLayer(0)
67  , m_h_brlStrawLayer(0)
68  , m_h_brlStraw(0)
69  , m_h_brlToT(0)
70  , m_h_brlToT_HL(0)
71  , m_h_brlDriftTimeBin(0)
72  , m_h_brlTrailEdge(0)
73  , m_h_ecPhiMod(0)
74  , m_h_ecWheel(0)
75  , m_h_ecStrawLayer(0)
76  , m_h_ecStraw(0)
77  , m_h_ecToT(0)
78  , m_h_ecToT_HL(0)
79  , m_h_ecDriftTimeBin(0)
80  , m_h_ecTrailEdge(0)
81  , m_h_sdoID(0)
82  , m_h_sdoWord(0)
83  , m_h_barrelEndcap_sdo(0)
84  , m_h_phiModule_sdo(0)
85  , m_h_layerWheel_sdo(0)
86  , m_h_strawLayer_sdo(0)
87  , m_h_straw_sdo(0)
88  , m_h_barcode(0)
89  , m_h_eventIndex(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() );
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();
183  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_layerWheel->GetName(), m_h_layerWheel));
184 
185  m_h_strawLayer = new TH1F("h_strawLayer", "Straw layer", 100, 0, 35);
186  m_h_strawLayer->StatOverflows();
187  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_strawLayer->GetName(), m_h_strawLayer));
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();
271  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_ecTrailEdge->GetName(), m_h_ecTrailEdge));
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();
307  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_eventIndex->GetName(), m_h_eventIndex));
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 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TRT_RDOAnalysis::m_barcode
std::vector< int > * m_barcode
Definition: TRT_RDOAnalysis.h:77
TRT_RDOAnalysis::m_h_trailEdge
TH1 * m_h_trailEdge
Definition: TRT_RDOAnalysis.h:95
TRT_RDOAnalysis::m_rdoWord
std::vector< unsigned int > * m_rdoWord
Definition: TRT_RDOAnalysis.h:47
TRT_SimHelper::isDeadChannel
static bool isDeadChannel(const InDetSimData &sdo)
Definition: TRT_SimHelper.h:138
TRT_RDOAnalysis::m_strawLayer
std::vector< int > * m_strawLayer
Definition: TRT_RDOAnalysis.h:52
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TRT_RDOAnalysis::m_barrelEndcap_sdo
std::vector< int > * m_barrelEndcap_sdo
Definition: TRT_RDOAnalysis.h:65
TRT_RDOAnalysis::m_layerWheel
std::vector< int > * m_layerWheel
Definition: TRT_RDOAnalysis.h:51
TRT_RDOAnalysis::m_h_charge
TH1 * m_h_charge
Definition: TRT_RDOAnalysis.h:124
InDetSimData::getdeposits
const std::vector< Deposit > & getdeposits() const
Definition: InDetSimData.h:74
TRT_RDOAnalysis::m_h_ecDriftTimeBin
TH1 * m_h_ecDriftTimeBin
Definition: TRT_RDOAnalysis.h:112
TRT_RDOAnalysis::m_strawLayer_sdo
std::vector< int > * m_strawLayer_sdo
Definition: TRT_RDOAnalysis.h:68
TRT_RDOAnalysis::finalize
virtual StatusCode finalize() override final
Definition: TRT_RDOAnalysis.cxx:523
TRT_LoLumRawData::lastBinHigh
bool lastBinHigh() const
Definition: TRT_LoLumRawData.h:165
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TRT_LoLumRawData
Definition: TRT_LoLumRawData.h:25
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TRT_RDOAnalysis::m_h_ToT_HL
TH1 * m_h_ToT_HL
Definition: TRT_RDOAnalysis.h:93
TRT_RDOAnalysis::m_h_brlToT_HL
TH1 * m_h_brlToT_HL
Definition: TRT_RDOAnalysis.h:102
TRT_RDOAnalysis::m_highLevel
std::vector< bool > * m_highLevel
Definition: TRT_RDOAnalysis.h:55
TRT_RDOAnalysis::m_straw
std::vector< int > * m_straw
Definition: TRT_RDOAnalysis.h:53
TRT_RDOAnalysis::m_driftTimeBin
std::vector< int > * m_driftTimeBin
Definition: TRT_RDOAnalysis.h:57
TRT_RDOAnalysis::m_h_ecToT
TH1 * m_h_ecToT
Definition: TRT_RDOAnalysis.h:110
TRT_SimHelper::isAboveTR_Thresh
static bool isAboveTR_Thresh(const InDetSimData &sdo)
Definition: TRT_SimHelper.h:133
TRT_SimHelper::isValidStraw
static bool isValidStraw(const InDetSimData &sdo)
Definition: TRT_SimHelper.h:148
TRT_RDOAnalysis::m_barrelEndcap
std::vector< int > * m_barrelEndcap
Definition: TRT_RDOAnalysis.h:49
Identifier::get_compact
value_type get_compact() const
Get the compact id.
TRT_RDOAnalysis::m_trailEdge
std::vector< int > * m_trailEdge
Definition: TRT_RDOAnalysis.h:58
TRT_RDOAnalysis::m_h_layerWheel
TH1 * m_h_layerWheel
Definition: TRT_RDOAnalysis.h:89
TRT_RDOAnalysis::m_rdoID
std::vector< unsigned long long > * m_rdoID
Definition: TRT_RDOAnalysis.h:46
TRT_SimHelper::isRodData
static bool isRodData(const InDetSimData &sdo)
Definition: TRT_SimHelper.h:143
TRT_RDOAnalysis::m_h_brlDriftTimeBin
TH1 * m_h_brlDriftTimeBin
Definition: TRT_RDOAnalysis.h:103
TRT_RDOAnalysis::m_sdoWord
std::vector< int > * m_sdoWord
Definition: TRT_RDOAnalysis.h:63
TRT_RDOAnalysis::m_h_ToT
TH1 * m_h_ToT
Definition: TRT_RDOAnalysis.h:92
TRT_RDOAnalysis::m_h_brlLayer
TH1 * m_h_brlLayer
Definition: TRT_RDOAnalysis.h:98
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
TRT_LoLumRawData::firstBinHigh
bool firstBinHigh() const
Definition: TRT_LoLumRawData.h:154
TRT_RDOAnalysis::m_h_ecPhiMod
TH1 * m_h_ecPhiMod
Definition: TRT_RDOAnalysis.h:106
TRT_RDOAnalysis::m_h_barrelEndcap_sdo
TH1 * m_h_barrelEndcap_sdo
Definition: TRT_RDOAnalysis.h:117
TRT_RDOAnalysis::m_path
std::string m_path
Definition: TRT_RDOAnalysis.h:130
TRT_ID::straw
int straw(const Identifier &id) const
Definition: TRT_ID.h:902
TRT_RDOAnalysis::m_phiModule_sdo
std::vector< int > * m_phiModule_sdo
Definition: TRT_RDOAnalysis.h:66
TRT_RDOAnalysis::m_eventIndex_vec
std::vector< std::vector< int > > * m_eventIndex_vec
Definition: TRT_RDOAnalysis.h:81
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TRT_RDOAnalysis::m_h_strawLayer_sdo
TH1 * m_h_strawLayer_sdo
Definition: TRT_RDOAnalysis.h:120
TRT_RDOAnalysis::m_inputKey
SG::ReadHandleKey< TRT_RDO_Container > m_inputKey
Definition: TRT_RDOAnalysis.h:40
TRT_RDOAnalysis::m_hit
std::vector< bool > * m_hit
Definition: TRT_RDOAnalysis.h:75
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
TRT_RDOAnalysis::m_RODdata
std::vector< bool > * m_RODdata
Definition: TRT_RDOAnalysis.h:73
m_path
std::string m_path
the path being used
Definition: OutputStreamData.cxx:88
InDetSimData
Definition: InDetSimData.h:42
TRT_RDOAnalysis::m_h_brlToT
TH1 * m_h_brlToT
Definition: TRT_RDOAnalysis.h:101
TRT_RDOAnalysis::m_h_ecStraw
TH1 * m_h_ecStraw
Definition: TRT_RDOAnalysis.h:109
TRT_RDOAnalysis.h
TRT_RDOAnalysis::m_charge_vec
std::vector< std::vector< float > > * m_charge_vec
Definition: TRT_RDOAnalysis.h:82
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
TRT_RDOAnalysis::m_h_rdoWord
TH1 * m_h_rdoWord
Definition: TRT_RDOAnalysis.h:86
TRT_RDOAnalysis::m_h_rdoID
TH1 * m_h_rdoID
Definition: TRT_RDOAnalysis.h:85
TRT_RDOAnalysis::m_ntupleDirName
std::string m_ntupleDirName
Definition: TRT_RDOAnalysis.h:128
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:239
TRT_RDOAnalysis::m_timeOverThreshold
std::vector< double > * m_timeOverThreshold
Definition: TRT_RDOAnalysis.h:56
TRT_RDOAnalysis::m_h_strawLayer
TH1 * m_h_strawLayer
Definition: TRT_RDOAnalysis.h:90
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:79
TRT_RDOAnalysis::m_trtID
const TRT_ID * m_trtID
Definition: TRT_RDOAnalysis.h:42
TRT_RDOAnalysis::m_charge
std::vector< float > * m_charge
Definition: TRT_RDOAnalysis.h:79
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:233
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:866
TRT_ID::straw_layer
int straw_layer(const Identifier &id) const
Definition: TRT_ID.h:893
TRT_ID::layer_or_wheel
int layer_or_wheel(const Identifier &id) const
Definition: TRT_ID.h:884
TRT_RDOAnalysis::m_h_sdoID
TH1 * m_h_sdoID
Definition: TRT_RDOAnalysis.h:115
TRT_RDOAnalysis::m_h_driftTimeBin
TH1 * m_h_driftTimeBin
Definition: TRT_RDOAnalysis.h:94
TRT_RDOAnalysis::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: TRT_RDOAnalysis.h:131
AthAlgorithm
Definition: AthAlgorithm.h:47
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TRT_RDOAnalysis::m_deadChan
std::vector< bool > * m_deadChan
Definition: TRT_RDOAnalysis.h:72
TRT_RDOAnalysis::m_h_ecToT_HL
TH1 * m_h_ecToT_HL
Definition: TRT_RDOAnalysis.h:111
TRT_RDOAnalysis::m_layerWheel_sdo
std::vector< int > * m_layerWheel_sdo
Definition: TRT_RDOAnalysis.h:67
python.SystemOfUnits.bar
int bar
Definition: SystemOfUnits.py:188
TRT_LoLumRawData::trailingEdge
int trailingEdge() const
Definition: TRT_LoLumRawData.h:66
TRT_RDOAnalysis::TRT_RDOAnalysis
TRT_RDOAnalysis(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TRT_RDOAnalysis.cxx:17
TRT_RDOAnalysis::m_validStraw
std::vector< bool > * m_validStraw
Definition: TRT_RDOAnalysis.h:74
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TRT_RDOAnalysis::m_h_barrelEndcap
TH1 * m_h_barrelEndcap
Definition: TRT_RDOAnalysis.h:87
TRT_RDOAnalysis::m_lastBin
std::vector< bool > * m_lastBin
Definition: TRT_RDOAnalysis.h:60
TRT_RDOAnalysis::execute
virtual StatusCode execute() override final
Definition: TRT_RDOAnalysis.cxx:316
TRT_RDOAnalysis::m_ntupleTreeName
std::string m_ntupleTreeName
Definition: TRT_RDOAnalysis.h:129
charge
double charge(const T &p)
Definition: AtlasPID.h:756
TRT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: TRT_ID.h:875
TRT_RDOAnalysis::m_aboveThresh
std::vector< bool > * m_aboveThresh
Definition: TRT_RDOAnalysis.h:71
TRT_RDOAnalysis::m_h_ecTrailEdge
TH1 * m_h_ecTrailEdge
Definition: TRT_RDOAnalysis.h:113
TRT_RDOAnalysis::m_barcode_vec
std::vector< std::vector< int > > * m_barcode_vec
Definition: TRT_RDOAnalysis.h:80
TRT_RDOAnalysis::m_phiModule
std::vector< int > * m_phiModule
Definition: TRT_RDOAnalysis.h:50
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
TRT_RDOAnalysis::m_h_layerWheel_sdo
TH1 * m_h_layerWheel_sdo
Definition: TRT_RDOAnalysis.h:119
TRT_RDOAnalysis::m_h_barcode
TH1 * m_h_barcode
Definition: TRT_RDOAnalysis.h:122
TRT_RDOAnalysis::m_h_ecStrawLayer
TH1 * m_h_ecStrawLayer
Definition: TRT_RDOAnalysis.h:108
TRT_RDOAnalysis::m_firstBin
std::vector< bool > * m_firstBin
Definition: TRT_RDOAnalysis.h:59
InDetSimData::word
int word() const
Definition: InDetSimData.h:69
TRT_RDOAnalysis::m_h_sdoWord
TH1 * m_h_sdoWord
Definition: TRT_RDOAnalysis.h:116
TRT_RDOAnalysis::m_straw_sdo
std::vector< int > * m_straw_sdo
Definition: TRT_RDOAnalysis.h:69
TRT_RDOAnalysis::m_ntupleFileName
std::string m_ntupleFileName
Definition: TRT_RDOAnalysis.h:127
TRT_RDOAnalysis::m_h_phiModule_sdo
TH1 * m_h_phiModule_sdo
Definition: TRT_RDOAnalysis.h:118
TRT_RDOAnalysis::m_tree
TTree * m_tree
Definition: TRT_RDOAnalysis.h:126
TRT_RDOAnalysis::m_eventIndex
std::vector< int > * m_eventIndex
Definition: TRT_RDOAnalysis.h:78
TRT_RDOAnalysis::m_h_phiModule
TH1 * m_h_phiModule
Definition: TRT_RDOAnalysis.h:88
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
TRT_RDOAnalysis::m_h_eventIndex
TH1 * m_h_eventIndex
Definition: TRT_RDOAnalysis.h:123
TRT_RDOAnalysis::initialize
virtual StatusCode initialize() override final
Definition: TRT_RDOAnalysis.cxx:107
TRT_RDOAnalysis::m_h_brlStrawLayer
TH1 * m_h_brlStrawLayer
Definition: TRT_RDOAnalysis.h:99
TRT_SimHelper::HasHit
static bool HasHit(const InDetSimData &sdo)
Definition: TRT_SimHelper.h:152
ReadHandle.h
Handle class for reading from StoreGate.
TRT_RDOAnalysis::m_h_brlPhiMod
TH1 * m_h_brlPhiMod
Definition: TRT_RDOAnalysis.h:97
TRT_RDOAnalysis::m_inputTruthKey
SG::ReadHandleKey< InDetSimDataCollection > m_inputTruthKey
Definition: TRT_RDOAnalysis.h:41
TRT_RDOAnalysis::m_h_brlTrailEdge
TH1 * m_h_brlTrailEdge
Definition: TRT_RDOAnalysis.h:104
TRT_RDOAnalysis::m_h_ecWheel
TH1 * m_h_ecWheel
Definition: TRT_RDOAnalysis.h:107
TRT_RDOAnalysis::m_h_straw
TH1 * m_h_straw
Definition: TRT_RDOAnalysis.h:91
TRT_RDOAnalysis::m_h_brlStraw
TH1 * m_h_brlStraw
Definition: TRT_RDOAnalysis.h:100
TRT_RDOAnalysis::m_h_straw_sdo
TH1 * m_h_straw_sdo
Definition: TRT_RDOAnalysis.h:121
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
TRT_RDOAnalysis::m_sdoID
std::vector< unsigned long long > * m_sdoID
Definition: TRT_RDOAnalysis.h:62
Identifier
Definition: IdentifierFieldParser.cxx:14