ATLAS Offline Software
SpacePointPerLayerSplitter.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4 */
9 
10 #include "Acts/Utilities/Helpers.hpp"
11 namespace MuonR4 {
14  SpacePointPerLayerSplitter(Acts::unpackConstSmartPointers(bucket)){}
15 
17  if (hits.empty()) return;
18 
19  const Muon::IMuonIdHelperSvc* idHelperSvc {hits.front()->msSector()->idHelperSvc()};
20  const MdtIdHelper& idHelper {idHelperSvc->mdtIdHelper()};
21  const SpacePointPerLayerSorter laySorter{};
22 
23  HitVec::const_iterator itr = hits.begin();
24 
25  while (itr != hits.end()) {
26  const unsigned int refLay = laySorter.sectorLayerNum(**itr);
27 
28  HitVec::const_iterator end_insert = std::find_if(itr, hits.end(),[&refLay,&laySorter](const SpacePoint* testMe) {
29  return refLay != laySorter.sectorLayerNum(*testMe);
30  });
31 
32  const bool isMdt = (*itr)->type() == xAOD::UncalibMeasType::MdtDriftCircleType;
33  HitLayVec& pushMe{ isMdt ? m_mdtLayers : m_stripLayers};
34  if (isMdt && !pushMe.empty()){
35  if (idHelper.multilayer((*itr)->identify()) != idHelper.multilayer(pushMe.back().front()->identify())) {
36  m_tubeLaySwitch = pushMe.size();
37  }
38  }
39 
40  (isMdt ? m_nMdtHits : m_nStripHits) += pushMe.emplace_back(itr, end_insert).size();
41  itr = end_insert;
42  }
43  }
44 }
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
MuonR4::SpacePointPerLayerSplitter
The SpacePointPerLayerSplitter takes a set of spacepoints already sorted by layer Identifier (see Muo...
Definition: SpacePointPerLayerSplitter.h:16
MuonR4::SpacePointBucket
: The muon space point bucket represents a collection of points that will bre processed together in t...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:21
MuonR4::SpacePointPerLayerSorter
The SpacePointPerLayerSorter sort two given space points by their layer Identifier.
Definition: SpacePointPerLayerSorter.h:15
MuonR4::SpacePointPerLayerSplitter::HitLayVec
std::vector< HitVec > HitLayVec
Definition: SpacePointPerLayerSplitter.h:19
MuonR4::SpacePointPerLayerSplitter::HitVec
std::vector< const SpacePoint * > HitVec
Definition: SpacePointPerLayerSplitter.h:18
SpacePointPerLayerSplitter.h
MuonR4::SpacePointPerLayerSplitter::m_nMdtHits
unsigned int m_nMdtHits
Number of all Mdt tube hits
Definition: SpacePointPerLayerSplitter.h:50
Acts
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/UtilFunctions.h:17
MuonR4::SpacePointPerLayerSplitter::m_nStripHits
unsigned int m_nStripHits
Number of all strip hits.
Definition: SpacePointPerLayerSplitter.h:52
MdtIdHelper
Definition: MdtIdHelper.h:61
MdtIdHelper.h
MuonR4::SpacePointPerLayerSplitter::m_tubeLaySwitch
unsigned int m_tubeLaySwitch
Index of the first tube-layer from the second multilayer.
Definition: SpacePointPerLayerSplitter.h:54
MuonR4::SpacePoint
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePoint.h:19
MuonR4::SpacePointPerLayerSplitter::m_stripLayers
HitLayVec m_stripLayers
Sorted Strip hits per gasGap strip
Definition: SpacePointPerLayerSplitter.h:48
MuonR4::SpacePointPerLayerSplitter::m_mdtLayers
HitLayVec m_mdtLayers
Sorted Mdt hits per tube layer.
Definition: SpacePointPerLayerSplitter.h:46
MuonR4::HitVec
SpacePointPerLayerSplitter::HitVec HitVec
Definition: SpacePointPerLayerSplitter.cxx:12
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:27
MuonR4::SpacePointPerLayerSplitter::SpacePointPerLayerSplitter
SpacePointPerLayerSplitter(const SpacePointBucket &bucket)
Constructor taking a complete bucket
Definition: SpacePointPerLayerSplitter.cxx:13
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
SpacePointPerLayerSorter.h
IMuonIdHelperSvc.h