ATLAS Offline Software
Loading...
Searching...
No Matches
MuonR4::SpacePointMakerAlg Class Reference

Data preparation algorithm that transforms the uncalibrated measurements into muon space points. More...

#include <SpacePointMakerAlg.h>

Inheritance diagram for MuonR4::SpacePointMakerAlg:

Classes

struct  BucketParameters
 Helper struct to define the bucket parameters for a given chamber. More...
struct  ResolvedParameter
 Helper struct to store the resolved bucket parameters for a given chamber. More...
class  SpacePointStatistics
 Helper class to keep track of how many eta+phi, eta and phi only space points are built in various detector regions. More...
struct  SpacePointsPerChamber
 : Helper struct to collect the space point per muon chamber, which are later sorted into the space point buckets. More...

Public Types

template<Acts::PointerConcept Prd_t>
using PrdVec_t = std::vector<Prd_t>
template<typename T>
using EtaPhi2DHits = std::array<PrdVec_t<T>, 3>
template<typename T>
using EtaPhi2DHitsVec = std::vector<EtaPhi2DHits<T>>

Public Member Functions

 ~SpacePointMakerAlg ()=default
StatusCode execute (const EventContext &ctx) const override
StatusCode initialize () override
StatusCode finalize () override
 ########################################## SpacePointMakerAlg #########################################
template<>
bool passOccupancy2D (const PrdVec_t< const xAOD::TgcStrip * > &etaHits, const PrdVec_t< const xAOD::TgcStrip * > &phiHits) const
template<>
bool passOccupancy2D (const PrdVec_t< const xAOD::RpcMeasurement * > &etaHits, const PrdVec_t< const xAOD::RpcMeasurement * > &phiHits) const
template<>
bool passOccupancy2D (const PrdVec_t< const xAOD::MMCluster * > &, const PrdVec_t< const xAOD::MMCluster * > &) const
template<>
StatusCode loadContainerAndSort (const EventContext &ctx, const SG::ReadHandleKey< xAOD::sTgcMeasContainer > &key, PreSortedSpacePointMap &fillContainer) const
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

using PreSortedSpacePointMap = std::unordered_map<const MuonGMR4::SpectrometerSector*, SpacePointsPerChamber>
 Container abrivation of the presorted space point container per MuonChambers.
using SpacePointBucketVec = std::vector<SpacePointBucket>
 Abrivation of a MuonSapcePoint bucket vector.
using BucketPatternMap = std::map<std::string, double, std::less<>>
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

template<typename ContType>
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 point map.
template<typename PrdType>
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.
template<typename ContType>
EtaPhi2DHitsVec< typename ContType::const_value_type > splitHitsPerGasGap (xAOD::ChamberViewer< ContType > &viewer) const
 Splits the chamber hits of the viewer per gas gap.
template<typename PrdType>
void fillUncombinedSpacePoints (const ActsTrk::GeometryContext &gctx, const Amg::Transform3D &sectorTrans, const PrdVec_t< const PrdType * > &prdsToFill, std::vector< SpacePoint > &outColl) const
 Transform the uncombined space prd measurements to space points.
void distributePointsAndStore (SpacePointsPerChamber &&hitsPerChamber, SpacePointContainer &finalContainer) const
 Distribute the premade spacepoints per chamber into their individual SpacePoint buckets.
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.
void distributePhiPoints (std::vector< SpacePoint > &&spacePoints, SpacePointBucketVec &splittedContainer) const
 Distributs the vector phi space points into the buckets.
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 newBucket (const SpacePoint &refSp, SpacePointBucketVec &sortedPoints, const BucketParameters &bucketParams) const
 Closes the current processed bucket and creates a new one.
std::string chamberConfigKey (const MuonGMR4::Chamber &chamber) const
 Returns a string key for a chamber, based on the space point identifier.
std::optional< BucketParametersresolveBucketParameters (const MuonGMR4::Chamber &chamber) const
 Resolves the bucket parameters for a given chamber, based on the chamber key and the configured patterns.
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.
const BucketParametersgetBucketParameters (const SpacePoint &spacePoint) const
 Returns the bucket parameters for a given space point.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::MdtDriftCircleContainerm_mdtKey
SG::ReadHandleKey< xAOD::RpcMeasurementContainerm_rpcKey
SG::ReadHandleKey< xAOD::TgcStripContainerm_tgcKey
SG::ReadHandleKey< xAOD::MMClusterContainerm_mmKey
SG::ReadHandleKey< xAOD::sTgcMeasContainerm_stgcKey {this, "sTgcKey", "xAODsTgcMeasurements"}
ActsTrk::GeoContextReadKey_t m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
const MuonGMR4::MuonDetectorManagerm_detMgr {nullptr}
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
SG::WriteHandleKey< SpacePointContainerm_writeKey {this, "WriteKey", "MuonSpacePoints"}
Gaudi::Property< double > m_spacePointWindow
 Default space point window size (Max distance between the two eta hits).
Gaudi::Property< double > m_maxBucketLength
 Default maximum bucket length (the width of the bucket in local y coordinate).
Gaudi::Property< double > m_spacePointOverlap
 Default space point overlap (the margin around the edge of the bucket which is also coppied into another bucket).
Gaudi::Property< BucketPatternMapm_spacePointWindowPatterns
 Chamber-pattern dependent space point window.
Gaudi::Property< BucketPatternMapm_maxBucketLengthPatterns
 Chamber-pattern dependent maximum bucket length.
Gaudi::Property< BucketPatternMapm_spacePointOverlapPatterns
 Chamber-pattern dependent space point overlap.
std::unordered_map< const MuonGMR4::Chamber *, BucketParametersm_bucketParameters {}
 Map of bucket parameters for each chamber.
BucketParameters m_defaultBucketParameters {}
 Default bucket parameters used if no chamber-specific parameters are found, defaults into m_spacePointWindow, m_maxBucketLength, and m_spacePointOverlap.
Gaudi::Property< bool > m_doStat
Gaudi::Property< unsigned > m_capacityBucket {this,"CapacityBucket" , 50}
std::unique_ptr< SpacePointStatistics > m_statCounter ATLAS_THREAD_SAFE {}
Gaudi::Property< double > m_maxOccRpcEta
Gaudi::Property< double > m_maxOccRpcPhi
Gaudi::Property< double > m_maxOccTgcEta
Gaudi::Property< double > m_maxOccTgcPhi
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Data preparation algorithm that transforms the uncalibrated measurements into muon space points.

Mdt, Mm measurements are directly transformed. The remaining three technologies provide eta & phi measurements, each 1D. The measurements are sorted by gas gap and if the occupancy in the gas gap is low enough, then each eta measurement is combined with each phi measurement to a 2D space point. Otherwise, single 1D space points are produced. Space points in the same MS layer & phi-sector are expressed in the common sector frame.

Definition at line 34 of file SpacePointMakerAlg.h.

Member Typedef Documentation

◆ BucketPatternMap

using MuonR4::SpacePointMakerAlg::BucketPatternMap = std::map<std::string, double, std::less<>>
private

Definition at line 208 of file SpacePointMakerAlg.h.

◆ EtaPhi2DHits

template<typename T>
using MuonR4::SpacePointMakerAlg::EtaPhi2DHits = std::array<PrdVec_t<T>, 3>

Definition at line 39 of file SpacePointMakerAlg.h.

◆ EtaPhi2DHitsVec

template<typename T>
using MuonR4::SpacePointMakerAlg::EtaPhi2DHitsVec = std::vector<EtaPhi2DHits<T>>

Definition at line 41 of file SpacePointMakerAlg.h.

◆ PrdVec_t

template<Acts::PointerConcept Prd_t>
using MuonR4::SpacePointMakerAlg::PrdVec_t = std::vector<Prd_t>

Definition at line 37 of file SpacePointMakerAlg.h.

◆ PreSortedSpacePointMap

Container abrivation of the presorted space point container per MuonChambers.

Definition at line 119 of file SpacePointMakerAlg.h.

◆ SpacePointBucketVec

Abrivation of a MuonSapcePoint bucket vector.

Definition at line 122 of file SpacePointMakerAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~SpacePointMakerAlg()

MuonR4::SpacePointMakerAlg::~SpacePointMakerAlg ( )
default

Member Function Documentation

◆ chamberConfigKey()

std::string MuonR4::SpacePointMakerAlg::chamberConfigKey ( const MuonGMR4::Chamber & chamber) const
private

Returns a string key for a chamber, based on the space point identifier.

Parameters
chamberChamber for which to generate the key
Returns
A string representing the chamber key (e.g. EML_eta-1_phi3)

Definition at line 837 of file SpacePointMakerAlg.cxx.

837 {
838 return std::format("{:}_eta{:}_phi{:}", Muon::MuonStationIndex::chName(chamber.chamberIndex()), chamber.stationEta(), chamber.stationPhi());
839}
const std::string & chName(ChIndex index)
convert ChIndex into a string

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ distributePhiPoints()

