![]() |
ATLAS Offline Software
|
Pattern state object storing pattern information during construction. More...
#include <GlobalPatternFinderDefs.h>
Public Member Functions | |
| PatternState (const CandidateHit &seed, const std::int8_t expSector, const Config *cfg, const Acts::Logger *logger) | |
| Constructor taking the seed information. | |
| PatternState (PatternState &&other) noexcept=default | |
| Move constructor. | |
| PatternState & | operator= (PatternState &&other) noexcept=default |
| Move assignment operator. | |
| PatternState (const PatternState &other)=default | |
| Copy constructor. | |
| PatternState & | operator= (const PatternState &other)=default |
| Copy assignment operator. | |
| ~PatternState ()=default | |
| Destructor. | |
| void | addHit (const CandidateHit &hit, const double residual, const double resSigma) |
| Add a hit to the pattern and update the internal state. | |
| void | overWriteHit (const CandidateHit &newHit, const double newResidual, const double newResSigma) |
| Overwrite the hits on the last layer with the new one. | |
| LineTestRes | checkLineComp (const Acts::GeometryContext &gctx, const CandidateHit &testHit, const Amg::Vector3D &beamSpot) |
| Method checking line compatibility of a test hit against the pattern. | |
| LineTestRes | computeLineResidual (const Acts::GeometryContext &gctx, const CandidateHit &testHit) const |
| Method to compute the residual of a test hit against the pattern line. | |
| Amg::Vector3D | projToPhiPlane (const Acts::GeometryContext &gctx, const HitPayload &hit) const |
| Project a certain hit position onto the bending plane where the pattern is defined. | |
| bool | isPhiCompatible (const HitPayload &hit) const |
| Method to check the phi compatibility of a test hit with a given pattern. | |
| bool | isInPattern (const HitPayload &hit) const |
| Check wheter a hit is present in the pattern. | |
| void | moveLineAnchorHit (const CandidateHit &refHit) |
| Move the line anchor hit given a reference hit. | |
| void | updateLineParameters (const Acts::GeometryContext &gctx, const Amg::Vector3D &beamSpot) |
| Update the line parameters based on the current hits. | |
| void | updatePatternPhi () |
| Helper method to update the pattern phi and bending plane normal. | |
| double | getMeanResidual2 () const |
| Return the mean normalized residual squared. | |
| uint8_t | nBendingLayers () const |
| Return the number of layers in bending coordinate. | |
| uint8_t | nStations (const bool onlyGoodStations) const |
| Method returning the number of stations. | |
| std::vector< const SpacePointBucket * > | getParentBuckets () const |
| Get the buckets associated with the pattern. | |
| const Acts::Logger & | logger () const |
| Return the logger. | |
| bool | operator== (const PatternState &other) const =delete |
| Patterns are considered identical if they have the same hit content. | |
| void | print (std::ostream &ostr, bool detailed) const |
| Print the pattern candidate. | |
Public Attributes | |
| const Config * | cfg {nullptr} |
| Pointer to cfg option. | |
| const Acts::Logger * | m_logger {nullptr} |
| Logger. | |
| Acts::CloneablePtr< PatHitVisual > | visualInfo {nullptr} |
| Pointer to Visual Information for pattern visualization. | |
| CandidateHit | lastInsertedHit {} |
| Last inserted hit. | |
| CandidateHit | prevLayerHit {} |
| Last hit in the second-to-last layer. | |
| CandidateHit | lineAnchorHit {} |
| Line anchor hit. | |
| Amg::Vector3D | bendPlaneNorm {Amg::Vector3D::Zero()} |
| Normal vector to the bending plane where the pattern lies. | |
| Amg::Vector3D | linePos {Amg::Vector3D::Zero()} |
| Position and direction of the pattern line. | |
| Amg::Vector3D | lineDir {Amg::Vector3D::Zero()} |
| double | leverArm {0.} |
| Distance between the two points defining the pattern line. | |
| double | meanNormResidual2 {0.} |
| Mean over eta hits of the square of their residual divided by residual uncertainty. | |
| double | lastResidual {0.} |
| Residual & residual uncertainty of the last inserted hit (needed when replacing a hit). | |
| double | lastResSigma {0.} |
| double | patPhi {0.} |
| Pattern phi, which is the phi of the bending plane where the pattern lies. | |
| double | patTheta {0.} |
| Pattern theta, which is the value of the seed hit. | |
| double | patPhiCov {0.} |
| Covariance of the pattern phi. | |
| ExpandedSector | expSect {static_cast<int8_t>(0)} |
| expanded MS sector | |
| uint8_t | nPrecisionLayers {0u} |
| Counts of precision / non-precision / phi layers. | |
| uint8_t | nTriggerLayers {0u} |
| uint8_t | nPhiLayers {0u} |
| bool | isFinalized {false} |
| Flag to indicate if the pattern has been finalized. | |
| bool | isOverlap {false} |
| Flag to indicate if the pattern is overlapping with another one, used during overlap removal. | |
| bool | useBeamspot {false} |
| Whether we used the beamspot to compute the line parameters. | |
| bool | needLineUpdate {false} |
| Whether we need to update the pattern line the next time we find a hit in a new layer. | |
| std::array< std::vector< CandidateHit >, s_nStations > | hitsPerStation {} |
| Map collection of hits per station. | |
| std::vector< HitPayload > | phiOnlyHits {} |
| Array holding phi-only hits. | |
Pattern state object storing pattern information during construction.
Definition at line 114 of file GlobalPatternFinderDefs.h.
|
explicit |
Constructor taking the seed information.
| seed | seed hit |
| expSector | expanded sector coordinate |
| cfg | pointer to configuration object |
| logger | pointer to messaging object |
Add the new hit
Update the hit counts
Definition at line 152 of file GlobalPatternFinderDefs.cxx.
|
defaultnoexcept |
Move constructor.
| other | other pattern state to move from |
|
default |
Copy constructor.
| other | other pattern state to copy from |
|
default |
Destructor.
| void MuonR4::FastReco::GlobalPatternFinder::PatternState::addHit | ( | const CandidateHit & | hit, |
| const double | residual, | ||
| const double | resSigma ) |
Add a hit to the pattern and update the internal state.
| hit | hit to be added |
| residual | residual of the hit |
| resSigma | residual uncertainty of the hit |
Add the new hit
Update the hit counts
Update the pointers to previous layer hit
If the new compatible hit is in a different station, update the line anchor
Definition at line 442 of file GlobalPatternFinderDefs.cxx.
| LineTestRes MuonR4::FastReco::GlobalPatternFinder::PatternState::checkLineComp | ( | const Acts::GeometryContext & | gctx, |
| const CandidateHit & | testHit, | ||
| const Amg::Vector3D & | beamSpot ) |
Method checking line compatibility of a test hit against the pattern.
| testHit | test hit information |
| beamSpot | Beam spot position, needed to update the pattern line |
Helper function to make the result
| decision | The decision for the test result if the residual is within the acceptance window |
Loosen the window when we use the beamspot or when we are looking for hits in a new station, as the straight line approximation becomes less accurate on large distances. TO DO: investigate this further
Definition at line 176 of file GlobalPatternFinderDefs.cxx.
| LineTestRes MuonR4::FastReco::GlobalPatternFinder::PatternState::computeLineResidual | ( | const Acts::GeometryContext & | gctx, |
| const CandidateHit & | testHit ) const |
Method to compute the residual of a test hit against the pattern line.
| testHit | test hit information |
We project the test hit onto the phi plane only when the test hit does not measure phi or when we have no phi layers, otherwise we do not project so the residual include the error in the phi direction.
If the residual is very small, it's likely due to bad topology, reject it.
Alpha represents the extrapolation distance along the pattern line
Accumulate the derivatives of the scalar residual with respect to the common phi-plane angle.
Accumulate the covariance contributions of the hits to the residual
Accumulate the covariance contributions of one hit to the residual. Each hit contributes with its intrinsic covariance and, if projected,
with the uncertainty in the common phi-plane angle of the pattern.
Intrinsic covariance: for a projected hit, the residual direction is
transformed with the projection jacobian J^T * dir. dir^T * J * cov * J^T * dir = (J^T * dir)^T * cov * (J^T * dir)
Phi plane uncertainty: for a projected hit, the derivative of the scalar
residual with respect to the common phi-plane angle for the projected hits.
| hit | the hit for which to compute the covariance |
| isProjected | flag indicating if the hit is projected |
| pos | projected position (needed for the phi-plane derivative of projected hits) |
| preFactor | factor, function of alpha, to scale the covariance contributions |
Compute the covariance contributions of the first line point
Compute the covariance contributions of the second line point
Compute the covariance contributions of the test hit
Definition at line 272 of file GlobalPatternFinderDefs.cxx.
| double MuonR4::FastReco::GlobalPatternFinder::PatternState::getMeanResidual2 | ( | ) | const |
Return the mean normalized residual squared.
Definition at line 558 of file GlobalPatternFinderDefs.cxx.
| std::vector< const SpacePointBucket * > MuonR4::FastReco::GlobalPatternFinder::PatternState::getParentBuckets | ( | ) | const |
Get the buckets associated with the pattern.
Definition at line 565 of file GlobalPatternFinderDefs.cxx.
| bool MuonR4::FastReco::GlobalPatternFinder::PatternState::isInPattern | ( | const HitPayload & | hit | ) | const |
Check wheter a hit is present in the pattern.
| hit | hit to be checked |
Definition at line 539 of file GlobalPatternFinderDefs.cxx.
| bool MuonR4::FastReco::GlobalPatternFinder::PatternState::isPhiCompatible | ( | const HitPayload & | hit | ) | const |
Method to check the phi compatibility of a test hit with a given pattern.
| hit | hit to be checked |
We check that the test hit is compatible with the pattern phi, if available, which is given by the first phi measurement in the pattern. If the pattern doesn't have a phi yet, we check that the test hit is in the same pattern sector(s)
Definition at line 415 of file GlobalPatternFinderDefs.cxx.
|
inline |
Return the logger.
Definition at line 200 of file GlobalPatternFinderDefs.h.
| void MuonR4::FastReco::GlobalPatternFinder::PatternState::moveLineAnchorHit | ( | const CandidateHit & | refHit | ) |
Move the line anchor hit given a reference hit.
The anchor is defined as the closest hit in the closest station to the referece hit,
Definition at line 222 of file GlobalPatternFinderDefs.cxx.
| uint8_t MuonR4::FastReco::GlobalPatternFinder::PatternState::nBendingLayers | ( | ) | const |
Return the number of layers in bending coordinate.
Definition at line 555 of file GlobalPatternFinderDefs.cxx.
| uint8_t MuonR4::FastReco::GlobalPatternFinder::PatternState::nStations | ( | const bool | onlyGoodStations | ) | const |
Method returning the number of stations.
| onlyGoodStations | flag to indicate if only good stations should be counted, i.e. having a minimum number of hits |
Definition at line 544 of file GlobalPatternFinderDefs.cxx.
|
default |
Copy assignment operator.
| other | other pattern state to copy from |
|
defaultnoexcept |
Move assignment operator.
| other | other pattern state to move from |
|
delete |
Patterns are considered identical if they have the same hit content.
However, map comparison is very expensive
| void MuonR4::FastReco::GlobalPatternFinder::PatternState::overWriteHit | ( | const CandidateHit & | newHit, |
| const double | newResidual, | ||
| const double | newResSigma ) |
Overwrite the hits on the last layer with the new one.
| newHit | new hit to replace with |
| newResidual | residual of the new hit |
| newResSigma | residual uncertainty of the new hit |
| beamSpot | needed to update line parameters |
Update the phi counts
Update the residual
Remove the last inserted hit
Add the new hit
Definition at line 472 of file GlobalPatternFinderDefs.cxx.
| void MuonR4::FastReco::GlobalPatternFinder::PatternState::print | ( | std::ostream & | ostr, |
| bool | detailed ) const |
Print the pattern candidate.
Definition at line 576 of file GlobalPatternFinderDefs.cxx.
| Amg::Vector3D MuonR4::FastReco::GlobalPatternFinder::PatternState::projToPhiPlane | ( | const Acts::GeometryContext & | gctx, |
| const HitPayload & | hit ) const |
Project a certain hit position onto the bending plane where the pattern is defined.
The hit is moved along the sensor direction if it does not measure phi, or is rotated around the Z axis if it does.
| hit | hit whose position is to be projected |
Definition at line 365 of file GlobalPatternFinderDefs.cxx.
| void MuonR4::FastReco::GlobalPatternFinder::PatternState::updateLineParameters | ( | const Acts::GeometryContext & | gctx, |
| const Amg::Vector3D & | beamSpot ) |
Update the line parameters based on the current hits.
| beamSpot | position of the beam spot, needed when there are not enough hits |
Check whether we have to use the beamspot instead of the anchor hit to draw the line.
Definition at line 245 of file GlobalPatternFinderDefs.cxx.
| void MuonR4::FastReco::GlobalPatternFinder::PatternState::updatePatternPhi | ( | ) |
Helper method to update the pattern phi and bending plane normal.
If there are no phi hits, we just use the central phi of the sector/overlap region, with a standard deviation based on the expanded sector size.
Definition at line 370 of file GlobalPatternFinderDefs.cxx.
| Amg::Vector3D MuonR4::FastReco::GlobalPatternFinder::PatternState::bendPlaneNorm {Amg::Vector3D::Zero()} |
Normal vector to the bending plane where the pattern lies.
Definition at line 217 of file GlobalPatternFinderDefs.h.
| ExpandedSector MuonR4::FastReco::GlobalPatternFinder::PatternState::expSect {static_cast<int8_t>(0)} |
expanded MS sector
Definition at line 237 of file GlobalPatternFinderDefs.h.
| std::array<std::vector<CandidateHit>, s_nStations> MuonR4::FastReco::GlobalPatternFinder::PatternState::hitsPerStation {} |
Map collection of hits per station.
A pattern is determined by the hits belonging to it.
Definition at line 252 of file GlobalPatternFinderDefs.h.
| bool MuonR4::FastReco::GlobalPatternFinder::PatternState::isFinalized {false} |
Flag to indicate if the pattern has been finalized.
Definition at line 243 of file GlobalPatternFinderDefs.h.
| bool MuonR4::FastReco::GlobalPatternFinder::PatternState::isOverlap {false} |
Flag to indicate if the pattern is overlapping with another one, used during overlap removal.
Definition at line 245 of file GlobalPatternFinderDefs.h.
| CandidateHit MuonR4::FastReco::GlobalPatternFinder::PatternState::lastInsertedHit {} |
Last inserted hit.
Needed to speed-up lookup
Definition at line 211 of file GlobalPatternFinderDefs.h.
| double MuonR4::FastReco::GlobalPatternFinder::PatternState::lastResidual {0.} |
Residual & residual uncertainty of the last inserted hit (needed when replacing a hit).
Definition at line 228 of file GlobalPatternFinderDefs.h.
| double MuonR4::FastReco::GlobalPatternFinder::PatternState::lastResSigma {0.} |
Definition at line 229 of file GlobalPatternFinderDefs.h.
| double MuonR4::FastReco::GlobalPatternFinder::PatternState::leverArm {0.} |
Distance between the two points defining the pattern line.
Definition at line 224 of file GlobalPatternFinderDefs.h.
| CandidateHit MuonR4::FastReco::GlobalPatternFinder::PatternState::lineAnchorHit {} |
| Amg::Vector3D MuonR4::FastReco::GlobalPatternFinder::PatternState::lineDir {Amg::Vector3D::Zero()} |
Definition at line 222 of file GlobalPatternFinderDefs.h.
| Amg::Vector3D MuonR4::FastReco::GlobalPatternFinder::PatternState::linePos {Amg::Vector3D::Zero()} |
Position and direction of the pattern line.
Both are constructed to be within the bending plane of the pattern. We store them as vectors to facilitate vector operations and avoid constructing them repeatedly.
Definition at line 221 of file GlobalPatternFinderDefs.h.
| const Acts::Logger* MuonR4::FastReco::GlobalPatternFinder::PatternState::m_logger {nullptr} |
| double MuonR4::FastReco::GlobalPatternFinder::PatternState::meanNormResidual2 {0.} |
Mean over eta hits of the square of their residual divided by residual uncertainty.
Definition at line 226 of file GlobalPatternFinderDefs.h.
| bool MuonR4::FastReco::GlobalPatternFinder::PatternState::needLineUpdate {false} |
Whether we need to update the pattern line the next time we find a hit in a new layer.
Definition at line 249 of file GlobalPatternFinderDefs.h.
| uint8_t MuonR4::FastReco::GlobalPatternFinder::PatternState::nPhiLayers {0u} |
Definition at line 241 of file GlobalPatternFinderDefs.h.
| uint8_t MuonR4::FastReco::GlobalPatternFinder::PatternState::nPrecisionLayers {0u} |
Counts of precision / non-precision / phi layers.
Definition at line 239 of file GlobalPatternFinderDefs.h.
| uint8_t MuonR4::FastReco::GlobalPatternFinder::PatternState::nTriggerLayers {0u} |
Definition at line 240 of file GlobalPatternFinderDefs.h.
| double MuonR4::FastReco::GlobalPatternFinder::PatternState::patPhi {0.} |
Pattern phi, which is the phi of the bending plane where the pattern lies.
Definition at line 231 of file GlobalPatternFinderDefs.h.
| double MuonR4::FastReco::GlobalPatternFinder::PatternState::patPhiCov {0.} |
| double MuonR4::FastReco::GlobalPatternFinder::PatternState::patTheta {0.} |
Pattern theta, which is the value of the seed hit.
Definition at line 233 of file GlobalPatternFinderDefs.h.
| std::vector<HitPayload> MuonR4::FastReco::GlobalPatternFinder::PatternState::phiOnlyHits {} |
| CandidateHit MuonR4::FastReco::GlobalPatternFinder::PatternState::prevLayerHit {} |
Last hit in the second-to-last layer.
Definition at line 213 of file GlobalPatternFinderDefs.h.
| bool MuonR4::FastReco::GlobalPatternFinder::PatternState::useBeamspot {false} |
Whether we used the beamspot to compute the line parameters.
Definition at line 247 of file GlobalPatternFinderDefs.h.
| Acts::CloneablePtr<PatHitVisual> MuonR4::FastReco::GlobalPatternFinder::PatternState::visualInfo {nullptr} |
Pointer to Visual Information for pattern visualization.
Definition at line 209 of file GlobalPatternFinderDefs.h.