ATLAS Offline Software
StgcRawDataMonAlg.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 // Package : sTgcRawDataMonAlg
7 // Author: Sebastian Fuenzalida Garrido
8 // Local supervisor: Edson Carquin Lopez
9 // Technical supervisor: Gerardo Vasquez
10 //
11 // DESCRIPTION:
12 // Subject: sTgc --> sTgc raw data monitoring
14 
16 
18 // *********************************************************************
19 // Public Methods
20 // *********************************************************************
22 
23 sTgcRawDataMonAlg::sTgcRawDataMonAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthMonitorAlgorithm(name, pSvcLocator) {
24  //Declare the property
25 }
26 
29  ATH_CHECK(m_idHelperSvc.retrieve());
30  ATH_CHECK(m_sTgcContainerKey.initialize());
34  ATH_CHECK(m_muonKey.initialize());
36 
37  return StatusCode::SUCCESS;
38 }
39 
40 StatusCode sTgcRawDataMonAlg::fillHistograms(const EventContext& ctx) const {
41  const int lumiblock = GetEventInfo(ctx) -> lumiBlock();
42 
47 
48  if (!meTPContainer.isValid()) {
49  ATH_MSG_FATAL("Could not get track particle container: " << m_meTrkKey.fullKey());
50  return StatusCode::FAILURE;
51  }
52 
53  if (!muonContainer.isValid()) {
54  ATH_MSG_FATAL("Could not get muon container: " << m_muonKey.fullKey());
55  return StatusCode::FAILURE;
56  }
57 
58  if(!m_rdoKey.key().empty()){
60  if (!NSWpadTriggerContainer.isValid()) {
61  ATH_MSG_FATAL("Could not get pad trigger data container: " << m_rdoKey.fullKey());
62  return StatusCode::FAILURE;
63  }
64  fillsTgcPadTriggerDataHistograms(muonContainer.cptr(), NSWpadTriggerContainer.cptr(), lumiblock);
65  fillsTgcPadTriggerEfficiencyHistograms(muonContainer.cptr(), NSWpadTriggerContainer.cptr(), detectorManagerKey.cptr());
66  }
67 
69  fillsTgcEfficiencyHistograms(muonContainer.cptr(), detectorManagerKey.cptr());
70  fillsTgcOccupancyHistograms(sTgcContainer.cptr(), detectorManagerKey.cptr());
71  fillsTgcLumiblockHistograms(sTgcContainer.cptr(), lumiblock);
72 
73  return StatusCode::SUCCESS;
74 }
75 
76 void sTgcRawDataMonAlg::fillsTgcOccupancyHistograms(const Muon::sTgcPrepDataContainer* sTgcContainer, const MuonGM::MuonDetectorManager* muonDetectorManagerObject) const {
77  for(const Muon::sTgcPrepDataCollection* coll : *sTgcContainer) {
78  for (const Muon::sTgcPrepData* prd : *coll) {
79  Identifier id = prd -> identify();
80 
81  if(!id.is_valid()) {
82  ATH_MSG_WARNING("Invalid identifier found in Muon::sTgcPrepData");
83  return;
84  }
85 
86  std::string stationName = m_idHelperSvc -> stgcIdHelper().stationNameString(m_idHelperSvc -> stgcIdHelper().stationName(id));
87  int stationEta = m_idHelperSvc -> stgcIdHelper().stationEta(id);
88  int stationPhi = m_idHelperSvc -> stgcIdHelper().stationPhi(id);
89  int multiplet = m_idHelperSvc -> stgcIdHelper().multilayer(id);
90  int gasGap = m_idHelperSvc -> stgcIdHelper().gasGap(id);
91  int channelType = m_idHelperSvc -> stgcIdHelper().channelType(id);
92  int sector = m_idHelperSvc -> sector(id);
93  int sectorsTotal = getSectors(id);
94  int layer = getLayer(multiplet, gasGap);
95 
96  if (channelType == sTgcIdHelper::sTgcChannelTypes::Pad) {
97  int padNumber = m_idHelperSvc -> stgcIdHelper().channel(id);
98  Identifier idPadQ1 = m_idHelperSvc -> stgcIdHelper().channelID(stationName, 1, stationPhi, multiplet, gasGap, channelType, 1);
99  Identifier idPadQ2 = m_idHelperSvc -> stgcIdHelper().channelID(stationName, 2, stationPhi, multiplet, gasGap, channelType, 1);
100  const MuonGM::sTgcReadoutElement* sTgcReadoutObjectPadQ1 = muonDetectorManagerObject -> getsTgcReadoutElement(idPadQ1);
101  const MuonGM::sTgcReadoutElement* sTgcReadoutObjectPadQ2 = muonDetectorManagerObject -> getsTgcReadoutElement(idPadQ2);
102  int maxPadNumberQ1 = sTgcReadoutObjectPadQ1 -> maxPadNumber(idPadQ1);
103  int maxPadNumberQ2 = sTgcReadoutObjectPadQ2 -> maxPadNumber(idPadQ2);
104 
105  if (std::abs(stationEta) == 1) {
106  auto sectorMon = Monitored::Scalar<int>("sector_layer_" + std::to_string(layer), sectorsTotal);
107  auto padNumberMon = Monitored::Scalar<int>("padNumber_layer_" + std::to_string(layer), padNumber);
108  fill("sTgcOccupancy", sectorMon, padNumberMon);
109  }
110 
111  else if (std::abs(stationEta) == 2) {
112  auto sectorMon = Monitored::Scalar<int>("sector_layer_" + std::to_string(layer), sectorsTotal);
113  auto padNumberMon = Monitored::Scalar<int>("padNumber_layer_" + std::to_string(layer), padNumber + maxPadNumberQ1);
114  fill("sTgcOccupancy", sectorMon, padNumberMon);
115  }
116 
117  else {
118  auto sectorMon = Monitored::Scalar<int>("sector_layer_" + std::to_string(layer), sectorsTotal);
119  auto padNumberMon = Monitored::Scalar<int>("padNumber_layer_" + std::to_string(layer), padNumber + maxPadNumberQ1 + maxPadNumberQ2);
120  fill("sTgcOccupancy", sectorMon, padNumberMon);
121  }
122 
123  auto sectorSidedMon = Monitored::Scalar<int>("sector_layer_" + std::to_string(layer), sector);
124  auto stationEtaSidedMon = Monitored::Scalar<int>("stationEta_layer_" + std::to_string(layer), stationEta);
125  fill("sTgcQuadOccupancyPad", sectorSidedMon, stationEtaSidedMon);
126  }
127 
128  else if (channelType == sTgcIdHelper::sTgcChannelTypes::Strip) {
129  int stripNumber = m_idHelperSvc -> stgcIdHelper().channel(id);
130  Identifier idStripQ1 = m_idHelperSvc -> stgcIdHelper().channelID(stationName, 1, stationPhi, multiplet, gasGap, channelType, 1);
131  Identifier idStripQ2 = m_idHelperSvc -> stgcIdHelper().channelID(stationName, 2, stationPhi, multiplet, gasGap, channelType, 1);
132  const MuonGM::sTgcReadoutElement* sTgcReadoutObjectStripQ1 = muonDetectorManagerObject -> getsTgcReadoutElement(idStripQ1);
133  const MuonGM::sTgcReadoutElement* sTgcReadoutObjectStripQ2 = muonDetectorManagerObject -> getsTgcReadoutElement(idStripQ2);
134  int maxStripNumberQ1 = sTgcReadoutObjectStripQ1 -> numberOfStrips(idStripQ1);
135  int maxStripNumberQ2 = sTgcReadoutObjectStripQ2 -> numberOfStrips(idStripQ2);
136 
137  if (std::abs(stationEta) == 1) {
138  auto sectorMon = Monitored::Scalar<int>("sector_layer_" + std::to_string(layer), sectorsTotal);
139  auto stripNumberMon = Monitored::Scalar<int>("stripNumber_layer_" + std::to_string(layer), stripNumber);
140  fill("sTgcOccupancy", sectorMon, stripNumberMon);
141  }
142 
143  else if (std::abs(stationEta) == 2) {
144  auto sectorMon = Monitored::Scalar<int>("sector_layer_" + std::to_string(layer), sectorsTotal);
145  auto stripNumberMon = Monitored::Scalar<int>("stripNumber_layer_" + std::to_string(layer), stripNumber + maxStripNumberQ1 + 1);
146  fill("sTgcOccupancy", sectorMon, stripNumberMon);
147  }
148 
149  else {
150  auto sectorMon = Monitored::Scalar<int>("sector_layer_" + std::to_string(layer), sectorsTotal);
151  auto stripNumberMon = Monitored::Scalar<int>("stripNumber_layer_" + std::to_string(layer), stripNumber + maxStripNumberQ1 + maxStripNumberQ2 + 1);
152  fill("sTgcOccupancy", sectorMon, stripNumberMon);
153  }
154 
155  auto sectorSidedMon = Monitored::Scalar<int>("sector_layer_" + std::to_string(layer), sector);
156  auto stationEtaSidedMon = Monitored::Scalar<int>("stationEta_layer_" + std::to_string(layer), stationEta);
157  fill("sTgcQuadOccupancyStrip", sectorSidedMon, stationEtaSidedMon);
158  }
159 
160  else if (channelType == sTgcIdHelper::sTgcChannelTypes::Wire) {
161  int wireGroupNumber = m_idHelperSvc -> stgcIdHelper().channel(id);
162  Identifier idWireGroupQ3 = m_idHelperSvc -> stgcIdHelper().channelID("STL", 3, stationPhi, 1, 3, channelType, 1);
163  const MuonGM::sTgcReadoutElement* sTgcReadoutObjectWireGroupQ3 = muonDetectorManagerObject -> getsTgcReadoutElement(idWireGroupQ3);
164  int maxWireGroupNumberQ3 = sTgcReadoutObjectWireGroupQ3 -> numberOfStrips(idWireGroupQ3);
165 
166  auto stationEtaMon = Monitored::Scalar<int>("stationEta_layer_" + std::to_string(layer), stationEta);
167  auto wireGroupNumberMon = Monitored::Scalar<int>("wireGroupNumber_layer_" + std::to_string(layer), wireGroupNumber + (sector - 1)*maxWireGroupNumberQ3);
168  fill("sTgcOccupancy", stationEtaMon, wireGroupNumberMon);
169 
170  auto sectorSidedMon = Monitored::Scalar<int>("sector_layer_" + std::to_string(layer), sector);
171  auto stationEtaSidedMon = Monitored::Scalar<int>("stationEta_layer_" + std::to_string(layer), stationEta);
172  fill("sTgcQuadOccupancyWire", sectorSidedMon, stationEtaSidedMon);
173  }
174  }
175  }
176 }
177 
179  for(const Muon::sTgcPrepDataCollection* coll : *sTgcContainer) {
180  for (const Muon::sTgcPrepData* prd : *coll) {
181  Identifier id = prd -> identify();
182 
183  if(!id.is_valid()) {
184  ATH_MSG_WARNING("Invalid identifier found in Muon::sTgcPrepData");
185  return;
186  }
187 
188  std::string stationName = m_idHelperSvc -> stgcIdHelper().stationNameString(m_idHelperSvc -> stgcIdHelper().stationName(id));
189  int stationEta = m_idHelperSvc -> stgcIdHelper().stationEta(id);
190  int multiplet = m_idHelperSvc -> stgcIdHelper().multilayer(id);
191  int gasGap = m_idHelperSvc -> stgcIdHelper().gasGap(id);
192  int channelType = m_idHelperSvc -> stgcIdHelper().channelType(id);
193  int layer = getLayer(multiplet, gasGap);
194  int sectorsTotal = getSectors(id);
195 
196  if (channelType == sTgcIdHelper::sTgcChannelTypes::Pad) {
197  auto padSectorMon = Monitored::Scalar<int>("padSector_quad_" + std::to_string(std::abs(stationEta)) + "_layer_" + std::to_string(layer), sectorsTotal);
198  auto padLumiblockMon = Monitored::Scalar<int>("padLumiblock_quad_" + std::to_string(std::abs(stationEta)) + "_layer_" + std::to_string(layer), lb);
199  fill("sTgcLumiblockPad_quad_" + std::to_string(std::abs(stationEta)), padSectorMon, padLumiblockMon);
200 
201  auto padSectorGlobalMon = Monitored::Scalar<int>("padSector", sectorsTotal);
202  auto padLumiblockGlobalMon = Monitored::Scalar<int>("padLumiblock", lb);
203  fill("sTgcLumiblock", padSectorGlobalMon, padLumiblockGlobalMon);
204  }
205 
206  else if (channelType == sTgcIdHelper::sTgcChannelTypes::Strip) {
207  auto stripSectorMon = Monitored::Scalar<int>("stripSector_quad_" + std::to_string(std::abs(stationEta)) + "_layer_" + std::to_string(layer), sectorsTotal);
208  auto stripLumiblockMon = Monitored::Scalar<int>("stripLumiblock_quad_" + std::to_string(std::abs(stationEta)) + "_layer_" + std::to_string(layer), lb);
209  fill("sTgcLumiblockStrip_quad_" + std::to_string(std::abs(stationEta)), stripSectorMon, stripLumiblockMon);
210 
211  auto stripSectorGlobalMon = Monitored::Scalar<int>("stripSector", sectorsTotal);
212  auto stripLumiblockGlobalMon = Monitored::Scalar<int>("stripLumiblock", lb);
213  fill("sTgcLumiblock", stripSectorGlobalMon, stripLumiblockGlobalMon);
214  }
215 
216  else if (channelType == sTgcIdHelper::sTgcChannelTypes::Wire) {
217  auto wireSectorMon = Monitored::Scalar<int>("wireSector_quad_" + std::to_string(std::abs(stationEta)) + "_layer_" + std::to_string(layer), sectorsTotal);
218  auto wireLumiblockMon = Monitored::Scalar<int>("wireLumiblock_quad_" + std::to_string(std::abs(stationEta)) + "_layer_" + std::to_string(layer), lb);
219  fill("sTgcLumiblockWire_quad_" + std::to_string(std::abs(stationEta)), wireSectorMon, wireLumiblockMon);
220 
221  auto wireSectorGlobalMon = Monitored::Scalar<int>("wireSector", sectorsTotal);
222  auto wireLumiblockGlobalMon = Monitored::Scalar<int>("wireLumiblock", lb);
223  fill("sTgcLumiblock", wireSectorGlobalMon, wireLumiblockGlobalMon);
224  }
225  }
226  }
227 }
228 
230  for (const xAOD::TrackParticle* meTP : *trkPartCont) {
231  const Trk::Track* meTrack = meTP -> track();
232  if(!meTrack) continue;
233  for (const Trk::TrackStateOnSurface* trkState : *meTrack -> trackStateOnSurfaces()) {
234  std::optional<std::tuple<Identifier, const Trk::RIO_OnTrack*>> status = getRotIdAndRotObject(trkState);
235  if (!status.has_value()) continue;
236  std::tuple<Identifier, const Trk::RIO_OnTrack*> rotIDtuple = status.value();
237 
238  Identifier rot_id = std::get<Identifier>(rotIDtuple);
239 
240  const Muon::sTgcClusterOnTrack* cluster = dynamic_cast<const Muon::sTgcClusterOnTrack*>(std::get<const Trk::RIO_OnTrack*>(rotIDtuple));
241  if(!cluster) continue;
242 
243  const Muon::sTgcPrepData* prd = cluster -> prepRawData();
244  if (!prd) continue;
245 
246  int channelType = m_idHelperSvc -> stgcIdHelper().channelType(rot_id);
247  int stEta = m_idHelperSvc -> stgcIdHelper().stationEta(rot_id);
248  int multi = m_idHelperSvc -> stgcIdHelper().multilayer(rot_id);
249  int gap = m_idHelperSvc -> stgcIdHelper().gasGap(rot_id);
250  int sector = m_idHelperSvc -> sector(rot_id);
251  int sectorsTotal = getSectors(rot_id);
252  int layer = getLayer(multi, gap);
253  int iside = (stEta > 0) ? 1 : 0;
254  std::string side = GeometricSectors::sTgcSide[iside];
255 
256  if (channelType == sTgcIdHelper::sTgcChannelTypes::Pad) {
257  float padCharge = prd -> charge();
258  auto padChargeMon = Monitored::Scalar<float>("padTrackCharge_" + side + "_quad_" + std::to_string(std::abs(stEta)) + "_sector_" + std::to_string(sector) + "_layer_" + std::to_string(layer), padCharge);
259  fill("padCharge_" + side + std::to_string(sector) + "_quad_" + std::to_string(std::abs(stEta)), padChargeMon);
260 
261  short int padTiming = prd -> time();
262  auto padSectorSidedMon = Monitored::Scalar<int>("padTrackSectorSided_layer_" + std::to_string(layer), sectorsTotal);
263  auto padTimingMon = Monitored::Scalar<float>("padTrackTiming_layer_" + std::to_string(layer), padTiming);
264  fill("sTgcTiming", padSectorSidedMon, padTimingMon);
265 
266  auto padSectorSidedExpertMon = Monitored::Scalar<int>("padTrackSectorSided_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), sectorsTotal);
267  auto padTimingExpertMon = Monitored::Scalar<float>("padTrackTiming_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), padTiming);
268  fill("padTiming_quad_" + std::to_string(std::abs(stEta)), padSectorSidedExpertMon, padTimingExpertMon);
269  }
270 
271  else if (channelType == sTgcIdHelper::sTgcChannelTypes::Strip) {
272  const std::vector<Identifier>& stripIds = prd->rdoList();
273  unsigned int csize = stripIds.size();
274 
275  std::vector<short int> stripTimesVec = prd -> stripTimes();
276  std::vector<int> stripChargesVec = prd -> stripCharges();
277 
278  float stripClusterTimes = 0;
279  float stripClusterCharges = 0;
280 
281  for (unsigned int sIdx = 0; sIdx < csize; ++sIdx) {
282  stripClusterTimes += stripTimesVec.at(sIdx);
283  stripClusterCharges += stripChargesVec.at(sIdx);
284  }
285 
286  stripClusterTimes /= stripTimesVec.size();
287 
288  auto stripClusterChargesPerSideQuadMon = Monitored::Scalar<float>("stripTrackCharge_" + side + "_quad_" + std::to_string(std::abs(stEta)) + "_sector_" + std::to_string(sector) + "_layer_" + std::to_string(layer), stripClusterCharges);
289  fill("stripCharge_" + side + std::to_string(sector) + "_quad_" + std::to_string(std::abs(stEta)), stripClusterChargesPerSideQuadMon);
290 
291  auto stripClusterSectorSidedMon = Monitored::Scalar<int>("stripTrackSectorSided_layer_" + std::to_string(layer), sectorsTotal);
292  auto stripClusterTimesMon = Monitored::Scalar<float>("stripTrackTiming_layer_" + std::to_string(layer), stripClusterTimes);
293  auto stripClusterSizeMon = Monitored::Scalar<unsigned int>("stripTrackClusterSize_layer_" + std::to_string(layer), csize);
294  fill("sTgcTiming", stripClusterSectorSidedMon, stripClusterTimesMon);
295  fill("sTgcOverview", stripClusterSectorSidedMon, stripClusterTimesMon, stripClusterSizeMon);
296 
297  auto stripSectorSidedExpertMon = Monitored::Scalar<int>("stripTrackSectorSided_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), sectorsTotal);
298  auto stripTimingExpertMon = Monitored::Scalar<float>("stripTrackTiming_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), stripClusterTimes);
299  fill("stripTiming_quad_" + std::to_string(std::abs(stEta)), stripSectorSidedExpertMon, stripTimingExpertMon);
300 
301 
302  std::optional<Trk::ResidualPull> resPull(m_residualPullCalculator -> residualPull(trkState -> measurementOnTrack(), trkState -> trackParameters(), Trk::ResidualPull::ResidualType::Biased));
303 
304  if (resPull) {
305  float residual = resPull -> residual()[Trk::locX];
306  auto residualMon = Monitored::Scalar<float>("residual_" + side + "_quad_" + std::to_string(std::abs(stEta)) + "_sector_" + std::to_string(sector) + "_layer_" + std::to_string(layer), residual);
307  fill("sTgcResiduals_" + side + std::to_string(sector) + "_quad_" + std::to_string(std::abs(stEta)), residualMon);
308  }
309  }
310 
311  else if (channelType == sTgcIdHelper::sTgcChannelTypes::Wire) {
312  float wireGroupCharge = prd -> charge();
313  auto wireGroupChargeMon = Monitored::Scalar<float>("wireGroupTrackCharge_" + side + "_quad_" + std::to_string(std::abs(stEta)) + "_sector_" + std::to_string(sector) + "_layer_" + std::to_string(layer), wireGroupCharge);
314  fill("wireGroupCharge_" + side + std::to_string(sector) + "_quad_" + std::to_string(std::abs(stEta)), wireGroupChargeMon);
315 
316  short int wireGroupTiming = prd -> time();
317  auto wireGroupSectorSidedMon = Monitored::Scalar<int>("wireGroupTrackSectorSided_layer_" + std::to_string(layer), sectorsTotal);
318  auto wireGroupTimingMon = Monitored::Scalar<float>("wireGroupTrackTiming_layer_" + std::to_string(layer), wireGroupTiming);
319  fill("sTgcTiming", wireGroupSectorSidedMon, wireGroupTimingMon);
320 
321  auto wireSectorSidedExpertMon = Monitored::Scalar<int>("wireTrackSectorSided_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), sectorsTotal);
322  auto wireTimingExpertMon = Monitored::Scalar<float>("wireTrackTiming_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), wireGroupTiming);
323  fill("wireTiming_quad_" + std::to_string(std::abs(stEta)), wireSectorSidedExpertMon, wireTimingExpertMon);
324  }
325  }
326  }
327 }
328 
330  for (const xAOD::Muon* mu : *muonContainer) {
331  if(mu -> pt() < m_cutPt) continue;
332  if(!(mu -> author() == xAOD::Muon::Author::MuidCo || mu -> author() == xAOD::Muon::Author::MuidSA)) continue;
333 
334  const xAOD::TrackParticle* meTP = mu -> trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
335  if(meTP == nullptr) continue;
336 
337  const Trk::Track* meTrack = meTP -> track();
338  if(!meTrack) continue;
339 
340  for(const Trk::TrackStateOnSurface* trkState : *meTrack->trackStateOnSurfaces()) {
341  std::optional<Identifier> status = getRotId(trkState);
342  if (!status.has_value()) continue;
343  Identifier rot_id = status.value();
344 
345  int channelType = m_idHelperSvc -> stgcIdHelper().channelType(rot_id);
346  if (channelType != sTgcIdHelper::sTgcChannelTypes::Pad) continue;
347 
348  for (const Muon::NSW_PadTriggerData* rdo : *NSWpadTriggerObject) {
349  bool sideA = rdo -> sideA();
350  bool largeSector = rdo -> largeSector();
351 
352  int iside = (sideA) ? 1 : 0;
353  int isize = (largeSector) ? 1 : 0;
354 
355  std::string side = GeometricSectors::sTgcSide[iside];
356  std::string size = GeometricSectors::sTgcSize[isize];
357 
358  size_t numberOfTriggers = rdo -> getNumberOfTriggers();
359  size_t numberOfHits = rdo -> getNumberOfHits();
360 
361  for (size_t trigger = 0; trigger < numberOfTriggers; ++trigger) {
362  int triggerPhiIdsUnsigned = rdo -> getTriggerPhiIds().at(trigger);
363  int triggerBandIds = rdo -> getTriggerBandIds().at(trigger);
364  int triggerRelBCID = rdo -> getTriggerRelBcids().at(trigger);
365  int sourceId = rdo -> getSourceid();
366  int sectorNumber = sourceidToSector(sourceId, sideA);
367 
368  if (triggerPhiIdsUnsigned == m_cutTriggerPhiId || triggerBandIds == m_cutTriggerBandId) continue;
369 
370  int triggerPhiIds = getSignedPhiId(triggerPhiIdsUnsigned);
371 
372  auto phiIdsPerSideSizeMon = Monitored::Scalar<int>("phiIds_" + side + "_" + size, triggerPhiIds);
373  auto bandIdsPerSideSizeMon = Monitored::Scalar<int>("bandIds_" + side + "_" + size, triggerBandIds);
374  fill("padTriggerShifter", phiIdsPerSideSizeMon, bandIdsPerSideSizeMon);
375 
376  auto lbMon = Monitored::Scalar<int>("lb", lb);
377  auto relBCIDMon = Monitored::Scalar<int>("relBCID", triggerRelBCID);
378  auto sectorMon = Monitored::Scalar<int>("sector", sectorNumber);
379  auto numberOfTriggersMon = Monitored::Scalar<int>("numberOfTriggers", numberOfTriggers);
380  fill("padTriggerShifter", lbMon, relBCIDMon, sectorMon, numberOfTriggersMon);
381 
382  auto numberOfTriggersPerSectorMon = Monitored::Scalar<int>("numberOfTriggers_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), numberOfTriggers);
383  auto phiIdsSidedSizedPerSectorMon = Monitored::Scalar<int>("phiIds_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerPhiIds);
384  auto bandIdsSidedSizedPerSectorMon = Monitored::Scalar<int>("bandIds_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerBandIds);
385  auto lbPerSectorMon = Monitored::Scalar<int>("lb_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), lb);
386  auto relBCIDperSectorMon = Monitored::Scalar<int>("relBCID_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerRelBCID);
387  fill("padTriggerExpert", numberOfTriggersPerSectorMon, phiIdsSidedSizedPerSectorMon, bandIdsSidedSizedPerSectorMon, lbPerSectorMon, relBCIDperSectorMon);
388 
389  auto RelBCIDPerSectorMon = Monitored::Scalar<int>("relBCID_"+ side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerRelBCID);
390  auto PhiIDPerSectorMon = Monitored::Scalar<int>("phiIds_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerPhiIds);
391  auto BandIDPerSectorMon = Monitored::Scalar<int>("bandID_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerBandIds);
392  fill("padTriggerShifter", RelBCIDPerSectorMon, PhiIDPerSectorMon, BandIDPerSectorMon);
393  } // end Number of triggers loop
394 
395  for (size_t hits = 0; hits < numberOfHits; ++hits){
396  std::optional<Identifier> status = getPadId(rdo->getSourceid(), rdo->getHitPfebs().at(hits), rdo->getHitTdsChannels().at(hits));
397  if (!status.has_value()) continue;
398  Identifier pad_id = status.value();
399 
400  if (rot_id != pad_id) continue;
401 
402  int sourceIds = rdo -> getSourceid();
403  int sectorNumbers = sourceidToSector(sourceIds, sideA);
404  int hitRelBCID = rdo -> getHitRelBcids().at(hits);
405  int hitpfebs = rdo -> getHitPfebs().at(hits);
406  int hitTdsChannels = rdo->getHitTdsChannels().at(hits);
407 
408  std::optional<std::tuple<int, int, std::string, std::string, int>> statusPadEtaPhi = getPadEtaPhiTuple(sourceIds, hitpfebs, hitTdsChannels);
409  if (!statusPadEtaPhi.has_value()) continue;
410  std::tuple<int, int, std::string, std::string, int> padEtaPhiTuple = statusPadEtaPhi.value();
411 
412  int padPhi = std::get<0>(padEtaPhiTuple);
413  int padEta = std::get<1>(padEtaPhiTuple);
414  std::string sideName = std::get<2>(padEtaPhiTuple);
415  std::string sizeName = std::get<3>(padEtaPhiTuple);
416  int layer = std::get<4>(padEtaPhiTuple);
417 
418  auto padPhiMon = Monitored::Scalar<int>("padPhi_" + sideName + "_" + sizeName + "_layer_" + std::to_string(layer), padPhi);
419  auto padEtaMon = Monitored::Scalar<int>("padEta_" + sideName + "_" + sizeName + "_layer_" + std::to_string(layer), padEta);
420  fill("padTriggerOccupancy", padPhiMon, padEtaMon);
421 
422  auto hitRelBCIDmon = Monitored::Scalar<int>("hitRelBCID", hitRelBCID);
423  auto hitPfebsMon = Monitored::Scalar<int>("hitPfebs", hitpfebs);
424  auto sectorMon = Monitored::Scalar<int>("sector", sectorNumbers);
425  fill("padTriggerShifter", hitRelBCIDmon, hitPfebsMon, sectorMon);
426 
427  auto hitRelBCIDPerSectorMon = Monitored::Scalar<int>("hitRelBCID_"+side+"_sector_"+std::to_string(std::abs(sectorNumbers)), hitRelBCID);
428  auto hitpfebsPerSectorMon = Monitored::Scalar<int>("hitPfebs_"+side+"_sector_"+std::to_string(std::abs(sectorNumbers)), hitpfebs);
429  fill("padTriggerShifter", hitRelBCIDPerSectorMon, hitpfebsPerSectorMon);
430  } // end number of hits loop
431  } // end NSW_PadTriggerData loop
432  } // end TrackStateOnSurface loop
433  } // end Muon loop
434 } // end fillsTgcPadTriggerDataHistograms function
435 
437  for (const xAOD::Muon* mu : *muonContainer) {
438  if (mu -> pt() < m_cutPt) continue;
439  if (!(mu -> author() == xAOD::Muon::Author::MuidCo || mu -> author() == xAOD::Muon::Author::MuidSA)) continue;
440 
441  struct sTGCeff {
442  std::array<int, 8> quadMultiplet{};
443  std::array<int, 8> layerMultiplet{};
444  std::array<float, 8> xPosMultiplet{};
445  std::array<float, 8> yPosMultiplet{};
446  std::array<float, 8> zPosMultiplet{};
447  };
448 
449  std::array<std::array<sTGCeff, 16>, 2> effPlots; // Store active layers per side (2) and sectors (16)
450 
451  const xAOD::TrackParticle* meTP = mu -> trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
452  if(meTP == nullptr) continue;
453 
454  const Trk::Track* meTrack = meTP -> track();
455  if(!meTrack) continue;
456 
457  for(const Trk::TrackStateOnSurface* trkState : *meTrack->trackStateOnSurfaces()) {
458  std::optional<Identifier> status = getRotId(trkState);
459  if (!status.has_value()) continue;
460 
461  Identifier rot_id = status.value();
462 
463  int channelType = m_idHelperSvc -> stgcIdHelper().channelType(rot_id);
464  if (channelType != sTgcIdHelper::sTgcChannelTypes::Strip) continue;
465 
466  int stEta = m_idHelperSvc -> stgcIdHelper().stationEta(rot_id);
467  int iside = (stEta > 0) ? 1 : 0;
468  int sector = m_idHelperSvc -> sector(rot_id);
469  int multi = m_idHelperSvc -> stgcIdHelper().multilayer(rot_id);
470  int gap = m_idHelperSvc -> stgcIdHelper().gasGap(rot_id);
471  int layer = getLayer(multi, gap);
472 
473  const Amg::Vector2D& positionsMultiplet = (trkState) -> trackParameters() -> localPosition();
474  float xPosStripInMultipletLocal = positionsMultiplet.x();
475  float yPosStripInMultipletLocal = positionsMultiplet.y();
476 
477  Amg::Vector2D localPos(xPosStripInMultipletLocal, yPosStripInMultipletLocal);
478  Amg::Vector3D globalPos(Amg::Vector3D::Zero());
479  const MuonGM::sTgcReadoutElement* sTgcReadoutObjectStrip = muonDetectorManagerObject -> getsTgcReadoutElement(rot_id);
480  sTgcReadoutObjectStrip -> surface(rot_id).localToGlobal(localPos, Amg::Vector3D::Zero(), globalPos);
481  float xPosStripInMultiplet = globalPos.x();
482  float yPosStripInMultiplet = globalPos.y();
483 
484  Amg::Vector3D posStripGlobal{Amg::Vector3D::Zero()};
485  (muonDetectorManagerObject -> getsTgcReadoutElement(rot_id)) -> stripGlobalPosition(rot_id, posStripGlobal);
486  float zPosStripInMultiplet = posStripGlobal.z();
487 
488  auto& sTGCelements = effPlots[iside][sector - 1];
489 
490  sTGCelements.quadMultiplet.at(layer - 1) = stEta;
491  sTGCelements.layerMultiplet.at(layer - 1) = layer;
492  sTGCelements.xPosMultiplet.at(layer - 1) = xPosStripInMultiplet;
493  sTGCelements.yPosMultiplet.at(layer - 1) = yPosStripInMultiplet;
494  sTGCelements.zPosMultiplet.at(layer - 1) = zPosStripInMultiplet;
495  } // end track state loop
496 
497  for (unsigned int isideIndex = 0; isideIndex <= 1; ++isideIndex) {
498  for (unsigned int sectorIndex = 1; sectorIndex <= 16; ++sectorIndex) {
499  auto& sTGCelements = effPlots[isideIndex][sectorIndex - 1];
500  bool fourOutEight = std::count_if(sTGCelements.layerMultiplet.begin(), sTGCelements.layerMultiplet.end(), [](int i) { return i != 0; }) >= 4;
501  bool oneRefLayer = std::count_if(sTGCelements.layerMultiplet.begin(), sTGCelements.layerMultiplet.end(), [](int i) { return i != 0; }) >= 1;
502 
503  if (fourOutEight) {
504  for (auto layerIndex = static_cast<std::array<int, 8>::size_type>(1); layerIndex <= sTGCelements.layerMultiplet.size(); ++layerIndex) {
505  if (sTGCelements.layerMultiplet.at(layerIndex - 1) == 0) continue;
506 
507  float xPos = sTGCelements.xPosMultiplet.at(layerIndex - 1);
508  float yPos = sTGCelements.yPosMultiplet.at(layerIndex - 1);
509  float rPos = std::hypot(xPos, yPos);
510 
511  std::string side = GeometricSectors::sTgcSide[isideIndex];
512 
513  auto effQuestionMon = Monitored::Scalar<bool>("hitLayer", true);
514 
515  auto rPosStripMon = Monitored::Scalar<float>("rPosStrip_" + side + "_sector_" + std::to_string(sectorIndex) + "_layer_" + std::to_string(layerIndex), rPos);
516  fill("rPosStrip_" + side + std::to_string(sectorIndex), rPosStripMon, effQuestionMon);
517 
518  auto xPosStripmon = Monitored::Scalar<float>("xPosStrip_" + side + "_layer_" + std::to_string(layerIndex), xPos);
519  auto yPosStripmon = Monitored::Scalar<float>("yPosStrip_" + side + "_layer_" + std::to_string(layerIndex), yPos);
520  fill("sTgcOverview", xPosStripmon, yPosStripmon, effQuestionMon);
521  } // End of loop over efficient layers
522  } // End of efficient case
523 
524  else if (!fourOutEight && oneRefLayer) {
525  auto refLayerIndex = std::distance(sTGCelements.layerMultiplet.begin(), std::find_if(sTGCelements.layerMultiplet.begin(), sTGCelements.layerMultiplet.end(), [](int i) {return i != 0;}));
526 
527  for (auto layerIndex = static_cast<std::array<int, 8>::size_type>(1); layerIndex <= sTGCelements.layerMultiplet.size(); ++layerIndex) {
528  if (sTGCelements.layerMultiplet.at(layerIndex - 1) != 0) continue;
529  int quad = sTGCelements.quadMultiplet.at(refLayerIndex);
530  int multi = (layerIndex <= static_cast<std::array<int, 8>::size_type>(m_idHelperSvc->stgcIdHelper().gasGapMax())) ? m_idHelperSvc->stgcIdHelper().multilayerMin() : m_idHelperSvc->stgcIdHelper().multilayerMax();
531  int gap = (layerIndex <= static_cast<std::array<int, 8>::size_type>(m_idHelperSvc->stgcIdHelper().gasGapMax())) ? layerIndex : layerIndex - static_cast<std::array<int, 8>::size_type>(m_idHelperSvc->stgcIdHelper().gasGapMax());
532 
533  bool isValid = false;
534  const Identifier idProbe = m_idHelperSvc -> stgcIdHelper().channelID((sectorIndex % 2 == 0) ? "STS" : "STL", quad, (sectorIndex % 2 == 0) ? sectorIndex/2 : (sectorIndex + 1)/2, multi, gap, sTgcIdHelper::sTgcChannelTypes::Strip, 1, isValid);
535 
536  if (!isValid) {
537  ATH_MSG_WARNING("Identifier of probe layer is invalid");
538  continue;
539  }
540 
542  (muonDetectorManagerObject -> getsTgcReadoutElement(idProbe)) -> stripGlobalPosition(idProbe, posProbe);
543  float posZprobe = posProbe.z();
544 
545  float xSlope = sTGCelements.xPosMultiplet.at(refLayerIndex)/sTGCelements.zPosMultiplet.at(refLayerIndex);
546  float ySlope = sTGCelements.yPosMultiplet.at(refLayerIndex)/sTGCelements.zPosMultiplet.at(refLayerIndex);
547 
548  float xPos = sTGCelements.xPosMultiplet.at(refLayerIndex) + xSlope*(posZprobe - sTGCelements.zPosMultiplet.at(refLayerIndex));
549  float yPos = sTGCelements.yPosMultiplet.at(refLayerIndex) + ySlope*(posZprobe - sTGCelements.zPosMultiplet.at(refLayerIndex));
550  float rPos = std::hypot(xPos, yPos);
551 
552  std::string side = GeometricSectors::sTgcSide[isideIndex];
553 
554  auto effQuestionMon = Monitored::Scalar<bool>("hitLayer", false);
555 
556  auto rPosStripProbemon = Monitored::Scalar<float>("rPosStrip_" + side + "_sector_" + std::to_string(sectorIndex) + "_layer_" + std::to_string(layerIndex), rPos);
557  fill("rPosStrip_" + side + std::to_string(sectorIndex), rPosStripProbemon, effQuestionMon);
558 
559  auto xPosStripProbemon = Monitored::Scalar<float>("xPosStrip_" + side + "_layer_" + std::to_string(layerIndex), xPos);
560  auto yPosStripProbemon = Monitored::Scalar<float>("yPosStrip_" + side + "_layer_" + std::to_string(layerIndex), yPos);
561  fill("sTgcOverview", xPosStripProbemon, yPosStripProbemon, effQuestionMon);
562  } // End of loop over probe layers
563  } // End of non-efficient case
564  } // End of sector loop
565  } // End of iside loop
566  } // End muon container loop
567 } // end stgc strip function
568 
570  for (const xAOD::Muon* mu : *muonContainer) {
571  if (!(mu -> author() == xAOD::Muon::Author::MuidCo || mu -> author() == xAOD::Muon::Author::MuidSA)) continue;
572  if (mu -> pt() < m_cutPt) continue;
573  if (std::abs(mu -> eta()) < m_cutEtaDown || std::abs(mu -> eta()) > m_cutEtaUp) continue;
574 
575  double recoMuonEta = mu -> eta();
576  double recoMuonPhi = mu -> phi();
577 
578  std::string sideRecoMuon = GeometricSectors::sTgcSide[recoMuonEta > 0];
579 
580  std::string minSideRecoMuon = "", minSideTrigger = "";
581 
582  double minTriggerEta = 999., minTriggerPhi = 999.,
583  minRecoEta = 999., minRecoPhi = 999., minDeltaR = 999.;
584 
585  auto minDeltaRtrigIt = -1;
586 
587  for (const Muon::NSW_PadTriggerData* rdo : *NSWpadTriggerObject) {
588  bool sideA = rdo -> sideA();
589  bool largeSector = rdo -> largeSector();
590  std::string sideTrigger = GeometricSectors::sTgcSide[sideA];
591  size_t numberOfTriggers = rdo -> getNumberOfTriggers();
592 
593  for (size_t trigger = 0; trigger < numberOfTriggers; ++trigger) {
594  int triggerPhiIdsUnsigned = rdo -> getTriggerPhiIds().at(trigger);
595  int triggerBandIds = rdo -> getTriggerBandIds().at(trigger);
596  int sourceId = rdo -> getSourceid();
597 
598  if (triggerPhiIdsUnsigned == m_cutTriggerPhiId || triggerBandIds == m_cutTriggerBandId) continue;
599 
600  int triggerPhiIds = getSignedPhiId(triggerPhiIdsUnsigned);
601  std::optional<double> status = bandId2eta(triggerBandIds, largeSector, sideA, muonDetectorManagerObject);
602  if (!status.has_value()) continue;
603  double triggerBandIdToEta = status.value();
604  double triggerPhiIDtoPhi = triggersectorphiid2phi(sourceId, triggerPhiIds);
605  double deltaR = xAOD::P4Helpers::deltaR(recoMuonEta, recoMuonPhi, triggerBandIdToEta, triggerPhiIDtoPhi);
606 
607  if (std::abs(triggerBandIdToEta) < m_cutEtaDown || std::abs(triggerBandIdToEta) > m_cutEtaUp) continue;
608 
609  if (sideRecoMuon == sideTrigger) {
610  if (deltaR < minDeltaR) {
611  minSideRecoMuon = sideRecoMuon;
612  minSideTrigger = sideTrigger;
613  minTriggerEta = triggerBandIdToEta;
614  minTriggerPhi = triggerPhiIDtoPhi;
615  minRecoEta = recoMuonEta;
616  minRecoPhi = recoMuonPhi;
617  minDeltaR = deltaR;
618  minDeltaRtrigIt = trigger;
619  }
620  }
621  } // end number of triggers loop
622  } // end pad trigger data container loop
623 
624  bool muonRecoTriggerMatch = false;
625 
626  if (minDeltaRtrigIt != -1) {
627  if (minDeltaR < m_minDeltaR) {
628  muonRecoTriggerMatch = true;
629  }
630  }
631 
632  auto deltaRmon = Monitored::Scalar<double>("deltaR", minDeltaR);
633  fill("sTgcOverview", deltaRmon);
634 
635  auto etaRecoMuonMon = Monitored::Scalar<double>("etaRecoMuon", minRecoEta);
636  auto phiRecoMuonMon = Monitored::Scalar<double>("phiRecoMuon", minRecoPhi);
637  fill("sTgcOverview", etaRecoMuonMon, phiRecoMuonMon);
638 
639  auto etaPadTriggerMon = Monitored::Scalar<double>("etaPadTrigger", minTriggerEta);
640  auto phiPadTriggerMon = Monitored::Scalar<double>("phiPadTrigger", minTriggerPhi);
641  fill("sTgcOverview", etaPadTriggerMon, phiPadTriggerMon);
642 
643  auto phiRecoMuonSidedMon = Monitored::Scalar<double>("phiRecoMuon_" + minSideRecoMuon, minRecoPhi);
644  auto phiPadTriggerSidedMon = Monitored::Scalar<double>("phiPadTrigger_" + minSideTrigger, minTriggerPhi);
645  fill("sTgcOverview", phiRecoMuonSidedMon, phiPadTriggerSidedMon);
646 
647  auto muonRecoTriggerMatchMon = Monitored::Scalar<bool>("muonRecoTriggerMatch", muonRecoTriggerMatch);
648  auto etaRecoMuonEffMon = Monitored::Scalar<double>("etaRecoMuonEff", minRecoEta);
649  auto phiRecoMuonEffMon = Monitored::Scalar<double>("phiRecoMuonEff", minRecoPhi);
650  fill("sTgcOverview", muonRecoTriggerMatchMon, etaRecoMuonEffMon, phiRecoMuonEffMon);
651 
652  auto muonRecoTriggerMatchSidedMon = Monitored::Scalar<bool>("muonRecoTriggerMatch", muonRecoTriggerMatch);
653  auto phiRecoMuonEffSidedMon = Monitored::Scalar<double>("phiRecoMuonEff_" + minSideRecoMuon, minRecoPhi);
654  fill("sTgcOverview", muonRecoTriggerMatchSidedMon, phiRecoMuonEffSidedMon);
655  } // end muon container loop
656 }
muonContainer
xAOD::MuonContainer * muonContainer
Definition: TrigGlobEffCorrValidation.cxx:188
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:161
Muon::MuonPrepDataContainer
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Definition: MuonPrepDataContainer.h:42
xAOD::identify
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:61
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
sTgcRawDataMonAlg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: StgcRawDataMonAlg.cxx:40
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
sTgcRawDataMonAlg::m_sTgcContainerKey
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_sTgcContainerKey
Definition: StgcRawDataMonAlg.h:90
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
sTgcRawDataMonAlg::fillsTgcEfficiencyHistograms
void fillsTgcEfficiencyHistograms(const xAOD::MuonContainer *, const MuonGM::MuonDetectorManager *) const
Definition: StgcRawDataMonAlg.cxx:436
sTgcRawDataMonAlg::m_cutTriggerPhiId
Gaudi::Property< int > m_cutTriggerPhiId
Definition: StgcRawDataMonAlg.h:100
Trk::locX
@ locX
Definition: ParamDefs.h:37
sTgcRawDataMonAlg::fillsTgcPadTriggerEfficiencyHistograms
void fillsTgcPadTriggerEfficiencyHistograms(const xAOD::MuonContainer *, const Muon::NSW_PadTriggerDataContainer *, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const
Definition: StgcRawDataMonAlg.cxx:569
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
python.MagFieldUtils.lumiblock
lumiblock
Definition: MagFieldUtils.py:188
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
sTgcRawDataMonAlg::m_meTrkKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_meTrkKey
Definition: StgcRawDataMonAlg.h:92
Muon::NSW_PadTriggerDataContainer
Definition: NSW_PadTriggerDataContainer.h:15
test_pyathena.pt
pt
Definition: test_pyathena.py:11
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
sTgcRawDataMonAlg::fillsTgcPadTriggerDataHistograms
void fillsTgcPadTriggerDataHistograms(const xAOD::MuonContainer *, const Muon::NSW_PadTriggerDataContainer *, const int lb) const
Definition: StgcRawDataMonAlg.cxx:329
PlotCalibFromCool.multi
multi
Definition: PlotCalibFromCool.py:99
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
CaloSwCorrections.gap
def gap(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:212
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
StgcRawDataMonAlg.h
sTgcRawDataMonAlg::getSectors
int getSectors(const Identifier &id) const
Definition: StgcRawDataUtils.cxx:13
TRT::Hit::side
@ side
Definition: HitInfo.h:83
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
sTgcRawDataMonAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: StgcRawDataMonAlg.h:66
sTgcRawDataMonAlg::m_residualPullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
Definition: StgcRawDataMonAlg.h:67
sTgcRawDataMonAlg::getLayer
int getLayer(const int multiplet, const int gasGap) const
Definition: StgcRawDataUtils.cxx:17
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
sTgcRawDataMonAlg::m_muonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonKey
Definition: StgcRawDataMonAlg.h:94
sTgcRawDataMonAlg::sourceidToSector
int32_t sourceidToSector(uint32_t sourceid, bool isSideA) const
Definition: StgcRawDataUtils.cxx:21
python.BunchSpacingUtils.lb
lb
Definition: BunchSpacingUtils.py:88
lumiFormat.i
int i
Definition: lumiFormat.py:85
sTgcRawDataMonAlg::m_minDeltaR
Gaudi::Property< double > m_minDeltaR
Definition: StgcRawDataMonAlg.h:99
xAOD::P4Helpers::deltaR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Definition: xAODP4Helpers.h:150
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MuonGM::sTgcReadoutElement
An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station c...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h:30
sTgcRawDataMonAlg::m_cutTriggerBandId
Gaudi::Property< int > m_cutTriggerBandId
Definition: StgcRawDataMonAlg.h:101
sTgcRawDataMonAlg::triggersectorphiid2phi
double triggersectorphiid2phi(uint32_t sourceid, int trigger_phiid) const
Definition: StgcRawDataUtils.cxx:177
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::NSW_PadTriggerData
Definition: NSW_PadTriggerData.h:19
sTgcRawDataMonAlg::getPadId
std::optional< Identifier > getPadId(uint32_t sourceid, uint32_t pfeb, uint32_t tdschan) const
Definition: StgcRawDataUtils.cxx:33
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.
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
sTgcRawDataMonAlg::m_detectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detectorManagerKey
Definition: StgcRawDataMonAlg.h:91
Muon::MuonPrepDataCollection
Template to hold collections of MuonPrepRawData objects.
Definition: MuonPrepDataCollection.h:46
AthMonitorAlgorithm::GetEventInfo
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
Definition: AthMonitorAlgorithm.cxx:107
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
sTgcRawDataMonAlg::getSignedPhiId
int getSignedPhiId(const uint32_t phiid) const
Definition: StgcRawDataUtils.cxx:26
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Muon::sTgcClusterOnTrack
Class to represent calibrated clusters formed from TGC strips.
Definition: sTgcClusterOnTrack.h:30
sTgcRawDataMonAlg::m_cutEtaDown
Gaudi::Property< double > m_cutEtaDown
Definition: StgcRawDataMonAlg.h:97
RPDUtils::sideA
unsigned constexpr int sideA
Definition: RPDUtils.h:16
sTgcRawDataMonAlg::m_cutEtaUp
Gaudi::Property< double > m_cutEtaUp
Definition: StgcRawDataMonAlg.h:98
sTgcRawDataMonAlg::fillsTgcClusterFromTrackHistograms
void fillsTgcClusterFromTrackHistograms(const xAOD::TrackParticleContainer *) const
Definition: StgcRawDataMonAlg.cxx:229
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
sTgcRawDataMonAlg::getRotId
std::optional< Identifier > getRotId(const Trk::TrackStateOnSurface *trkState) const
Definition: StgcRawDataUtils.cxx:78
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
sTgcRawDataMonAlg::m_cutPt
Gaudi::Property< double > m_cutPt
Definition: StgcRawDataMonAlg.h:96
charge
double charge(const T &p)
Definition: AtlasPID.h:756
MuonParameters::MuidSA
@ MuidSA
Definition: MuonParamDefs.h:59
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
sTgcRawDataMonAlg::sTgcRawDataMonAlg
sTgcRawDataMonAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: StgcRawDataMonAlg.cxx:23
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
MuonParameters::MuidCo
@ MuidCo
Definition: MuonParamDefs.h:60
sTgcRawDataMonAlg::fillsTgcLumiblockHistograms
void fillsTgcLumiblockHistograms(const Muon::sTgcPrepDataContainer *, const int lb) const
Definition: StgcRawDataMonAlg.cxx:178
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
sTgcRawDataMonAlg::fillsTgcOccupancyHistograms
void fillsTgcOccupancyHistograms(const Muon::sTgcPrepDataContainer *, const MuonGM::MuonDetectorManager *) const
Definition: StgcRawDataMonAlg.cxx:76
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
merge.status
status
Definition: merge.py:17
sTgcRawDataMonAlg::m_rdoKey
SG::ReadHandleKey< Muon::NSW_PadTriggerDataContainer > m_rdoKey
Definition: StgcRawDataMonAlg.h:93
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
sTgcRawDataMonAlg::initialize
virtual StatusCode initialize() override
initialize
Definition: StgcRawDataMonAlg.cxx:27
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:159
xAOD::lumiBlock
setTeId lumiBlock
Definition: L2StandAloneMuon_v1.cxx:327
sTgcRawDataMonAlg::getRotIdAndRotObject
std::optional< std::tuple< Identifier, const Trk::RIO_OnTrack * > > getRotIdAndRotObject(const Trk::TrackStateOnSurface *trkState) const
Definition: StgcRawDataUtils.cxx:56
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
Muon::sTgcPrepData
Class to represent sTgc measurements.
Definition: sTgcPrepData.h:20
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
sTgcRawDataMonAlg::bandId2eta
std::optional< double > bandId2eta(int bandid, bool isLarge, bool isA, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const
Definition: StgcRawDataUtils.cxx:168
sTgcRawDataMonAlg::getPadEtaPhiTuple
std::optional< std::tuple< int, int, std::string, std::string, int > > getPadEtaPhiTuple(uint32_t sourceid, uint32_t pfeb, uint32_t tdschan) const
Definition: StgcRawDataUtils.cxx:86
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
SG::ReadCondHandle::cptr
const_pointer_type cptr()
Definition: ReadCondHandle.h:67
dumpNswErrorDb.quad
def quad
Definition: dumpNswErrorDb.py:24
Identifier
Definition: IdentifierFieldParser.cxx:14