void MuonR4::SpacePointMakerAlg::distributePhiPoints ( std::vector< SpacePoint > && spacePoints,
SpacePointBucketVec & splittedContainer ) const
private

Distributs the vector phi space points into the buckets.

In contrast to the primary distribution no new buckets are created and the points are distributed into the existing ones instead.

Parameters
spacePointVecotr of phi space points to sort into the buckets
splittedContainerOutput vector containing all defined bucket

If maxY is smaller than the lower cov boundary or minY is bigger than the other boundary, there's definetely no overlap

Definition at line 726 of file SpacePointMakerAlg.cxx.

727 {
728 for (SpacePoint& sp : spacePoints) {
729 auto phiPoint = std::make_shared<SpacePoint>(std::move(sp));
730 const double dY = std::sqrt(phiPoint->covariance()[Acts::toUnderlying(CovIdx::etaCov)]);
731 const double minY = phiPoint->localPosition().y() - dY;
732 const double maxY = phiPoint->localPosition().y() + dY;
733 for (SpacePointBucket& bucket : splittedContainer){
736 if (! (maxY < bucket.coveredMin() || bucket.coveredMax() < minY) ) {
737 bucket.emplace_back(phiPoint);
738 }
739 }
740 }
741}
static Double_t sp

◆ distributePointsAndStore()

void MuonR4::SpacePointMakerAlg::distributePointsAndStore ( SpacePointsPerChamber && hitsPerChamber,
SpacePointContainer & finalContainer ) const
private

Distribute the premade spacepoints per chamber into their individual SpacePoint buckets.

A new bucket is created everytime if the hit to fill is along the z-axis farther away from the first point in the bucket than the <spacePointWindowSize>. Hit in the previous bucket which are <spacePointOverlap> away from the first hit in the new bucket are also mirrored. The bucket formation starts with the eta Muon space points and then consumes the phi hits.

Parameters
ctxEvent context of the current event
hitsPerChamberList of all premade space points which have to be sorted
finalContainerOutput SpacePoint bucket container.

Definition at line 684 of file SpacePointMakerAlg.cxx.

685 {
686 SpacePointBucketVec splittedHits{};
687 splittedHits.emplace_back();
688 if (m_statCounter){
689 m_statCounter->addToStat(hitsPerChamber.etaHits);
690 m_statCounter->addToStat(hitsPerChamber.phiHits);
691
692 }
693 distributePrimaryPoints(std::move(hitsPerChamber.etaHits), splittedHits);
694 splittedHits.erase(std::remove_if(splittedHits.begin(), splittedHits.end(),
695 [](const SpacePointBucket& bucket) {
696 return bucket.size() <= 1;
697 }), splittedHits.end());
698 distributePhiPoints(std::move(hitsPerChamber.phiHits), splittedHits);
699
700 std::size_t nBuckets{0};
701 std::size_t nSpacePointsInBuckets{0};
702 std::size_t maxBucketSize{0};
703 for (SpacePointBucket& bucket : splittedHits) {
704
705 std::ranges::sort(bucket, MuonR4::SpacePointPerLayerSorter{});
706
707 if (msgLvl(MSG::VERBOSE)){
708 std::stringstream spStr{};
709 for (const std::shared_ptr<SpacePoint>& sp : bucket){
710 spStr<<"SpacePoint: PrimaryMeas: " <<(*sp)<<std::endl;
711 }
712 ATH_MSG_VERBOSE("Created a bucket, printing all spacepoints..."<<std::endl<<spStr.str());
713 }
714 bucket.populateChamberLocations();
715
716 ++nBuckets;
717 nSpacePointsInBuckets += bucket.size();
718 maxBucketSize = std::max(maxBucketSize, bucket.size());
719 finalContainer.push_back(std::make_unique<SpacePointBucket>(std::move(bucket)));
720 }
721
722 ATH_MSG_DEBUG("Created "<<nBuckets<<" buckets with a total of "<<nSpacePointsInBuckets
723 <<" space points. Max bucket size: "<<maxBucketSize);
724
725}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
bool msgLvl(const MSG::Level lvl) const
void distributePhiPoints(std::vector< SpacePoint > &&spacePoints, SpacePointBucketVec &splittedContainer) const
Distributs the vector phi space points into the buckets.
std::vector< SpacePointBucket > SpacePointBucketVec
Abrivation of a MuonSapcePoint bucket vector.
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.
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.

◆ distributePrimaryPoints()

void MuonR4::SpacePointMakerAlg::distributePrimaryPoints ( std::vector< SpacePoint > && spacePoints,
SpacePointBucketVec & splittedContainer ) const
private

Distributes the vector of primary eta or eta + phi space points and fills them into the buckets.

The buckets are dynamically created based on the distance of the new space point to sort to the previous or the first space point in the bucket.

Parameters
spacePointsVector of space points to sort into the buckets
splittedContainerOutput vector containing all defined bucket

Order the space points by local chamber y which is along the tube-plane.

Definition at line 799 of file SpacePointMakerAlg.cxx.

800 {
801
802 if (spacePoints.empty()) return;
803
805 std::ranges::sort(spacePoints,
806 [] (const SpacePoint& a, const SpacePoint& b) {
807 return a.localPosition().y() < b.localPosition().y();
808 });
809
810 double firstPointPos = spacePoints.front().localPosition().y();
811
812 //Base the bucket parameters on the first space point in the chamber. This is a good approximation since all space points in the same chamber should have similar properties with the exception of the edge space points and overlapping chambers
813 const BucketParameters& bucketParams = getBucketParameters(spacePoints.front());
814
815 ATH_MSG_DEBUG("Distributing "<<spacePoints.size()<<" primary space points into buckets with parameters: "
816 << "maxBucketLength=" << bucketParams.maxBucketLength
817 << ", spacePointWindow=" << bucketParams.spacePointWindow
818 << ", spacePointOverlap=" << bucketParams.spacePointOverlap);
819
820 for (SpacePoint& toSort : spacePoints) {
821 ATH_MSG_VERBOSE("Add new primary space point "<<toSort);
822
823 if (splitBucket(toSort, firstPointPos, splittedHits, bucketParams)){
824 newBucket(toSort, splittedHits, bucketParams);
825 firstPointPos = splittedHits.back().empty() ? toSort.localPosition().y() : splittedHits.back().front()->localPosition().y();
826 ATH_MSG_VERBOSE("New bucket: id " << splittedHits.back().bucketId() << " Coverage: " << firstPointPos);
827 }
828 std::shared_ptr<SpacePoint> spacePoint = std::make_shared<SpacePoint>(std::move(toSort));
829 splittedHits.back().emplace_back(spacePoint);
830 }
831 SpacePointBucket& lastBucket{splittedHits.back()};
832 lastBucket.setCoveredRange(lastBucket.front()->localPosition().y(),
833 lastBucket.back()->localPosition().y());
834}
static Double_t a
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 newBucket(const SpacePoint &refSp, SpacePointBucketVec &sortedPoints, const BucketParameters &bucketParams) const
Closes the current processed bucket and creates a new one.
const BucketParameters & getBucketParameters(const SpacePoint &spacePoint) const
Returns the bucket parameters for a given space point.
Helper struct to define the bucket parameters for a given chamber.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode MuonR4::SpacePointMakerAlg::execute ( const EventContext & ctx) const
override

Definition at line 661 of file SpacePointMakerAlg.cxx.

661 {
662 PreSortedSpacePointMap preSortedContainer{};
663 ATH_CHECK(loadContainerAndSort(ctx, m_mdtKey, preSortedContainer));
664 ATH_CHECK(loadContainerAndSort(ctx, m_rpcKey, preSortedContainer));
665 ATH_CHECK(loadContainerAndSort(ctx, m_tgcKey, preSortedContainer));
666 ATH_CHECK(loadContainerAndSort(ctx, m_mmKey, preSortedContainer));
667 ATH_CHECK(loadContainerAndSort(ctx, m_stgcKey, preSortedContainer));
668 std::unique_ptr<SpacePointContainer> outContainer = std::make_unique<SpacePointContainer>();
669
670 for (auto &[chamber, hitsPerChamber] : preSortedContainer){
671 ATH_MSG_DEBUG("Fill space points for chamber "<<chamber->identString() << " with "<<hitsPerChamber.etaHits.size()
672 <<" primary and "<<hitsPerChamber.phiHits.size()<<" phi space points.");
673
674 distributePointsAndStore(std::move(hitsPerChamber), *outContainer);
675 }
676
677 ATH_MSG_DEBUG("Created a total of "<<outContainer->size()<<" space points in "<<preSortedContainer.size()<<" chambers");
678
679 SG::WriteHandle writeHandle{m_writeKey, ctx};
680 ATH_CHECK(writeHandle.record(std::move(outContainer)));
681 return StatusCode::SUCCESS;
682}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< xAOD::TgcStripContainer > m_tgcKey
SG::ReadHandleKey< xAOD::MMClusterContainer > m_mmKey
SG::WriteHandleKey< SpacePointContainer > m_writeKey
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
SG::ReadHandleKey< xAOD::sTgcMeasContainer > m_stgcKey
void distributePointsAndStore(SpacePointsPerChamber &&hitsPerChamber, SpacePointContainer &finalContainer) const
Distribute the premade spacepoints per chamber into their individual SpacePoint buckets.
std::unordered_map< const MuonGMR4::SpectrometerSector *, SpacePointsPerChamber > PreSortedSpacePointMap
Container abrivation of the presorted space point container per MuonChambers.
SG::ReadHandleKey< xAOD::MdtDriftCircleContainer > m_mdtKey
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ fillUncombinedSpacePoints()

