 |
ATLAS Offline Software
|
#include <SpacePointMakerAlg.h>
|
struct | SpacePointsPerChamber |
| : Helper struct to collect the space point per muon chamber, which are later sorted into the space point buckets. 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...
|
|
|
| ~SpacePointMakerAlg ()=default |
|
StatusCode | execute (const EventContext &ctx) const override |
|
StatusCode | initialize () override |
|
StatusCode | finalize () override |
|
template<> |
bool | passOccupancy2D (const std::vector< const xAOD::TgcStrip * > &etaHits, const std::vector< const xAOD::TgcStrip * > &phiHits) const |
|
template<> |
bool | passOccupancy2D (const std::vector< const xAOD::RpcMeasurement * > &etaHits, const std::vector< const xAOD::RpcMeasurement * > &phiHits) const |
|
template<> |
bool | passOccupancy2D (const std::vector< const xAOD::sTgcMeasurement * > &etaHits, const std::vector< const xAOD::sTgcMeasurement * > &phiHits) const |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
template<class MeasType > |
Amg::Transform3D | toChamberTransform (const ActsGeometryContext &gctx, const Amg::Transform3D §orTrans, const MeasType *meas) const |
| Returns the transform from the attached Muon chamber frame to the sector frame. More...
|
|
template<class MeasType > |
Amg::Vector3D | positionInChamber (const MeasType *meas, const Amg::Transform3D &toChamberTrans) const |
| Returns the position of the uncalibrated muon measurement in the sector frame. More...
|
|
template<class MeasType > |
Amg::Vector3D | channelDirInChamber (const MeasType *meas, const Amg::Transform3D &toChamberTrans) const |
| Returns the direction of the measurement channel in the sector frame. More...
|
|
template<class MeasType > |
Amg::Vector3D | channelNormalInChamber (const MeasType *meas, const Amg::Transform3D &toChamberTrans) const |
| Returns the direction, in the sector frame, of the precision axis of the measurement, i.e. More...
|
|
template<class MeasType > |
| AmgSymMatrix (2) computeCov(const MeasType *primaryMeas |
| Helper function to calculate the covariance for spacepoints having only one measurement. More...
|
|
template<class MeasType > |
void | fillSpacePoint (std::vector< SpacePoint > &pointColl, const MeasType *primaryMeas, const MeasType *secondaryMeas, const Amg::Transform3D &toChamberTrans_eta, const Amg::Transform3D &toChamberTrans_phi) const |
| Helper function that creates the spacepoint and populates it, when having two measurement. More...
|
|
template<class 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. More...
|
|
void | distributePointsAndStore (SpacePointsPerChamber &&hitsPerChamber, SpacePointContainer &finalContainer) const |
| Distribute the premade spacepoints per chamber into their individual SpacePoint buckets. More...
|
|
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. More...
|
|
void | distributePhiPoints (std::vector< SpacePoint > &&spacePoints, SpacePointBucketVec &splittedContainer) const |
| Distributs the vector phi space points into the buckets. More...
|
|
bool | splitBucket (const SpacePoint &spacePoint, const double firstSpPos, const SpacePointBucketVec &sortedPoints) const |
| Returns whether the space point is beyond the bucket boundary. More...
|
|
void | newBucket (const SpacePoint &refSp, SpacePointBucketVec &sortedPoints) const |
| Closes the current processed bucket and creates a new one. More...
|
|
template<class PrdType > |
bool | passOccupancy2D (const std::vector< const PrdType * > &etaHits, const std::vector< const PrdType * > &phiHits) const |
| : Check whether the occupancy cuts of hits in a gasGap are surpassed. More...
|
|
template<class MeasType > |
AmgSymMatrix(2) computeCov(const xAOD | AmgSymMatrix (std::vector< SpacePoint > &pointColl, const MeasType *primaryMeas, const Amg::Transform3D &toChamberTrans) constvoid |
| Helper function to calculate the covariance for spacepoints having two measurements. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
const Amg::Vector3D & | dir |
|
const Amg::Vector3D const Amg::Vector3D &nor | const |
|
SG::ReadHandleKey< xAOD::MdtDriftCircleContainer > | m_mdtKey |
|
SG::ReadHandleKey< xAOD::RpcMeasurementContainer > | m_rpcKey |
|
SG::ReadHandleKey< xAOD::TgcStripContainer > | m_tgcKey |
|
SG::ReadHandleKey< xAOD::MMClusterContainer > | m_mmKey |
|
SG::ReadHandleKey< xAOD::sTgcMeasContainer > | m_stgcKey {this, "sTgcKey", "xAODsTgcMeasurements"} |
|
SG::ReadHandleKey< ActsGeometryContext > | m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"} |
|
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
|
SG::WriteHandleKey< SpacePointContainer > | m_writeKey {this, "WriteKey", "MuonSpacePoints"} |
|
Gaudi::Property< double > | m_spacePointWindow |
|
Gaudi::Property< double > | m_maxBucketLength |
|
Gaudi::Property< double > | m_spacePointOverlap |
|
Gaudi::Property< bool > | m_doStat |
|
Gaudi::Property< unsigned int > | 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 |
|
Gaudi::Property< double > | m_maxOccStgcEta |
|
Gaudi::Property< double > | m_maxOccStgcPhi |
|
DataObjIDColl | m_extendedExtraObjects |
| Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
|
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 27 of file SpacePointMakerAlg.h.
◆ PreSortedSpacePointMap
Container abrivation of the presorted space point container per MuonChambers.
Definition at line 153 of file SpacePointMakerAlg.h.
◆ SpacePointBucketVec
◆ StoreGateSvc_t
◆ ~SpacePointMakerAlg()
MuonR4::SpacePointMakerAlg::~SpacePointMakerAlg |
( |
| ) |
|
|
default |
◆ AmgSymMatrix() [1/2]
template<class MeasType >
MuonR4::SpacePointMakerAlg::AmgSymMatrix |
( |
2 |
| ) |
const |
|
private |
Helper function to calculate the covariance for spacepoints having only one measurement.
- Parameters
-
primaryMeas | Uncalibrated muon measurement |
dir | direction of the measurement channel in the sector frame |
nor | direction of the precision axis of the measurement in the sector frame |
◆ AmgSymMatrix() [2/2]
template<class MeasType >
Helper function to calculate the covariance for spacepoints having two measurements.
- Parameters
-
primaryMeas | Primary uncalibrated muon measurement |
secondaryMeas | Secondary uncalibrated muon measurement |
nor1 | direction of the precision axis of the primary measurement in the sector frame |
nor2 | direction of the precision axis of the secondary measurement in the sector frame |
Helper function that creates the spacepoint and populates it, when having one measurement
- Parameters
-
pointColl | Collection of spacepoints where the new one is being push |
primaryMeas | Uncalibrated muon measurement |
toChamberTrans | transform from the attached Muon chamber frame to the sector frame |
◆ cardinality()
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.
◆ channelDirInChamber()
template<class MeasType >
Returns the direction of the measurement channel in the sector frame.
- Parameters
-
meas | Uncalibrated muon measurement |
toChamberTrans | transform from the attached Muon chamber frame to the sector frame |
Definition at line 75 of file SpacePointMakerAlg.cxx.
77 if constexpr (std::is_same_v<MeasType, xAOD::MdtDriftCircle>){
78 return toChamberTrans.linear() * Amg::Vector3D::UnitZ();
80 else if constexpr (std::is_same_v<MeasType, xAOD::RpcMeasurement> or
81 std::is_same_v<MeasType, xAOD::MMCluster> or
82 std::is_same_v<MeasType, xAOD::sTgcMeasurement>){
83 return toChamberTrans.linear() * Amg::Vector3D::UnitY();
85 else if constexpr (std::is_same_v<MeasType, xAOD::TgcStrip>) {
86 const auto& stripLay = meas->readoutElement()->sensorLayout(meas->layerHash());
87 if (meas->measuresPhi()) {
89 return toChamberTrans.linear() * stripLay->to3D(sDesign.stripDir(meas->channelNumber()),
true);
91 return toChamberTrans.linear() * stripLay->to3D(stripLay->design().stripDir(),
false);
◆ channelNormalInChamber()
template<class MeasType >
Returns the direction, in the sector frame, of the precision axis of the measurement, i.e.
the vector pointing to the next strip or tube
- Parameters
-
meas | Uncalibrated muon measurement |
toChamberTrans | transform from the attached Muon chamber frame to the sector frame |
Definition at line 98 of file SpacePointMakerAlg.cxx.
100 if constexpr (std::is_same_v<MeasType, xAOD::MdtDriftCircle>){
101 return toChamberTrans.linear() * Amg::Vector3D::UnitY();
103 else if constexpr (std::is_same_v<MeasType, xAOD::RpcMeasurement> or
104 std::is_same_v<MeasType, xAOD::MMCluster> or
105 std::is_same_v<MeasType, xAOD::sTgcMeasurement>){
106 return toChamberTrans.linear() * Amg::Vector3D::UnitX();
108 else if constexpr (std::is_same_v<MeasType, xAOD::TgcStrip>) {
109 const auto& stripLay = meas->readoutElement()->sensorLayout(meas->layerHash());
110 if (meas->measuresPhi()) {
112 return toChamberTrans.linear() * stripLay->to3D(sDesign.stripNormal(meas->channelNumber()),
true);
114 return toChamberTrans.linear() * stripLay->to3D(stripLay->design().stripNormal(),
false);
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ distributePhiPoints()
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
-
spacePoint | Vecotr of phi space points to sort into the buckets |
splittedContainer | Output 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 535 of file SpacePointMakerAlg.cxx.
538 auto phiPoint = std::make_shared<SpacePoint>(std::move(sp));
539 const double minY = phiPoint->positionInChamber().y() - phiPoint->uncertainty().y();
540 const double maxY = phiPoint->positionInChamber().y() + phiPoint->uncertainty().y();
541 for (SpacePointBucket& bucket : splittedContainer){
544 if (! (maxY < bucket.coveredMin() || bucket.coveredMax() < minY) ) {
545 bucket.emplace_back(phiPoint);
◆ distributePointsAndStore()
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
-
ctx | Event context of the current event |
hitsPerChamber | List of all premade space points which have to be sorted |
finalContainer | Output SpacePoint bucket container. |
Definition at line 500 of file SpacePointMakerAlg.cxx.
503 splittedHits.emplace_back();
505 m_statCounter->addToStat(hitsPerChamber.etaHits);
506 m_statCounter->addToStat(hitsPerChamber.phiHits);
510 splittedHits.erase(std::remove_if(splittedHits.begin(), splittedHits.end(),
511 [](
const SpacePointBucket& bucket) {
512 return bucket.size() <= 1;
513 }), splittedHits.end());
516 for (SpacePointBucket& bucket : splittedHits) {
521 std::stringstream spStr{};
522 for (
const std::shared_ptr<SpacePoint>& sp : bucket){
523 spStr<<
"SpacePoint: PrimaryMeas: " <<
m_idHelperSvc->toString(sp->identify()) <<
" SecondaryMeas: "
525 <<
" Pos: " <<
Amg::toString(sp->positionInChamber())<<std::endl;
527 ATH_MSG_VERBOSE(
"Created a bucket, printing all spacepoints..."<<std::endl<<spStr.str());
530 bucket.populateChamberLocations();
531 finalContainer.push_back(std::make_unique<SpacePointBucket>(std::move(bucket)));
◆ 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
-
spacePoints | Vector of space points to sort into the buckets |
splittedContainer | Output vector containing all defined bucket |
Order the space points by local chamber y which is along the tube-plane.
Definition at line 588 of file SpacePointMakerAlg.cxx.
596 return a.positionInChamber().
y() <
b.positionInChamber().y();
599 double firstPointPos =
spacePoints.front().positionInChamber().y();
605 if (
splitBucket(toSort, firstPointPos, splittedHits)){
607 firstPointPos = splittedHits.back().empty() ? toSort.positionInChamber().y() : splittedHits.back().front()->positionInChamber().y();
608 ATH_MSG_VERBOSE(
"New bucket: id " << splittedHits.back().bucketId() <<
" Coverage: " << firstPointPos);
610 std::shared_ptr<SpacePoint> spacePoint = std::make_shared<SpacePoint>(std::move(toSort));
611 splittedHits.back().emplace_back(spacePoint);
613 SpacePointBucket& lastBucket{splittedHits.back()};
614 lastBucket.setCoveredRange(lastBucket.front()->positionInChamber().y(),
615 lastBucket.back()->positionInChamber().y());
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode MuonR4::SpacePointMakerAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
override |
Definition at line 482 of file SpacePointMakerAlg.cxx.
489 std::unique_ptr<SpacePointContainer> outContainer = std::make_unique<SpacePointContainer>();
491 for (
auto &[
chamber, hitsPerChamber] : preSortedContainer){
496 ATH_CHECK(writeHandle.record(std::move(outContainer)));
497 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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()
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.
◆ fillSpacePoint()
template<class MeasType >
Helper function that creates the spacepoint and populates it, when having two measurement.
- Parameters
-
pointColl | Collection of spacepoints where the new one is being push |
primaryMeas | Primary uncalibrated muon measurement |
secondaryMeas | Secondary uncalibrated muon measurement |
toChamberTrans_eta | transform from the attached Muon chamber frame to the sector frame for the primary meas |
toChamberTrans_phi | transform from the attached Muon chamber frame to the sector frame for the secondary meas |
◆ filterPassed()
◆ finalize()
StatusCode MuonR4::SpacePointMakerAlg::finalize |
( |
| ) |
|
|
override |
Definition at line 292 of file SpacePointMakerAlg.cxx.
294 m_statCounter->dumpStatisics(msgStream());
296 return StatusCode::SUCCESS;
◆ initialize()
StatusCode MuonR4::SpacePointMakerAlg::initialize |
( |
| ) |
|
|
override |
◆ inputHandles()
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()
◆ loadContainerAndSort()
template<class ContType >
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
-
ctx | Event context of the current event |
key | ReadHandleKey to access the container of data type <ContType> |
fillContainer | Global container into which all space points are filled. |
Loop over the chamber hits to split the hits per gasGap
Make directly to a space point
Wires measure the phi coordinate
Tgc & Rpcs have the measuresPhi property
Sort in the hit
Create the space points
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
If there's a phi measuremnt which cannot be combined with the others or no eta measurement is suitable, then manually push_back the phi hits
Definition at line 346 of file SpacePointMakerAlg.cxx.
349 const ContType* measurementCont{
nullptr};
351 if (!measurementCont || measurementCont->empty()){
353 return StatusCode::SUCCESS;
358 using PrdType =
typename ContType::const_value_type;
359 using PrdVec = std::vector<PrdType>;
363 SpacePointsPerChamber& pointsInChamb =
fillContainer[viewer.at(0)->readoutElement()->msSector()];
364 const Amg::Transform3D& sectorTrans = viewer.at(0)->readoutElement()->msSector()->globalToLocalTrans(*gctx);
366 if constexpr( std::is_same_v<ContType, xAOD::MdtDriftCircleContainer> ||
367 std::is_same_v<ContType, xAOD::MMClusterContainer>) {
369 pointsInChamb.etaHits.reserve(pointsInChamb.etaHits.capacity() + viewer.size());
370 for (
const PrdType prd: viewer) {
372 <<
", hash: "<<prd->identifierHash());
379 using EtaPhiHits = std::array<PrdVec, 2>;
380 std::vector<EtaPhiHits> hitsPerGasGap{};
381 for (
const PrdType prd : viewer) {
384 unsigned int gapIdx = prd->gasGap() -1;
385 if constexpr (std::is_same_v<ContType, xAOD::RpcMeasurementContainer>) {
386 gapIdx = prd->readoutElement()->createHash(0, prd->gasGap(), prd->doubletPhi(),
false);
390 if constexpr(std::is_same_v<ContType, xAOD::sTgcMeasContainer>) {
392 if (prd->channelType() == sTgcIdHelper::sTgcChannelTypes::Pad) {
398 measPhi = prd->channelType() == sTgcIdHelper::sTgcChannelTypes::Wire;
401 measPhi = prd->measuresPhi();
404 if (hitsPerGasGap.size() <= gapIdx) {
405 hitsPerGasGap.resize(gapIdx + 1);
408 PrdVec& toPush = hitsPerGasGap[gapIdx][measPhi];
409 if (toPush.capacity() == toPush.size()) {
412 toPush.push_back(prd);
415 for (
auto& [etaHits, phiHits] : hitsPerGasGap) {
418 if (!etaHits.empty()){
421 if (!phiHits.empty()){
426 ATH_MSG_VERBOSE(
"Occupancy cut not passed "<<etaHits.size()<<
", "<<phiHits.size());
427 pointsInChamb.etaHits.reserve(pointsInChamb.etaHits.size() + etaHits.size());
428 pointsInChamb.phiHits.reserve(pointsInChamb.phiHits.size() + phiHits.size());
429 for (
const PrdType etaPrd : etaHits) {
431 fillSpacePoint(pointsInChamb.etaHits, etaPrd, toChamberTrans_eta);
433 <<
" "<<
Amg::toString(pointsInChamb.etaHits.back().positionInChamber()));
436 for (
const PrdType phiPrd : phiHits) {
437 fillSpacePoint(pointsInChamb.phiHits, phiPrd, toChamberTrans_phi);
439 <<
" "<<
Amg::toString(pointsInChamb.phiHits.back().positionInChamber()));
443 std::vector<std::shared_ptr<unsigned>> etaCounts{matchCountVec(etaHits.size())},
444 phiCounts{matchCountVec(phiHits.size())};
445 pointsInChamb.etaHits.reserve(etaHits.size()*phiHits.size());
447 for (
unsigned int etaP = 0; etaP < etaHits.size(); ++etaP) {
449 for (
unsigned int phiP = 0; phiP < phiHits.size(); ++ phiP) {
452 if (!(etaHits[etaP]->bcBitMap() & phiHits[phiP]->bcBitMap())){
456 fillSpacePoint(pointsInChamb.etaHits, etaHits[etaP], phiHits[phiP], toChamberTrans_eta, toChamberTrans_phi);
458 SpacePoint& sp {pointsInChamb.etaHits.back()};
461 sp.setInstanceCounts(etaCounts[etaP], phiCounts[phiP]);
463 if (!(*etaCounts[etaP])) {
464 fillSpacePoint(pointsInChamb.etaHits, etaHits[etaP], toChamberTrans_eta);
470 for (
unsigned int phiP = 0; phiP < phiHits.size(); ++ phiP){
471 if (!(*phiCounts[phiP])) {
472 fillSpacePoint(pointsInChamb.phiHits, phiHits[phiP], toChamberTrans_phi);
477 }
while (viewer.next());
478 return StatusCode::SUCCESS;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ newBucket()
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
-
refSp | First new space point which will be added to the new bucket. |
sortedPoints | List of all processed buckets in the chamber. The list is augmented by 1 element |
Set the boundaries from the previous bucket
Copy space points that could be within the overlap region to the next bucket
Definition at line 564 of file SpacePointMakerAlg.cxx.
566 SpacePointBucket& newContainer = sortedPoints.emplace_back();
567 newContainer.setBucketId(sortedPoints.size() -1);
570 SpacePointBucket& overlap{sortedPoints[sortedPoints.size() - 2]};
571 overlap.setCoveredRange(overlap.front()->positionInChamber().y(),
572 overlap.back()->positionInChamber().y());
574 const double refBound = refSpacePoint.positionInChamber().y();
578 const double overlapPos = pointInBucket->positionInChamber().y() + pointInBucket->uncertainty()[
Amg::y];
580 newContainer.insert(newContainer.begin(), pointInBucket);
◆ outputHandles()
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<class PrdType >
bool MuonR4::SpacePointMakerAlg::passOccupancy2D |
( |
const std::vector< const PrdType * > & |
etaHits, |
|
|
const std::vector< const 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
-
etaHits | List of all presorted eta measurements in a gas gap |
phiHits | List of all presorted phi measurements in a gas gap |
◆ passOccupancy2D() [2/4]
◆ passOccupancy2D() [3/4]
Definition at line 335 of file SpacePointMakerAlg.cxx.
337 if (etaHits.empty() || phiHits.empty()) {
341 return ((1.*etaHits.size()) / (1.*
re->numChannels(etaHits[0]->measurementHash()))) <
m_maxOccStgcEta &&
342 ((1.*phiHits.size()) / (1.*
re->numChannels(phiHits[0]->measurementHash()))) <
m_maxOccStgcPhi;
◆ passOccupancy2D() [4/4]
Definition at line 312 of file SpacePointMakerAlg.cxx.
314 if (etaHits.empty() || phiHits.empty()) {
319 return ((1.*etaHits.size()) / ((1.*
re->numChannels(etaHits[0]->measurementHash())))) <
m_maxOccTgcEta &&
320 ((1.*phiHits.size()) / ((1.*
re->numChannels(phiHits[0]->measurementHash())))) <
m_maxOccTgcPhi;
◆ positionInChamber()
template<class MeasType >
Returns the position of the uncalibrated muon measurement in the sector frame.
- Parameters
-
meas | Uncalibrated muon measurement |
toChamberTrans | transform from the attached Muon chamber frame to the sector frame |
Definition at line 48 of file SpacePointMakerAlg.cxx.
50 if constexpr (std::is_same_v<MeasType, xAOD::MdtDriftCircle>){
51 return toChamberTrans * meas->localCirclePosition();
52 }
else if constexpr (std::is_same_v<MeasType, xAOD::RpcMeasurement>){
53 return toChamberTrans * meas->localMeasurementPos();
54 }
else if constexpr (std::is_same_v<MeasType, xAOD::TgcStrip>){
55 const auto& stripLay = meas->readoutElement()->sensorLayout(meas->layerHash());
56 return toChamberTrans * stripLay->to3D(meas->template localPosition<1>()[0]*Amg::Vector2D::UnitX(),
58 }
else if constexpr (std::is_same_v<MeasType, xAOD::MMCluster>){
59 return toChamberTrans * (meas->template localPosition<1>()[
Trk::locX] * Amg::Vector3D::UnitX());
61 else if constexpr (std::is_same_v<MeasType, xAOD::sTgcMeasurement>){
62 if (meas->channelType() == sTgcIdHelper::sTgcChannelTypes::Strip ||
63 meas->channelType() == sTgcIdHelper::sTgcChannelTypes::Wire) {
64 return toChamberTrans * (meas->template localPosition<1>()[
Trk::locX] * Amg::Vector3D::UnitX());
67 locPos.block<2,1>(0,0) = xAOD::toEigen(meas->template localPosition<2>());
68 return toChamberTrans * locPos;
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ splitBucket()
Returns whether the space point is beyond the bucket boundary.
- Parameters
-
spacePoint | Space point candidate to add to the bucket |
sortedPoints | Container of all defined buckets in the chamber |
Distance between this point and the first one exceeds the maximum length
Definition at line 550 of file SpacePointMakerAlg.cxx.
554 const double spY = spacePoint.positionInChamber().y();
559 if (sortedPoints.empty() || sortedPoints.back().empty()) {
562 return spY - sortedPoints.back().back()->positionInChamber().y() >
m_spacePointWindow;
◆ sysExecute()
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.
Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.
◆ sysInitialize()
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 InputMakerBase, and HypoBase.
Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ toChamberTransform()
template<class MeasType >
Returns the transform from the attached Muon chamber frame to the sector frame.
- Parameters
-
gctx | Geometry context to calculate the relative alignment between chamber & measurement |
meas | Uncalibrated muon measurement |
Definition at line 34 of file SpacePointMakerAlg.cxx.
38 if constexpr(std::is_same_v<MeasType, xAOD::MdtDriftCircle>) {
39 hash = meas->measurementHash();
41 hash = meas->layerHash();
◆ updateVHKA()
◆ ATLAS_THREAD_SAFE
std::unique_ptr<SpacePointStatistics> m_statCounter MuonR4::SpacePointMakerAlg::ATLAS_THREAD_SAFE {} |
|
private |
◆ const
◆ dir
◆ m_capacityBucket
Gaudi::Property<unsigned int> MuonR4::SpacePointMakerAlg::m_capacityBucket {this,"CapacityBucket" , 50} |
|
private |
◆ m_detStore
◆ 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 252 of file SpacePointMakerAlg.h.
◆ m_evtStore
◆ m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 114 of file AthCommonReentrantAlgorithm.h.
◆ m_geoCtxKey
◆ m_idHelperSvc
◆ m_maxBucketLength
Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_maxBucketLength |
|
private |
◆ 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 258 of file SpacePointMakerAlg.h.
◆ 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 260 of file SpacePointMakerAlg.h.
◆ m_maxOccStgcEta
Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_maxOccStgcEta |
|
private |
Initial value:{this, "maxSTGCEtaOccupancy", 0.1,
"Maximum occpancy of sTgc eta hits in a gasGap"}
Definition at line 268 of file SpacePointMakerAlg.h.
◆ m_maxOccStgcPhi
Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_maxOccStgcPhi |
|
private |
Initial value:{this, "maxSTGCPhiOccupancy", 0.1,
"Maximum occpancy of sTgc phi hits in a gasGap"}
Definition at line 270 of file SpacePointMakerAlg.h.
◆ 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 263 of file SpacePointMakerAlg.h.
◆ 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 265 of file SpacePointMakerAlg.h.
◆ m_mdtKey
Initial value:{this, "MdtKey", "xMdtMeasurements",
"Key to the uncalibrated Drift circle measurements"}
Definition at line 221 of file SpacePointMakerAlg.h.
◆ m_mmKey
Initial value:{this, "MmKey", "xAODMMClusters",
"Key to the uncalibrated 1D Mm hits"}
Definition at line 230 of file SpacePointMakerAlg.h.
◆ m_rpcKey
Initial value:{this, "RpcKey", "xRpcMeasurements",
"Key to the uncalibrated 1D rpc hits"}
Definition at line 224 of file SpacePointMakerAlg.h.
◆ m_spacePointOverlap
Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_spacePointOverlap |
|
private |
Initial value:
"Hits that are within <spacePointOverlap> of the bucket margin. "
"Are copied to the next bucket"}
Definition at line 248 of file SpacePointMakerAlg.h.
◆ m_spacePointWindow
Gaudi::Property<double> MuonR4::SpacePointMakerAlg::m_spacePointWindow |
|
private |
Initial value:
"Maximal distance between consecutive hits in a bucket"}
Definition at line 242 of file SpacePointMakerAlg.h.
◆ m_stgcKey
◆ m_tgcKey
Initial value:{this, "TgcKey", "xTgcStrips",
"Key to the uncalibrated 1D tgc hits"}
Definition at line 227 of file SpacePointMakerAlg.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeKey
The documentation for this class was generated from the following files:
std::unordered_map< const MuonGMR4::SpectrometerSector *, SpacePointsPerChamber > PreSortedSpacePointMap
Container abrivation of the presorted space point container per MuonChambers.
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
SG::ReadHandleKey< xAOD::sTgcMeasContainer > m_stgcKey
The SpacePointPerLayerSorter sort two given space points by their layer Identifier.
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.
bool splitBucket(const SpacePoint &spacePoint, const double firstSpPos, const SpacePointBucketVec &sortedPoints) const
Returns whether the space point is beyond the bucket boundary.
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)
Gaudi::Property< double > m_maxOccStgcPhi
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
SG::ReadHandleKey< xAOD::RpcMeasurementContainer > m_rpcKey
void distributePhiPoints(std::vector< SpacePoint > &&spacePoints, SpacePointBucketVec &splittedContainer) const
Distributs the vector phi space points into the buckets.
#define ATH_MSG_VERBOSE(x)
SG::ReadHandleKey< xAOD::MMClusterContainer > m_mmKey
void newBucket(const SpacePoint &refSp, SpacePointBucketVec &sortedPoints) const
Closes the current processed bucket and creates a new one.
virtual void setOwner(IDataHandleHolder *o)=0
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
std::vector< SpacePointBucket > SpacePointBucketVec
Abrivation of a MuonSapcePoint bucket vector.
SG::ReadHandleKey< xAOD::TgcStripContainer > m_tgcKey
SG::WriteHandleKey< SpacePointContainer > m_writeKey
Gaudi::Property< double > m_maxOccStgcEta
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Eigen::Affine3d Transform3D
Gaudi::Property< double > m_maxOccTgcEta
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Gaudi::Property< double > m_maxOccTgcPhi
Include the GeoPrimitives which need to be put first.
virtual void renounce()=0
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
StatusCode fillContainer(const std::unique_ptr< Muon::NSW_PadTriggerDataContainer > &out, const std::vector< std::unique_ptr< NSWL1::PadTrigger >> &triggers, const uint32_t l1id)
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 ...
Eigen::Matrix< double, 3, 1 > Vector3D
SG::ReadHandleKey< xAOD::MdtDriftCircleContainer > m_mdtKey
bool passOccupancy2D(const std::vector< const PrdType * > &etaHits, const std::vector< const PrdType * > &phiHits) const
: Check whether the occupancy cuts of hits in a gasGap are surpassed.
Gaudi::Property< double > m_maxBucketLength
Gaudi::Property< double > m_spacePointWindow
#define ATH_MSG_WARNING(x)
const boost::regex re(r_e)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
virtual StatusCode sysInitialize() override
Override sysInitialize.
Gaudi::Property< bool > m_doStat
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Gaudi::Property< double > m_maxOccRpcEta
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
void fillSpacePoint(std::vector< SpacePoint > &pointColl, const MeasType *primaryMeas, const MeasType *secondaryMeas, const Amg::Transform3D &toChamberTrans_eta, const Amg::Transform3D &toChamberTrans_phi) const
Helper function that creates the spacepoint and populates it, when having two measurement.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Gaudi::Property< unsigned int > m_capacityBucket
void distributePointsAndStore(SpacePointsPerChamber &&hitsPerChamber, SpacePointContainer &finalContainer) const
Distribute the premade spacepoints per chamber into their individual SpacePoint buckets.
Amg::Transform3D toChamberTransform(const ActsGeometryContext &gctx, const Amg::Transform3D §orTrans, const MeasType *meas) const
Returns the transform from the attached Muon chamber frame to the sector frame.
Gaudi::Property< double > m_spacePointOverlap
Gaudi::Property< double > m_maxOccRpcPhi