ATLAS Offline Software
TGC_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 "TGC_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 TGC_RDOAnalysis::TGC_RDOAnalysis(const std::string& name, ISvcLocator *pSvcLocator)
18  : AthAlgorithm(name, pSvcLocator)
19  , m_inputKey("TGCRDO")
20  , m_inputTruthKey("TGC_SDO")
21  , m_tgcID(0)
22  , m_tgcSubDetID(0)
23  , m_tgcRodID(0)
24  , m_tgcTrigType(0)
25  , m_tgcBcID(0)
26  , m_tgcL1ID(0)
27  , m_tgcOrbit(0)
28  , m_tgcVersion(0)
29  , m_bcTag(0)
30  , m_subDetID(0)
31  , m_rodID(0)
32  , m_sswID(0)
33  , m_slbID(0)
34  , m_bcID(0)
35  , m_l1ID(0)
36  , m_type(0)
37  , m_slbType(0)
38  , m_coinc(0)
39  , m_bitPos(0)
40  , m_track(0)
41  , m_adj(0)
42  , m_forward(0)
43  , m_index(0)
44  , m_pos(0)
45  , m_delta(0)
46  , m_segment(0)
47  , m_subMat(0)
48  , m_sector(0)
49  , m_chip(0)
50  , m_hipt(0)
51  , m_hitID(0)
52  , m_hsub(0)
53  , m_strip(0)
54  , m_inner(0)
55  , m_cand3plus(0)
56  , m_muplus(0)
57  , m_thresh(0)
58  , m_overlap(0)
59  , m_veto(0)
60  , m_roi(0)
61 
62  , m_sdoID(0)
63  , m_sdoWord(0)
64  , m_xPos(0)
65  , m_yPos(0)
66  , m_zPos(0)
67  , m_barcode(0)
68  , m_eventIndex(0)
69  , m_radius(0)
70  , m_localZ(0)
71  , m_barcode_vec(0)
72  , m_eventIndex_vec(0)
73  , m_radius_vec(0)
74  , m_localZ_vec(0)
75 
76  , m_h_tgcID(0)
77  , m_h_tgcSubDetID(0)
78  , m_h_tgcRodID(0)
79  , m_h_tgcTrigType(0)
80  , m_h_tgcBcID(0)
81  , m_h_tgcL1ID(0)
82  , m_h_bcTag(0)
83  , m_h_subDetID(0)
84  , m_h_rodID(0)
85  , m_h_sswID(0)
86  , m_h_slbID(0)
87  , m_h_bcID(0)
88  , m_h_l1ID(0)
89  , m_h_type(0)
90  , m_h_slbType(0)
91  , m_h_bitPos(0)
92  , m_h_track(0)
93  , m_h_adj(0)
94  , m_h_sdoID(0)
95  , m_h_sdoWord(0)
96  , m_h_xPos(0)
97  , m_h_yPos(0)
98  , m_h_zPos(0)
99  , m_h_barcode(0)
100  , m_h_eventIndex(0)
101  , m_h_radius(0)
102  , m_h_localZ(0)
103 
104  , m_tree(0)
105  , m_ntupleFileName("/ntuples/file1")
106  , m_ntupleDirName("/TGC_RDOAnalysis/")
107  , m_ntupleTreeName("TGC_RDOAna")
108  , m_path("/TGC_RDOAnalysis/")
109  , m_thistSvc("THistSvc", name)
110 {
111  declareProperty("InputKey", m_inputKey);
112  declareProperty("InputTruthKey", m_inputTruthKey);
113  declareProperty("NtupleFileName", m_ntupleFileName);
114  declareProperty("NtupleDirectoryName", m_ntupleDirName);
115  declareProperty("NtupleTreeName", m_ntupleTreeName);
116  declareProperty("HistPath", m_path);
117 }
118 
120  ATH_MSG_DEBUG( "Initializing TGC_RDOAnalysis" );
121 
122  // This will check that the properties were initialized
123  // properly by job configuration.
126 
127  ATH_CHECK(m_thistSvc.retrieve());
128 
129  m_tree = new TTree(TString(m_ntupleTreeName), "TGC_RDOAna");
130  std::string fullNtupleName = m_ntupleFileName + m_ntupleDirName + m_ntupleTreeName;
131  ATH_CHECK(m_thistSvc->regTree(fullNtupleName, m_tree));
132  if (m_tree) {
133  m_tree->Branch("tgcID", &m_tgcID);
134  m_tree->Branch("tgcSubDetID", &m_tgcSubDetID);
135  m_tree->Branch("tgcRodID", &m_tgcRodID);
136  m_tree->Branch("tgcTrigType", &m_tgcTrigType);
137  m_tree->Branch("tgcBcID", &m_tgcBcID);
138  m_tree->Branch("tgcL1ID", &m_tgcL1ID);
139  m_tree->Branch("tgcOrbit", &m_tgcOrbit);
140  m_tree->Branch("tgcVersion", &m_tgcVersion);
141  m_tree->Branch("bcTag", &m_bcTag);
142  m_tree->Branch("subDetID", &m_subDetID);
143  m_tree->Branch("rodID", &m_rodID);
144  m_tree->Branch("sswID", &m_sswID);
145  m_tree->Branch("slbID", &m_slbID);
146  m_tree->Branch("bcID", &m_bcID);
147  m_tree->Branch("l1ID", &m_l1ID);
148  m_tree->Branch("type", &m_type);
149  m_tree->Branch("slbType", &m_slbType);
150  m_tree->Branch("coinc", &m_coinc);
151  m_tree->Branch("bitPos", &m_bitPos);
152  m_tree->Branch("track", &m_track);
153  m_tree->Branch("adj", &m_adj);
154  m_tree->Branch("forward", &m_forward);
155  m_tree->Branch("index", &m_index);
156  m_tree->Branch("pos", &m_pos);
157  m_tree->Branch("delta", &m_delta);
158  m_tree->Branch("segment", &m_segment);
159  m_tree->Branch("subMat", &m_subMat);
160  m_tree->Branch("sector", &m_sector);
161  m_tree->Branch("chip", &m_chip);
162  m_tree->Branch("hipt", &m_hipt);
163  m_tree->Branch("hitID", &m_hitID);
164  m_tree->Branch("hsub", &m_hsub);
165  m_tree->Branch("strip", &m_strip);
166  m_tree->Branch("inner", &m_inner);
167  m_tree->Branch("cand3plus", &m_cand3plus);
168  m_tree->Branch("muplus", &m_muplus);
169  m_tree->Branch("thresh", &m_thresh);
170  m_tree->Branch("overlap", &m_overlap);
171  m_tree->Branch("veto", &m_veto);
172  m_tree->Branch("roi", &m_roi);
173 
174  m_tree->Branch("sdoID", &m_sdoID);
175  m_tree->Branch("sdoWord", &m_sdoWord);
176  m_tree->Branch("xPos", &m_xPos);
177  m_tree->Branch("yPos", &m_yPos);
178  m_tree->Branch("zPos", &m_zPos);
179  m_tree->Branch("barcode", &m_barcode);
180  m_tree->Branch("eventIndex", &m_eventIndex);
181  m_tree->Branch("radius", &m_radius);
182  m_tree->Branch("localZ", &m_localZ);
183  m_tree->Branch("barcode_vec", &m_barcode_vec);
184  m_tree->Branch("eventIndex_vec", &m_eventIndex_vec);
185  m_tree->Branch("radius_vec", &m_radius_vec);
186  m_tree->Branch("localZ_vec", &m_localZ_vec);
187  }
188  else {
189  ATH_MSG_ERROR("No tree found!");
190  }
191 
192  // HISTOGRAMS
193  m_h_tgcID = new TH1F("h_tgcID", "TGC ID", 100, 0, 25);
194  m_h_tgcID->StatOverflows();
195  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_tgcID->GetName(), m_h_tgcID));
196 
197  m_h_tgcSubDetID = new TH1F("h_tgcSubDetID", "TGC sub-detector ID", 100, 0, 110);
198  m_h_tgcSubDetID->StatOverflows();
199  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_tgcSubDetID->GetName(), m_h_tgcSubDetID));
200 
201  m_h_tgcRodID = new TH1F("h_tgcRodID", "TGC ROD ID", 100, 0, 15);
202  m_h_tgcRodID->StatOverflows();
203  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_tgcRodID->GetName(), m_h_tgcRodID));
204 
205  m_h_tgcTrigType = new TH1F("h_tgcTrigType", "TGC trigger type", 100, 0, 2);
206  m_h_tgcTrigType->StatOverflows();
207  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_tgcTrigType->GetName(), m_h_tgcTrigType));
208 
209  m_h_tgcBcID = new TH1F("h_tgcBcID", "TGC BCID", 100, 0, 2);
210  m_h_tgcBcID->StatOverflows();
211  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_tgcBcID->GetName(), m_h_tgcBcID));
212 
213  m_h_tgcL1ID = new TH1F("h_tgcL1ID", "TGC L1ID", 100, 0, 2);
214  m_h_tgcL1ID->StatOverflows();
215  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_tgcL1ID->GetName(), m_h_tgcL1ID));
216 
217  m_h_bcTag = new TH1F("h_bcTag", "BC Tag", 100, 0, 5);
218  m_h_bcTag->StatOverflows();
219  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_bcTag->GetName(), m_h_bcTag));
220 
221  m_h_subDetID = new TH1F("h_subDetID", "Sub-detector ID", 100, 0, 110);
222  m_h_subDetID->StatOverflows();
223  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_subDetID->GetName(), m_h_subDetID));
224 
225  m_h_rodID = new TH1F("h_rodID", "ROD ID", 100, 0, 15);
226  m_h_rodID->StatOverflows();
227  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_rodID->GetName(), m_h_rodID));
228 
229  m_h_sswID = new TH1F("h_sswID", "SSW ID", 100, 0, 10);
230  m_h_sswID->StatOverflows();
231  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_sswID->GetName(), m_h_sswID));
232 
233  m_h_slbID = new TH1F("h_slbID", "SLB ID", 100, 0, 30);
234  m_h_slbID->StatOverflows();
235  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_slbID->GetName(), m_h_slbID));
236 
237  m_h_bcID = new TH1F("h_bcID", "BCID", 100, 0, 10);
238  m_h_bcID->StatOverflows();
239  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_bcID->GetName(), m_h_bcID));
240 
241  m_h_l1ID = new TH1F("h_l1ID", "L1ID", 100, 0, 10);
242  m_h_l1ID->StatOverflows();
243  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_l1ID->GetName(), m_h_l1ID));
244 
245  m_h_type = new TH1F("h_type", "type (hit or coinc)", 100, 0, 10);
246  m_h_type->StatOverflows();
247  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_type->GetName(), m_h_type));
248 
249  m_h_slbType = new TH1F("h_slbType", "SLB type", 100, 0, 10);
250  m_h_slbType->StatOverflows();
251  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_slbType->GetName(), m_h_slbType));
252 
253  m_h_bitPos = new TH1F("h_bitPos", "Bitmap position", 100, 0, 220);
254  m_h_bitPos->StatOverflows();
255  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_bitPos->GetName(), m_h_bitPos));
256 
257  m_h_track = new TH1F("h_track", "tracklet", 100, 0, 10);
258  m_h_track->StatOverflows();
259  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_track->GetName(), m_h_track));
260 
261  m_h_adj = new TH1F("h_adj", "Adjacent", 100, 0, 2);
262  m_h_adj->StatOverflows();
263  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_adj->GetName(), m_h_adj));
264 
265  m_h_sdoID = new TH1F("h_sdoID", "sdoID", 100, 0, 1e19);
266  m_h_sdoID->StatOverflows();
267  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_sdoID->GetName(), m_h_sdoID));
268 
269  m_h_sdoWord = new TH1F("h_sdoWord", "sdoWord", 100, 0, 10);
270  m_h_sdoWord->StatOverflows();
271  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_sdoWord->GetName(), m_h_sdoWord));
272 
273  m_h_xPos = new TH1F("h_xPos", "Global x-position (SDO)", 100, -15000, 15000);
274  m_h_xPos->StatOverflows();
275  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_xPos->GetName(), m_h_xPos));
276 
277  m_h_yPos = new TH1F("h_yPos", "Global y-position (SDO)", 100, -15000, 15000);
278  m_h_yPos->StatOverflows();
279  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_yPos->GetName(), m_h_yPos));
280 
281  m_h_zPos = new TH1F("h_zPos", "Global z-position (SDO)", 100, -15000, 15000);
282  m_h_zPos->StatOverflows();
283  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_zPos->GetName(), m_h_zPos));
284 
285  m_h_barcode = new TH1F("h_barcode", "Barcode (SDO)", 100, 0, 2.2e9);
286  m_h_barcode->StatOverflows();
287  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_barcode->GetName(), m_h_barcode));
288 
289  m_h_eventIndex = new TH1F("h_eventIndex", "Event index (SDO)", 100, 0, 1000);
290  m_h_eventIndex->StatOverflows();
291  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_eventIndex->GetName(), m_h_eventIndex));
292 
293  m_h_radius = new TH1F("h_radius", "Radius (SDO)", 100, 0, 1);
294  m_h_radius->StatOverflows();
295  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_radius->GetName(), m_h_radius));
296 
297  m_h_localZ = new TH1F("h_localZ", "Local z-position (SDO)", 100, -250, 250);
298  m_h_localZ->StatOverflows();
299  ATH_CHECK(m_thistSvc->regHist(m_path + m_h_localZ->GetName(), m_h_localZ));
300 
301  return StatusCode::SUCCESS;
302 }
303 
305  ATH_MSG_DEBUG( "In TGC_RDOAnalysis::execute()" );
306 
307  m_tgcID->clear();
308  m_tgcSubDetID->clear();
309  m_tgcRodID->clear();
310  m_tgcTrigType->clear();
311  m_tgcBcID->clear();
312  m_tgcL1ID->clear();
313  m_tgcOrbit->clear();
314  m_tgcVersion->clear();
315  m_bcTag->clear();
316  m_subDetID->clear();
317  m_rodID->clear();
318  m_sswID->clear();
319  m_slbID->clear();
320  m_bcID->clear();
321  m_l1ID->clear();
322  m_type->clear();
323  m_slbType->clear();
324  m_coinc->clear();
325  m_bitPos->clear();
326  m_track->clear();
327  m_adj->clear();
328  m_forward->clear();
329  m_index->clear();
330  m_pos->clear();
331  m_delta->clear();
332  m_segment->clear();
333  m_subMat->clear();
334  m_sector->clear();
335  m_chip->clear();
336  m_hipt->clear();
337  m_hitID->clear();
338  m_hsub->clear();
339  m_strip->clear();
340  m_inner->clear();
341  m_cand3plus->clear();
342  m_muplus->clear();
343  m_thresh->clear();
344  m_overlap->clear();
345  m_veto->clear();
346  m_roi->clear();
347 
348  m_sdoID->clear();
349  m_sdoWord->clear();
350  m_xPos->clear();
351  m_yPos->clear();
352  m_zPos->clear();
353  m_barcode->clear();
354  m_eventIndex->clear();
355  m_radius->clear();
356  m_localZ->clear();
357  m_barcode_vec->clear();
358  m_eventIndex_vec->clear();
359  m_radius_vec->clear();
360  m_localZ_vec->clear();
361 
363  if(p_TGCcont.isValid()) {
364  TgcRdoContainer::const_iterator tgcCont_itr(p_TGCcont->begin());
365  const TgcRdoContainer::const_iterator tgcCont_end(p_TGCcont->end());
366 
367  for ( ; tgcCont_itr != tgcCont_end; ++tgcCont_itr ) {
368  const uint16_t tgcID((*tgcCont_itr)->identify());
369  const uint16_t tgcSubDetID((*tgcCont_itr)->subDetectorId());
370  const uint16_t tgcRodID((*tgcCont_itr)->rodId());
371  const uint16_t tgcTrigType((*tgcCont_itr)->triggerType());
372  const uint16_t tgcBcID((*tgcCont_itr)->bcId());
373  const uint16_t tgcL1ID((*tgcCont_itr)->l1Id());
374  // @todo variables to plot in the future
375  // const TgcRdo::Errors& tgcErr = (*tgcCont_itr)->errors();
376  // const TgcRdo::RodStatus& tgcRodStat = (*tgcCont_itr)->rodStatus();
377  // const TgcRdo::LocalStatus& tgcLocalStat = (*tgcCont_itr)->localStatus();
378  const uint32_t tgcOrbit((*tgcCont_itr)->orbit());
379  const uint16_t tgcVersion((*tgcCont_itr)->version());
380 
381  m_tgcID->push_back(tgcID);
382  m_tgcSubDetID->push_back(tgcSubDetID);
383  m_tgcRodID->push_back(tgcRodID);
384  m_tgcTrigType->push_back(tgcTrigType);
385  m_tgcBcID->push_back(tgcBcID);
386  m_tgcL1ID->push_back(tgcL1ID);
387  m_tgcOrbit->push_back(tgcOrbit);
388  m_tgcVersion->push_back(tgcVersion);
389 
390  m_h_tgcID->Fill(tgcID);
391  m_h_tgcSubDetID->Fill(tgcSubDetID);
392  m_h_tgcRodID->Fill(tgcRodID);
393  m_h_tgcTrigType->Fill(tgcTrigType);
394  m_h_tgcBcID->Fill(tgcBcID);
395  m_h_tgcL1ID->Fill(tgcL1ID);
396 
397  const TgcRdo* p_TGCraw(*tgcCont_itr);
398  TgcRdo::const_iterator tgc_itr(p_TGCraw->begin());
399  const TgcRdo::const_iterator tgc_end(p_TGCraw->end());
400 
401  for ( ; tgc_itr != tgc_end; ++tgc_itr ) {
402  const uint16_t bctag((*tgc_itr)->bcTag());
403  const uint16_t subDetID((*tgc_itr)->subDetectorId());
404  const uint16_t rodID((*tgc_itr)->rodId());
405  const uint16_t sswID((*tgc_itr)->sswId());
406  const uint16_t slbID((*tgc_itr)->slbId());
407  const uint16_t bcID((*tgc_itr)->bcId());
408  const uint16_t l1ID((*tgc_itr)->l1Id());
409  TgcRawData::DataType type_var = (*tgc_itr)->type();
410  TgcRawData::SlbType slbType_var = (*tgc_itr)->slbType();
411  const bool coinc((*tgc_itr)->isCoincidence());
412  const uint16_t bitPos((*tgc_itr)->bitpos());
413  const uint16_t track((*tgc_itr)->tracklet());
414  const bool adj((*tgc_itr)->isAdjacent());
415  const bool forward((*tgc_itr)->isForward());
416  const uint16_t ix((*tgc_itr)->index());
417  const uint16_t pos((*tgc_itr)->position());
418  const uint16_t del((*tgc_itr)->delta());
419  const uint16_t seg((*tgc_itr)->segment());
420  const uint16_t subMat((*tgc_itr)->subMatrix());
421  const uint16_t sector((*tgc_itr)->sector());
422  const uint16_t chip((*tgc_itr)->chip());
423  const bool hipt((*tgc_itr)->isHipt());
424  const uint16_t hitID((*tgc_itr)->hitId());
425  const uint16_t hsub((*tgc_itr)->hsub());
426  const bool strip((*tgc_itr)->isStrip());
427  //const uint16_t inner((*tgc_itr)->inner());
428  const bool cand3plus((*tgc_itr)->cand3plus());
429  const bool muplus((*tgc_itr)->isMuplus());
430  const bool thresh((*tgc_itr)->threshold());
431  const bool overlap((*tgc_itr)->isOverlap());
432  const bool veto((*tgc_itr)->isVeto());
433  const uint16_t roi((*tgc_itr)->roi());
434 
435  m_bcTag->push_back(bctag);
436  m_subDetID->push_back(subDetID);
437  m_rodID->push_back(rodID);
438  m_sswID->push_back(sswID);
439  m_slbID->push_back(slbID);
440  m_bcID->push_back(bcID);
441  m_l1ID->push_back(l1ID);
442  m_type->push_back(int(type_var));
443  m_slbType->push_back(int(slbType_var));
444  m_coinc->push_back(coinc);
445  m_bitPos->push_back(bitPos);
446  m_track->push_back(track);
447  m_adj->push_back(adj);
448  m_forward->push_back(forward);
449  m_index->push_back(ix);
450  m_pos->push_back(pos);
451  m_delta->push_back(del);
452  m_segment->push_back(seg);
453  m_subMat->push_back(subMat);
454  m_sector->push_back(sector);
455  m_chip->push_back(chip);
456  m_hipt->push_back(hipt);
457  m_hitID->push_back(hitID);
458  m_hsub->push_back(hsub);
459  m_strip->push_back(strip);
460  //m_inner->push_back(inner);
461  m_cand3plus->push_back(cand3plus);
462  m_muplus->push_back(muplus);
463  m_thresh->push_back(thresh);
464  m_overlap->push_back(overlap);
465  m_veto->push_back(veto);
466  m_roi->push_back(roi);
467 
468  m_h_bcTag->Fill(bctag);
469  m_h_subDetID->Fill(subDetID);
470  m_h_rodID->Fill(rodID);
471  m_h_sswID->Fill(sswID);
472  m_h_slbID->Fill(slbID);
473  m_h_bcID->Fill(bcID);
474  m_h_l1ID->Fill(l1ID);
475  m_h_type->Fill(int(type_var));
476  m_h_slbType->Fill(int(slbType_var));
477  if (int(type_var) == 0) {
478  m_h_bitPos->Fill(bitPos);
479  m_h_track->Fill(track);
480  m_h_adj->Fill(adj);
481  }
482  }
483  }
484  }
485 
486  // SimData
488  if(simDataMapTGC.isValid()) {
489  MuonSimDataCollection::const_iterator sdo_itr(simDataMapTGC->begin());
490  const MuonSimDataCollection::const_iterator sdo_end(simDataMapTGC->end());
491 
492  std::vector<int> barcode_vec;
493  std::vector<int> eventIndex_vec;
494  std::vector<double> radius_vec;
495  std::vector<float> localZ_vec;
496  for ( ; sdo_itr != sdo_end; ++sdo_itr ) {
497  const Identifier sdoID((*sdo_itr).first);
498  const MuonSimData& sdo((*sdo_itr).second);
499 
500  const unsigned long long sdoID_int = sdoID.get_compact();
501  const int sdoWord(sdo.word());
502  const Amg::Vector3D gPos(sdo.globalPosition());
503  const float xPos(gPos.x());
504  const float yPos(gPos.y());
505  const float zPos(gPos.z());
506 
507  m_sdoID->push_back(sdoID_int);
508  m_sdoWord->push_back(sdoWord);
509  m_xPos->push_back(xPos);
510  m_yPos->push_back(yPos);
511  m_zPos->push_back(zPos);
512 
513  m_h_sdoID->Fill(sdoID_int);
514  m_h_sdoWord->Fill(sdoWord);
515  m_h_xPos->Fill(xPos);
516  m_h_yPos->Fill(yPos);
517  m_h_zPos->Fill(zPos);
518 
519  // loop over deposits
520  const std::vector<MuonSimData::Deposit>& deposits = sdo.getdeposits();
521  std::vector<MuonSimData::Deposit>::const_iterator dep_itr(deposits.begin());
522  const std::vector<MuonSimData::Deposit>::const_iterator dep_end(deposits.end());
523  for ( ; dep_itr != dep_end; ++dep_itr ) {
524  const HepMcParticleLink& particleLink = (*dep_itr).first;
525  const int bar(HepMC::barcode(particleLink)); // FIXME barcode-based
526  const int eventIx(particleLink.eventIndex());
527  const MuonMCData& data = (*dep_itr).second;
528  const double radius(data.firstEntry());
529  const float localZ(data.secondEntry());
530 
531  m_barcode->push_back(bar);
532  m_eventIndex->push_back(eventIx);
533  m_radius->push_back(radius);
534  m_localZ->push_back(localZ);
535 
536  m_h_barcode->Fill(bar);
537  m_h_eventIndex->Fill(eventIx);
539  m_h_localZ->Fill(localZ);
540 
541  barcode_vec.push_back(bar);
542  eventIndex_vec.push_back(eventIx);
543  radius_vec.push_back(radius);
544  localZ_vec.push_back(localZ);
545  }
546  m_barcode_vec->push_back(barcode_vec);
547  m_eventIndex_vec->push_back(eventIndex_vec);
548  m_radius_vec->push_back(radius_vec);
549  m_localZ_vec->push_back(localZ_vec);
550  barcode_vec.clear();
551  eventIndex_vec.clear();
552  radius_vec.clear();
553  localZ_vec.clear();
554  }
555  }
556 
557  if (m_tree) {
558  m_tree->Fill();
559  }
560 
561  return StatusCode::SUCCESS;
562 }
563 
565  return StatusCode::SUCCESS;
566 }
TGC_RDOAnalysis::m_zPos
std::vector< float > * m_zPos
Definition: TGC_RDOAnalysis.h:104
TGC_RDOAnalysis::m_segment
std::vector< uint16_t > * m_segment
Definition: TGC_RDOAnalysis.h:80
TGC_RDOAnalysis::m_rodID
std::vector< uint16_t > * m_rodID
Definition: TGC_RDOAnalysis.h:56
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TgcRawData::DataType
DataType
Definition: TgcRawData.h:42
MuonSimData::word
int word() const
Definition: MuonSimData.h:89
TGC_RDOAnalysis::m_veto
std::vector< bool > * m_veto
Definition: TGC_RDOAnalysis.h:95
TGC_RDOAnalysis::m_hipt
std::vector< bool > * m_hipt
Definition: TGC_RDOAnalysis.h:85
TGC_RDOAnalysis::m_h_zPos
TH1 * m_h_zPos
Definition: TGC_RDOAnalysis.h:139
TGC_RDOAnalysis::m_h_xPos
TH1 * m_h_xPos
Definition: TGC_RDOAnalysis.h:137
TGC_RDOAnalysis::m_h_bcID
TH1 * m_h_bcID
Definition: TGC_RDOAnalysis.h:127
TGC_RDOAnalysis::m_inputTruthKey
SG::ReadHandleKey< MuonSimDataCollection > m_inputTruthKey
Definition: TGC_RDOAnalysis.h:36
TGC_RDOAnalysis::m_eventIndex
std::vector< int > * m_eventIndex
Definition: TGC_RDOAnalysis.h:107
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TGC_RDOAnalysis::m_xPos
std::vector< float > * m_xPos
Definition: TGC_RDOAnalysis.h:102
TGC_RDOAnalysis::m_hsub
std::vector< uint16_t > * m_hsub
Definition: TGC_RDOAnalysis.h:87
TGC_RDOAnalysis::m_h_rodID
TH1 * m_h_rodID
Definition: TGC_RDOAnalysis.h:124
SiliconTech::strip
@ strip
TGC_RDOAnalysis::m_h_track
TH1 * m_h_track
Definition: TGC_RDOAnalysis.h:132
TGC_RDOAnalysis::m_tgcVersion
std::vector< uint16_t > * m_tgcVersion
Definition: TGC_RDOAnalysis.h:48
TGC_RDOAnalysis::m_h_tgcSubDetID
TH1 * m_h_tgcSubDetID
Definition: TGC_RDOAnalysis.h:117
TGC_RDOAnalysis::m_yPos
std::vector< float > * m_yPos
Definition: TGC_RDOAnalysis.h:103
TGC_RDOAnalysis::m_h_barcode
TH1 * m_h_barcode
Definition: TGC_RDOAnalysis.h:140
TGC_RDOAnalysis::m_bcTag
std::vector< uint16_t > * m_bcTag
Definition: TGC_RDOAnalysis.h:53
physval_make_web_display.thresh
thresh
Definition: physval_make_web_display.py:35
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TGC_RDOAnalysis::m_strip
std::vector< bool > * m_strip
Definition: TGC_RDOAnalysis.h:88
TGC_RDOAnalysis::m_radius
std::vector< double > * m_radius
Definition: TGC_RDOAnalysis.h:108
TGC_RDOAnalysis::m_muplus
std::vector< bool > * m_muplus
Definition: TGC_RDOAnalysis.h:92
TGC_RDOAnalysis::m_h_slbID
TH1 * m_h_slbID
Definition: TGC_RDOAnalysis.h:126
TGC_RDOAnalysis::m_ntupleDirName
std::string m_ntupleDirName
Definition: TGC_RDOAnalysis.h:147
TGC_RDOAnalysis::m_pos
std::vector< uint16_t > * m_pos
Definition: TGC_RDOAnalysis.h:78
TGC_RDOAnalysis::m_h_type
TH1 * m_h_type
Definition: TGC_RDOAnalysis.h:129
TGC_RDOAnalysis::m_subMat
std::vector< uint16_t > * m_subMat
Definition: TGC_RDOAnalysis.h:81
TGC_RDOAnalysis::m_h_bcTag
TH1 * m_h_bcTag
Definition: TGC_RDOAnalysis.h:122
MuonSimData::getdeposits
const std::vector< Deposit > & getdeposits() const
Definition: MuonSimData.h:94
TGC_RDOAnalysis::m_sswID
std::vector< uint16_t > * m_sswID
Definition: TGC_RDOAnalysis.h:57
TGC_RDOAnalysis::m_tgcBcID
std::vector< uint16_t > * m_tgcBcID
Definition: TGC_RDOAnalysis.h:42
TGC_RDOAnalysis::m_type
std::vector< int > * m_type
Definition: TGC_RDOAnalysis.h:63
TGC_RDOAnalysis::m_h_radius
TH1 * m_h_radius
Definition: TGC_RDOAnalysis.h:142
TGC_RDOAnalysis::m_l1ID
std::vector< uint16_t > * m_l1ID
Definition: TGC_RDOAnalysis.h:61
TGC_RDOAnalysis::m_h_tgcRodID
TH1 * m_h_tgcRodID
Definition: TGC_RDOAnalysis.h:118
TGC_RDOAnalysis::m_track
std::vector< uint16_t > * m_track
Definition: TGC_RDOAnalysis.h:70
TGC_RDOAnalysis::m_radius_vec
std::vector< std::vector< double > > * m_radius_vec
Definition: TGC_RDOAnalysis.h:112
TGC_RDOAnalysis::m_h_tgcBcID
TH1 * m_h_tgcBcID
Definition: TGC_RDOAnalysis.h:120
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44
TGC_RDOAnalysis::m_bitPos
std::vector< uint16_t > * m_bitPos
Definition: TGC_RDOAnalysis.h:68
TGC_RDOAnalysis::execute
virtual StatusCode execute() override final
Definition: TGC_RDOAnalysis.cxx:304
TGC_RDOAnalysis::m_sdoID
std::vector< unsigned long long > * m_sdoID
Definition: TGC_RDOAnalysis.h:100
TGC_RDOAnalysis::m_index
std::vector< uint16_t > * m_index
Definition: TGC_RDOAnalysis.h:76
TGC_RDOAnalysis::m_tree
TTree * m_tree
Definition: TGC_RDOAnalysis.h:145
TGC_RDOAnalysis::m_tgcOrbit
std::vector< uint32_t > * m_tgcOrbit
Definition: TGC_RDOAnalysis.h:47
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TGC_RDOAnalysis::m_tgcTrigType
std::vector< uint16_t > * m_tgcTrigType
Definition: TGC_RDOAnalysis.h:41
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
TGC_RDOAnalysis::m_h_adj
TH1 * m_h_adj
Definition: TGC_RDOAnalysis.h:133
TGC_RDOAnalysis::m_h_tgcL1ID
TH1 * m_h_tgcL1ID
Definition: TGC_RDOAnalysis.h:121
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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
TGC_RDOAnalysis::m_h_tgcID
TH1 * m_h_tgcID
Definition: TGC_RDOAnalysis.h:116
TGC_RDOAnalysis::m_bcID
std::vector< uint16_t > * m_bcID
Definition: TGC_RDOAnalysis.h:60
m_path
std::string m_path
the path being used
Definition: OutputStreamData.cxx:88
TGC_RDOAnalysis::m_h_l1ID
TH1 * m_h_l1ID
Definition: TGC_RDOAnalysis.h:128
TGC_RDOAnalysis::m_tgcRodID
std::vector< uint16_t > * m_tgcRodID
Definition: TGC_RDOAnalysis.h:40
TGC_RDOAnalysis::m_localZ_vec
std::vector< std::vector< float > > * m_localZ_vec
Definition: TGC_RDOAnalysis.h:113
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:242
TGC_RDOAnalysis.h
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:82
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:236
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
TH1::Fill
int Fill(double)
Definition: rootspy.cxx:285
TGC_RDOAnalysis::m_coinc
std::vector< bool > * m_coinc
Definition: TGC_RDOAnalysis.h:65
TGC_RDOAnalysis::m_h_subDetID
TH1 * m_h_subDetID
Definition: TGC_RDOAnalysis.h:123
TGC_RDOAnalysis::m_ntupleTreeName
std::string m_ntupleTreeName
Definition: TGC_RDOAnalysis.h:148
AthAlgorithm
Definition: AthAlgorithm.h:47
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TGC_RDOAnalysis::m_chip
std::vector< uint16_t > * m_chip
Definition: TGC_RDOAnalysis.h:84
TGC_RDOAnalysis::m_path
std::string m_path
Definition: TGC_RDOAnalysis.h:149
TGC_RDOAnalysis::m_tgcID
std::vector< uint16_t > * m_tgcID
Definition: TGC_RDOAnalysis.h:38
TGC_RDOAnalysis::m_adj
std::vector< bool > * m_adj
Definition: TGC_RDOAnalysis.h:71
TGC_RDOAnalysis::m_slbType
std::vector< int > * m_slbType
Definition: TGC_RDOAnalysis.h:64
TGC_RDOAnalysis::initialize
virtual StatusCode initialize() override final
Definition: TGC_RDOAnalysis.cxx:119
TGC_RDOAnalysis::m_h_eventIndex
TH1 * m_h_eventIndex
Definition: TGC_RDOAnalysis.h:141
python.SystemOfUnits.bar
int bar
Definition: SystemOfUnits.py:188
TGC_RDOAnalysis::m_ntupleFileName
std::string m_ntupleFileName
Definition: TGC_RDOAnalysis.h:146
TGC_RDOAnalysis::m_eventIndex_vec
std::vector< std::vector< int > > * m_eventIndex_vec
Definition: TGC_RDOAnalysis.h:111
TGC_RDOAnalysis::m_hitID
std::vector< uint16_t > * m_hitID
Definition: TGC_RDOAnalysis.h:86
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TGC_RDOAnalysis::m_tgcSubDetID
std::vector< uint16_t > * m_tgcSubDetID
Definition: TGC_RDOAnalysis.h:39
TGC_RDOAnalysis::m_barcode
std::vector< int > * m_barcode
Definition: TGC_RDOAnalysis.h:106
TGC_RDOAnalysis::finalize
virtual StatusCode finalize() override final
Definition: TGC_RDOAnalysis.cxx:564
MuonSimData
Definition: MuonSimData.h:62
TGC_RDOAnalysis::m_h_yPos
TH1 * m_h_yPos
Definition: TGC_RDOAnalysis.h:138
TGC_RDOAnalysis::TGC_RDOAnalysis
TGC_RDOAnalysis(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TGC_RDOAnalysis.cxx:17
TGC_RDOAnalysis::m_slbID
std::vector< uint16_t > * m_slbID
Definition: TGC_RDOAnalysis.h:58
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
TGC_RDOAnalysis::m_sector
std::vector< uint16_t > * m_sector
Definition: TGC_RDOAnalysis.h:83
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
TGC_RDOAnalysis::m_delta
std::vector< uint16_t > * m_delta
Definition: TGC_RDOAnalysis.h:79
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
TGC_RDOAnalysis::m_barcode_vec
std::vector< std::vector< int > > * m_barcode_vec
Definition: TGC_RDOAnalysis.h:110
TGC_RDOAnalysis::m_overlap
std::vector< bool > * m_overlap
Definition: TGC_RDOAnalysis.h:94
TGC_RDOAnalysis::m_forward
std::vector< bool > * m_forward
Definition: TGC_RDOAnalysis.h:74
TGC_RDOAnalysis::m_h_sdoID
TH1 * m_h_sdoID
Definition: TGC_RDOAnalysis.h:135
TGC_RDOAnalysis::m_cand3plus
std::vector< bool > * m_cand3plus
Definition: TGC_RDOAnalysis.h:91
LVL1::gFEXPos
Definition: gFexPos.h:11
TGC_RDOAnalysis::m_h_tgcTrigType
TH1 * m_h_tgcTrigType
Definition: TGC_RDOAnalysis.h:119
TgcRdo
Definition: TgcRdo.h:22
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
TGC_RDOAnalysis::m_localZ
std::vector< float > * m_localZ
Definition: TGC_RDOAnalysis.h:109
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
veto
std::vector< std::string > veto
these patterns are anded
Definition: listroot.cxx:191
TGC_RDOAnalysis::m_roi
std::vector< uint16_t > * m_roi
Definition: TGC_RDOAnalysis.h:96
TGC_RDOAnalysis::m_thresh
std::vector< bool > * m_thresh
Definition: TGC_RDOAnalysis.h:93
ReadHandle.h
Handle class for reading from StoreGate.
TGC_RDOAnalysis::m_h_sdoWord
TH1 * m_h_sdoWord
Definition: TGC_RDOAnalysis.h:136
TGC_RDOAnalysis::m_h_bitPos
TH1 * m_h_bitPos
Definition: TGC_RDOAnalysis.h:131
TGC_RDOAnalysis::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: TGC_RDOAnalysis.h:150
TGC_RDOAnalysis::m_inner
std::vector< uint16_t > * m_inner
Definition: TGC_RDOAnalysis.h:89
TGC_RDOAnalysis::m_h_sswID
TH1 * m_h_sswID
Definition: TGC_RDOAnalysis.h:125
TGC_RDOAnalysis::m_h_slbType
TH1 * m_h_slbType
Definition: TGC_RDOAnalysis.h:130
TGC_RDOAnalysis::m_sdoWord
std::vector< int > * m_sdoWord
Definition: TGC_RDOAnalysis.h:101
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
MuonMCData
Definition: MuonSimData.h:42
TGC_RDOAnalysis::m_h_localZ
TH1 * m_h_localZ
Definition: TGC_RDOAnalysis.h:143
MuonSimData::globalPosition
const Amg::Vector3D globalPosition() const
Definition: MuonSimData.h:113
TGC_RDOAnalysis::m_subDetID
std::vector< uint16_t > * m_subDetID
Definition: TGC_RDOAnalysis.h:55
hipt
bool hipt
Definition: globals.cxx:29
TGC_RDOAnalysis::m_inputKey
SG::ReadHandleKey< TgcRdoContainer > m_inputKey
Definition: TGC_RDOAnalysis.h:35
TgcRawData::SlbType
SlbType
Definition: TgcRawData.h:31
TGC_RDOAnalysis::m_tgcL1ID
std::vector< uint16_t > * m_tgcL1ID
Definition: TGC_RDOAnalysis.h:43