template<typename PrdType>
void MuonR4::SpacePointMakerAlg::fillUncombinedSpacePoints ( const ActsTrk::GeometryContext & gctx,
const Amg::Transform3D & sectorTrans,
const PrdVec_t< const PrdType * > & prdsToFill,
std::vector< SpacePoint > & outColl ) const
private

Transform the uncombined space prd measurements to space points.

Parameters
gctxGeometry context to fetch the transformation of the measurements
sectorTransTransformation to go from the global -> sector frame
prdsToFillList of uncombined measurements to transform
outCollReference to the mutable output collection to which the 1D space points are appended.

Local coordinate system aligned such that the strips point along local y

The measurement is a phi measurement

Definition at line 274 of file SpacePointMakerAlg.cxx.

277 {
278 if (prdsToFill.empty()) {
279 return;
280 }
281 const PrdType* refMeas = prdsToFill.front();
282 bool allSpArePhi{false};
283
284 const Amg::Transform3D toSectorTrans = toChamberTransform(gctx, sectorTrans, *refMeas);
286 Amg::Vector3D sensorDir{Amg::Vector3D::Zero()}, toNextSen{Amg::Vector3D::Zero()};
288 if constexpr(std::is_same_v<PrdType, xAOD::RpcMeasurement> ||
289 std::is_same_v<PrdType, xAOD::TgcStrip>) {
290 allSpArePhi = refMeas->measuresPhi();
291 const auto& stripLayout = refMeas->readoutElement()->sensorLayout(refMeas->layerHash());
292 const auto& design = stripLayout->design(allSpArePhi);
293 sensorDir = toSectorTrans.linear() * stripLayout->to3D(design.stripDir(), allSpArePhi);
294 toNextSen = toSectorTrans.linear() * stripLayout->to3D(design.stripNormal(), allSpArePhi);
295 ATH_MSG_VERBOSE("Fill space points for "<<m_idHelperSvc->toString(refMeas->identify())
296 <<" -> sensor: "<<Amg::toString(sensorDir)<<", "<<Amg::toString(toNextSen));
297 } else if constexpr (std::is_same_v<PrdType, xAOD::sTgcMeasurement>){
298 allSpArePhi = refMeas->channelType() == xAOD::sTgcMeasurement::sTgcChannelTypes::Wire;
299 const auto& stripLayout = refMeas->readoutElement()->stripLayer(refMeas->measurementHash());
300 const auto& design = stripLayout.design(allSpArePhi);
301 sensorDir = toSectorTrans.linear() * stripLayout.to3D(design.stripDir(), allSpArePhi);
302 toNextSen = toSectorTrans.linear() * stripLayout.to3D(design.stripNormal(), allSpArePhi);
303 } else {
304 sensorDir = toSectorTrans.linear().col(Amg::y);
305 toNextSen = toSectorTrans.linear().col(Amg::x);
306 }
307 outColl.reserve(outColl.size() + prdsToFill.size());
308 for (const PrdType* prd: prdsToFill) {
309 SpacePoint& newSp = outColl.emplace_back(prd);
310 if constexpr (std::is_same_v<PrdType, xAOD::TgcStrip>) {
311 if (allSpArePhi) {
312 const auto& stripLayout = refMeas->readoutElement()->sensorLayout(refMeas->layerHash());
313 const auto& radialDesign = static_cast<const MuonGMR4::RadialStripDesign&>(stripLayout->design(allSpArePhi));
314 toNextSen = toSectorTrans.linear() * stripLayout->to3D(radialDesign.stripNormal(prd->channelNumber()), allSpArePhi);
315 sensorDir = toSectorTrans.linear() * stripLayout->to3D(radialDesign.stripDir(prd->channelNumber()), allSpArePhi);
316 }
317 }
318 newSp.setPosition(toSectorTrans * prd->localMeasurementPos());
319 newSp.setDirection(sensorDir, toNextSen);
320 auto cov = Acts::filledArray<double,3>(0.);
321 if (prd->numDimensions() == 2) {
322 cov[Acts::toUnderlying(CovIdx::etaCov)] = prd->template localCovariance<2>()(0,0);
323 cov[Acts::toUnderlying(CovIdx::phiCov)] = prd->template localCovariance<2>()(1,1);
324 } else {
326 auto covIdx{Acts::toUnderlying(CovIdx::etaCov)},
327 lenIdx{Acts::toUnderlying(CovIdx::phiCov)};
328 if (!newSp.measuresEta()) {
329 std::swap(covIdx, lenIdx);
330 }
331 cov[covIdx] = prd->template localCovariance<1>()[0];
332 cov[lenIdx] = Acts::square(sensorHalfLength(*prd));
333 }
334 newSp.setCovariance(std::move(cov));
335 }
336}
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode MuonR4::SpacePointMakerAlg::finalize ( )
override

########################################## SpacePointMakerAlg #########################################

Definition at line 194 of file SpacePointMakerAlg.cxx.

194 {
195 if (m_statCounter) {
196 m_statCounter->dumpStatisics(msgStream());
197 }
198 return StatusCode::SUCCESS;
199}

◆ getBucketParameters()

const SpacePointMakerAlg::BucketParameters & MuonR4::SpacePointMakerAlg::getBucketParameters ( const SpacePoint & spacePoint) const
private

Returns the bucket parameters for a given space point.

Parameters
spacePointSpace point for which to get the bucket parameters
Returns
A reference to the BucketParameters struct for the space point

Definition at line 841 of file SpacePointMakerAlg.cxx.

841 {
842 const MuonGMR4::Chamber* chamber = spacePoint.chamber();
843
844 ATH_MSG_DEBUG("Resolving bucket parameters for chamber "<<chamber->identString());
845
846 if (const auto itr = m_bucketParameters.find(chamber);
847 itr != m_bucketParameters.end()) {
848 ATH_MSG_DEBUG("FOUNDPARAMS!" );
849 return itr->second;
850 }
851
853}
BucketParameters m_defaultBucketParameters
Default bucket parameters used if no chamber-specific parameters are found, defaults into m_spacePoin...
std::unordered_map< const MuonGMR4::Chamber *, BucketParameters > m_bucketParameters
Map of bucket parameters for each chamber.

◆ initialize()

StatusCode MuonR4::SpacePointMakerAlg::initialize ( )
override

Definition at line 200 of file SpacePointMakerAlg.cxx.

