ATLAS Offline Software
TRTMonitoringRun3ESD_Alg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
12 #include "InDetIdentifier/TRT_ID.h"
14 #include "TrkTrack/Track.h"
22 
25 
26 #include <sstream>
27 #include <iomanip>
28 #include <memory>
29 #include <cmath>
30 using namespace std;
31 
32 //Private Static Const data member initialization
35 const int TRTMonitoringRun3ESD_Alg::s_Straw_max[2] = {1642, 3840};
36 const int TRTMonitoringRun3ESD_Alg::s_iStack_max[2] = {32, 64};
37 const int TRTMonitoringRun3ESD_Alg::s_iChip_max[2] = {104, 240};
38 const int TRTMonitoringRun3ESD_Alg::s_numberOfStacks[2] = {32, 32};
39 const int TRTMonitoringRun3ESD_Alg::s_moduleNum[2] = {96, 64};
40 
41 TRTMonitoringRun3ESD_Alg::TRTMonitoringRun3ESD_Alg( const std::string& name, ISvcLocator* pSvcLocator )
42 :AthMonitorAlgorithm(name,pSvcLocator)
43 ,m_idHelper(nullptr)
44 ,m_sumTool("TRT_StrawStatusSummaryTool", this)
45 ,m_TRTStrawNeighbourSvc("TRT_StrawNeighbourSvc", name)
46 ,m_TRTCalDbTool("TRT_CalDbTool", this)
47 ,m_drifttool("TRT_DriftFunctionTool", this)
48 ,m_pTRTHelper(nullptr)
49 ,m_mgr(nullptr)
50 ,m_isCosmics(false)
51 ,m_minTRThits(10)
52 ,m_minP(0)
53 ,m_EventBurstCut(-1)
54 ,m_trackSelTool("InDet::InDetTrackSelectionTool/TrackSelectionTool", this)
55 {
56  declareProperty("InDetTRTStrawStatusSummaryTool", m_sumTool);
57  declareProperty("NeighbourSvc", m_TRTStrawNeighbourSvc);
58  declareProperty("ITRT_CalDbTool", m_TRTCalDbTool);
59  declareProperty("DriftFunctionTool", m_drifttool);
60  declareProperty("TrackSelectionTool", m_trackSelTool);
61  declareProperty("doExpert", m_doExpert = false);
62  declareProperty("DoTracksMon", m_doTracksMon = true);
63  declareProperty("doStraws", m_doStraws = true);
64  declareProperty("doChips", m_doChips = true);
65  declareProperty("doShift", m_doShift = true);
66  declareProperty("DistanceToStraw", m_DistToStraw = 0.4);
67  declareProperty("min_si_hits", m_min_si_hits = 1);
68  declareProperty("min_pixel_hits", m_min_pixel_hits = 0);
69  declareProperty("min_sct_hits", m_min_sct_hits = 0);
70  declareProperty("min_trt_hits", m_min_trt_hits = 10);
71  declareProperty("MinTRTHitCut", m_minTRThits = 10);
72  declareProperty("MinTrackP", m_minP = 0.0 * CLHEP::GeV);
73  declareProperty("min_pT", m_min_pT = 0.5 * CLHEP::GeV);
74 }
75 
77 
79  using namespace Monitored;
80 
81  ATH_MSG_VERBOSE("Initializing TRT Monitoring");
82 
83  // Initialize superclass
85 
86  // Retrieve detector manager
87  ATH_CHECK( detStore()->retrieve(m_mgr, "TRT") );
88  // Get ID helper for TRT to access various detector components like straw, straw_layer, layer_or_wheel, phi_module, etc.
89  ATH_CHECK( detStore()->retrieve(m_pTRTHelper, "TRT_ID") );
90  ATH_CHECK( detStore()->retrieve(m_idHelper, "AtlasID") );
91 
92  // InDetTrackSelectionTools initialization:
93  ATH_CHECK( m_trackSelTool.retrieve() );
94 
95  if (m_doExpert) {
96  // Retrieve the TRT_Straw Status Service
97  if (m_sumTool.name().empty()) {
98  ATH_MSG_WARNING("TRT_StrawStatusTool not given.");
99  } else {
100  ATH_CHECK( m_sumTool.retrieve() );
101  }
102 
104 
105  if (m_sumTool.name() != "") {
106  ATH_MSG_VERBOSE("Trying " << m_sumTool << " isGood");
107  ATH_MSG_VERBOSE("TRT_StrawStatusTool reports status = " << m_sumTool->getStatus(ident, Gaudi::Hive::currentContext()));
108  }
109  } //If do expert
110 
111  // Retrieve TRT_StrawNeighbourService
112  if (m_TRTStrawNeighbourSvc.name().empty()) {
113  ATH_MSG_WARNING("TRT_StrawNeighbourSvc not given.");
114  } else {
115  if (m_TRTStrawNeighbourSvc.retrieve().isFailure()) {
116  ATH_MSG_FATAL("Could not get StrawNeighbourSvc.");
117  }
118  }
119 
120  // Get Track summary tool
121  if (m_TrackSummaryTool.retrieve().isFailure())
122  ATH_MSG_ERROR("Cannot get TrackSummaryTool");
123  else
124  ATH_MSG_DEBUG("Retrieved succesfully the track summary tool" << m_TrackSummaryTool);
125 
126  //Get TRTCalDbTool
127  if (m_TRTCalDbTool.name().empty()) {
128  ATH_MSG_WARNING("TRT_CalDbTool not given.");
129  } else {
130  if (m_TRTCalDbTool.retrieve().isFailure()) {
131  ATH_MSG_ERROR("Cannot get TRTCalDBTool.");
132  }
133  }
134 
135  ATH_CHECK(m_drifttool.retrieve());
136 
137  // Initialize arrays
138  // These arrays store information about each entry to the HitMap histograms
139 
140  if (true) {
141  //loop over straw hash index to create straw number mapping for TRTViewer
142  unsigned int maxHash = m_pTRTHelper->straw_layer_hash_max();
143 
144  for (int ibe = 0; ibe < 2; ibe++) { // ibe=0(barrel), ibe=1(endcap)
145  for (unsigned int index = 0; index < maxHash; index++) {
146  IdentifierHash idHash = index;
147  Identifier id = m_pTRTHelper->layer_id(idHash);
148  int idBarrelEndcap = m_pTRTHelper->barrel_ec(id);
149  int idLayerWheel = m_pTRTHelper->layer_or_wheel(id);
150  int idPhiModule = m_pTRTHelper->phi_module(id);
151  int idStrawLayer = m_pTRTHelper->straw_layer(id);
152  bool isBarrel = m_pTRTHelper->is_barrel(id);
153  int idSide;
154  int sectorflag = 0;
155  const InDetDD::TRT_BaseElement *element = nullptr;
156 
157  if (ibe == 0) { // barrel
158  idSide = idBarrelEndcap ? 1 : -1;
159 
160  if (isBarrel && (idBarrelEndcap == -1)) {
161  sectorflag = 1;
162  element = m_mgr->getBarrelElement(idSide, idLayerWheel, idPhiModule, idStrawLayer);
163  }
164  } else if (ibe == 1) { // endcap
165  idSide = idBarrelEndcap ? 1 : 0;
166 
167  if (!isBarrel && ((idBarrelEndcap == -2) || (idBarrelEndcap == 2))) {
168  sectorflag = 1;
169  element = m_mgr->getEndcapElement(idSide, idLayerWheel, idStrawLayer, idPhiModule);//, idStrawLayer_ec);
170  }
171  }
172 
173  if (sectorflag == 1) {
174  if (!element) continue;
175 
176  for (unsigned int istraw = 0; istraw < element->nStraws(); istraw++) {
177  std::vector<Identifier> neighbourIDs;
178  Identifier strawID = m_pTRTHelper->straw_id(id, int(istraw));
179  int i_chip, i_pad;
180  m_TRTStrawNeighbourSvc->getChip(strawID, i_chip);
181  m_TRTStrawNeighbourSvc->getPad(id, i_pad);
182 
183  if (ibe == 0) { //barrel
184  if (idLayerWheel == 1) i_chip += 21;
185 
186  if (idLayerWheel == 2) i_chip += 54;
187 
188  int tempStrawNumber = strawNumber(istraw, idStrawLayer, idLayerWheel);
189 
190  if (tempStrawNumber < 0 || tempStrawNumber > (s_Straw_max[ibe] - 1)) {
191  ATH_MSG_WARNING("Found tempStrawNumber = " << tempStrawNumber << " out of range.");
192  } else {
193  m_mat_chip_B.at(idPhiModule).at(tempStrawNumber) = i_chip;
194  m_mat_chip_B.at(idPhiModule + 32).at(tempStrawNumber) = i_chip;
195  }
196  } else if (ibe == 1) { //endcap
197  ++i_chip -= 104;
198  int tempStrawNumber = strawNumberEndCap(istraw, idStrawLayer, idLayerWheel, idPhiModule, idSide);
199 
200  if (tempStrawNumber < 0 || tempStrawNumber > (s_Straw_max[ibe] - 1)) {
201  ATH_MSG_WARNING("Found tempStrawNumber = " << tempStrawNumber << " out of range.");
202  } else {
203  m_mat_chip_E.at(idPhiModule).at(tempStrawNumber) = i_chip;
204  m_mat_chip_E.at(idPhiModule + 32).at(tempStrawNumber) = i_chip;
205  }
206  }
207  }
208  }
209  }
210  }
211  }
212 
213  // Initialization of VarHandleKeys
219 
220  return StatusCode::SUCCESS;
221 }
222 
223 
224 //----------------------------------------------------------------------------------//
226 //----------------------------------------------------------------------------------//
227  switch (LayerNumber) {
228  case 0:
229  return strawLayerNumber;
230 
231  case 1:
232  return strawLayerNumber + 19;
233 
234  case 2:
235  return strawLayerNumber + 43;
236 
237  default:
238  return strawLayerNumber;
239  }
240 }
241 
242 //----------------------------------------------------------------------------------//
243 int TRTMonitoringRun3ESD_Alg::strawNumber(int strawNumber, int strawlayerNumber, int LayerNumber) const {
244 //----------------------------------------------------------------------------------//
245  int addToStrawNumber = 0;
246  int addToStrawNumberNext = 0;
247  int i = 0;
248  const int numberOfStraws[75] = {
249  0,
250  15,
251  16, 16, 16, 16,
252  17, 17, 17, 17, 17,
253  18, 18, 18, 18, 18,
254  19, 19, 19,
255  18,
256  19,
257  20, 20, 20, 20, 20,
258  21, 21, 21, 21, 21,
259  22, 22, 22, 22, 22,
260  23, 23, 23, 23, 23,
261  24, 24,
262  23, 23,
263  24, 24, 24, 24,
264  25, 25, 25, 25, 25,
265  26, 26, 26, 26, 26,
266  27, 27, 27, 27, 27,
267  28, 28, 28, 28, 28,
268  29, 29, 29, 29,
269  28,
270  0
271  };
272 
273  do {
274  i++;
275  addToStrawNumber += numberOfStraws[i - 1];
276  addToStrawNumberNext = addToStrawNumber + numberOfStraws[i];
277  } while (strawLayerNumber(strawlayerNumber, LayerNumber) != i - 1);
278 
279  strawNumber = addToStrawNumberNext - strawNumber - 1;
280 
281  if (strawNumber < 0 || strawNumber > s_Straw_max[0] - 1) {
282  ATH_MSG_WARNING("strawNumber = " << strawNumber << " out of range. Will set to 0.");
283  strawNumber = 0;
284  }
285 
286  return strawNumber;
287 }
288 
289 
290 //----------------------------------------------------------------------------------//
291 int TRTMonitoringRun3ESD_Alg::strawNumberEndCap(int strawNumber, int strawLayerNumber, int LayerNumber, int phi_stack, int side) const {
292 //----------------------------------------------------------------------------------//
293  // Before perfoming map, corrections need to be perfomed.
294  // apply special rotations for endcap mappings
295  // for eca, rotate triplets by 180 for stacks 9-16, and 25-32.
296  static const int TripletOrientation[2][32] = {
297  {
298  1, 1, 1, 1, 1, 1, 1, 1,
299  0, 0, 0, 0, 0, 0, 0, 0,
300  1, 1, 1, 1, 1, 1, 1, 1,
301  0, 0, 0, 0, 0, 0, 0, 0
302  },
303  {
304  1, 1, 1, 1, 1, 1, 1, 1,
305  0, 0, 0, 0, 0, 0, 0, 0,
306  1, 1, 1, 1, 1, 1, 1, 1,
307  0, 0, 0, 0, 0, 0, 0, 0
308  }
309  };
310  int phi1 = -1;
311 
312  if (side == 2) phi1 = phi_stack, side = 1;
313  else if (side == -2) phi1 = 31 - phi_stack, side = 0;
314 
315  if (phi1 > -1) {
316  if (TripletOrientation[side][phi1]) {
317  // Change straw number from 0-23 in straw layer to 0-192
319 
321 
322  strawNumber = (192 - 1) * TripletOrientation[side][phi1] + strawNumber * (1 - 2 * TripletOrientation[side][phi1]); //actual rotation
323 
324  // Take strawNumber back to 0-23
326 
327  if (strawLayerNumber > 7) strawLayerNumber = int(strawNumber / 24) + 8;
328 
329  strawNumber = strawNumber % 24;
330  }
331 
332  // Finish rotation
333  // Flip straw in layer.
334 
335  if (side == 0) strawNumber = 23 - strawNumber;
336 
337  // Finish Flipping
338  }
339 
340  // Done with corrections
341  // Start mapping from athena identifiers to TRTViewer maps
342  int strawNumberNew = 0;
343 
344  if (LayerNumber < 6 && strawLayerNumber > 7) {
345  strawNumberNew = strawNumberNew + (384 * LayerNumber);
346  strawNumberNew = strawNumberNew + 192 + (strawLayerNumber % 8) + (strawNumber * 8);
347  } else if (LayerNumber < 6 && strawLayerNumber < 8) {
348  strawNumberNew = strawNumberNew + (384 * LayerNumber);
349  strawNumberNew = strawNumberNew + (strawLayerNumber % 8) + (strawNumber * 8);
350  } else if (LayerNumber > 5 && strawLayerNumber > 7) {
351  strawNumberNew = strawNumberNew + 2304 + 192 * (LayerNumber - 6);
352  strawNumberNew = strawNumberNew + 192 + (strawLayerNumber % 8) + (8 * strawNumber);
353  } else if (LayerNumber > 5 && strawLayerNumber < 8) {
354  strawNumberNew = strawNumberNew + 2304 + 192 * (LayerNumber - 6);
355  strawNumberNew = strawNumberNew + (strawLayerNumber % 8) + (8 * strawNumber);
356  }
357 
358  strawNumber = strawNumberNew;
359 
360  if (strawNumber < 0 || strawNumber > s_Straw_max[1] - 1) {
361  ATH_MSG_WARNING("strawNumber = " << strawNumber << " out of range. Will set to 0.");
362  strawNumber = 0;
363  }
364 
365  return strawNumber;
366 }
367 
368 //----------------------------------------------------------------------------------//
369 float TRTMonitoringRun3ESD_Alg::radToDegrees(float radValue) const {
370 //----------------------------------------------------------------------------------//
371  float degreeValue = radValue / M_PI * 180;
372 
373  if (degreeValue < 0) degreeValue += 360;
374 
375  return degreeValue;
376 }
377 
378 
379 // Check for EventBurst: Counts high level hits and returns true if the count is less than m_passEventBurstCut.
380 // If m_EventBurstCut is less than zero, returns allways true
381 //----------------------------------------------------------------------------------//
383 //----------------------------------------------------------------------------------//
384  if (m_EventBurstCut <= 0) return true;
385 
386  int nHLHits = 0;
387  TRT_RDO_Container::const_iterator RDO_CollectionBegin = rdoContainer.begin();
388  TRT_RDO_Container::const_iterator RDO_CollectionEnd = rdoContainer.end();
389 
390  for (; RDO_CollectionBegin != RDO_CollectionEnd; ++RDO_CollectionBegin) {
391  const InDetRawDataCollection<TRT_RDORawData> *TRT_Collection(*RDO_CollectionBegin);
392 
393  if (!TRT_Collection) continue;
394  else {
395  DataVector<TRT_RDORawData>::const_iterator p_rdo = TRT_Collection->begin();
396 
397  for (; p_rdo != TRT_Collection->end(); ++p_rdo) {
398  const TRT_LoLumRawData *p_lolum = dynamic_cast<const TRT_LoLumRawData *>(*p_rdo);
399 
400  if (!p_lolum) continue;
401 
402  if (p_lolum->highLevel()) nHLHits++;
403  }
404  }
405  }
406 
407  if (nHLHits > m_EventBurstCut) return false;
408  else return true;
409 }
410 
411 
412 // Fill the TRT Track level histograms
413 //----------------------------------------------------------------------------------//
415  const xAOD::TrigDecision* trigDecision,
416  const ComTime* comTimeObject,
417  const xAOD::EventInfo& eventInfo) const {
418 //----------------------------------------------------------------------------------//
419  ATH_MSG_VERBOSE("Filling TRT Tracks Histos");
420 
421  // TProfile
422  auto ValidRawDriftTimeonTrkS_x = Monitored::Scalar<float>("ValidRawDriftTimeonTrkS_x", 0.0);
423  auto ValidRawDriftTimeonTrkS_y = Monitored::Scalar<float>("ValidRawDriftTimeonTrkS_y", 0.0);
424  auto ValidRawDriftTimeonTrkC_x = Monitored::Scalar<float>("ValidRawDriftTimeonTrkC_x", 0.0);
425  auto ValidRawDriftTimeonTrkC_y = Monitored::Scalar<float>("ValidRawDriftTimeonTrkC_y", 0.0);
426  auto HitTronTMapC_x = Monitored::Scalar<float>("HitTronTMapC_x", 0.0);
427  auto HitTronTMapC_y = Monitored::Scalar<float>("HitTronTMapC_y", 0.0);
428  auto HitTronTwEPCMapS_x = Monitored::Scalar<float>("HitTronTwEPCMapS_x", 0.0);
429  auto HitTronTwEPCMapS_y = Monitored::Scalar<float>("HitTronTwEPCMapS_y", 0.0);
430  auto HitTronTwEPCMapC_x = Monitored::Scalar<float>("HitTronTwEPCMapC_x", 0.0);
431  auto HitTronTwEPCMapC_y = Monitored::Scalar<float>("HitTronTwEPCMapC_y", 0.0);
432  auto AvgTroTDetPhi_B_Ar_x = Monitored::Scalar<float>("AvgTroTDetPhi_B_Ar_x", 0.0);
433  auto AvgTroTDetPhi_B_Ar_y = Monitored::Scalar<float>("AvgTroTDetPhi_B_Ar_y", 0.0);
434  auto AvgTroTDetPhi_B_x = Monitored::Scalar<float>("AvgTroTDetPhi_B_x", 0.0);
435  auto AvgTroTDetPhi_B_y = Monitored::Scalar<float>("AvgTroTDetPhi_B_y", 0.0);
436  auto AvgTroTDetPhi_E_Ar_x = Monitored::Scalar<float>("AvgTroTDetPhi_E_Ar_x", 0.0);
437  auto AvgTroTDetPhi_E_Ar_y = Monitored::Scalar<float>("AvgTroTDetPhi_E_Ar_y", 0.0);
438  auto AvgTroTDetPhi_E_x = Monitored::Scalar<float>("AvgTroTDetPhi_E_x", 0.0);
439  auto AvgTroTDetPhi_E_y = Monitored::Scalar<float>("AvgTroTDetPhi_E_y", 0.0);
440  auto NumHoTDetPhi_B_x = Monitored::Scalar<float>("NumHoTDetPhi_B_x", 0.0);
441  auto NumHoTDetPhi_B_y = Monitored::Scalar<float>("NumHoTDetPhi_B_y", 0.0);
442  auto NumHoTDetPhi_E_x = Monitored::Scalar<float>("NumHoTDetPhi_E_x", 0.0);
443  auto NumHoTDetPhi_E_y = Monitored::Scalar<float>("NumHoTDetPhi_E_y", 0.0);
444  auto EvtPhaseDetPhi_B_x = Monitored::Scalar<float>("EvtPhaseDetPhi_B_x", 0.0);
445  auto EvtPhaseDetPhi_B_y = Monitored::Scalar<float>("EvtPhaseDetPhi_B_y", 0.0);
446  auto EvtPhaseDetPhi_E_x = Monitored::Scalar<float>("EvtPhaseDetPhi_E_x", 0.0);
447  auto EvtPhaseDetPhi_E_y = Monitored::Scalar<float>("EvtPhaseDetPhi_E_y", 0.0);
448  auto NTrksperLB_x = Monitored::Scalar<float>("NTrksperLB_x", 0.0);
449  auto NTrksperLB_y = Monitored::Scalar<float>("NTrksperLB_y", 0.0);
450 
451 
452  // TH1F
453  auto DriftTimeonTrkDist_B = Monitored::Scalar<float>("DriftTimeonTrkDist_B", 0.0);
454  auto DriftTimeonTrkDist_B_Ar = Monitored::Scalar<float>("DriftTimeonTrkDist_B_Ar", 0.0);
455  auto DriftTimeonTrkDist_E_Ar = Monitored::Scalar<float>("DriftTimeonTrkDist_E_Ar", 0.0);
456  auto DriftTimeonTrkDist_E = Monitored::Scalar<float>("DriftTimeonTrkDist_E", 0.0);
457  auto NumTrksDetPhi_B = Monitored::Scalar<float>("NumTrksDetPhi_B", 0.0);
458  auto NumTrksDetPhi_E = Monitored::Scalar<float>("NumTrksDetPhi_E", 0.0);
459  auto Pull_Biased_Barrel = Monitored::Scalar<float>("Pull_Biased_Barrel", 0.0);
460  auto Pull_Biased_EndCap = Monitored::Scalar<float>("Pull_Biased_EndCap", 0.0);
461  auto Residual_B = Monitored::Scalar<float>("Residual_B", 0.0);
462  auto Residual_B_Ar = Monitored::Scalar<float>("Residual_B_Ar", 0.0);
463  auto Residual_B_20GeV = Monitored::Scalar<float>("Residual_B_20GeV", 0.0);
464  auto Residual_B_Ar_20GeV = Monitored::Scalar<float>("Residual_B_Ar_20GeV", 0.0);
465  auto Residual_E = Monitored::Scalar<float>("Residual_E", 0.0);
466  auto Residual_E_Ar = Monitored::Scalar<float>("Residual_E_Ar", 0.0);
467  auto Residual_E_20GeV = Monitored::Scalar<float>("Residual_E_20GeV", 0.0);
468  auto Residual_E_Ar_20GeV = Monitored::Scalar<float>("Residual_E_Ar_20GeV", 0.0);
469  auto Residual_noTubeHits_B = Monitored::Scalar<float>("Residual_noTubeHits_B", 0.0);
470  auto Residual_noTubeHits_B_Ar = Monitored::Scalar<float>("Residual_noTubeHits_B_Ar", 0.0);
471  auto Residual_noTubeHits_B_20GeV = Monitored::Scalar<float>("Residual_noTubeHits_B_20GeV", 0.0);
472  auto Residual_noTubeHits_B_Ar_20GeV = Monitored::Scalar<float>("Residual_noTubeHits_B_Ar_20GeV", 0.0);
473  auto Residual_noTubeHits_E = Monitored::Scalar<float>("Residual_noTubeHits_E", 0.0);
474  auto Residual_noTubeHits_E_Ar = Monitored::Scalar<float>("Residual_noTubeHits_E_Ar", 0.0);
475  auto Residual_noTubeHits_E_20GeV = Monitored::Scalar<float>("Residual_noTubeHits_E_20GeV", 0.0);
476  auto Residual_noTubeHits_E_Ar_20GeV = Monitored::Scalar<float>("Residual_noTubeHits_E_Ar_20GeV", 0.0);
477  auto TimeResidual_B = Monitored::Scalar<float>("TimeResidual_B", 0.0);
478  auto TimeResidual_B_Ar = Monitored::Scalar<float>("TimeResidual_B_Ar", 0.0);
479  auto TimeResidual_E = Monitored::Scalar<float>("TimeResidual_E", 0.0);
480  auto TimeResidual_E_Ar = Monitored::Scalar<float>("TimeResidual_E_Ar", 0.0);
481  auto TimeResidual_noTubeHits_B = Monitored::Scalar<float>("TimeResidual_noTubeHits_B", 0.0);
482  auto TimeResidual_noTubeHits_B_Ar = Monitored::Scalar<float>("TimeResidual_noTubeHits_B_Ar", 0.0);
483  auto TimeResidual_noTubeHits_E = Monitored::Scalar<float>("TimeResidual_noTubeHits_E", 0.0);
484  auto TimeResidual_noTubeHits_E_Ar = Monitored::Scalar<float>("TimeResidual_noTubeHits_E_Ar", 0.0);
485  auto TronTDist_E = Monitored::Scalar<float>("TronTDist_E", 0.0);
486  auto TronTDist_B = Monitored::Scalar<float>("TronTDist_B", 0.0);
487  auto TronTDist_B_Ar = Monitored::Scalar<float>("TronTDist_B_Ar", 0.0);
488  auto TronTDist_E_Ar = Monitored::Scalar<float>("TronTDist_E_Ar", 0.0);
489  auto WireToTrkPosition_B_Ar = Monitored::Scalar<float>("WireToTrkPosition_B_Ar", 0.0);
490  auto WireToTrkPosition_B = Monitored::Scalar<float>("WireToTrkPosition_B", 0.0);
491  auto WireToTrkPosition_E_Ar = Monitored::Scalar<float>("WireToTrkPosition_E_Ar", 0.0);
492  auto WireToTrkPosition_E = Monitored::Scalar<float>("WireToTrkPosition_E", 0.0);
493  auto EvtPhase = Monitored::Scalar<float>("EvtPhase", 0.0);
494  auto Summary = Monitored::Scalar<float>("Summary", 0.0);
495  auto SummaryWeight = Monitored::Scalar<float>("SummaryWeight", 0.0);
496 
497  // TH2F
498  auto RtRelation_B_Ar_x = Monitored::Scalar<float>("RtRelation_B_Ar_x", 0.0);
499  auto RtRelation_B_Ar_y = Monitored::Scalar<float>("RtRelation_B_Ar_y", 0.0);
500  auto RtRelation_B_x = Monitored::Scalar<float>("RtRelation_B_x", 0.0);
501  auto RtRelation_B_y = Monitored::Scalar<float>("RtRelation_B_y", 0.0);
502  auto RtRelation_E_Ar_x = Monitored::Scalar<float>("RtRelation_E_Ar_x", 0.0);
503  auto RtRelation_E_Ar_y = Monitored::Scalar<float>("RtRelation_E_Ar_y", 0.0);
504  auto RtRelation_E_x = Monitored::Scalar<float>("RtRelation_E_x", 0.0);
505  auto RtRelation_E_y = Monitored::Scalar<float>("RtRelation_E_y", 0.0);
506  auto EvtPhaseVsTrig_x = Monitored::Scalar<float>("EvtPhaseVsTrig_x", 0.0);
507  auto EvtPhaseVsTrig_y = Monitored::Scalar<float>("EvtPhaseVsTrig_y", 0.0);
508 
509  // Initialize a bunch of stuff before looping over the track collection. Fill some basic histograms.
510  const float timeCor = comTimeObject ? comTimeObject->getTime() : 0;
511 
512  auto p_trk = trackCollection.begin();
513 
514  const Trk::Perigee *mPer = nullptr;
515  const DataVector<const Trk::TrackParameters> *AllTrkPar(nullptr);
517 
518  int ntrackstack[2][64];
519  int nTotalTracks = 0;
520  int nTracksB[2] = {0, 0};
521  int nTracksEC[2] = {0, 0};
522  int nTracksEC_B[2] = {0, 0};
523  int nTrksperLB_B = 0;
524  int nTrksperLB_E[2] = {0, 0};
525 
526  for (int ibe = 0; ibe < 2; ibe++) {
527  std::fill(ntrackstack[ibe], ntrackstack[ibe] + 64, 0);
528  }
529 
530 for (; p_trk != trackCollection.end(); ++p_trk) {
531 
532  uint8_t tempHitsVariable(0);
533  (*p_trk)->summaryValue(tempHitsVariable, xAOD::SummaryType::numberOfTRTHits);
534  int nTRTHits = unsigned(tempHitsVariable);
535 
536 
537  if (nTRTHits < m_minTRThits) continue;
538 
539  AllTrkPar = ((*p_trk)->track())->trackParameters();
540 
541  // Search of MeasuredPerigee in TrackParameters
542  // The following algorithm only finds the First perigee measurement.
543  // As there should be one and only one perigee measurement then this assumption should be valid.
544  // But no check is done to see if there is more than one perigee measurement.
545  for (p_trkpariter = AllTrkPar->begin(); p_trkpariter != AllTrkPar->end(); ++p_trkpariter) {
546  // If track parameter does have a measured perigee then the track parameter is a keeper and break out of the loop
547  if ((mPer = dynamic_cast<const Trk::Perigee *>(*p_trkpariter))) break;
548  }
549 
550  if (!mPer) continue;
551 
552  float theta = mPer->parameters()[Trk::theta];
553  float p = (mPer->parameters()[Trk::qOverP] != 0.) ? std::abs(1. / (mPer->parameters()[Trk::qOverP])) : 10e7;
554  float pT = (p * std::sin(theta));
555  pT = pT * 1e-3; // GeV
556 
557  if (p < m_minP) continue;
558 
559  const Trk::TrackStates *trackStates = ((*p_trk)->track())->trackStateOnSurfaces();
560 
561  if (trackStates == nullptr) continue;
562 
563  Trk::TrackStates::const_iterator TSOSItBegin0 = trackStates->begin();
564  Trk::TrackStates::const_iterator TSOSItBegin = trackStates->begin();
565  Trk::TrackStates::const_iterator TSOSItBeginTemp = trackStates->begin();
566  Trk::TrackStates::const_iterator TSOSItEnd = trackStates->end();
567 
568  (*p_trk)->summaryValue(tempHitsVariable, xAOD::SummaryType::numberOfTRTHits);
569  int n_trt_hits = unsigned(tempHitsVariable);
570 
571  bool is_pT_over_20GeV = false;
572 
573  if (mPer->pT() > 20 * CLHEP::GeV) {
574  is_pT_over_20GeV = true;
575  } else {
576  is_pT_over_20GeV = false;
577  }
578 
579  const bool cnst_is_pT_over_20GeV = is_pT_over_20GeV;
580 
581  const bool passed_track_preselection = (static_cast<bool>(m_trackSelTool->accept(**p_trk)) || m_isCosmics) &&
582  n_trt_hits >= m_min_trt_hits &&
583  mPer->pT() > (m_isCosmics?m_min_pT : 2.0 * CLHEP::GeV); // Hardcoded cut for pT 2.0 GeV for collision setup
584  if (!passed_track_preselection) continue;
585 
586  nTotalTracks++;
587  int checkB[2] = {0, 0};
588  int checkEC[2] = {0, 0};
589  int checkEC_B[2] = {0, 0};
590  int nTRTHitsW[2][2];
591  int nTRTHits_side[2][2];
592  int nTRTHitsW_perwheel[2][18];
593  int hitontrack[2] = {0, 0};
594  int hitontrack_E_side[2] = {0, 0};
595 
596  for (int ibe = 0; ibe < 2; ibe++) {
597  for (int iside = 0; iside < 2; iside++) {
598  nTRTHits_side[ibe][iside] = -1;
599  nTRTHitsW[ibe][iside] = 0;
600  }
601  std::fill(nTRTHitsW_perwheel[ibe], nTRTHitsW_perwheel[ibe] + 18, 0);
602  }
603 
604  int barrel_ec = 0;
605  int layer_or_wheel = 0;
606  int phi_module = 0;
607  int straw_layer = 0;
608  int straw = 0;
609  int nearest_straw_layer[2] = {100, 100};
610  int nearest_straw[2] = {0, 0};
611  int testLayer[2] = {100, 100};
612  float phi2D[2] = {-100, -100};
613 
614  for (TSOSItBeginTemp = TSOSItBegin0; TSOSItBeginTemp != TSOSItEnd; ++TSOSItBeginTemp) {
615  if ((*TSOSItBeginTemp) == nullptr) continue;
616 
617  if (! ((*TSOSItBeginTemp)->type(Trk::TrackStateOnSurface::Measurement)) ) continue;
618  const InDet::TRT_DriftCircleOnTrack *trtCircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>((*TSOSItBeginTemp)->measurementOnTrack());
619 
620  if (!trtCircle) continue;
621  const Trk::TrackParameters *aTrackParam = dynamic_cast<const Trk::TrackParameters *>((*TSOSItBeginTemp)->trackParameters());
622 
623  if (!aTrackParam) continue;
624  Identifier DCoTId = trtCircle->identify();
625  barrel_ec = m_pTRTHelper->barrel_ec(DCoTId);
626  int ibe = std::abs(barrel_ec) - 1;
627  layer_or_wheel = m_pTRTHelper->layer_or_wheel (DCoTId);
628  straw_layer = m_pTRTHelper->straw_layer(DCoTId);
629  straw = m_pTRTHelper->straw(DCoTId);
630 
631  // Restrict ourselves to the inner most TRT layers To get detector phi.
632  if (layer_or_wheel >= testLayer[ibe]) continue;
633  testLayer[ibe] = layer_or_wheel;
634 
635  if (straw_layer < nearest_straw_layer[ibe]) {
636  nearest_straw_layer[ibe] = straw_layer;
637  nearest_straw[ibe] = straw;
638  const InDetDD::TRT_BaseElement *circleElement = nullptr;
639  circleElement = trtCircle->detectorElement();
640  phi2D[ibe] = radToDegrees(circleElement->strawCenter(nearest_straw[ibe]).phi());
641  circleElement = nullptr;
642  }
643  }
644 
645  if (phi2D[0] == -999) {
646  ATH_MSG_DEBUG("Track did not go through inner layer of Barrel.");
647  } else {
648  ATH_MSG_VERBOSE("Track's closest approach is m_layer_or_wheel: " <<
649  testLayer[0] << " m_straw_layer: " <<
650  nearest_straw_layer[0] << " (in the Barrel).");
651  }
652 
653  if (phi2D[1] == -999) {
654  ATH_MSG_DEBUG("Track did not go through any inner layer of EndCap A or C.");
655  } else {
656  ATH_MSG_VERBOSE("Track's closest approach is m_layer_or_wheel: " <<
657  testLayer[1] << " m_straw_layer: " <<
658  nearest_straw_layer[1] << " (in the EndCaps).");
659  }
660 
661  bool trackfound[2][64];
662 
663  for (int i = 0; i < 2; i++) {
664  std::fill(trackfound[i], trackfound[i] + 64, false);
665  }
666 
667  for (TSOSItBegin = TSOSItBegin0; TSOSItBegin != TSOSItEnd; ++TSOSItBegin) {
668  // Select a TSOS which is non-empty, measurement type and contains both drift circle and track parameters informations
669  if ((*TSOSItBegin) == nullptr) continue;
670 
671  if ( !((*TSOSItBegin)->type(Trk::TrackStateOnSurface::Measurement)) ) continue;
672 
673  const InDet::TRT_DriftCircleOnTrack *trtCircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>((*TSOSItBegin)->measurementOnTrack());
674 
675  if (!trtCircle) continue;
676 
677  const Trk::TrackParameters *aTrackParam = dynamic_cast<const Trk::TrackParameters *>((*TSOSItBegin)->trackParameters());
678 
679  if (!aTrackParam) continue;
680 
681  Identifier DCoTId = trtCircle->identify();
682  barrel_ec = m_pTRTHelper->barrel_ec(DCoTId);
683  layer_or_wheel = m_pTRTHelper->layer_or_wheel(DCoTId);
684  phi_module = m_pTRTHelper->phi_module(DCoTId);
685  straw_layer = m_pTRTHelper->straw_layer(DCoTId);
686  straw = m_pTRTHelper->straw(DCoTId);
687  int ibe = std::abs(barrel_ec) - 1; // ibe = 0 (Barrel), ibe = 1 (Endcap)
688  int iside = barrel_ec > 0 ? 0 : 1; // iside = 0 (Side A), iside = 1 (Side C)
689  int thisStrawNumber[2] = {-1, -1};
690  int chip[2] = {0, 0};
691 
692  if (ibe == 0) {
693  thisStrawNumber[ibe] = strawNumber(straw, straw_layer, layer_or_wheel);
694 
695  if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] < s_Straw_max[ibe]) {
696  chip[ibe] = m_mat_chip_B.at(phi_module).at(thisStrawNumber[ibe]);
697  }
698  } else if (ibe == 1) {
699  thisStrawNumber[ibe] = strawNumberEndCap(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
700 
701  if (thisStrawNumber[ibe] >= 0 && thisStrawNumber[ibe] < s_Straw_max[ibe]) {
702  chip[ibe] = m_mat_chip_E.at(phi_module).at(thisStrawNumber[ibe]);
703  }
704  } else {
705  thisStrawNumber[ibe] = -1;
706  }
707 
708  if (thisStrawNumber[ibe] < 0 || thisStrawNumber[ibe] >= s_Straw_max[ibe]) continue;
709 
710  if (checkB[iside] == 0 && ibe == 0) {
711  nTracksB[iside]++;
712  checkB[iside] = 1;
713  }
714 
715  if (checkEC[iside] == 0 && ibe == 1) {
716  nTracksEC[iside]++;
717  checkEC[iside] = 1;
718  }
719 
720  if (checkEC_B[iside] == 0 && checkB[iside] == 1 && ibe == 1 ) {
721  nTracksEC_B[iside]++;
722  checkEC_B[iside] = 1;
723  }
724 
725  Identifier surfaceID;
726  const Trk::MeasurementBase *mesb = (*TSOSItBegin)->measurementOnTrack();
727  surfaceID = trtCircle->identify();
728  const bool isArgonStraw = ( Straw_Gastype( m_sumTool->getStatusHT(surfaceID, Gaudi::Hive::currentContext()) ) == GasType::Ar );
729  // Assume always Xe if m_ArgonXenonSplitter is not enabled, otherwise check the straw status (good is Xe, non-good is Ar)
730  float temp_locr = aTrackParam->parameters()[Trk::driftRadius];
731  TRTCond::RtRelation const *rtr = m_TRTCalDbTool->getRtRelation(surfaceID);
732  int iphi_module = -9999;
733 
734  if (iside == 0) iphi_module = phi_module;
735  else if (iside == 1) iphi_module = phi_module + 32;
736 
737  if (iphi_module >= 0 && iphi_module < 64) trackfound[ibe][iphi_module] = true;
738  else ATH_MSG_ERROR("Variable iphi_module is out of range!");
739 
740  if (((ibe == 0) && (temp_locr < m_DistToStraw)) ||
741  ((ibe == 1) && ((*TSOSItBegin)->type(Trk::TrackStateOnSurface::Measurement) ||
742  (*TSOSItBegin)->type(Trk::TrackStateOnSurface::Outlier) ||
743  (*TSOSItBegin)->type(Trk::TrackStateOnSurface::Hole)) &&
744  (temp_locr < m_DistToStraw))) {
745  if (m_idHelper->is_trt(DCoTId)) {
746  if (ibe == 0) {
747  hitontrack[ibe]++;
748  } else if (ibe == 1) {
749  hitontrack[ibe]++;
750  hitontrack_E_side[iside]++;
751  }
752  }
753  }
754  const InDet::TRT_DriftCircle *RawDriftCircle = dynamic_cast<const InDet::TRT_DriftCircle *>(trtCircle->prepRawData());
755  bool isTubeHit = (mesb->localCovariance()(Trk::locX, Trk::locX) > 1.0) ? 1 : 0;
756  if (RawDriftCircle) {
757  nTRTHits_side[ibe][iside]++;
758  double t0 = m_TRTCalDbTool->getT0(DCoTId, TRTCond::ExpandedIdentifier::STRAW);
759 
760  const bool driftTimeValid = RawDriftCircle->driftTimeValid();
761 
762  if (driftTimeValid) {
763  const float validRawDriftTime = RawDriftCircle->rawDriftTime();
764 
765  if (m_doExpert && m_doStraws) {
766  ValidRawDriftTimeonTrkS_x = thisStrawNumber[ibe];
767  ValidRawDriftTimeonTrkS_y = validRawDriftTime;
768  fill("TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), ValidRawDriftTimeonTrkS_x, ValidRawDriftTimeonTrkS_y);
769  }
770 
771  if (m_doExpert && m_doChips) {
772  ValidRawDriftTimeonTrkC_x = chip[ibe] - 1;
773  ValidRawDriftTimeonTrkC_y = validRawDriftTime;
774  fill("TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), ValidRawDriftTimeonTrkC_x, ValidRawDriftTimeonTrkC_y);
775  }
776  }
777 
778  if (m_doShift && m_doStraws) {
779  if (ibe == 0) {
780  if (isArgonStraw) {
781  DriftTimeonTrkDist_B_Ar = RawDriftCircle->rawDriftTime();
782  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), DriftTimeonTrkDist_B_Ar);
783  }
784  else {
785  DriftTimeonTrkDist_B = RawDriftCircle->rawDriftTime();
786  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), DriftTimeonTrkDist_B);
787  }
788  } else if (ibe == 1) {
789  if (isArgonStraw) {
790  DriftTimeonTrkDist_E_Ar = RawDriftCircle->rawDriftTime();
791  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), DriftTimeonTrkDist_E_Ar);
792  }
793  else {
794  DriftTimeonTrkDist_E = RawDriftCircle->rawDriftTime();
795  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), DriftTimeonTrkDist_E);
796  }
797  }
798  }
799 
800  float locR_err = 0.0;
801  const AmgSymMatrix(5)* b_err = aTrackParam->covariance();
802 
803  if (b_err) {
804  if (!Amg::hasPositiveDiagElems(*b_err)) {
805  ATH_MSG_WARNING("Some diagonal element(s) of the covariance matrix is (are) infinite or smaller than / too close to zero or above the covariance cutoff");
806  }
807  else {
808  locR_err = Amg::error(*b_err, Trk::locR);
809  }
810  } else {
811  ATH_MSG_ERROR("Track parameters have no covariance attached.");
812  }
813 
814  float loc_err = sqrt(Amg::error(trtCircle->localCovariance(), Trk::driftRadius));
815  float locR = aTrackParam->parameters()[Trk::driftRadius];
816  float loc = trtCircle->localParameters()[Trk::driftRadius];
817 
818  if (isTubeHit) {
819  bool isOK = false;
820  loc = m_drifttool->driftRadius(RawDriftCircle->rawDriftTime(), DCoTId, t0, isOK);
821 
822  if ((loc * locR) < 0) loc = -loc;
823  }
824 
825  // Calculate Residuals for hit
826  if (m_doShift && m_doStraws) {
827  bool pull_b_fill;
828  double pull_b = -999.;
829  const double diff_loc_err = (loc_err * loc_err * loc_err * loc_err) - (locR_err * locR_err * locR_err * locR_err);
830  if ( diff_loc_err > 0 ) {
831  pull_b = (loc - locR) / sqrt(diff_loc_err);
832  pull_b_fill = true;
833  }
834  else pull_b_fill = false;
835  const double thist0 = m_TRTCalDbTool->getT0(surfaceID);
836  const double trkdrifttime = (!rtr) ? 0 : rtr->drifttime(std::abs(locR));
837  const double timeresidual = RawDriftCircle->rawDriftTime() - thist0 - trkdrifttime;
838 
839  if (ibe == 0) {
840  if (!isTubeHit) {
841  if (pull_b_fill) {
842  Pull_Biased_Barrel = pull_b;
843  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), Pull_Biased_Barrel);
844  }
845  }
846 
847  if (isArgonStraw) {
848  Residual_B_Ar = loc - locR;
849  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B_Ar);
850  Residual_noTubeHits_B_Ar = loc - locR;
851  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B_Ar);
852 
853  if (cnst_is_pT_over_20GeV) {
854  Residual_B_Ar_20GeV = loc - locR;
855  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B_Ar_20GeV);
856  Residual_noTubeHits_B_Ar_20GeV = loc - locR;
857  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B_Ar_20GeV);
858  }
859  TimeResidual_B_Ar = timeresidual;
860  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_B_Ar);
861  TimeResidual_noTubeHits_B_Ar = timeresidual;
862  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_noTubeHits_B_Ar);
863  } else {
864  Residual_B = loc - locR;
865  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B);
866  Residual_noTubeHits_B = loc - locR;
867  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B);
868  TimeResidual_B = timeresidual;
869  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_B);
870  TimeResidual_noTubeHits_B = timeresidual;
871  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe), TimeResidual_noTubeHits_B);
872 
873  if (cnst_is_pT_over_20GeV) {
874  Residual_B_20GeV = loc - locR;
875  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_B_20GeV);
876  Residual_noTubeHits_B_20GeV = loc - locR;
877  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe), Residual_noTubeHits_B_20GeV);
878  }
879  }
880  } else if (ibe == 1) {
881  if (!isTubeHit) {
882  if (pull_b_fill) {
883  Pull_Biased_EndCap = pull_b;
884  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), Pull_Biased_EndCap);
885  }
886  }
887 
888  if (isArgonStraw) {
889  Residual_E_Ar = loc - locR;
890  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E_Ar);
891  Residual_noTubeHits_E_Ar = loc - locR;
892  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E_Ar);
893  TimeResidual_E_Ar = timeresidual;
894  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_E_Ar);
895  TimeResidual_noTubeHits_E_Ar = timeresidual;
896  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_noTubeHits_E_Ar);
897 
898  if (cnst_is_pT_over_20GeV) {
899  Residual_E_Ar_20GeV = loc - locR;
900  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E_Ar_20GeV);
901  Residual_noTubeHits_E_Ar_20GeV = loc - locR;
902  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E_Ar_20GeV);
903  }
904  } else {
905  Residual_E = loc - locR;
906  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E);
907  Residual_noTubeHits_E = loc - locR;
908  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E);
909  TimeResidual_E = timeresidual;
910  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_E);
911  TimeResidual_noTubeHits_E = timeresidual;
912  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TimeResidual_noTubeHits_E);
913 
914  if (cnst_is_pT_over_20GeV) {
915  Residual_E_20GeV = loc - locR;
916  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_E_20GeV);
917  Residual_noTubeHits_E_20GeV = loc - locR;
918  if (!isTubeHit) fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), Residual_noTubeHits_E_20GeV);
919  }
920  }
921  }
922  }
923 
924  if (m_doShift) {
925  if (ibe == 0) {
926  if (isArgonStraw) {
927  WireToTrkPosition_B_Ar = locR;
928  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), WireToTrkPosition_B_Ar);
929  } else {
930  WireToTrkPosition_B = locR;
931  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), WireToTrkPosition_B);
932  }
933  } else if (ibe == 1) {
934  if (isArgonStraw) {
935  WireToTrkPosition_E_Ar = locR;
936  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), WireToTrkPosition_E_Ar);
937  } else {
938  WireToTrkPosition_E = locR;
939  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), WireToTrkPosition_E);
940  }
941  }
942  }
943 
944  const float LE = (RawDriftCircle->driftTimeBin()) * 3.125;
945  const float EP = timeCor;
946 
947  if (m_doShift && m_doStraws) {
948  if (ibe == 0) {
949  if (isArgonStraw) {
950  if (m_isCosmics) {
951  RtRelation_B_Ar_x = LE - EP - t0;
952  RtRelation_B_Ar_y = std::abs(locR);
953  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_Ar_x, RtRelation_B_Ar_y);
954  } else {
955  RtRelation_B_Ar_x = LE - t0;
956  RtRelation_B_Ar_y = std::abs(locR);
957  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_Ar_x, RtRelation_B_Ar_y);
958  }
959  } else {
960  if (m_isCosmics) {
961  RtRelation_B_x = LE - EP - t0;
962  RtRelation_B_y = std::abs(locR);
963  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_x, RtRelation_B_y);
964  } else {
965  RtRelation_B_x = LE - t0;
966  RtRelation_B_y = std::abs(locR);
967  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), RtRelation_B_x, RtRelation_B_y);
968  }
969  }
970  } else if (ibe == 1) {
971  if (isArgonStraw) {
972  if (m_isCosmics) {
973  RtRelation_E_Ar_x = LE - EP - t0;
974  RtRelation_E_Ar_y = std::abs(locR);
975  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_Ar_x, RtRelation_E_Ar_y);
976  } else {
977  RtRelation_E_Ar_x = LE - t0;
978  RtRelation_E_Ar_y = std::abs(locR);
979  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_Ar_x, RtRelation_E_Ar_y);
980  }
981  } else {
982  if (m_isCosmics) {
983  RtRelation_E_x = LE - EP - t0;
984  RtRelation_E_y = std::abs(locR);
985  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_x, RtRelation_E_y);
986  } else {
987  RtRelation_E_x = LE - t0;
988  RtRelation_E_y = std::abs(locR);
989  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), RtRelation_E_x, RtRelation_E_y);
990  }
991  }
992  }
993  }
994 
995  const int driftTimeBin = RawDriftCircle->driftTimeBin();
996  const int firstBinHigh = RawDriftCircle->firstBinHigh();
997  const int lastBinHigh = RawDriftCircle->lastBinHigh();
998  const int trailingEdge = RawDriftCircle->trailingEdge();
999  float trailingEdgeScaled = (trailingEdge + 1) * 3.125;
1000 
1001  if (firstBinHigh || lastBinHigh || driftTimeBin > 0 || trailingEdge < 23) nTRTHitsW[ibe][iside]++;
1002 
1003  if ((trailingEdge < 23) &&
1004  !(RawDriftCircle->lastBinHigh()) &&
1005  !(RawDriftCircle->firstBinHigh())) {
1006 
1007  if (m_doExpert && m_doChips) {
1008  HitTronTMapC_x = chip[ibe] - 1;
1009  HitTronTMapC_y = trailingEdgeScaled;
1010  fill("TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTMapC_x, HitTronTMapC_y);
1011  }
1012 
1013  if (m_doExpert && m_doStraws) {
1014  HitTronTwEPCMapS_x = thisStrawNumber[ibe];
1015  HitTronTwEPCMapS_y = trailingEdgeScaled - timeCor;
1016  fill("TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTwEPCMapS_x, HitTronTwEPCMapS_y);
1017  }
1018 
1019  if (m_doExpert && m_doChips) {
1020  HitTronTwEPCMapC_x = chip[ibe] - 1;
1021  HitTronTwEPCMapC_y = trailingEdgeScaled - timeCor;
1022  fill("TRTTrackHistograms"+std::to_string(ibe)+std::to_string(iphi_module), HitTronTwEPCMapC_x, HitTronTwEPCMapC_y);
1023  }
1024 
1025  if (m_doShift && m_doStraws) {
1026  if (RawDriftCircle->driftTimeValid()) {
1027  if (ibe == 0) {
1028  if (isArgonStraw) {
1029  TronTDist_B_Ar = trailingEdgeScaled;
1030  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), TronTDist_B_Ar);
1031  AvgTroTDetPhi_B_Ar_x = phi2D[ibe];
1032  AvgTroTDetPhi_B_Ar_y = trailingEdgeScaled;
1033  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), AvgTroTDetPhi_B_Ar_x, AvgTroTDetPhi_B_Ar_y);
1034  } else {
1035  TronTDist_B = trailingEdgeScaled;
1036  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), TronTDist_B);
1037  AvgTroTDetPhi_B_x = phi2D[ibe];
1038  AvgTroTDetPhi_B_y = trailingEdgeScaled;
1039  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), AvgTroTDetPhi_B_x, AvgTroTDetPhi_B_y);
1040  }
1041  } else if (ibe == 1) {
1042  if (isArgonStraw) {
1043  TronTDist_E_Ar = trailingEdgeScaled;
1044  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TronTDist_E_Ar);
1045  AvgTroTDetPhi_E_Ar_x = phi2D[ibe];
1046  AvgTroTDetPhi_E_Ar_y = trailingEdgeScaled;
1047  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), AvgTroTDetPhi_E_Ar_x, AvgTroTDetPhi_E_Ar_y);
1048  } else {
1049  TronTDist_E = trailingEdgeScaled;
1050  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), TronTDist_E);
1051  AvgTroTDetPhi_E_x = phi2D[ibe];
1052  AvgTroTDetPhi_E_y = trailingEdgeScaled;
1053  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), AvgTroTDetPhi_E_x, AvgTroTDetPhi_E_y);
1054  }
1055  }
1056  }
1057  }
1058  }
1059  }
1060  }
1061 
1062  // ToDo: work on the part below
1063  for (int ibe = 0; ibe < 2; ibe++) {
1064  for (int i = 0; i < 64; i++)
1065  if (trackfound[ibe][i])
1066  ntrackstack[ibe][i]++;
1067 
1068  if (m_doShift) {
1069  if (ibe == 0) {
1070  if (hitontrack[ibe] >= m_minTRThits) {
1071  NumHoTDetPhi_B_x = phi2D[ibe];
1072  NumHoTDetPhi_B_y = hitontrack[ibe];
1073  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), NumHoTDetPhi_B_x, NumHoTDetPhi_B_y);
1074  }
1075  }
1076 
1077  if (ibe == 1) {
1078  if (hitontrack_E_side[0] >= m_minTRThits) {
1079  NumHoTDetPhi_E_x = phi2D[ibe];
1080  NumHoTDetPhi_E_y = hitontrack_E_side[0];
1081  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+"0", NumHoTDetPhi_E_x, NumHoTDetPhi_E_y);
1082  }
1083 
1084  if (hitontrack_E_side[1] >= m_minTRThits) {
1085  NumHoTDetPhi_E_x = phi2D[ibe];
1086  NumHoTDetPhi_E_y = hitontrack_E_side[1];
1087  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+"1", NumHoTDetPhi_E_x, NumHoTDetPhi_E_y);
1088  }
1089  }
1090  }
1091 
1092  if (phi2D[ibe] < 0) continue;
1093 
1094  if (m_doShift) {
1095  if (ibe == 0) {
1096  if (nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1] > 0) {
1097  NumTrksDetPhi_B = phi2D[ibe];
1098  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), NumTrksDetPhi_B);
1099  }
1100  } else if (ibe == 1) {
1101  if (nTRTHitsW[ibe][0] > 0) {
1102  NumTrksDetPhi_E = phi2D[ibe];
1103  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+"0", NumTrksDetPhi_E);
1104  }
1105 
1106  if (nTRTHitsW[ibe][1] > 0) {
1107  NumTrksDetPhi_E = phi2D[ibe];
1108  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+"1", NumTrksDetPhi_E);
1109  }
1110  }
1111  }
1112 
1113  if (ibe == 0) {
1114  if ((nTRTHitsW[ibe][0] + nTRTHitsW[ibe][1]) > 0) {
1115  nTrksperLB_B++;
1116  }
1117  if (comTimeObject) {
1118  if (m_doShift && (phi2D[ibe] > 0) && (std::abs(timeCor) > 1e-8)) {
1119  EvtPhaseDetPhi_B_x = phi2D[ibe];
1120  EvtPhaseDetPhi_B_y = timeCor;
1121  fill("ShiftTRTTrackHistograms"+std::to_string(ibe), EvtPhaseDetPhi_B_x, EvtPhaseDetPhi_B_y);
1122  }
1123  }
1124  } else if (ibe == 1) {
1125  for (int iside = 0; iside < 2; iside++) {
1126  if (nTRTHitsW[ibe][iside] > 0) nTrksperLB_E[iside]++;
1127  if (comTimeObject) {
1128  if (nTRTHits_side[ibe][iside] > 5 && (std::abs(timeCor)
1129  > 1e-8)) {
1130  if (m_doShift) {
1131  EvtPhaseDetPhi_E_x = phi2D[ibe];
1132  EvtPhaseDetPhi_E_y = timeCor;
1133  fill("ShiftTRTTrackHistograms"+std::to_string(ibe)+std::to_string(iside), EvtPhaseDetPhi_E_x, EvtPhaseDetPhi_E_y);
1134  }
1135  }
1136  }
1137  }
1138  }
1139  }
1140  }
1141 
1142  if (comTimeObject) {
1143  if (std::abs(timeCor) > 1e-8) {
1144  if (m_doShift) {
1145  EvtPhase = timeCor;
1146  fill("ShiftTRTTrackHistograms0", EvtPhase);
1147  }
1148 
1149  if (m_doShift && trigDecision) {
1150  std::vector<int> trigid;
1151  trigid.clear(); // Trigger ID
1152  // Get bits for trigger after veto
1153  std::vector<unsigned int> level1TAV = trigDecision->tav();
1154 
1155  for (unsigned int j = 0; j < 8 && j < level1TAV.size(); ++j) {
1156  for (unsigned int i = 0; i < 32; ++i) {
1157  if ((level1TAV[j] >> i) & 0x1) {
1158  trigid.push_back(i + (j % 8) * 32); // Found the ID
1159  }
1160  }
1161  }
1162 
1163  for (unsigned int j = 0; j < trigid.size(); ++j) {
1164  EvtPhaseVsTrig_x = timeCor;
1165  EvtPhaseVsTrig_y = trigid[j];
1166  fill("ShiftTRTTrackHistograms0", EvtPhaseVsTrig_x, EvtPhaseVsTrig_y);
1167  }
1168  }
1169  }
1170  }
1171 
1172  if (m_doShift) {
1173  Summary = 0;
1174  SummaryWeight = 1.;
1175  fill("SmryHistograms", SummaryWeight, Summary);
1176 
1177  if (m_doTracksMon) {
1178  Summary = 1;
1179  SummaryWeight = nTotalTracks;
1180  fill("SmryHistograms", SummaryWeight, Summary);
1181  Summary = 2;
1182  SummaryWeight = nTracksB[0];
1183  fill("SmryHistograms", SummaryWeight, Summary);
1184  Summary = 3;
1185  SummaryWeight = nTracksB[1];
1186  fill("SmryHistograms", SummaryWeight, Summary);
1187  Summary = 4;
1188  SummaryWeight = nTracksEC[0];
1189  fill("SmryHistograms", SummaryWeight, Summary);
1190  Summary = 5;
1191  SummaryWeight = nTracksEC[1];
1192  fill("SmryHistograms", SummaryWeight, Summary);
1193  Summary = 6;
1194  SummaryWeight = nTracksEC_B[0];
1195  fill("SmryHistograms", SummaryWeight, Summary);
1196  Summary = 7;
1197  SummaryWeight = nTracksEC_B[1];
1198  fill("SmryHistograms", SummaryWeight, Summary);
1199  }
1200 
1201  const unsigned int lumiBlock = eventInfo.lumiBlock();
1202  ATH_MSG_VERBOSE("This is lumiblock : " << lumiBlock);
1203  int lastLumiBlock = -99; // ToDo - last lumiblock calculation is not correct
1204  if ((int)lumiBlock != lastLumiBlock) {
1205  lastLumiBlock = lumiBlock;
1206  }
1207  float evtLumiBlock = 1.;
1208  float lumiBlockScale = (evtLumiBlock > 0) ? (1. / evtLumiBlock) : 0;
1209 
1210  if (m_doTracksMon && evtLumiBlock > 0) {
1211  NTrksperLB_x = lastLumiBlock;
1212  NTrksperLB_y = (float)nTrksperLB_B * lumiBlockScale;
1213  fill("ShiftTRTTrackHistograms0", NTrksperLB_x, NTrksperLB_y);
1214 
1215  for (int iside = 0; iside < 2; iside++) {
1216  NTrksperLB_x = lastLumiBlock;
1217  NTrksperLB_y = (float)nTrksperLB_E[iside] * lumiBlockScale;
1218  fill("ShiftTRTTrackHistograms1"+std::to_string(iside), NTrksperLB_x, NTrksperLB_y);
1219  }
1220 
1221  nTrksperLB_B = 0;
1222 
1223  for (int iside = 0; iside < 2; iside++) {
1224  nTrksperLB_E[iside] = 0;
1225  }
1226  }
1227  }
1228 
1229  ATH_MSG_DEBUG("end of event and lumi block");
1230  //number of events in lumiblock counter setted to zero since it is end of the run or the lumiblock
1231 
1232  return StatusCode::SUCCESS;
1233 }
1234 
1235 //----------------------------------------------------------------------------------//
1237  const xAOD::EventInfo& eventInfo, const EventContext& ctx) const {
1238 //----------------------------------------------------------------------------------//
1239 
1240  auto IntLum = Monitored::Scalar<float>("IntLum", 0.0);
1241  auto LBvsLum = Monitored::Scalar<float>("LBvsLum", 0.0);
1242  auto LBvsTime_x = Monitored::Scalar<float>("LBvsTime_x", 0.0);
1243  auto LBvsTime_y = Monitored::Scalar<float>("LBvsTime_y", 0.0);
1244  auto IntLumWeight = Monitored::Scalar<float>("IntLumWeight", 0.0);
1245  auto LBvsLumWeight = Monitored::Scalar<float>("LBvsLumWeight", 0.0);
1246 
1247  int lumiBlockNumber;
1248  int timeStamp;
1249  lumiBlockNumber = eventInfo.lumiBlock();
1250  timeStamp = eventInfo.timeStamp();
1251 
1252  int runNumber;
1253  runNumber = eventInfo.runNumber();
1254  // get Online Luminosity
1255  double intLum = (lbDuration(ctx) * lbAverageLuminosity(ctx));
1256  IntLum = 0.5;
1257  IntLumWeight = intLum;
1258  fill("SmryHistograms", IntLumWeight, IntLum);
1259  LBvsLum = lumiBlockNumber;
1260  LBvsLumWeight = intLum;
1261  fill("SmryHistograms", LBvsLumWeight, LBvsLum);
1262  LBvsTime_x = lumiBlockNumber;
1263  LBvsTime_y = timeStamp;
1264  fill("SmryHistograms", LBvsTime_x, LBvsTime_y);
1265 
1266  ATH_MSG_VERBOSE("Filling TRT Aging Histos");
1267 
1268  auto Trackr_HT = Monitored::Scalar<float>("Trackr_HT", 0.0);
1269  auto Trackr_All = Monitored::Scalar<float>("Trackr_All", 0.0);
1270  auto Trackz_HT = Monitored::Scalar<float>("Trackz_HT", 0.0);
1271  auto Trackz_All = Monitored::Scalar<float>("Trackz_All", 0.0);
1272 
1273  auto p_trk = trackCollection.begin();
1274  const Trk::Perigee *perigee = nullptr;
1275  const DataVector<const Trk::TrackParameters> *AllTrkPar(nullptr);
1277 
1278  for (; p_trk != trackCollection.end(); ++p_trk) {
1279  AllTrkPar = ((*p_trk)->track())->trackParameters();
1280 
1281  for (p_trkpariter = AllTrkPar->begin(); p_trkpariter != AllTrkPar->end(); ++p_trkpariter) {
1282  if ((perigee = dynamic_cast<const Trk::Perigee *>(*p_trkpariter))) break;
1283  }
1284 
1285  // If you went through all of the track parameters and found no perigee mearsurement
1286  // then something is wrong with the track and so don't use the track.
1287  // i.e. continue to the next track.
1288  if (!perigee) {
1289  ATH_MSG_DEBUG("No perigee mearsurement found for the track. This entry will not be propogated to aging histograms.");
1290  continue;
1291  }
1292 
1293  float track_eta = perigee->eta();
1294  float track_p = (perigee->parameters()[Trk::qOverP] != 0.) ? std::abs(1. / (perigee->parameters()[Trk::qOverP])) : 10e7;
1295  const Trk::TrackStates *trackStates = ((*p_trk)->track())->trackStateOnSurfaces();
1296 
1297  if (trackStates == nullptr) continue;
1298 
1299  Trk::TrackStates::const_iterator TSOSItBegin = trackStates->begin();
1300  Trk::TrackStates::const_iterator TSOSItEnd = trackStates->end();
1301 
1302  uint8_t tempHitsVariable = 0;
1303  (*p_trk)->summaryValue(tempHitsVariable, xAOD::SummaryType::numberOfTRTHits);
1304  int trt_hits = unsigned(tempHitsVariable);
1305 
1306  const bool passed_track_preselection = (static_cast<bool>(m_trackSelTool->accept(**p_trk)) || m_isCosmics) &&
1307  trt_hits >= 6. &&
1308  std::abs(track_p) >= 5000.;
1309 
1310  if (!passed_track_preselection) continue;
1311 
1312  // Now we have hit informations
1313  const Trk::TrackStates *track_states = ((*p_trk)->track())->trackStateOnSurfaces();
1314 
1315  if (track_states) {
1316  ATH_MSG_DEBUG("This track has " << track_states->size() << " track states on surface.");
1317  } else {
1318  ATH_MSG_DEBUG("This track has null track states on surface.");
1319  continue;
1320  }
1321 
1322  int barrel_ec_side = 0;
1323  int layer_or_wheel = 0;
1324  int phi_module = 0;
1325  int straw_layer = 0;
1326 
1327  for (; TSOSItBegin != TSOSItEnd; ++TSOSItBegin) {
1328  if ((*TSOSItBegin) == nullptr) continue;
1329  if ( !((*TSOSItBegin)->type(Trk::TrackStateOnSurface::Measurement)) ) continue;
1330 
1331  const InDet::TRT_DriftCircleOnTrack *trtCircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>((*TSOSItBegin)->measurementOnTrack());
1332  const Trk::TrackParameters *aTrackParam = dynamic_cast<const Trk::TrackParameters *>((*TSOSItBegin)->trackParameters());
1333 
1334  if (!trtCircle) continue;
1335  if (!aTrackParam) continue;
1336 
1337 
1338  Identifier DCoTId = trtCircle->identify();
1339  barrel_ec_side = m_pTRTHelper->barrel_ec(DCoTId);
1340  layer_or_wheel = m_pTRTHelper->layer_or_wheel(DCoTId);
1341  phi_module = m_pTRTHelper->phi_module(DCoTId);
1342  straw_layer = m_pTRTHelper->straw_layer(DCoTId);
1343  int Ba_Ec = abs(barrel_ec_side) - 1; // Ba_Ec: 0 is barrel, 1 is Endcap
1344  int Side = barrel_ec_side > 0 ? 0 : 1; // Side : 0 is side_A, 1 is side_C
1345  double xPos = trtCircle->globalPosition().x(); // Global x coordinate
1346  double yPos = trtCircle->globalPosition().y(); // Global y coordinate
1347  double zPos = trtCircle->globalPosition().z(); // Global z coordinate
1348  double RPos = sqrt(xPos * xPos + yPos * yPos);
1349  Identifier surfaceID;
1350  surfaceID = trtCircle->identify();
1351  // Assume always Xe if m_ArgonXenonSplitter is not enabled, otherwise check the straw status (good is Xe, non-good is Ar)
1352  const InDet::TRT_DriftCircle *RawDriftCircle = dynamic_cast<const InDet::TRT_DriftCircle *>(trtCircle->prepRawData());
1353 
1354  if (!RawDriftCircle) { //coverity 25097
1355  // This shouldn't happen in normal conditions because trtCircle is a TRT_DriftCircleOnTrack object
1356  ATH_MSG_WARNING("RawDriftCircle object returned null");
1357  continue;
1358  }
1359 
1360  int middleHTbit = RawDriftCircle->getWord() & 0x00020000;
1361  //0x00020000 = 0000 0000 0000 0000 0000 0010 0000 0000 0000 0000
1362  bool is_middleHTbit_high = (middleHTbit != 0);
1363  // bool isHighLevel= RawDriftCircle->highLevel();
1364  bool isHighLevel = is_middleHTbit_high; // Hardcoded HT Middle Bit
1365  bool shortStraw = false;
1366  int InputBar = 0;
1367 
1368  if (std::abs(track_eta) < 2. && Ba_Ec == 0.) {
1369  if ((layer_or_wheel == 0) && (phi_module < 4 || (phi_module > 7 && phi_module < 12) || (phi_module > 15 && phi_module < 20) || (phi_module > 23 && phi_module < 28))) InputBar = 1;
1370  else if ((runNumber >= 296939) && (layer_or_wheel == 0) && (phi_module > 27)) InputBar = 1;
1371  else if (layer_or_wheel == 0)
1372  InputBar = 0;
1373  else if ((layer_or_wheel == 1) && ((phi_module > 1 && phi_module < 6) || (phi_module > 9 && phi_module < 14) || (phi_module > 17 && phi_module < 22) || (phi_module > 25 && phi_module < 30)))
1374  InputBar = 1;
1375  else if (layer_or_wheel == 1)
1376  InputBar = 0;
1377  else if (layer_or_wheel == 2 && phi_module % 2 != 0)
1378  InputBar = 1;
1379  else if (layer_or_wheel == 2)
1380  InputBar = 0;
1381  else {
1382  ATH_MSG_WARNING("Should not pass here");
1383  continue;
1384  }
1385 
1386  if ((layer_or_wheel == 0) && straw_layer < 9.)
1387  shortStraw = true;
1388  }
1389 
1390  // Fill Barrel Plots
1391  if ((!shortStraw) && (Ba_Ec == 0)) {
1392  Trackz_All = zPos;
1393  fill("TRTAgingHistograms0"+std::to_string(layer_or_wheel)+std::to_string(InputBar), Trackz_All);
1394  if (isHighLevel) {
1395  Trackz_HT = zPos;
1396  fill("TRTAgingHistograms"+std::to_string(Ba_Ec)+std::to_string(layer_or_wheel)+std::to_string(InputBar), Trackz_HT);
1397  }
1398  }
1399 
1400  if (shortStraw) {
1401  if (zPos > 0.) {
1402  Trackz_All = zPos;
1403  fill("TRTAgingHistograms"+std::to_string(Ba_Ec)+"3"+std::to_string(InputBar), Trackz_All);
1404  if (isHighLevel) {
1405  Trackz_HT = zPos;
1406  fill("TRTAgingHistograms"+std::to_string(Ba_Ec)+"3"+std::to_string(InputBar), Trackz_HT);
1407  }
1408  } else {
1409  Trackz_All = zPos;
1410  fill("TRTAgingHistograms"+std::to_string(Ba_Ec)+"4"+std::to_string(InputBar), Trackz_All);
1411 
1412  if (isHighLevel) {
1413  Trackz_HT = zPos;
1414  fill("TRTAgingHistograms"+std::to_string(Ba_Ec)+"4"+std::to_string(InputBar), Trackz_HT);
1415  }
1416  }
1417  }
1418 
1419  // End of Barrel plots, moving to Endcap plots
1420  int WType = -1;
1421 
1422  if ((Ba_Ec == 1) && (layer_or_wheel < 6) &&
1423  ((straw_layer > 3 && straw_layer < 8) ||
1424  (straw_layer > 11))) {
1425  WType = 0;
1426  }
1427  if ((Ba_Ec == 1) && (layer_or_wheel >= 6) &&
1428  (straw_layer > 3)) {
1429  WType = 3;
1430  }
1431  if ((Ba_Ec == 1) && (layer_or_wheel < 6) &&
1432  ((straw_layer > -1 && straw_layer < 4) ||
1433  (straw_layer > 7 && straw_layer < 12))) {
1434  WType = 2;
1435  }
1436  if ((Ba_Ec == 1) && (layer_or_wheel >= 6) &&
1437  ((straw_layer > -1 && straw_layer < 4))) {
1438  WType = 1;
1439  }
1440 
1441  if (WType < 0 && Ba_Ec == 1) { // Coverity CID 25096
1442  ATH_MSG_WARNING("The variable \"WType\" is less than zero!.");
1443  continue;
1444  }
1445 
1446  if (Ba_Ec == 1) {
1447  Trackr_All = RPos;
1448  fill("TRTAgingHistograms"+std::to_string(Ba_Ec)+std::to_string(WType)+std::to_string(Side), Trackr_All);
1449  if (isHighLevel) {
1450  Trackr_HT = RPos;
1451  fill("TRTAgingHistograms"+std::to_string(Ba_Ec)+std::to_string(WType)+std::to_string(Side), Trackr_HT);
1452  }
1453  }
1454  }
1455  }
1456 
1457  return StatusCode::SUCCESS;
1458 }
1459 
1460 
1461 StatusCode TRTMonitoringRun3ESD_Alg::fillHistograms( const EventContext& ctx ) const {
1462  using namespace Monitored;
1463  bool passEventBurst = true;
1464 
1465  // Declare the quantities which should be monitored
1466 
1467  // Set the values of the monitored variables for the event
1468 
1469  ATH_MSG_VERBOSE("Monitoring Histograms being filled");
1470 
1474 
1475  if (!xAODEventInfo.isValid()) {
1476  ATH_MSG_ERROR("Could not find event info object " << m_xAODEventInfoKey.key() <<
1477  " in store");
1478  return StatusCode::FAILURE;
1479  }
1480 
1481  if (m_doTracksMon) {
1482  if (!trackCollection.isValid()) {
1483  ATH_MSG_ERROR("Could not find track collection " << m_trackCollectionKey.key() <<
1484  " in store");
1485  return StatusCode::FAILURE;
1486  }
1487  const xAOD::TrigDecision* trigDecision = nullptr;
1488  if (! m_trigDecisionKey.empty()) {
1489  trigDecision = SG::get(m_trigDecisionKey, ctx);
1490  if (!trigDecision) {
1491  ATH_MSG_INFO("Could not find trigger decision object " << m_trigDecisionKey.key() <<
1492  " in store");
1493  }
1494  }
1495  const ComTime *comTimeObject=nullptr;
1496  if (!m_comTimeObjectKey.empty()) {
1497  SG::ReadHandle<ComTime> tmp_comTimeObject(m_comTimeObjectKey, ctx);
1498  if (!tmp_comTimeObject.isValid()) {
1499  // NOTE: failing to retrieve ComTime from store for some reason
1500  ATH_MSG_DEBUG("Could not find com time object " << m_comTimeObjectKey.key() << " in store" );
1501  }
1502  else {
1503  comTimeObject = tmp_comTimeObject.cptr();
1504  }
1505  }
1506  ATH_CHECK( fillTRTTracks(*trackCollection, trigDecision, comTimeObject, *xAODEventInfo) );
1507  }
1508 
1509  if (!m_doTracksMon) {
1510  if (!trackCollection.isValid()) {
1511  ATH_MSG_ERROR("Could not find track collection " << m_trackCollectionKey.key() <<
1512  " in store");
1513  return StatusCode::FAILURE;
1514  }
1515  }
1516 
1517  if (passEventBurst) { // ESD files does not have an RDO container to pass event burst, what to do?
1518  ATH_CHECK( fillTRTHighThreshold(*trackCollection, *xAODEventInfo, ctx) );
1519  }
1520 
1521 
1522 
1523  return StatusCode::SUCCESS;
1524 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TRTMonitoringRun3ESD_Alg::initialize
virtual StatusCode initialize() override
initialize
Definition: TRTMonitoringRun3ESD_Alg.cxx:78
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
TRTMonitoringRun3ESD_Alg::m_min_pixel_hits
int m_min_pixel_hits
Definition: TRTMonitoringRun3ESD_Alg.h:135
TRTMonitoringRun3ESD_Alg::m_minP
float m_minP
Definition: TRTMonitoringRun3ESD_Alg.h:139
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
TRT_ID::layer_id
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
Definition: TRT_ID.h:500
lastBinHigh
bool lastBinHigh(unsigned int m_word)
Definition: driftCircle.h:108
TRTMonitoringRun3ESD_Alg::strawNumberEndCap
int strawNumberEndCap(int strawNumber, int strawLayerNumber, int LayerNumber, int phi_stack, int side) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:291
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TRT::Hit::straw
@ straw
Definition: HitInfo.h:82
InDet::TRT_DriftCircleOnTrack::prepRawData
virtual const TRT_DriftCircle * prepRawData() const override final
returns the PrepRawData - is a TRT_DriftCircle in this scope
Definition: TRT_DriftCircleOnTrack.h:202
Amg::hasPositiveDiagElems
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
Definition: EventPrimitivesCovarianceHelpers.h:96
AthMonitorAlgorithm::lbAverageLuminosity
virtual float lbAverageLuminosity(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).
Definition: AthMonitorAlgorithm.cxx:250
TRTMonitoringRun3ESD_Alg::m_TRT_BCIDCollectionKey
SG::ReadHandleKey< InDetTimeCollection > m_TRT_BCIDCollectionKey
Definition: TRTMonitoringRun3ESD_Alg.h:111
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
Trk::locX
@ locX
Definition: ParamDefs.h:37
TRTMonitoringRun3ESD_Alg::fillTRTTracks
StatusCode fillTRTTracks(const xAOD::TrackParticleContainer &trackCollection, const xAOD::TrigDecision *trigDecision, const ComTime *comTimeObject, const xAOD::EventInfo &eventInfo) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:414
ComTime::getTime
double getTime() const
Definition: ComTime.h:44
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
TRT_DetectorManager.h
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TRT_LoLumRawData::highLevel
virtual bool highLevel() const override final
Definition: TRT_LoLumRawData.h:128
TRTMonitoringRun3ESD_Alg::s_iStack_max
static const int s_iStack_max[2]
Definition: TRTMonitoringRun3ESD_Alg.h:98
TRTMonitoringRun3ESD_Alg::s_numberOfStacks
static const int s_numberOfStacks[2]
Definition: TRTMonitoringRun3ESD_Alg.h:100
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TRT_LoLumRawData
Definition: TRT_LoLumRawData.h:25
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDetDD::TRT_DetectorManager::getBarrelElement
const TRT_BarrelElement * getBarrelElement(unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
Access Barrel Elements:---------------—(Fast)-------------------------—.
Definition: TRT_DetectorManager.cxx:103
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
TRT_ID::straw_layer_hash_max
size_type straw_layer_hash_max(void) const
Definition: TRT_ID.h:920
InDetDD::TRT_BaseElement::nStraws
unsigned int nStraws() const
Number of straws in the element.
EventPrimitivesHelpers.h
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
M_PI
#define M_PI
Definition: ActiveFraction.h:11
InDetDD::TRT_BaseElement::strawCenter
const Amg::Vector3D & strawCenter(int straw) const
Straw Surface: Local -> global transform of the straw via integer.
Definition: TRT_BaseElement.cxx:143
xAOD::TrigDecision_v1::tav
const std::vector< uint32_t > & tav() const
Get the Trigger After Veto bits.
TRTMonitoringRun3ESD_Alg::m_min_si_hits
int m_min_si_hits
Definition: TRTMonitoringRun3ESD_Alg.h:134
xAOD::numberOfTRTHits
@ numberOfTRTHits
number of TRT hits [unit8_t].
Definition: TrackingPrimitives.h:275
Trk::locR
@ locR
Definition: ParamDefs.h:44
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
TRTMonitoringRun3ESD_Alg::m_DistToStraw
float m_DistToStraw
Definition: TRTMonitoringRun3ESD_Alg.h:131
InDetRawDataContainer
Definition: InDetRawDataContainer.h:27
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
TRTMonitoringRun3ESD_Alg.h
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
InDetRawDataContainer.h
InDet::TRT_DriftCircle::driftTimeBin
int driftTimeBin() const
returns the leading edge bin defined as in TRT_LoLumRawData to be the first 0-1 transition
MuonValidation_CreateSlides_config.Summary
list Summary
Definition: MuonValidation_CreateSlides_config.py:34
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
ComTime
Definition: ComTime.h:17
TRTMonitoringRun3ESD_Alg::radToDegrees
float radToDegrees(float radValue) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:369
TRTMonitoringRun3ESD_Alg::m_sumTool
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
Definition: TRTMonitoringRun3ESD_Alg.h:104
InDet::TRT_DriftCircleOnTrack::detectorElement
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
Definition: TRT_DriftCircleOnTrack.h:224
xAOD::unsigned
unsigned
Definition: RingSetConf_v1.cxx:662
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
InDet::TRT_DriftCircle
Definition: TRT_DriftCircle.h:32
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
TRTMonitoringRun3ESD_Alg::m_pTRTHelper
const TRT_ID * m_pTRTHelper
Definition: TRTMonitoringRun3ESD_Alg.h:119
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
ITRT_ConditionsSvc.h
TRTMonitoringRun3ESD_Alg::s_numberOfBarrelStacks
static const int s_numberOfBarrelStacks
Definition: TRTMonitoringRun3ESD_Alg.h:95
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
TRT::Hit::side
@ side
Definition: HitInfo.h:83
Track.h
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
TRTMonitoringRun3ESD_Alg::m_mgr
const InDetDD::TRT_DetectorManager * m_mgr
Definition: TRTMonitoringRun3ESD_Alg.h:120
TRTCond::RtRelation
Definition: RtRelation.h:27
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
TRT_ID::straw
int straw(const Identifier &id) const
Definition: TRT_ID.h:902
TRTMonitoringRun3ESD_Alg::m_doStraws
bool m_doStraws
Definition: TRTMonitoringRun3ESD_Alg.h:123
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ITRT_DAQ_ConditionsSvc.h
ITRT_StrawStatusSummaryTool.h
abstract interface to TRT straw status constants
Trk::TrackStateOnSurface::Hole
@ Hole
A hole on the track - this is defined in the following way.
Definition: TrackStateOnSurface.h:128
lumiFormat.i
int i
Definition: lumiFormat.py:85
TRTMonitoringRun3ESD_Alg::Straw_Gastype
GasType Straw_Gastype(int stat) const
Definition: TRTMonitoringRun3ESD_Alg.h:143
Monitored
Generic monitoring tool for athena components.
Definition: GenericMonitoringTool.h:30
TRTCond::RtRelation::drifttime
virtual float drifttime(float radius) const =0
drifttime for given radius
IDTPM::nTRTHits
float nTRTHits(const U &p)
Definition: TrackParametersHelper.h:446
Trk::theta
@ theta
Definition: ParamDefs.h:66
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
TRTMonitoringRun3ESD_Alg::m_xAODEventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_xAODEventInfoKey
Definition: TRTMonitoringRun3ESD_Alg.h:110
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:53
TRTMonitoringRun3ESD_Alg::m_TRTStrawNeighbourSvc
ServiceHandle< ITRT_StrawNeighbourSvc > m_TRTStrawNeighbourSvc
Definition: TRTMonitoringRun3ESD_Alg.h:105
TrackCollection.h
SignEnum::LE
@ LE
Definition: SignEnums.h:21
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
Side
Definition: WaferTree.h:36
TRTMonitoringRun3ESD_Alg::m_doTracksMon
bool m_doTracksMon
Definition: TRTMonitoringRun3ESD_Alg.h:122
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
TRTMonitoringRun3ESD_Alg::m_doExpert
bool m_doExpert
Definition: TRTMonitoringRun3ESD_Alg.h:126
TRTMonitoringRun3ESD_Alg::s_numberOfEndCapStacks
static const int s_numberOfEndCapStacks
Definition: TRTMonitoringRun3ESD_Alg.h:96
TRTMonitoringRun3ESD_Alg::strawNumber
int strawNumber(int strawNumber, int strawlayerNumber, int LayerNumber) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:243
TRTMonitoringRun3ESD_Alg::m_isCosmics
bool m_isCosmics
Definition: TRTMonitoringRun3ESD_Alg.h:132
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:79
ITRT_CalDbTool.h
abstract interface to TRT calibration constants
TRTMonitoringRun3ESD_Alg::TRTMonitoringRun3ESD_Alg
TRTMonitoringRun3ESD_Alg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TRTMonitoringRun3ESD_Alg.cxx:41
TrackSummary.h
Trk::ParametersBase
Definition: ParametersBase.h:55
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:233
TRT_DriftCircleOnTrack.h
AthMonitorAlgorithm::fill
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
InDet::TRT_DriftCircle::trailingEdge
int trailingEdge() const
returns the trailing edge bin
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
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
TRT_ID::layer_or_wheel
int layer_or_wheel(const Identifier &id) const
Definition: TRT_ID.h:884
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
firstBinHigh
bool firstBinHigh(unsigned int m_word)
Definition: driftCircle.h:104
InDetDD::TRT_DetectorManager::getEndcapElement
const TRT_EndcapElement * getEndcapElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
Access Endcap Elements:---------------—(Fast)--------------------------—.
Definition: TRT_DetectorManager.cxx:119
Trk::MeasurementBase
Definition: MeasurementBase.h:58
TRTMonitoringRun3ESD_Alg::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: TRTMonitoringRun3ESD_Alg.h:69
TRTMonitoringRun3ESD_Alg::s_moduleNum
static const int s_moduleNum[2]
Definition: TRTMonitoringRun3ESD_Alg.h:101
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TRTMonitoringRun3ESD_Alg::fillTRTHighThreshold
StatusCode fillTRTHighThreshold(const xAOD::TrackParticleContainer &trackCollection, const xAOD::EventInfo &eventInfo, const EventContext &ctx) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:1236
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
TRTCond::ExpandedIdentifier::STRAW
@ STRAW
Definition: InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h:37
TRTMonitoringRun3ESD_Alg::m_trigDecisionKey
SG::ReadHandleKey< xAOD::TrigDecision > m_trigDecisionKey
Definition: TRTMonitoringRun3ESD_Alg.h:113
InDet::TRT_DriftCircle::lastBinHigh
bool lastBinHigh() const
returns true if the last bin is high
TRTMonitoringRun3ESD_Alg::m_minTRThits
int m_minTRThits
Definition: TRTMonitoringRun3ESD_Alg.h:138
TRT::Hit::ident
@ ident
Definition: HitInfo.h:77
TRT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: TRT_ID.h:875
xAOD::timeStamp
setEventNumber timeStamp
Definition: EventInfo_v1.cxx:128
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
ITRT_StrawNeighbourSvc.h
Abstract interface to information on straws electronic grouping.
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
DataVector< RawDataT >::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
IInDetConditionsSvc.h
EventPrimitivesCovarianceHelpers.h
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
TRTMonitoringRun3ESD_Alg::m_trackSelTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelTool
Definition: TRTMonitoringRun3ESD_Alg.h:162
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
DeMoScan.index
string index
Definition: DeMoScan.py:364
TRTMonitoringRun3ESD_Alg::m_mat_chip_E
std::vector< std::vector< unsigned char > > m_mat_chip_E
Definition: TRTMonitoringRun3ESD_Alg.h:129
TRT_ID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel.
Definition: TRT_ID.h:857
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TRTMonitoringRun3ESD_Alg::~TRTMonitoringRun3ESD_Alg
virtual ~TRTMonitoringRun3ESD_Alg()
Definition: TRTMonitoringRun3ESD_Alg.cxx:76
TRTMonitoringRun3ESD_Alg::m_drifttool
ToolHandle< ITRT_DriftFunctionTool > m_drifttool
Definition: TRTMonitoringRun3ESD_Alg.h:117
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
TRTMonitoringRun3ESD_Alg::m_min_sct_hits
int m_min_sct_hits
Definition: TRTMonitoringRun3ESD_Alg.h:136
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
TRTMonitoringRun3ESD_Alg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: TRTMonitoringRun3ESD_Alg.cxx:1461
TRTMonitoringRun3ESD_Alg::m_mat_chip_B
std::vector< std::vector< unsigned char > > m_mat_chip_B
Definition: TRTMonitoringRun3ESD_Alg.h:128
python.LArCondContChannels.isBarrel
isBarrel
Definition: LArCondContChannels.py:659
xAOD::EventInfo_v1::timeStamp
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
InDet::TRT_DriftCircle::driftTimeValid
bool driftTimeValid() const
return true if the corrected drift time is OK
TRTMonitoringRun3ESD_Alg::m_TRTCalDbTool
ToolHandle< ITRT_CalDbTool > m_TRTCalDbTool
Definition: TRTMonitoringRun3ESD_Alg.h:106
TRTMonitoringRun3ESD_Alg::m_doChips
bool m_doChips
Definition: TRTMonitoringRun3ESD_Alg.h:124
TRTMonitoringRun3ESD_Alg::strawLayerNumber
int strawLayerNumber(int strawLayerNumber, int LayerNumber) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:225
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
InDet::TRT_DriftCircle::rawDriftTime
double rawDriftTime() const
returns the raw driftTime
InDet::TRT_DriftCircleOnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
return the global position of this RIO_OnTrack
Definition: TRT_DriftCircleOnTrack.cxx:160
InDet::TRT_DriftCircle::getWord
unsigned int getWord() const
returns the TRT dataword
TRTMonitoringRun3ESD_Alg::m_min_trt_hits
int m_min_trt_hits
Definition: TRTMonitoringRun3ESD_Alg.h:137
AthMonitorAlgorithm::lbDuration
virtual double lbDuration(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the duration of the luminosity block (in seconds)
Definition: AthMonitorAlgorithm.cxx:319
TRTMonitoringRun3ESD_Alg::m_doShift
bool m_doShift
Definition: TRTMonitoringRun3ESD_Alg.h:125
SG::get
const T * get(const ReadHandleKey< T > &key)
Convenience function to retrieve an object given a ReadHandleKey.
xAOD::lumiBlock
setTeId lumiBlock
Definition: L2StandAloneMuon_v1.cxx:327
TRTMonitoringRun3ESD_Alg::checkEventBurst
bool checkEventBurst(const TRT_RDO_Container &rdoContainer) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:382
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
trailingEdge
int trailingEdge(unsigned int m_word)
Definition: driftCircle.h:64
TRTMonitoringRun3ESD_Alg::m_min_pT
float m_min_pT
Definition: TRTMonitoringRun3ESD_Alg.h:140
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TRTMonitoringRun3ESD_Alg::s_iChip_max
static const int s_iChip_max[2]
Definition: TRTMonitoringRun3ESD_Alg.h:99
InDet::TRT_DriftCircle::firstBinHigh
bool firstBinHigh() const
returns true if the first bin is high
readCCLHist.float
float
Definition: readCCLHist.py:83
xAOD::TrigDecision_v1
Interface to the raw trigger decision information of the event.
Definition: TrigDecision_v1.h:44
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
TRTMonitoringRun3ESD_Alg::s_Straw_max
static const int s_Straw_max[2]
Definition: TRTMonitoringRun3ESD_Alg.h:97
TRTMonitoringRun3ESD_Alg::m_TrackSummaryTool
ToolHandle< Trk::ITrackSummaryTool > m_TrackSummaryTool
Definition: TRTMonitoringRun3ESD_Alg.h:116
DataVector< RawDataT >::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:57
TRTMonitoringRun3ESD_Alg::m_EventBurstCut
int m_EventBurstCut
Definition: TRTMonitoringRun3ESD_Alg.h:161
TRT_ID::straw_id
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw:
Definition: TRT_ID.h:581
TRTMonitoringRun3ESD_Alg::m_comTimeObjectKey
SG::ReadHandleKey< ComTime > m_comTimeObjectKey
Definition: TRTMonitoringRun3ESD_Alg.h:112
driftTimeBin
int driftTimeBin(unsigned int m_word)
Definition: driftCircle.h:50
Identifier
Definition: IdentifierFieldParser.cxx:14
TRTMonitoringRun3ESD_Alg::m_trackCollectionKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackCollectionKey
Definition: TRTMonitoringRun3ESD_Alg.h:109