 |
ATLAS Offline Software
|
#include <NswSegmentFinderAlg.h>
|
| virtual | ~NswSegmentFinderAlg ()=default |
| |
| virtual StatusCode | initialize () override |
| |
| virtual StatusCode | execute (const EventContext &ctx) const override |
| |
| virtual StatusCode | finalize () override |
| |
| 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 |
| |
|
| StripOrient | classifyStrip (const SpacePoint &spacePoint) const |
| | Determines the orientation of the strip space point. More...
|
| |
| UsedHitMarker_t | emptyBookKeeper (const HitLayVec &sortedSp) const |
| | Constructs an empty HitMarker from the split space points. More...
|
| |
| HitWindow | hitFromIPCorridor (const SpacePoint &testHit, const Amg::Vector3D &beamSpotPos, const Amg::Vector3D &dirEstUp, const Amg::Vector3D &dirEstDn) const |
| | The hit is above the predefined corridor. More...
|
| |
| void | constructPrelimnarySeeds (const Amg::Vector3D &beamSpot, const HitLaySpan_t &combinatoricLayers, const UsedHitSpan_t &usedHits, InitialSeedVec_t &outVec) const |
| | Construct a set of prelimnary seeds from the selected combinatoric layers. More...
|
| |
| std::unique_ptr< SegmentSeed > | buildSegmentSeed (const InitialSeed_t &initialSeed, const AmgSymMatrix(2)&bMatrix, const HoughMaximum &max, const HitLaySpan_t &extensionLayers, const UsedHitSpan_t &usedHits) const |
| | Build the final seed from the initial seed hits and then attempt to append hits from the complementary layers onto the seed. More...
|
| |
| std::unique_ptr< Segment > | fitSegmentSeed (const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const SegmentSeed *patternSeed) const |
| | Fit the segment seed. More...
|
| |
| void | markHitsAsUsed (const HitVec &spacePoints, const HitLayVec &allSortHits, UsedHitMarker_t &usedHitMarker, unsigned int increase, bool markNeighborHits) const |
| | Hits that are used in a good seed/segment built should be flagged as used and not contribute to other seed. More...
|
| |
| HitVec | extendHits (const Amg::Vector3D &startPos, const Amg::Vector3D &direction, const HitLaySpan_t &extensionLayers, const UsedHitSpan_t &usedHits) const |
| | Extend the seed with the hits from the other layers. More...
|
| |
| std::pair< std::vector< std::unique_ptr< SegmentSeed > >, std::vector< std::unique_ptr< Segment > > > | findSegmentsFromMaximum (const HoughMaximum &max, const ActsTrk::GeometryContext &gctx, const EventContext &ctx) const |
| | Find seed and segment from an eta hough maximum. 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...
|
| |
|
| SG::ReadHandleKey< EtaHoughMaxContainer > | m_etaKey {this, "CombinatorialReadKey", "MuonHoughNswMaxima"} |
| |
| SG::WriteHandleKey< SegmentSeedContainer > | m_writeSegmentSeedKey {this, "MuonNswSegmentSeedWriteKey", "MuonNswSegmentSeeds"} |
| |
| SG::WriteHandleKey< SegmentContainer > | m_writeSegmentKey {this, "MuonNswSegmentWriteKey", "MuonNswSegments"} |
| |
| SG::ReadHandleKey< ActsTrk::GeometryContext > | m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"} |
| |
| ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
| |
| ToolHandle< MuonValR4::IPatternVisualizationTool > | m_visionTool {this, "VisualizationTool", ""} |
| | Pattern visualization tool. More...
|
| |
| ToolHandle< ISpacePointCalibrator > | m_calibTool {this, "Calibrator", "" } |
| |
| std::unique_ptr< SegmentFit::SegmentLineFitter > | m_lineFitter {} |
| |
| DoubleProperty | m_windowTheta {this, "thetaWindow", 0.5 * Gaudi::Units::deg} |
| |
| DoubleProperty | m_minPullThreshold {this, "maxPull", 5.} |
| |
| DoubleProperty | m_minSeedHits {this, "minSeedHits", 6.} |
| |
| DoubleProperty | m_maxInvalidClusters {this, "maxInvalidClusters", 4.} |
| |
| BooleanProperty | m_markHitsFromSeed {this, "markHitsFromSeed", true} |
| |
| UnsignedIntegerProperty | m_maxUsed {this, "maxHitIsUsed", 6} |
| |
| DoubleProperty | m_minClusSize {this, "minClusterSize", 1.} |
| |
| DoubleProperty | m_maxChi2 {this, "maxChi2", 6.} |
| |
| DoubleProperty | m_maxClustersInLayer {this, "maxClustersInLayer", 8} |
| |
| DoubleProperty | m_maxdYWindow {this, "maxdYWindow", 4.*Gaudi::Units::cm} |
| |
| BooleanProperty | m_dumpSeedStatistics {this, "dumpStatistics", true} |
| |
| std::unique_ptr< SeedStatistics > m_seedCounter | ATLAS_THREAD_SAFE {} |
| |
| 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 33 of file NswSegmentFinderAlg.h.
◆ HitLaySpan_t
Abbrivation of the space comprising multiple hit vectors without copy.
Definition at line 113 of file NswSegmentFinderAlg.h.
◆ HitLayVec
◆ HitVec
◆ InitialSeed_t
◆ InitialSeedVec_t
◆ StoreGateSvc_t
◆ UsedHitMarker_t
Abbrivation of the container book keeping whether a hit is used or not.
Definition at line 115 of file NswSegmentFinderAlg.h.
◆ UsedHitSpan_t
Abbrivation of the container to pass a subset of markers wtihout copy.
Definition at line 117 of file NswSegmentFinderAlg.h.
◆ HitWindow
To fastly check whether a hit is roughly compatible with a muon trajectory a narrow corridor is opened from the estimated beamspot to the first tested hit in the seed finding.
Hits in subsequent layers need to be within this corridor in order to be considered for seed construction. The HitWindow is the output classification of such a corridor test.
| Enumerator |
|---|
| tooLow | |
| inside | The hit is below the predefined corridor.
|
| tooHigh | The hit is inside the defined window and hence an initial candidate.
|
Definition at line 131 of file NswSegmentFinderAlg.h.
◆ StripOrient
Enumeration to classify the orientation of a NSW strip
| Enumerator |
|---|
| U | |
| V | Stereo strips with positive angle.
|
| X | Stereo strips with negative angle.
|
| P | Ordinary eta strips.
|
| C | Single phi measurements.
|
| Unknown | Combined 2D space point (sTGC wire + strip / sTgc pad)
|
Definition at line 45 of file NswSegmentFinderAlg.h.
◆ ~NswSegmentFinderAlg()
| virtual MuonR4::NswSegmentFinderAlg::~NswSegmentFinderAlg |
( |
| ) |
|
|
virtualdefault |
◆ buildSegmentSeed()
Build the final seed from the initial seed hits and then attempt to append hits from the complementary layers onto the seed.
- Parameters
-
| initialSeed | Reference to the hit quadruplet that may form a seed |
| bMatrix | Kernel matrix calculated from the layer configuration to construct the seed |
| max | Refrence to the eta maximum from which the segment seed is constructed |
| extensionLayers | Reference to the hits on the remaining layers of the detector |
| usedExtensionHits | Refrence to the book keeper of which of the hits on the extension was already used |
Definition at line 299 of file NswSegmentFinderAlg.cxx.
307 bool allValid = std::all_of(initialSeed.begin(), initialSeed.end(), [
this](
const auto& hit){
309 if (hit->type() == xAOD::UncalibMeasType::MMClusterType) {
310 const auto* mmClust = static_cast<const xAOD::MMCluster*>(hit->primaryMeasurement());
311 return mmClust->stripNumbers().size() >= m_minClusSize;
318 ATH_MSG_VERBOSE(
"Seed rejection: Not all clusters meet minimum strip size");
323 std::array<double, 4>
params = defineParameters(bMatrix, initialSeed);
325 const auto [segPos, direction] = seedSolution(initialSeed,
params);
329 for (std::size_t
i = 0;
i < 4; ++
i) {
330 const double halfLength = stripHalfLength(*initialSeed[
i]);
332 if (std::abs(
params[
i]) > halfLength) {
333 ATH_MSG_VERBOSE(
"Seed Rejection: Invalid seed - outside of the strip's length");
340 double interceptX = segPos.x();
341 double interceptY = segPos.y();
345 auto extendedHits =
extendHits(segPos, direction, extensionLayers, usedHits);
346 HitVec hits{initialSeed.begin(),initialSeed.end()};
347 hits.insert(
hits.end(), extendedHits.begin(), extendedHits.end());
350 return std::make_unique<SegmentSeed>(tanBeta, interceptY, tanAlpha,
351 interceptX,
hits.size(),
352 std::move(
hits),
max.parentBucket());
◆ 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.
◆ classifyStrip()
Determines the orientation of the strip space point.
Definition at line 100 of file NswSegmentFinderAlg.cxx.
103 const auto& design = getDesign(sp);
104 if (!design.hasStereoAngle()) {
110 if (sp.dimension() == 2) {
◆ constructPrelimnarySeeds()
Construct a set of prelimnary seeds from the selected combinatoric layers.
Quadruplets of hits, one from each layer, are formed if they are all within the the corridor as described above
- Parameters
-
| beamSpot | Position of the beam spot in the sector's frame |
| combinatoricLayers | Quadruplet of four hit vectors from which the hits are retrieved |
| usedHits | Mask marking hits that were already successfully added to a seed |
| outVec | Reference to the output vector where the initial seeds are stored. The vector is cleared at the beginning and capacity is allocated accordingly |
Assign enough memory to the vector
The hit is alrady in a good seed. Don't consider again
Construct the beamspot to first hit connection to guestimate the angle
Apply cut window on theta of the seed.
Definition at line 197 of file NswSegmentFinderAlg.cxx.
202 seedHitsFromLayers.clear();
203 std::size_t maxSize{1};
204 for (
const HitVec& hitVec : combinatoricLayers) {
205 maxSize = maxSize * hitVec.size();
207 seedHitsFromLayers.reserve(maxSize);
210 unsigned int iterLay0{0}, iterLay1{0}, iterLay2{0}, iterLay3{0};
211 unsigned int startLay1{0}, startLay2{0}, startLay3{0};
213 for( ; iterLay0 < combinatoricLayers[0].get().
size() ; ++iterLay0){
218 const SpacePoint* hit0 = combinatoricLayers[0].get()[iterLay0];
229 for( iterLay1 = startLay1; iterLay1 < combinatoricLayers[1].get().
size() ; ++iterLay1){
231 for( iterLay2 = startLay2; iterLay2 < combinatoricLayers[2].get().
size() ; ++iterLay2){
233 for( iterLay3 = startLay3; iterLay3 < combinatoricLayers[3].get().
size(); ++iterLay3){
235 seedHitsFromLayers.emplace_back(
std::array{hit0, combinatoricLayers[1].get()[iterLay1],
236 combinatoricLayers[2].
get()[iterLay2],
237 combinatoricLayers[3].
get()[iterLay3]});
◆ 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()
◆ emptyBookKeeper()
Constructs an empty HitMarker from the split space points.
- Parameters
-
| sortedSp | List of space points sorted by layer |
Definition at line 91 of file NswSegmentFinderAlg.cxx.
93 for (std::size_t
l = 0;
l < sortedSp.size(); ++
l) {
94 emptyKeeper[
l].resize(sortedSp[
l].
size(), 0);
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
| StatusCode MuonR4::NswSegmentFinderAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Definition at line 581 of file NswSegmentFinderAlg.cxx.
591 ATH_CHECK(writeSegments.record(std::make_unique<SegmentContainer>()));
594 ATH_CHECK(writeSegmentSeeds.record(std::make_unique<SegmentSeedContainer>()));
598 for (
const HoughMaximum *
max : *maxima) {
603 for(
const auto& hitMax :
max->getHitsInMax()){
610 for(
auto& seed: seeds){
613 std::stringstream sstr{};
614 sstr<<
"Seed tanBeta = "<<
seed->tanBeta()<<
", y0 = "<<
seed->interceptY()
615 <<
", tanAlpha = "<<
seed->tanAlpha()<<
", x0 = "<<
seed->interceptX()<<
", hits in the seed "
616 <<
seed->getHitsInMax().size()<<std::endl;
618 for(
const auto& hit :
seed->getHitsInMax()){
619 sstr<<
" *** Hit "<<
m_idHelperSvc->toString(hit->identify())<<
", "
625 m_visionTool->visualizeSeed(ctx, *seed,
"#phi-combinatorialSeed");
628 writeSegmentSeeds->push_back(std::move(seed));
632 for (
auto &seg : segments) {
639 m_visionTool->visualizeSegment(ctx, *seg,
"#phi-segment");
642 writeSegments->push_back(std::move(seg));
647 return StatusCode::SUCCESS;
◆ extendHits()
Extend the seed with the hits from the other layers.
- Parameters
-
| startPos | The seed position |
| direction | The seed direction |
| extensionLayers | The layers to which the seed is extended by extrapolation |
| usedHits | The book keeping of the used hits to be skipped |
Definition at line 246 of file NswSegmentFinderAlg.cxx.
255 for (std::size_t
i = 0;
i < extensionLayers.size(); ++
i) {
257 const Amg::Vector3D extrapPos = SeedingAux::extrapolateToPlane(startPos, direction, *
layer.front());
259 unsigned int indexOfHit =
layer.size() + 1;
260 unsigned int triedHit{0};
264 for (
unsigned int j = 0; j <
layer.size(); ++j) {
268 auto hit =
layer.at(j);
269 const double pull = std::sqrt(SeedingAux::chi2Term(extrapPos, direction, *hit));
273 if (
pull > minPull) {
288 const auto* bestCand =
layer.at(indexOfHit);
291 <<
", dir: "<<
Amg::toString(bestCand->sensorDirection())<<
" found with pull "<<minPull);
292 combinatoricHits.push_back(bestCand);
295 return combinatoricHits;
◆ 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.
◆ filterPassed()
◆ finalize()
| StatusCode MuonR4::NswSegmentFinderAlg::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 650 of file NswSegmentFinderAlg.cxx.
653 m_seedCounter->printTableSeedStats(msgStream());
655 return StatusCode::SUCCESS;
◆ findSegmentsFromMaximum()
Find seed and segment from an eta hough maximum.
- Parameters
-
| max | The maximum from the eta hough transform |
| gctx | The geometry Context |
| ctx | The event context |
Definition at line 376 of file NswSegmentFinderAlg.cxx.
378 SpacePointPerLayerSplitter hitLayers{
max.getHitsInMax()};
380 const HitLayVec& stripHitsLayers{hitLayers.stripHits()};
381 const std::size_t layerSize = stripHitsLayers.size();
384 std::vector<std::unique_ptr<SegmentSeed>> seeds{};
385 std::vector<std::unique_ptr<Segment>> segments{};
388 unsigned int nSeeds{0}, nExtSeeds{0}, nSegments{0};
393 return std::make_pair(std::move(seeds),std::move(segments));
400 constexpr
double legX{0.2};
403 const auto* mmClust =
static_cast<const xAOD::MMCluster*
>(sp->primaryMeasurement());
412 const double pull = std::sqrt(SeedingAux::chi2Term(hitPos, hitDir, *sp));
413 const double pull2 = (mmClust->localPosition<1>().
x() - simHit->
localPosition().x()) / std::sqrt(mmClust->localCovariance<1>().x());
419 "truth", std::move(primitives));
426 std::array<const SpacePoint*, 4> seedHits{};
430 for (std::size_t
i = 0;
i < layerSize - 3; ++
i) {
431 seedHits[0] = stripHitsLayers[
i].front();
432 for (std::size_t j =
i + 1; j < layerSize - 2; ++j) {
433 seedHits[1] = stripHitsLayers[j].front();
434 for (std::size_t
k = j + 1;
k < layerSize - 1; ++
k) {
435 seedHits[2] = stripHitsLayers[
k].front();
436 for (std::size_t
l =
k + 1;
l < layerSize; ++
l) {
437 seedHits[3] = stripHitsLayers[
l].front();
439 const HitLaySpan_t layers{stripHitsLayers[
i], stripHitsLayers[j], stripHitsLayers[
k], stripHitsLayers[
l]};
443 [
this](
const auto&
layer) {
444 return layer.get().size() > m_maxClustersInLayer;
450 if (std::abs(bMatrix.determinant()) < 1.
e-6) {
459 UsedHitSpan_t usedHits{allUsedHits[
i], allUsedHits[j], allUsedHits[
k], allUsedHits[
l]};
466 usedExtensionHits.reserve(stripHitsLayers.size());
467 extensionLayers.reserve(stripHitsLayers.size());
468 for (std::size_t
e = 0 ;
e < stripHitsLayers.size(); ++
e) {
469 if (!(
e ==
i ||
e == j ||
e ==
k ||
e ==
l)){
470 extensionLayers.emplace_back(stripHitsLayers[
e]);
471 usedExtensionHits.emplace_back(allUsedHits[
e]);
476 for (
auto &combinatoricHits : preLimSeeds) {
488 seeds.push_back(std::move(seed));
495 markHitsAsUsed(seeds.back()->getHitsInMax(), stripHitsLayers, allUsedHits, 1,
false);
503 segMeasSP.reserve(segment->measurements().size());
505 segment->measurements().end(),
506 std::back_inserter(segMeasSP),
507 [](
const auto&
m) { return m->spacePoint(); });
509 markHitsAsUsed(segMeasSP, stripHitsLayers, allUsedHits, 10,
true);
510 segments.push_back(std::move(segment));
520 m_seedCounter->addToStat(
max.msSector(), nSeeds, nExtSeeds, nSegments);
523 return std::make_pair(std::move(seeds),std::move(segments));
◆ fitSegmentSeed()
Fit the segment seed.
- Parameters
-
| gctx | The reference to the Geometry Context |
| patternSeed | The pointer to the seed of which we fit the calibrated space points |
Definition at line 356 of file NswSegmentFinderAlg.cxx.
364 patternSeed->localPosition(), patternSeed->localDirection(), 0.);
366 const Amg::Transform3D& locToGlob{patternSeed->msSector()->localToGlobalTrans(gctx)};
368 auto segment =
m_lineFitter->fitSegment(ctx, patternSeed, patternSeed->parameters(),
369 locToGlob, std::move(calibratedHits));
◆ hitFromIPCorridor()
The hit is above the predefined corridor.
Tests whether a hit is inside the corridor defined by line connecting the centre of the first candidate hit in the seed and the beam spot. The theta angle is varied by m_windowTheta to define the lower & upper direction etimate. The function tests whether the strip then crosses the corridor.
- Parameters
-
| testHit | Reference to the hit to test |
| beamSpotPos | Position of the beam spot serving as starting point |
| dirEstUp | Direction vector defining the upper limit of the corridor |
| dirEstDn | Direction vector defining the lower limit of the corridor |
Calculate the strip edges
Check whether the both edges are below the lower estimated muon arrival
Analogous check for the upper edge
No extrapolation needed
Analogous check for the upper edge
Definition at line 120 of file NswSegmentFinderAlg.cxx.
125 const Amg::Vector3D estPlaneArrivalUp = SeedingAux::extrapolateToPlane(beamSpotPos, dirEstUp, testHit);
126 const Amg::Vector3D estPlaneArrivalDn = SeedingAux::extrapolateToPlane(beamSpotPos, dirEstDn, testHit);
128 bool below{
true}, above{
true};
133 const double halfLength = 0.5* stripHalfLength(testHit);
135 const Amg::Vector3D leftEdge = testHit.localPosition() - halfLength * testHit.sensorDirection();
136 const Amg::Vector3D rightEdge = testHit.localPosition() + halfLength * testHit.sensorDirection();
139 below = estPlaneArrivalDn.y() >
std::max(leftEdge.y(), rightEdge.y());
141 above = estPlaneArrivalUp.y() <
std::min(leftEdge.y(), rightEdge.y());
146 const double hY = testHit.localPosition().y();
147 below = estPlaneArrivalDn.y() > hY;
149 above = estPlaneArrivalUp.y() < hY;
161 << (below || above ?
" is outside the window" :
" is inside the window"));
◆ initialize()
| StatusCode MuonR4::NswSegmentFinderAlg::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 61 of file NswSegmentFinderAlg.cxx.
71 ATH_MSG_ERROR(
"MM or STGC not part of initialized detector layout");
72 return StatusCode::FAILURE;
75 SegmentLineFitter::Config fitCfg{};
80 m_lineFitter = std::make_unique<SegmentFit::SegmentLineFitter>(
name(), std::move(fitCfg));
84 m_seedCounter = std::make_unique<SeedStatistics>();
87 return StatusCode::SUCCESS;
◆ 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()
◆ markHitsAsUsed()
Hits that are used in a good seed/segment built should be flagged as used and not contribute to other seed.
- Parameters
-
| spacePoints | The space points to be marked as used |
| allSortHits | All the available hits |
| usedHitMarker | The book keeping of the hits |
| increase | The hit counter increase |
| markNeighborHits | Flag wether to mark hits on the layer in the vicinity |
Definition at line 527 of file NswSegmentFinderAlg.cxx.
533 SpacePointPerLayerSorter layerSorter{};
541 unsigned int measLayer = layerSorter.sectorLayerNum(*sp);
544 double spPosX = sp->primaryMeasurement()->localPosition<1>().
x();
546 for (std::size_t lIdx = 0; !
found && lIdx < allSortHits.size(); ++lIdx) {
547 const HitVec& hVec{allSortHits[lIdx]};
549 unsigned int hitLayer = layerSorter.sectorLayerNum(*hVec.front());
550 if(hitLayer != measLayer){
551 ATH_MSG_VERBOSE(
"Not in the same layer since measLayer = "<< measLayer <<
" and "<<hitLayer);
555 for (std::size_t hIdx = 0 ; hIdx < hVec.size(); ++hIdx) {
558 auto testHit = hVec[hIdx];
561 usedHitMarker[lIdx][hIdx] += incr;
563 if(!markNeighborHits){
569 double deltaX = std::abs(testHit->primaryMeasurement()->localPosition<1>().x() - spPosX);
571 usedHitMarker[lIdx][hIdx] += incr;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ 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.
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ 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.
◆ updateVHKA()
◆ ATLAS_THREAD_SAFE
| std::unique_ptr<SeedStatistics> m_seedCounter MuonR4::NswSegmentFinderAlg::ATLAS_THREAD_SAFE {} |
|
private |
◆ m_calibTool
◆ m_detStore
◆ m_dumpSeedStatistics
| BooleanProperty MuonR4::NswSegmentFinderAlg::m_dumpSeedStatistics {this, "dumpStatistics", true} |
|
private |
◆ m_etaKey
◆ 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_lineFitter
◆ m_markHitsFromSeed
| BooleanProperty MuonR4::NswSegmentFinderAlg::m_markHitsFromSeed {this, "markHitsFromSeed", true} |
|
private |
◆ m_maxChi2
| DoubleProperty MuonR4::NswSegmentFinderAlg::m_maxChi2 {this, "maxChi2", 6.} |
|
private |
◆ m_maxClustersInLayer
| DoubleProperty MuonR4::NswSegmentFinderAlg::m_maxClustersInLayer {this, "maxClustersInLayer", 8} |
|
private |
◆ m_maxdYWindow
| DoubleProperty MuonR4::NswSegmentFinderAlg::m_maxdYWindow {this, "maxdYWindow", 4.*Gaudi::Units::cm} |
|
private |
◆ m_maxInvalidClusters
| DoubleProperty MuonR4::NswSegmentFinderAlg::m_maxInvalidClusters {this, "maxInvalidClusters", 4.} |
|
private |
◆ m_maxUsed
| UnsignedIntegerProperty MuonR4::NswSegmentFinderAlg::m_maxUsed {this, "maxHitIsUsed", 6} |
|
private |
◆ m_minClusSize
| DoubleProperty MuonR4::NswSegmentFinderAlg::m_minClusSize {this, "minClusterSize", 1.} |
|
private |
◆ m_minPullThreshold
| DoubleProperty MuonR4::NswSegmentFinderAlg::m_minPullThreshold {this, "maxPull", 5.} |
|
private |
◆ m_minSeedHits
| DoubleProperty MuonR4::NswSegmentFinderAlg::m_minSeedHits {this, "minSeedHits", 6.} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_visionTool
◆ m_windowTheta
| DoubleProperty MuonR4::NswSegmentFinderAlg::m_windowTheta {this, "thetaWindow", 0.5 * Gaudi::Units::deg} |
|
private |
◆ m_writeSegmentKey
◆ m_writeSegmentSeedKey
The documentation for this class was generated from the following files:
constexpr unsigned int minLayers
BooleanProperty m_markHitsFromSeed
double stereoAngle() const
Returns the value of the stereo angle.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::vector< std::reference_wrapper< const HitVec > > HitLaySpan_t
Abbrivation of the space comprising multiple hit vectors without copy.
const SpectrometerSector * msSector() const
Returns the pointer to the envelope volume enclosing all chambers in the sector.
Identifier identify() const
Returns the global ATLAS identifier of the SimHit.
StripOrient
Enumeration to classify the orientation of a NSW strip
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
@ tooHigh
The hit is inside the defined window and hence an initial candidate.
std::unique_ptr< SegmentFit::SegmentLineFitter > m_lineFitter
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)
std::unique_ptr< SegmentSeed > buildSegmentSeed(const InitialSeed_t &initialSeed, const AmgSymMatrix(2)&bMatrix, const HoughMaximum &max, const HitLaySpan_t &extensionLayers, const UsedHitSpan_t &usedHits) const
Build the final seed from the initial seed hits and then attempt to append hits from the complementar...
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
#define TEST_HIT_CORRIDOR(LAYER, HIT_ITER, START_LAYER)
Macro to check whether a hit is compatible with the hit corridor.
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
@ Unknown
Combined 2D space point (sTGC wire + strip / sTgc pad)
DoubleProperty m_windowTheta
#define ATH_MSG_VERBOSE(x)
UnsignedIntegerProperty m_maxUsed
void constructPrelimnarySeeds(const Amg::Vector3D &beamSpot, const HitLaySpan_t &combinatoricLayers, const UsedHitSpan_t &usedHits, InitialSeedVec_t &outVec) const
Construct a set of prelimnary seeds from the selected combinatoric layers.
std::unique_ptr< TLatex > drawLabel(const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
Create a TLatex label,.
SG::WriteHandleKey< SegmentContainer > m_writeSegmentKey
ToolHandle< MuonValR4::IPatternVisualizationTool > m_visionTool
Pattern visualization tool.
#define AmgSymMatrix(dim)
void markHitsAsUsed(const HitVec &spacePoints, const HitLayVec &allSortHits, UsedHitMarker_t &usedHitMarker, unsigned int increase, bool markNeighborHits) const
Hits that are used in a good seed/segment built should be flagged as used and not contribute to other...
virtual void setOwner(IDataHandleHolder *o)=0
@ inside
The hit is below the predefined corridor.
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.
double houghTanBeta(const Amg::Vector3D &v)
Returns the hough tanBeta [y] / [z].
SG::ReadHandleKey< EtaHoughMaxContainer > m_etaKey
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
int multilayer() const
Returns the multi layer of the element [1-2].
DoubleProperty m_maxdYWindow
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.
ToolHandle< ISpacePointCalibrator > m_calibTool
::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
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Acts::Experimental::CompositeSpacePointLineFitter::ParamVec_t Parameters
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
ConstVectorMap< 3 > localDirection() const
Returns the local direction of the traversing particle.
std::pair< std::vector< std::unique_ptr< SegmentSeed > >, std::vector< std::unique_ptr< Segment > > > findSegmentsFromMaximum(const HoughMaximum &max, const ActsTrk::GeometryContext &gctx, const EventContext &ctx) const
Find seed and segment from an eta hough maximum.
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.
StripOrient classifyStrip(const SpacePoint &spacePoint) const
Determines the orientation of the strip space point.
const StripDesign & design(bool phiView=false) const
Returns the underlying strip design.
std::vector< std::reference_wrapper< std::vector< unsigned int > >> UsedHitSpan_t
Abbrivation of the container to pass a subset of markers wtihout copy.
@ X
Stereo strips with negative angle.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
SG::WriteHandleKey< SegmentSeedContainer > m_writeSegmentSeedKey
const StripLayer & stripLayer(const Identifier &measId) const
HitVec extendHits(const Amg::Vector3D &startPos, const Amg::Vector3D &direction, const HitLaySpan_t &extensionLayers, const UsedHitSpan_t &usedHits) const
Extend the seed with the hits from the other layers.
DoubleProperty m_minPullThreshold
BooleanProperty m_dumpSeedStatistics
Eigen::Matrix< double, 3, 1 > Vector3D
Amg::Vector3D dirFromAngles(const double phi, const double theta)
Constructs a direction vector from the azimuthal & polar angles.
std::vector< InitialSeed_t > InitialSeedVec_t
Vector of initial seeds.
DoubleProperty m_minSeedHits
#define ATH_MSG_WARNING(x)
ISpacePointCalibrator::CalibSpacePointVec CalibSpacePointVec
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
std::unique_ptr< Segment > fitSegmentSeed(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const SegmentSeed *patternSeed) const
Fit the segment seed.
ConstVectorMap< 3 > localPosition() const
Returns the local postion of the traversing particle.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
@ V
Stereo strips with positive angle.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
const xAOD::MuonSimHit * getTruthMatchedHit(const xAOD::UncalibratedMeasurement &prdHit)
Returns the MuonSimHit, if there's any, matched to the uncalibrated muon measurement.
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
bool hasStereoAngle() const
Returns whether a stereo angle is defined.
SpacePointPerLayerSplitter::HitLayVec HitLayVec
DataVector< HoughMaximum > EtaHoughMaxContainer
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
double houghTanAlpha(const Amg::Vector3D &v)
: Returns the hough tanAlpha [x] / [z]
std::vector< std::vector< unsigned int > > UsedHitMarker_t
Abbrivation of the container book keeping whether a hit is used or not.
@ C
Single phi measurements.
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment
SpacePointPerLayerSplitter::HitVec HitVec
UsedHitMarker_t emptyBookKeeper(const HitLayVec &sortedSp) const
Constructs an empty HitMarker from the split space points.