200 {
201 ATH_CHECK(m_geoCtxKey.initialize());
202 ATH_CHECK(m_mdtKey.initialize(!m_mdtKey.empty()));
203 ATH_CHECK(m_rpcKey.initialize(!m_rpcKey.empty()));
204 ATH_CHECK(m_tgcKey.initialize(!m_tgcKey.empty()));
205 ATH_CHECK(m_mmKey.initialize(!m_mmKey.empty()));
206 ATH_CHECK(m_stgcKey.initialize(!m_stgcKey.empty()));
207 ATH_CHECK(m_idHelperSvc.retrieve());
208 ATH_CHECK(m_writeKey.initialize());
209 if (m_doStat) {
210 m_statCounter = std::make_unique<SpacePointStatistics>(m_idHelperSvc.get());
211 }
212
213
214 //Initialize the chamber-based bucket windows and max bucket lengths
216 .spacePointWindow = m_spacePointWindow.value(),
217 .maxBucketLength = m_maxBucketLength.value(),
218 .spacePointOverlap= m_spacePointOverlap.value()
219 };
220
221
222 ATH_CHECK(detStore()->retrieve(m_detMgr));
223 const auto chambers = m_detMgr->getAllChambers();
224
225 m_bucketParameters.reserve(chambers.size());
226 for (const MuonGMR4::Chamber* chamber : chambers) {
227 const std::optional<BucketParameters> parameters = resolveBucketParameters(*chamber);
228
229 //Fill only the chambers for which we have at least one match, the rest will be filled with the default parameters on demand
230 if (!parameters) {
231 continue;
232 }
233
234 m_bucketParameters.emplace( chamber, *parameters);
235 }
236
237 ATH_MSG_DEBUG( "Configured chamber-dependent bucket parameters for " << m_bucketParameters.size() << " chambers out of " << chambers.size() << " the rest has the following default bucket parameters: "
238 << " maxBucketLength=" << m_defaultBucketParameters.maxBucketLength
239 << " spacePointWindow=" << m_defaultBucketParameters.spacePointWindow
240 << " spacePointOverlap=" << m_defaultBucketParameters.spacePointOverlap);
241
242 return StatusCode::SUCCESS;
243}
const ServiceHandle< StoreGateSvc > & detStore() const
const MuonGMR4::MuonDetectorManager * m_detMgr
Gaudi::Property< double > m_spacePointWindow
Default space point window size (Max distance between the two eta hits).
Gaudi::Property< bool > m_doStat
Gaudi::Property< double > m_maxBucketLength
Default maximum bucket length (the width of the bucket in local y coordinate).
Gaudi::Property< double > m_spacePointOverlap
Default space point overlap (the margin around the edge of the bucket which is also coppied into anot...
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...
ActsTrk::GeoContextReadKey_t m_geoCtxKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ loadContainerAndSort() [1/2]

template<typename ContType>
StatusCode MuonR4::SpacePointMakerAlg::loadContainerAndSort ( const EventContext & ctx,
const SG::ReadHandleKey< ContType > & key,
PreSortedSpacePointMap & fillContainer ) const
private

Retrieve an uncalibrated measurement container <ContType> and fill the hits into the presorted space point map.

Per associated MuonChamber, hits from Tgc, Rpc, sTgcs are grouped by their gasGap location and then divided into eta & phi measurements. If both are found, each eta measurement is combined with phi measurement into a SpacePoint. In any other case, the measurements are just transformed into a SpacePoint.

Parameters
ctxEvent context of the current event
keyReadHandleKey to access the container of data type <ContType>
fillContainerGlobal container into which all space points are filled.

Loop over the chamber hits to split the hits per gasGap

Fill in the 2D measurements BIL Rpc

Only one dimensional space points can be built

Simple combination by taking the cross-product

There's no valid combination with another phi hit

Tgc measurements with different bunch crossing tags cannot be combined

Definition at line 378 of file SpacePointMakerAlg.cxx.

380 {
381 const ContType* measurementCont{nullptr};
382 ATH_CHECK(SG::get(measurementCont, key, ctx));
383 if (!measurementCont || measurementCont->empty()){
384 ATH_MSG_DEBUG("nothing to do");
385 return StatusCode::SUCCESS;
386 }
387 const ActsTrk::GeometryContext* gctx{nullptr};
388 ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
389
390 xAOD::ChamberViewer viewer{*measurementCont};
391
392 do {
393 SpacePointsPerChamber& pointsInChamb = fillContainer[viewer.at(0)->readoutElement()->msSector()];
394 const Amg::Transform3D sectorTrans = viewer.at(0)->readoutElement()->msSector()->globalToLocalTransform(*gctx);
395 ATH_MSG_DEBUG("Fill space points for chamber "<<m_idHelperSvc->toStringDetEl(viewer.at(0)->identify()));
396 if constexpr( std::is_same_v<ContType, xAOD::MdtDriftCircleContainer>) {
397 pointsInChamb.etaHits.reserve(pointsInChamb.etaHits.capacity() + viewer.size());
398 for (const auto& prd : viewer) {
399 Amg::Transform3D toChamberTrans{toChamberTransform(*gctx, sectorTrans, *prd)};
400 SpacePoint& sp{pointsInChamb.etaHits.emplace_back(prd)};
401 sp.setPosition(toChamberTrans*prd->localMeasurementPos());
402 sp.setDirection(toChamberTrans.linear().col(Amg::z),
403 toChamberTrans.linear().col(Amg::y));
404 std::array<double, 3> cov{Acts::filledArray<double,3>(0.)};
405 cov[Acts::toUnderlying(CovIdx::etaCov)] = prd->driftRadiusCov();
406 cov[Acts::toUnderlying(CovIdx::phiCov)] = Acts::square(sensorHalfLength(*prd));
407 if (ATH_UNLIKELY(prd->numDimensions() == 2)){
408 cov[Acts::toUnderlying(CovIdx::phiCov)] = static_cast<const xAOD::MdtTwinDriftCircle*>(prd)->posAlongWireCov();
409 }
410 sp.setCovariance(std::move(cov));
411 }
412 } else {
414 for (auto& [etaHits, phiHits, two2DHits] : splitHitsPerGasGap(viewer)) {
415 ATH_MSG_DEBUG("Found "<<etaHits.size()<<"/"<<phiHits.size()
416 <<" 1D and "<<two2DHits.size()<<" 2D hits in chamber "
417 <<m_idHelperSvc->toStringDetEl(viewer.at(0)->identify()));
419 fillUncombinedSpacePoints(*gctx, sectorTrans, two2DHits, pointsInChamb.etaHits);
421 // Check if we do not have 2D occupancy (missing phi or eta hits)
422 if (!passOccupancy2D(etaHits, phiHits)) {
423 fillUncombinedSpacePoints(*gctx, sectorTrans, etaHits, pointsInChamb.etaHits);
424 fillUncombinedSpacePoints(*gctx, sectorTrans, phiHits, pointsInChamb.phiHits);
425 continue;
426 }
427
428 std::vector<std::shared_ptr<unsigned>> etaCounts{matchCountVec(etaHits.size())},
429 phiCounts{matchCountVec(phiHits.size())};
430
431 pointsInChamb.etaHits.reserve(pointsInChamb.etaHits.size() + etaHits.size()*phiHits.size());
433 const auto& firstEta{etaHits.front()};
434 const Amg::Transform3D toSectorTrans = toChamberTransform(*gctx, sectorTrans, *firstEta);
435
436 Amg::Vector3D toNextDir{Amg::Vector3D::Zero()}, sensorDir{Amg::Vector3D::Zero()};
437 if constexpr (std::is_same_v<xAOD::RpcMeasurementContainer, ContType> ||
438 std::is_same_v<xAOD::TgcStripContainer, ContType>) {
439 const auto& stripLayout = firstEta->readoutElement()->sensorLayout(firstEta->layerHash());
440 const auto& design = stripLayout->design();
441 sensorDir = toSectorTrans.linear() * stripLayout->to3D(design.stripDir(), false);
442 toNextDir = toSectorTrans.linear() * stripLayout->to3D(design.stripNormal(), false);
443 } else if constexpr (std::is_same_v<xAOD::sTgcMeasContainer, ContType>){
444 const auto& stripLayout = firstEta->readoutElement()->stripLayer(firstEta->measurementHash());
445 const auto& design = stripLayout.design(false);
446 sensorDir = toSectorTrans.linear() * stripLayout.to3D(design.stripDir(), false);
447 toNextDir = toSectorTrans.linear() * stripLayout.to3D(design.stripNormal(), false);
448 } else {
449 ATH_MSG_ERROR("Unsupported container type");
450 return StatusCode::FAILURE;
451 }
452
453 using namespace Acts::detail::LineHelper;
454 for (unsigned etaP = 0; etaP < etaHits.size(); ++etaP) {
456 for (unsigned phiP = 0; phiP < phiHits.size(); ++ phiP) {
458 if constexpr(std::is_same_v<xAOD::TgcStripContainer, ContType>) {
459 if (!(etaHits[etaP]->bcBitMap() & phiHits[phiP]->bcBitMap())){
460 continue;
461 }
462 const auto& stripLay = phiHits[phiP]->readoutElement()->sensorLayout(phiHits[phiP]->layerHash());
463 const auto& radialDesign = static_cast<const MuonGMR4::RadialStripDesign&>(stripLay->design(true));
464 toNextDir = toSectorTrans.linear() * stripLay->to3D(radialDesign.stripDir(phiHits[phiP]->channelNumber()), true);
465 }
466
467 SpacePoint& newSp = pointsInChamb.etaHits.emplace_back(etaHits[etaP], phiHits[phiP]);
468 newSp.setInstanceCounts(etaCounts[etaP], phiCounts[phiP]);
469
470 auto spIsect = lineIntersect(toSectorTrans*etaHits[etaP]->localMeasurementPos(), sensorDir,
471 toSectorTrans*phiHits[phiP]->localMeasurementPos(), toNextDir);
472 newSp.setPosition(spIsect.position());
473 newSp.setDirection(sensorDir, toNextDir);
474 auto cov = Acts::filledArray<double, 3>(0.);
475 cov[Acts::toUnderlying(CovIdx::etaCov)] = etaHits[etaP]->template localCovariance<1>()[0];
476 cov[Acts::toUnderlying(CovIdx::phiCov)] = phiHits[phiP]->template localCovariance<1>()[0];
478 if constexpr(std::is_same_v<xAOD::TgcStripContainer, ContType>) {
479 const auto& stripLay = phiHits[phiP]->readoutElement()->sensorLayout(phiHits[phiP]->layerHash());
480 const auto& radialDesign = static_cast<const MuonGMR4::RadialStripDesign&>(stripLay->design(true));
481 const Amg::Vector2D planePos = stripLay->to2D(toSectorTrans.inverse()*spIsect.position(), true);
482 cov[Acts::toUnderlying(CovIdx::phiCov)] =
483 Acts::square(radialDesign.stripPitch(phiHits[phiP]->channelNumber(), planePos)) / 12.;
484 }
485
486 newSp.setCovariance(std::move(cov));
487 ATH_MSG_VERBOSE("Created new space point "<<newSp);
488 }
489 }
490 }
491 }
492 } while (viewer.next());
493 return StatusCode::SUCCESS;
494}
#define ATH_MSG_ERROR(x)
#define ATH_UNLIKELY(x)
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.
void fillUncombinedSpacePoints(const ActsTrk::GeometryContext &gctx, const Amg::Transform3D &sectorTrans, const PrdVec_t< const PrdType * > &prdsToFill, std::vector< SpacePoint > &outColl) const
Transform the uncombined space prd measurements to space points.
EtaPhi2DHitsVec< typename ContType::const_value_type > splitHitsPerGasGap(xAOD::ChamberViewer< ContType > &viewer) const
Splits the chamber hits of the viewer per gas gap.
const_ref at(const std::size_t idx) const
Returns the i-the measurement from the current chamber.
std::size_t size() const noexcept
Returns how many hits are in the current chamber.
Eigen::Matrix< double, 2, 1 > Vector2D
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
MdtTwinDriftCircle_v1 MdtTwinDriftCircle
: Helper struct to collect the space point per muon chamber, which are later sorted into the space po...

◆ loadContainerAndSort() [2/2]

template<>
StatusCode MuonR4::SpacePointMakerAlg::loadContainerAndSort ( const EventContext & ctx,
const SG::ReadHandleKey< xAOD::sTgcMeasContainer > & key,
PreSortedSpacePointMap & fillContainer ) const

Helper function combine an eta and a phi collection. The function takes two indices referrring to the indices of the hit vector inside HitColls

Parameters
collIdxAIndex of the collection to put as phi
collIdxBIndex of the collection to put as eta
combFuncLambda function that rejects hits which cannot be combined due to geometry reasons.

Skip if one of collections are empty

Get first hit from the first collection

The hit in the collection has already been used

Definition at line 497 of file SpacePointMakerAlg.cxx.

499 {
500
501 const xAOD::sTgcMeasContainer* measurementCont{nullptr};
502 ATH_CHECK(SG::get(measurementCont, key, ctx));
503 if (!measurementCont || measurementCont->empty()){
504 ATH_MSG_DEBUG("nothing to do");
505 return StatusCode::SUCCESS;
506 }
507 const ActsTrk::GeometryContext* gctx{nullptr};
508 ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
509 xAOD::ChamberViewer viewer{*measurementCont};
510 using namespace Acts::detail::LineHelper;
511 do {
512 SpacePointsPerChamber& pointsInChamb = fillContainer[viewer.at(0)->readoutElement()->msSector()];
513 const Amg::Transform3D sectorTrans = viewer.at(0)->readoutElement()->msSector()->globalToLocalTransform(*gctx);
514 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Fill space points for multiplet "<<m_idHelperSvc->toStringDetEl(viewer.at(0)->identify()));
515 for(auto& HitColls: splitHitsPerGasGap(viewer)){
516 auto& [etaHits, phiHits, two2DHits] = HitColls;
517 std::array<std::vector<std::shared_ptr<unsigned>>, 3> instanceCounts{matchCountVec(etaHits.size()),
518 matchCountVec(phiHits.size()),
519 matchCountVec(two2DHits.size())};
520
521 //loop through the Prds and try to combine according` to the hierarchy
522 // Strip+Wire
523 // Strip+Pad
524 // Wire+Pad
525 // Pad
533 auto combineMe = [&](const std::size_t collIdxA,
534 const std::size_t collIdxB,
535 const std::function<bool(const xAOD::sTgcMeasurement*,
536 const xAOD::sTgcMeasurement*)>& combFunc) {
537 std::vector<char> combinedFlagsA{}, combinedFlagsB{};
538 std::ranges::transform(instanceCounts[collIdxA], std::back_inserter(combinedFlagsA),
539 [](const std::shared_ptr<unsigned>& countPtr){
540 return (*countPtr) == 0;
541 });
542 std::ranges::transform(instanceCounts[collIdxB], std::back_inserter(combinedFlagsB),
543 [](const std::shared_ptr<unsigned>& countPtr){
544 return (*countPtr) == 0;
545 });
546
547 const auto& collA = HitColls[collIdxA];
548 const auto& collB = HitColls[collIdxB];
549
551 if(collA.empty() || collB.empty()) {
552 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Skipping combination: both collections empty");
553 return;
554 }
555
557 const xAOD::sTgcMeasurement* firstHit = collB.front();
558 const Amg::Transform3D toSectorTrans = toChamberTransform(*gctx, sectorTrans, *firstHit);
559
560 for(std::size_t idxA = 0; idxA < collA.size(); ++idxA) {
562 if(!combinedFlagsA[idxA]) {
563 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Hit "<<m_idHelperSvc->toString(collA[idxA]->identify())
564 <<" has been used in previous iteration");
565 continue;
566 }
567 for(std::size_t idxB = 0; idxB < collB.size(); ++idxB) {
568 if(!combinedFlagsB[idxB] || !combFunc(collA[idxA], collB[idxB])){
569 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Hit "<<m_idHelperSvc->toString(collB[idxB]->identify())
570 <<" has been used in previous iteration. Or is incompatible with "
571 <<m_idHelperSvc->toString(collA[idxA]->identify()));
572 continue;
573 }
574 //create space point
575 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Combine sTgc measurements "
576 <<m_idHelperSvc->toString(collA[idxA]->identify())<<" and "
577 <<m_idHelperSvc->toString(collB[idxB]->identify())<< "with local positions"
578 << Amg::toString(collA[idxA]->localMeasurementPos()) << " and "
579 << Amg::toString(collB[idxB]->localMeasurementPos())
580 <<" to new space point");
581
582 SpacePoint& newSp = pointsInChamb.etaHits.emplace_back(collB[idxB], collA[idxA]);
583 auto crossPoint = lineIntersect<3>(collA[idxA]->localMeasurementPos(),
584 Amg::Vector3D::UnitX(),
585 collB[idxB]->localMeasurementPos(),
586 Amg::Vector3D::UnitY());
587
588 newSp.setPosition(toSectorTrans*crossPoint.position());
589 newSp.setDirection(Amg::Vector3D::UnitX(), Amg::Vector3D::UnitY());
590 auto cov = Acts::filledArray<double, 3>(0.);
591 cov[Acts::toUnderlying(CovIdx::phiCov)] = covElement(*collA[idxA], CovIdx::phiCov);
592 cov[Acts::toUnderlying(CovIdx::etaCov)] = covElement(*collB[idxB], CovIdx::etaCov);
593 newSp.setCovariance(std::move(cov));
594 newSp.setInstanceCounts(instanceCounts[collIdxB][idxB], instanceCounts[collIdxA][idxA]);
595 ATH_MSG_VERBOSE("Created new space point "<<newSp);
596 }
597 }
598 };
599
600 //try to combine strip with wire measurements first
601 combineMe(1, 0, [&](const xAOD::sTgcMeasurement* wire,
603 // do not combine the strips with the wire that are in the etaZero region
604 const MuonGMR4::sTgcReadoutElement* readoutElement = strip->readoutElement();
605 if(readoutElement->isEtaZero(strip->measurementHash(),
606 strip->localMeasurementPos().block<2,1>(0,0))){
607 return false;
608 }
609 //ignore combinations where the wire and the strip are not crossing
610 //check if the projection of the crossing point is within the bounds of the layer
611 Amg::Vector3D crossPoint = strip->localMeasurementPos() + wire->localMeasurementPos();
612 const Acts::Surface& surf = readoutElement->surface(strip->layerHash());
613 return surf.insideBounds(crossPoint.block<2,1>(0,0));
614 });
615
616 //combine strip and pad measurements
617 combineMe(2, 0, [&](const xAOD::sTgcMeasurement* pad,
619 // do not combine the strips with the pads that are not overlayed
620 const MuonGMR4::sTgcReadoutElement* readoutElement = pad ->readoutElement();
621 const MuonGMR4::PadDesign& padDesign = readoutElement->padDesign(pad->measurementHash());
622 double padHeight = padDesign.padHeight();
623 const Amg::Vector3D padCenter = pad->localMeasurementPos();
624
625 return std::abs(strip->localMeasurementPos().x() - padCenter.x()) < 0.5*padHeight;
626 });
627
628 //finally combine wire and pad measurements
629 combineMe(1, 2, [&](const xAOD::sTgcMeasurement* wire,
630 const xAOD::sTgcMeasurement* pad){
631 // do not combine the wires with the pads that are not overlayed
632 const MuonGMR4::sTgcReadoutElement* readoutElement = pad ->readoutElement();
633 const std::array<Amg::Vector2D, 4> localPadCorners = readoutElement->localPadCorners(pad->measurementHash());
634 auto [min,max] = std::ranges::minmax_element(localPadCorners.begin(), localPadCorners.end(),
635 [](const Amg::Vector2D& a, const Amg::Vector2D& b){
636 return a.y() < b.y();
637 });
638 return (wire->localMeasurementPos().y() > min->y() || wire->localMeasurementPos().y() < max->y());
639
640 });
641
642 //fill uncombined strip, wire and pad measurements that have not been used in combination
643 for(std::size_t collIdx = 0; collIdx < HitColls.size(); ++collIdx){
644 const auto& hits = HitColls[collIdx];
645 std::vector<const xAOD::sTgcMeasurement*> unusedHits{};
646 unusedHits.reserve(hits.size());
647
648 for(std::size_t idx = 0; idx < hits.size(); ++idx){
649 if((*instanceCounts[collIdx][idx]) == 0){
650 unusedHits.push_back(hits[idx]);
651 }
652 }
653 fillUncombinedSpacePoints(*gctx, sectorTrans, unusedHits, pointsInChamb.etaHits);
654 }
655 }
656 } while (viewer.next());
657 return StatusCode::SUCCESS;
658}
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
bool empty() const noexcept
Returns true if the collection is empty.
const Acts::Surface & surface() const
Returns the surface associated with the readout element.
double padHeight() const
Returns the height of all the pads that are not adjacent to the bottom edge of the trapezoid active a...
const PadDesign & padDesign(const IdentifierHash &measHash) const
Retrieves the readoutElement Layer given the Identifier/Hash.
localCornerArray localPadCorners(const IdentifierHash &measHash) const
bool isEtaZero(const IdentifierHash &measurementHash, const Amg::Vector2D &localPosition) const
bool next()
Loads the hits from the next chamber.
const MuonGMR4::sTgcReadoutElement * readoutElement() const override final
Retrieve the associated sTgcReadoutElement.
IdentifierHash measurementHash() const override final
Returns the hash of the measurement channel w.r.t ReadoutElement.
Amg::Vector3D localMeasurementPos() const override final
Returns the local measurement position as 3-vector.
sTgcMeasContainer_v1 sTgcMeasContainer
setBGCode setTAP setLVL2ErrorBits bool
sTgcMeasurement_v1 sTgcMeasurement

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ newBucket()

