4#ifndef MUONSPACEPOINTFORMATION_MUONSPACEPOINTMAKERALG_H
5#define MUONSPACEPOINTFORMATION_MUONSPACEPOINTMAKERALG_H
13#include "Acts/Utilities/PointerTraits.hpp"
36 template <Acts::Po
interConcept Prd_t>
43 using AthReentrantAlgorithm::AthReentrantAlgorithm;
46 StatusCode
execute(
const EventContext& ctx)
const override;
76 void addToStat(
const std::vector<SpacePoint>& spacePoints);
131 template <
typename ContType>
142 template <
typename PrdType>
151 template <
typename ContType>
159 template <
typename PrdType>
163 std::vector<SpacePoint>& outColl)
const;
195 const double firstSpPos,
231 "Key to the uncalibrated Drift circle measurements"};
234 "Key to the uncalibrated 1D rpc hits"};
237 "Key to the uncalibrated 1D tgc hits"};
240 "Key to the uncalibrated 1D Mm hits"};
256 "Maximal distance between consecutive hits in a bucket"};
260 "Maximal size of a space point bucket"};
265 "Hits that are within <spacePointOverlap> of the bucket margin. "
266 "Are copied to the next bucket"};
270 "Chamber-pattern dependent space point window. " "Examples: BML*=0.5, BIL_eta3_phi3=0.2"};
274 "Chamber-pattern dependent max bucket length. " "Examples: BML*=0.5, BIL_eta3_phi3=0.2"};
278 "Chamber-dependent overrides of spacePointOverlap" };
285 Gaudi::Property<bool>
m_doStat{
this,
"doStats",
false,
286 "If enabled the algorithm keeps track how many hits have been made" };
292 "Maximum occpancy of Rpc eta hits in a gasGap"};
294 "Maximum occpancy of Rpc phi hits in a gasGap"};
297 "Maximum occpancy of Tgc eta hits in a gasGap"};
299 "Maximum occpancy of Tgc phi hits in a gasGap"};
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
Chamber represent the volume enclosing a muon station.
std::map< FieldKey, StatField > StatMap_t
SpacePointStatistics(const Muon::IMuonIdHelperSvc *idHelperSvc)
Standard constructor.
const Muon::IMuonIdHelperSvc * m_idHelperSvc
void addToStat(const std::vector< SpacePoint > &spacePoints)
Adds the vector of space points to the overall statistics.
void dumpStatisics(MsgStream &msg) const
Print the statistics table of the built space points per category into the log-file / console.
Data preparation algorithm that transforms the uncalibrated measurements into muon space points.
Gaudi::Property< double > m_maxOccRpcEta
BucketParameters m_defaultBucketParameters
Default bucket parameters used if no chamber-specific parameters are found, defaults into m_spacePoin...
std::unique_ptr< SpacePointStatistics > m_statCounter ATLAS_THREAD_SAFE
Gaudi::Property< double > m_maxOccTgcEta
const MuonGMR4::MuonDetectorManager * m_detMgr
Gaudi::Property< double > m_maxOccTgcPhi
Gaudi::Property< double > m_spacePointWindow
Default space point window size (Max distance between the two eta hits).
Gaudi::Property< bool > m_doStat
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::vector< EtaPhi2DHits< T > > EtaPhi2DHitsVec
SG::ReadHandleKey< xAOD::TgcStripContainer > m_tgcKey
bool splitBucket(const SpacePoint &spacePoint, const double firstSpPos, const SpacePointBucketVec &sortedPoints, const BucketParameters &bucketParams) const
Returns whether the space point is beyond the bucket boundary.
void distributePhiPoints(std::vector< SpacePoint > &&spacePoints, SpacePointBucketVec &splittedContainer) const
Distributs the vector phi space points into the buckets.
Gaudi::Property< double > m_maxOccRpcPhi
Gaudi::Property< double > m_maxBucketLength
Default maximum bucket length (the width of the bucket in local y coordinate).
ResolvedParameter resolveParameter(const std::string_view chamberKey, const double defaultValue, const BucketPatternMap &patterns) const
Resolves a specific parameter for a given chamber key, based on the configured patterns.
SG::ReadHandleKey< xAOD::MMClusterContainer > m_mmKey
bool passOccupancy2D(const PrdVec_t< PrdType > &etaHits, const PrdVec_t< PrdType > &phiHits) const
: Check whether the occupancy cuts of hits in a gasGap are surpassed.
std::vector< SpacePointBucket > SpacePointBucketVec
Abrivation of a MuonSapcePoint bucket vector.
void fillUncombinedSpacePoints(const ActsTrk::GeometryContext &gctx, const Amg::Transform3D §orTrans, const PrdVec_t< const PrdType * > &prdsToFill, std::vector< SpacePoint > &outColl) const
Transform the uncombined space prd measurements to space points.
void newBucket(const SpacePoint &refSp, SpacePointBucketVec &sortedPoints, const BucketParameters &bucketParams) const
Closes the current processed bucket and creates a new one.
Gaudi::Property< BucketPatternMap > m_spacePointOverlapPatterns
Chamber-pattern dependent space point overlap.
SG::WriteHandleKey< SpacePointContainer > m_writeKey
~SpacePointMakerAlg()=default
StatusCode loadContainerAndSort(const EventContext &ctx, const SG::ReadHandleKey< ContType > &key, PreSortedSpacePointMap &fillContainer) const
Retrieve an uncalibrated measurement container <ContType> and fill the hits into the presorted space ...
SG::ReadHandleKey< xAOD::RpcMeasurementContainer > m_rpcKey
Gaudi::Property< double > m_spacePointOverlap
Default space point overlap (the margin around the edge of the bucket which is also coppied into anot...
StatusCode execute(const EventContext &ctx) const override
std::optional< BucketParameters > resolveBucketParameters(const MuonGMR4::Chamber &chamber) const
Resolves the bucket parameters for a given chamber, based on the chamber key and the configured patte...
std::vector< Prd_t > PrdVec_t
void distributePrimaryPoints(std::vector< SpacePoint > &&spacePoints, SpacePointBucketVec &splittedContainer) const
Distributes the vector of primary eta or eta + phi space points and fills them into the buckets.
StatusCode initialize() override
SG::ReadHandleKey< xAOD::sTgcMeasContainer > m_stgcKey
void distributePointsAndStore(SpacePointsPerChamber &&hitsPerChamber, SpacePointContainer &finalContainer) const
Distribute the premade spacepoints per chamber into their individual SpacePoint buckets.
EtaPhi2DHitsVec< typename ContType::const_value_type > splitHitsPerGasGap(xAOD::ChamberViewer< ContType > &viewer) const
Splits the chamber hits of the viewer per gas gap.
StatusCode finalize() override
########################################## SpacePointMakerAlg #######################################...
const BucketParameters & getBucketParameters(const SpacePoint &spacePoint) const
Returns the bucket parameters for a given space point.
Gaudi::Property< BucketPatternMap > m_maxBucketLengthPatterns
Chamber-pattern dependent maximum bucket length.
std::string chamberConfigKey(const MuonGMR4::Chamber &chamber) const
Returns a string key for a chamber, based on the space point identifier.
Gaudi::Property< BucketPatternMap > m_spacePointWindowPatterns
Chamber-pattern dependent space point window.
std::unordered_map< const MuonGMR4::SpectrometerSector *, SpacePointsPerChamber > PreSortedSpacePointMap
Container abrivation of the presorted space point container per MuonChambers.
std::array< PrdVec_t< T >, 3 > EtaPhi2DHits
Gaudi::Property< unsigned > m_capacityBucket
SG::ReadHandleKey< xAOD::MdtDriftCircleContainer > m_mdtKey
ActsTrk::GeoContextReadKey_t m_geoCtxKey
std::map< std::string, double, std::less<> > BucketPatternMap
std::unordered_map< const MuonGMR4::Chamber *, BucketParameters > m_bucketParameters
Map of bucket parameters for each chamber.
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
std::vector< std::string > patterns
SG::ReadHandleKey< GeometryContext > GeoContextReadKey_t
Abrivate the ReadHandleKey to declare the data dependency on the Geometry context.
Eigen::Affine3d Transform3D
This header ties the generic definitions in this package.
DataVector< SpacePointBucket > SpacePointContainer
Abrivation of the space point container type.
StIndex
enum to classify the different station layers in the muon spectrometer
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Helper struct to define the bucket parameters for a given chamber.
Helper struct to store the resolved bucket parameters for a given chamber.
Helper struct to define the counting categories.
bool operator<(const FieldKey &other) const
################################################################ SpacePointStatistics ###############...
Muon::MuonStationIndex::StIndex StIdx_t
Muon::MuonStationIndex::TechnologyIndex TechIdx_t
Helper struct to count the space-points in each detector category.
unsigned measEtaPhi
Number of space points measuring eta & phi.
unsigned measEta
Number of space points measuring eta only.
unsigned measPhi
Number of space points measuring phi only.
unsigned allHits() const
Helper method returning the sum of the three space point type counts.
: Helper struct to collect the space point per muon chamber, which are later sorted into the space po...
std::vector< SpacePoint > etaHits
Vector of all hits that contain an eta measurement including the ones which are combined with phi mea...
std::vector< SpacePoint > phiHits
Vector of all space points that are built from single phi hits.