void MuonR4::SpacePointMakerAlg::newBucket ( const SpacePoint & refSp,
SpacePointBucketVec & sortedPoints,
const BucketParameters & bucketParams ) const
private

Closes the current processed bucket and creates a new one.

Space points of the previous bucket within the overlap region to the first space point of the new bucket are copied over

Parameters
refSpFirst new space point which will be added to the new bucket.
sortedPointsList of all processed buckets in the chamber. The list is augmented by 1 element
bucketParamsParameters defining the bucket properties

Set the boundaries from the previous bucket

Copy space points that could be within the overlap region to the next bucket

Definition at line 772 of file SpacePointMakerAlg.cxx.

774 {
775 SpacePointBucket& newContainer = sortedPoints.emplace_back();
776 newContainer.setBucketId(sortedPoints.size() -1);
777
779 SpacePointBucket& overlap{sortedPoints[sortedPoints.size() - 2]};
780 overlap.setCoveredRange(overlap.front()->localPosition().y(),
781 overlap.back()->localPosition().y());
782
783 const double refBound = refSpacePoint.localPosition().y();
784
785
787 for (const std::shared_ptr<SpacePoint>& pointInBucket : overlap | std::views::reverse) {
788 const double overlapPos = pointInBucket->localPosition().y() +
789 std::sqrt(pointInBucket->covariance()[Acts::toUnderlying(CovIdx::etaCov)]);
790 if (refBound - overlapPos < bucketParams.spacePointOverlap) {
791 newContainer.insert(newContainer.begin(), pointInBucket);
792 } else {
793 break;
794 }
795 }
796
797}

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ passOccupancy2D() [1/4]

template<>
bool MuonR4::SpacePointMakerAlg::passOccupancy2D ( const PrdVec_t< const xAOD::MMCluster * > & ,
const PrdVec_t< const xAOD::MMCluster * > &  ) const

Definition at line 269 of file SpacePointMakerAlg.cxx.

270 {
271 return false;
272 }

◆ passOccupancy2D() [2/4]

template<>
bool MuonR4::SpacePointMakerAlg::passOccupancy2D ( const PrdVec_t< const xAOD::RpcMeasurement * > & etaHits,
const PrdVec_t< const xAOD::RpcMeasurement * > & phiHits ) const

Definition at line 257 of file SpacePointMakerAlg.cxx.

258 {
259 if (etaHits.empty() || phiHits.empty()) {
260 return false;
261 }
262 const MuonGMR4::RpcReadoutElement* re = etaHits[0]->readoutElement();
263 ATH_MSG_VERBOSE("Collected "<<etaHits.size()<<"/"<<phiHits.size()<<" hits in "<<m_idHelperSvc->toStringGasGap(etaHits[0]->identify()));
264 return ((1.*etaHits.size()) / (1.*re->nEtaStrips())) < m_maxOccRpcEta &&
265 ((1.*phiHits.size()) / (1.*re->nPhiStrips())) < m_maxOccRpcPhi;
266 }
const std::regex re(r_e)
Gaudi::Property< double > m_maxOccRpcEta
Gaudi::Property< double > m_maxOccRpcPhi

◆ passOccupancy2D() [3/4]

template<>
bool MuonR4::SpacePointMakerAlg::passOccupancy2D ( const PrdVec_t< const xAOD::TgcStrip * > & etaHits,
const PrdVec_t< const xAOD::TgcStrip * > & phiHits ) const

Definition at line 246 of file SpacePointMakerAlg.cxx.

247 {
248 if (etaHits.empty() || phiHits.empty()) {
249 return false;
250 }
251 const MuonGMR4::TgcReadoutElement* re = etaHits[0]->readoutElement();
252 ATH_MSG_VERBOSE("Collected "<<etaHits.size()<<"/"<<phiHits.size()<<" hits in "<<m_idHelperSvc->toStringGasGap(etaHits[0]->identify()));
253 return ((1.*etaHits.size()) / ((1.*re->numChannels(etaHits[0]->measurementHash())))) < m_maxOccTgcEta &&
254 ((1.*phiHits.size()) / ((1.*re->numChannels(phiHits[0]->measurementHash())))) < m_maxOccTgcPhi;
255 }
Gaudi::Property< double > m_maxOccTgcEta
Gaudi::Property< double > m_maxOccTgcPhi

◆ passOccupancy2D() [4/4]

template<typename PrdType>
bool MuonR4::SpacePointMakerAlg::passOccupancy2D ( const PrdVec_t< PrdType > & etaHits,
const PrdVec_t< PrdType > & phiHits ) const
private

: Check whether the occupancy cuts of hits in a gasGap are surpassed.

The method is specified for each of the 3 strip technologies, Rpc, Tgc, sTgc and applies a technology-dependent upper bound on the number of phi & eta hits. If the threshold is surpassed, only 1D space points are built intsead of 2D ones

Parameters
etaHitsList of all presorted eta measurements in a gas gap
phiHitsList of all presorted phi measurements in a gas gap

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ resolveBucketParameters()

std::optional< SpacePointMakerAlg::BucketParameters > MuonR4::SpacePointMakerAlg::resolveBucketParameters ( const MuonGMR4::Chamber & chamber) const
private

Resolves the bucket parameters for a given chamber, based on the chamber key and the configured patterns.

Parameters
chamberChamber for which to resolve the bucket parameters
Returns
A BucketParameters struct containing the resolved parameters for the chamber

Definition at line 905 of file SpacePointMakerAlg.cxx.

906 {
907
908 const std::string chamberKey = chamberConfigKey(chamber);
909
910 const ResolvedParameter maxLength = resolveParameter(
911 chamberKey,
912 m_maxBucketLength.value(),
914
915 const ResolvedParameter hitWindow = resolveParameter(
916 chamberKey,
917 m_spacePointWindow.value(),
919
920 const ResolvedParameter overlap = resolveParameter(
921 chamberKey,
922 m_spacePointOverlap.value(),
924
925 // No chamber-dependent setting matched.
926 if (!maxLength.matched &&
927 !hitWindow.matched &&
928 !overlap.matched) {
929 return std::nullopt;
930 }
931
933 .spacePointWindow = hitWindow.value,
934 .maxBucketLength = maxLength.value,
935 .spacePointOverlap = overlap.value
936 };
937
938
940 "Resolved bucket override for " << chamberKey
941 << ": maxBucketLength=" << parameters.maxBucketLength
942 << (maxLength.matched ? " [override]" : " [default]")
943 << ", spacePointWindow=" << parameters.spacePointWindow
944 << (hitWindow.matched ? " [override]" : " [default]")
945 << ", spacePointOverlap=" << parameters.spacePointOverlap
946 << (overlap.matched ? " [override]" : " [default]"));
947
948 return parameters;
949}
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.
Gaudi::Property< BucketPatternMap > m_spacePointOverlapPatterns
Chamber-pattern dependent space point overlap.
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.
Helper struct to store the resolved bucket parameters for a given chamber.

◆ resolveParameter()

SpacePointMakerAlg::ResolvedParameter MuonR4::SpacePointMakerAlg::resolveParameter ( const std::string_view chamberKey,
const double defaultValue,
const BucketPatternMap & patterns ) const
private

Resolves a specific parameter for a given chamber key, based on the configured patterns.

Parameters
chamberKeyKey (e.g. EML_eta-1_phi3) of the chamber
defaultValueDefault value to use if no match is found
patternsMap of patterns to values
Returns
The resolved parameter value

Definition at line 855 of file SpacePointMakerAlg.cxx.

858 {
859
860 // Exact match (e.g. BIL_eta-3_phi3) has the highest priority.
861 if (const auto exactItr = patterns.find(chamberKey);
862 exactItr != patterns.end()) {
863 return {
864 .value = exactItr->second,
865 .matched = true
866 };
867 }
868
869 double resolvedValue = defaultValue;
870 std::size_t bestSpecificity = 0;
871 bool matched = false;
872
873 // Otherwise select the most-specific matching wildcard (e.g. BIL_eta-3* or BIL* or BIL_eta*_phi3).
874 // If there are multiple patterns matching, the one with the most non-wildcard characters is selected.
875 for (const auto& [pattern, value] : patterns) {
876 if (pattern.find('*') == std::string::npos) {
877 continue;
878 }
879
880 if (!wildcardMatch(pattern, chamberKey)) {
881 continue;
882 }
883
884 // More non-wildcard characters means a more specific pattern.
885 const std::size_t specificity =
886 std::ranges::count_if(pattern, [](const char c) {
887 return c != '*';
888 });
889
890 if (!matched || specificity > bestSpecificity) {
891 bestSpecificity = specificity;
892 resolvedValue = value;
893 matched = true;
894 }
895 }
896
897 return {
898 .value = resolvedValue,
899 .matched = matched
900 };
901}
std::vector< std::string > patterns
Definition listroot.cxx:187

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ splitBucket()

bool MuonR4::SpacePointMakerAlg::splitBucket ( const SpacePoint & spacePoint,
const double firstSpPos,
const SpacePointBucketVec & sortedPoints,
const BucketParameters & bucketParams ) const
private

Returns whether the space point is beyond the bucket boundary.

Parameters
spacePointSpace point candidate to add to the bucket
sortedPointsContainer of all defined buckets in the chamber
bucketParamsParameters defining the bucket properties
Returns
True if the space point should start a new bucket, false otherwise

Distance between this point and the first one exceeds the maximum length

Definition at line 742 of file SpacePointMakerAlg.cxx.

744 {
745
747 const double spY = spacePoint.localPosition().y();
748
749 if (spY - firstSpPos > bucketParams.maxBucketLength){
750 ATH_MSG_DEBUG("Splitting bucket based on maxLength. First space point Y=" << firstSpPos
751 << " current space point Y =" << spY
752 << " m_maxBucketLength=" << bucketParams.maxBucketLength );
753 return true;
754 }
755
756 if (sortedPoints.empty() || sortedPoints.back().empty()) {
757 return false;
758 }
759
760 const double gap = spY - sortedPoints.back().back()->localPosition().y();
761
762
763 if (gap > bucketParams.spacePointWindow){
764 ATH_MSG_DEBUG("Splitting bucket based on gap. Last space point Y=" << sortedPoints.back().back()->localPosition().y()
765 << " current space point Y =" << spY
766 << " gap=" << gap
767 << " window=" << bucketParams.spacePointWindow);
768 }
769
770 return gap > bucketParams.spacePointWindow;
771}
gap(flags, cells_name, *args, **kw)

◆ splitHitsPerGasGap()

template<typename ContType>
SpacePointMakerAlg::EtaPhi2DHitsVec< typename ContType::const_value_type > MuonR4::SpacePointMakerAlg::splitHitsPerGasGap ( xAOD::ChamberViewer< ContType > & viewer) const
private

Splits the chamber hits of the viewer per gas gap.

Parameters
viewerChamber viewer containing all hits in the chamber
Returns
Vector of gas gap hit collections. Each entry contains 3 vectors:
  • eta hits
  • phi hits
  • 2D hits

Wires measure the phi coordinate

Tgc & Rpcs have the measuresPhi property

Sort in the hit

Definition at line 341 of file SpacePointMakerAlg.cxx.

341 {
342 std::vector<EtaPhi2DHits<typename ContType::const_value_type>> hitsPerGasGap{};
343 for (const auto& prd : viewer) {
344 ATH_MSG_VERBOSE("Create space point from "<<m_idHelperSvc->toString(prd->identify())
345 <<", hash: "<<prd->identifierHash());
346
347 unsigned gapIdx = prd->gasGap() -1;
348 if constexpr (std::is_same_v<ContType, xAOD::RpcMeasurementContainer>) {
349 gapIdx = prd->readoutElement()->createHash(0, prd->gasGap(), prd->doubletPhi(), false);
350 }
351 if (hitsPerGasGap.size() <= gapIdx) {
352 hitsPerGasGap.resize(gapIdx + 1);
353 }
354 bool measPhi{false};
355 if constexpr(std::is_same_v<ContType, xAOD::sTgcMeasContainer>) {
357 measPhi = prd->channelType() == sTgcIdHelper::sTgcChannelTypes::Wire;
358 } else if constexpr(!std::is_same_v<ContType, xAOD::MMClusterContainer>) {
360 measPhi = prd->measuresPhi();
361 }
362
363 if (prd->numDimensions() == 2) {
364 hitsPerGasGap[gapIdx][2].push_back(prd);
365 continue;
366 }
368 auto& toPush = hitsPerGasGap[gapIdx][measPhi];
369 if (toPush.capacity() == toPush.size()) {
370 toPush.reserve(toPush.size() + m_capacityBucket);
371 }
372 toPush.push_back(prd);
373 }
374 return hitsPerGasGap;
375}
Gaudi::Property< unsigned > m_capacityBucket

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_WARNING(x)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::unique_ptr<SpacePointStatistics> m_statCounter MuonR4::SpacePointMakerAlg::ATLAS_THREAD_SAFE {}
private

Definition at line 289 of file SpacePointMakerAlg.h.

289{};

◆ m_bucketParameters

std::unordered_map<const MuonGMR4::Chamber*, BucketParameters> MuonR4::SpacePointMakerAlg::m_bucketParameters {}
private

Map of bucket parameters for each chamber.

Definition at line 281 of file SpacePointMakerAlg.h.

281{};

◆ m_capacityBucket

Gaudi::Property<unsigned> MuonR4::SpacePointMakerAlg::m_capacityBucket {this,"CapacityBucket" , 50}
private

Definition at line 288 of file SpacePointMakerAlg.h.

288{this,"CapacityBucket" , 50};

◆ m_defaultBucketParameters

BucketParameters MuonR4::SpacePointMakerAlg::m_defaultBucketParameters {}
private

Default bucket parameters used if no chamber-specific parameters are found, defaults into m_spacePointWindow, m_maxBucketLength, and m_spacePointOverlap.

Definition at line 283 of file SpacePointMakerAlg.h.

283{};

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* MuonR4::SpacePointMakerAlg::m_detMgr {nullptr}
private

Definition at line 247 of file SpacePointMakerAlg.h.

247{nullptr};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doStat

Gaudi::Property<bool> MuonR4::SpacePointMakerAlg::m_doStat
private
Initial value:
{this, "doStats", false,
"If enabled the algorithm keeps track how many hits have been made" }

Definition at line 285 of file SpacePointMakerAlg.h.

285 {this, "doStats", false,
286 "If enabled the algorithm keeps track how many hits have been made" };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_geoCtxKey

ActsTrk::GeoContextReadKey_t MuonR4::SpacePointMakerAlg::m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
private

Definition at line 245 of file SpacePointMakerAlg.h.

245{this, "AlignmentKey", "ActsAlignment", "cond handle key"};

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonR4::SpacePointMakerAlg::m_idHelperSvc {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 249 of file SpacePointMakerAlg.h.

249{this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_maxBucketLength

Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_maxBucketLength
private
Initial value:
{this, "maxBucketLength", 2.*Gaudi::Units::m,
"Maximal size of a space point bucket"}

Default maximum bucket length (the width of the bucket in local y coordinate).

Can be overridden by chamber-specific patterns

Parameters
maxBucketLengthDefault maximum bucket length in meters

Definition at line 259 of file SpacePointMakerAlg.h.

259 {this, "maxBucketLength", 2.*Gaudi::Units::m,
260 "Maximal size of a space point bucket"};

◆ m_maxBucketLengthPatterns

Gaudi::Property<BucketPatternMap> MuonR4::SpacePointMakerAlg::m_maxBucketLengthPatterns
private
Initial value:
{ this, "maxBucketLengthPatterns", {},
"Chamber-pattern dependent max bucket length. " "Examples: BML*=0.5, BIL_eta3_phi3=0.2"}

Chamber-pattern dependent maximum bucket length.

Example: cfg.getEventAlgo("MuonSpacePointMakerAlg").maxBucketLengthPatterns = {"BIL_eta3_phi3": 0.2 * m, "BML*": 0.5 * m}

Definition at line 273 of file SpacePointMakerAlg.h.

273 { this, "maxBucketLengthPatterns", {},
274 "Chamber-pattern dependent max bucket length. " "Examples: BML*=0.5, BIL_eta3_phi3=0.2"};

◆ m_maxOccRpcEta

Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_maxOccRpcEta
private
Initial value:
{this, "maxRpcEtaOccupancy", 0.1,
"Maximum occpancy of Rpc eta hits in a gasGap"}

Definition at line 291 of file SpacePointMakerAlg.h.

291 {this, "maxRpcEtaOccupancy", 0.1,
292 "Maximum occpancy of Rpc eta hits in a gasGap"};

◆ m_maxOccRpcPhi

Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_maxOccRpcPhi
private
Initial value:
{this, "maxRpcPhiOccupancy", 0.1,
"Maximum occpancy of Rpc phi hits in a gasGap"}

Definition at line 293 of file SpacePointMakerAlg.h.

293 {this, "maxRpcPhiOccupancy", 0.1,
294 "Maximum occpancy of Rpc phi hits in a gasGap"};

◆ m_maxOccTgcEta

Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_maxOccTgcEta
private
Initial value:
{this, "maxTgcEtaOccupancy", 0.1,
"Maximum occpancy of Tgc eta hits in a gasGap"}

Definition at line 296 of file SpacePointMakerAlg.h.

296 {this, "maxTgcEtaOccupancy", 0.1,
297 "Maximum occpancy of Tgc eta hits in a gasGap"};

◆ m_maxOccTgcPhi

Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_maxOccTgcPhi
private
Initial value:
{this, "maxTgcPhiOccupancy", 0.1,
"Maximum occpancy of Tgc phi hits in a gasGap"}

Definition at line 298 of file SpacePointMakerAlg.h.

298 {this, "maxTgcPhiOccupancy", 0.1,
299 "Maximum occpancy of Tgc phi hits in a gasGap"};

◆ m_mdtKey

SG::ReadHandleKey<xAOD::MdtDriftCircleContainer> MuonR4::SpacePointMakerAlg::m_mdtKey
private
Initial value:
{this, "MdtKey", "xMdtMeasurements",
"Key to the uncalibrated Drift circle measurements"}

Definition at line 230 of file SpacePointMakerAlg.h.

230 {this, "MdtKey", "xMdtMeasurements",
231 "Key to the uncalibrated Drift circle measurements"};

◆ m_mmKey

SG::ReadHandleKey<xAOD::MMClusterContainer> MuonR4::SpacePointMakerAlg::m_mmKey
private
Initial value:
{this, "MmKey", "xAODMMClusters",
"Key to the uncalibrated 1D Mm hits"}

Definition at line 239 of file SpacePointMakerAlg.h.

239 {this, "MmKey", "xAODMMClusters",
240 "Key to the uncalibrated 1D Mm hits"};

◆ m_rpcKey

SG::ReadHandleKey<xAOD::RpcMeasurementContainer> MuonR4::SpacePointMakerAlg::m_rpcKey
private
Initial value:
{this, "RpcKey", "xRpcMeasurements",
"Key to the uncalibrated 1D rpc hits"}

Definition at line 233 of file SpacePointMakerAlg.h.

233 {this, "RpcKey", "xRpcMeasurements",
234 "Key to the uncalibrated 1D rpc hits"};

◆ m_spacePointOverlap

Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_spacePointOverlap
private
Initial value:
{this, "spacePointOverlap", 25.*Gaudi::Units::cm,
"Hits that are within <spacePointOverlap> of the bucket margin. "
"Are copied to the next bucket"}

Default space point overlap (the margin around the edge of the bucket which is also coppied into another bucket).

Can be overridden by chamber-specific patterns

Parameters
spacePointOverlapDefault space point overlap in meters

Definition at line 264 of file SpacePointMakerAlg.h.

264 {this, "spacePointOverlap", 25.*Gaudi::Units::cm,
265 "Hits that are within <spacePointOverlap> of the bucket margin. "
266 "Are copied to the next bucket"};

◆ m_spacePointOverlapPatterns

Gaudi::Property<BucketPatternMap> MuonR4::SpacePointMakerAlg::m_spacePointOverlapPatterns
private
Initial value:
{ this, "spacePointOverlapPatterns", {},
"Chamber-dependent overrides of spacePointOverlap" }

Chamber-pattern dependent space point overlap.

Example: cfg.getEventAlgo("MuonSpacePointMakerAlg").spacePointOverlapPatterns = {"BIL_eta3_phi3": 0.2 * m, "BML*": 0.5 * m}

Definition at line 277 of file SpacePointMakerAlg.h.

277 { this, "spacePointOverlapPatterns", {},
278 "Chamber-dependent overrides of spacePointOverlap" };

◆ m_spacePointWindow

Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_spacePointWindow
private
Initial value:
{this, "spacePointWindowSize", 0.8*Gaudi::Units::m,
"Maximal distance between consecutive hits in a bucket"}

Default space point window size (Max distance between the two eta hits).

Can be overridden by chamber-specific patterns

Parameters
spacePointWindowSizeDefault space point window size in meters

Definition at line 255 of file SpacePointMakerAlg.h.

255 {this, "spacePointWindowSize", 0.8*Gaudi::Units::m,
256 "Maximal distance between consecutive hits in a bucket"};

◆ m_spacePointWindowPatterns

Gaudi::Property<BucketPatternMap> MuonR4::SpacePointMakerAlg::m_spacePointWindowPatterns
private
Initial value:
{ this, "spacePointWindowPatterns", {},
"Chamber-pattern dependent space point window. " "Examples: BML*=0.5, BIL_eta3_phi3=0.2"}

Chamber-pattern dependent space point window.

Example: cfg.getEventAlgo("MuonSpacePointMakerAlg").spacePointWindowPatterns = {"BIL_eta3_phi3": 0.2 * m, "BML*": 0.5 * m, "BOL_eta3*": 0.7 * m}

Definition at line 269 of file SpacePointMakerAlg.h.

269 { this, "spacePointWindowPatterns", {},
270 "Chamber-pattern dependent space point window. " "Examples: BML*=0.5, BIL_eta3_phi3=0.2"};

◆ m_stgcKey

SG::ReadHandleKey<xAOD::sTgcMeasContainer> MuonR4::SpacePointMakerAlg::m_stgcKey {this, "sTgcKey", "xAODsTgcMeasurements"}
private

Definition at line 242 of file SpacePointMakerAlg.h.

242{this, "sTgcKey", "xAODsTgcMeasurements"};

◆ m_tgcKey

SG::ReadHandleKey<xAOD::TgcStripContainer> MuonR4::SpacePointMakerAlg::m_tgcKey
private
Initial value:
{this, "TgcKey", "xTgcStrips",
"Key to the uncalibrated 1D tgc hits"}

Definition at line 236 of file SpacePointMakerAlg.h.

236 {this, "TgcKey", "xTgcStrips",
237 "Key to the uncalibrated 1D tgc hits"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeKey

SG::WriteHandleKey<SpacePointContainer> MuonR4::SpacePointMakerAlg::m_writeKey {this, "WriteKey", "MuonSpacePoints"}
private

Definition at line 251 of file SpacePointMakerAlg.h.

251{this, "WriteKey", "MuonSpacePoints"};

The documentation for this class was generated from the following files: