4#ifndef MUONTRACKFINDINGTEST_MSTRACKTESTER_H
5#define MUONTRACKFINDINGTEST_MSTRACKTESTER_H
43 StatusCode
execute(
const EventContext& ctx)
override final;
44 StatusCode
finalize()
override final;
52 std::optional<MuonR4::MsTrackSeed>
makeSeedFromTruth(
const Acts::GeometryContext& tgContext,
60 std::pair<double, double>
calcSeedLength(
const Acts::GeometryContext& tgContext,
75 const EventContext& ctx)
const;
82 const EventContext& ctx)
const;
85 const EventContext& ctx)
const;
114 const EventContext& ctx);
128 Gaudi::Property<bool>
m_isMC{
this,
"isMC",
false};
130 Gaudi::Property<bool>
m_storeID{
this,
"storeIdTrks",
true};
159 ToolHandle<MuonR4::ITrackSummaryTool>
m_summaryTool{
this,
"SummaryTool" ,
""};
161 ToolHandle<MuonR4::ITrackSeedingDiagnosticsTool>
m_seedingTool{
this,
"SeedingTool",
""};
163 ToolHandle<MuonR4::ISegmentSelectionTool>
m_segSelector{
this,
"SegmentSelectionTool" ,
"" };
177 Gaudi::Property<double>
m_toleranceX0{
this,
"toleranceX0", 20.*Gaudi::Units::cm};
180 Gaudi::Property<double>
m_toleranceY0{
this,
"toleranceY0", 5.*Gaudi::Units::cm};
186 Gaudi::Property<double>
m_tolerancePhi{
this,
"tolerancePhi", 2.*Gaudi::Units::deg};
Property holding a SG store/key/clid from which a ReadHandle is made.
Utility class to handle the three contexts neeeded in an ACTS reconstruction job 1) GeometryContext -...
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
SectorProjector
Enumeration to select the sector projection of the regular MS sector.
Location
Enum defining whether the seed is made in the endcap / barrel.
Baseline EDM object to gather all relevant information about a reconstructed muon candidate which can...
ToolHandle< MuonR4::ITrackSeedingDiagnosticsTool > m_seedingTool
The track seeding tool to construct the seed candidates and to estimate the initial parameters.
const MuonGMR4::MuonDetectorManager * m_detMgr
The detector manager to fetch the segment surfaces.
MuonVal::ScalarBranch< std::uint16_t > & m_nIdTags
The number of selected ID tracks in the event.
std::shared_ptr< MuonPRDTest::SegmentVariables > SegmentBranchPtr_t
Abrivation of the branches containing sement information.
ToolHandle< MuonR4::ITrackSummaryTool > m_summaryTool
Hit summary tool.
StatusCode dumpLegacyTracks(const EventContext &ctx)
Dumps the legacy containers to the TTree.
SG::ReadHandleKey< xAOD::MuonContainer > MuonKey_t
Abrivate the key type for the muon container.
SegmentKey_t m_legacySegmentKey
Legacy segment container.
const MuonR4::MuonTag * findBaseIdTag(const xAOD::TrackParticle &idTrack, const EventContext &ctx) const
Searches the Id track in the basline collection of all ID tracks selected for the combined muon recon...
MuonR4::MsTrackSeed::Location Location
const MuonGMR4::SpectrometerSector * getEnvelope(const xAOD::MuonSegment &segment) const
MuonTagKey_t m_idTagKey
The collection of all ID tracks that are selected for combined reconstruction.
TrackKey_t m_idTrackKey
The collection of ID tracks associated with the truth particle.
MuonVal::VectorBranch< unsigned short > & m_legacySegToTrkLinks
Link of the legacy track to the legacy segment.
ParticleBranchPtr_t m_truthTrks
MuonVal::VectorBranch< int > & m_seedSector
Sector of the seed, even center, odd overlap regions, for details see:
MuonVal::VectorBranch< float > & m_seedThetaCone
Maximum angular difference between the segments part of the seed.
ParticleBranchPtr_t m_legacyTrks
Output branches of the legacy MS tracks.
SegmentBranchPtr_t m_truthSegs
SegmentBranchPtr_t m_legacyRecoSegs
std::unordered_set< const xAOD::MuonSimHit * > TruthHitCol
MuonVal::ScalarBranch< std::uint16_t > & m_nIdTracks
The number of ID tracks in the event.
MuonVal::MatrixBranch< unsigned short > & m_truthMuRecoSegLinks
Links from the truth muon to the segments.
std::unique_ptr< const Acts::Logger > m_logger
Instance to the Acts logger.
MuonVal::MatrixBranch< unsigned short > & m_truthMuToSeedIdx
Links to all MsTrkSeeds that could be matched to the truthMuon, i.e.
TrackKey_t m_legacyTrackKey
Legacy track reconstruction chain.
MuonR4::ExpandedSector::SectorProjector SectorProjector
std::pair< double, double > calcSeedLength(const Acts::GeometryContext &tgContext, const MuonR4::MsTrackSeed &seed) const
Calculate the length of the seed and the theta deflection angle The length is defined as the spread o...
StatusCode execute(const EventContext &ctx) override final
Execute method.
SegmentTagVariables calcSegTagVariables(const xAOD::TrackParticle &idTrack, const EventContext &ctx)
MuonTagKey_t m_segTagKey
The collection of the original segment tags.
std::shared_ptr< MuonVal::IParticleFourMomBranch > ParticleBranchPtr_t
MuonVal::VectorBranch< char > & m_seedType
Is the seed in the encap or in the barrel chambers.
StatusCode dumpRecoContent(const EventContext &ctx)
Dump the reconstructed information.
SG::ReadHandleKey< MuonR4::MuonTagContainer > MuonTagKey_t
Abrivate the muon tag container.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthKey
Key to the truth particle collection.
SG::ReadHandleKey< xAOD::TrackParticleContainer > TrackKey_t
Abrivate the key type for the track particle container.
Gaudi::Property< double > m_toleranceTheta
Extra tolerance applied on the bending direction when calculating the matching score.
Gaudi::Property< bool > m_isMC
Toggle whether the job runs on MC or not.
ParticleBranchPtr_t m_muonTrks
Stored muon information from the Acts muon reco chain.
MuonVal::MatrixBranch< unsigned short > & m_truthSegToRecoLink
Link of the truth segments to the matchin reco segments.
Gaudi::Property< double > m_toleranceX0
Extra tolerance applied on the non-bending intercept when calculating the matching score.
SegmentBranchPtr_t m_recoSegs
StatusCode dumpTruthContent(const EventContext &ctx)
Dump truth information.
SG::ReadHandleKey< MuonR4::MsTrackSeedContainer > m_msTrkSeedKey
Temporary container write handle to push the seeds to store gate for later efficiency analysis.
Gaudi::Property< bool > m_storeID
Toggle whether to process ID tracks or not.
SG::ReadDecorHandleKeyArray< SG::AuxVectorBase > m_trkTruthLinks
Decoration dependency to the MS truth track links.
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
Track extrapolation tool.
const MuonR4::MuonTag * findMuTagIMO(const xAOD::TrackParticle &idTrack, const EventContext &ctx) const
ParticleBranchPtr_t m_idTracks
Stored ID track information.
StatusCode initialize() override final
MuonVal::MatrixBranch< unsigned short > & m_seedRecoSegMatch
Link of the track seed to the building segment.
const xAOD::TruthParticle * truthTreeParticle(const xAOD::IParticle &part) const
Returns the matched truth particle that is dumped in the tree.
MuonVal::VectorBranch< float > & m_seedQP
Estimated momentum times charge from the track seed.
MuonVal::MatrixBranch< unsigned short > & m_truthMuToSeedCounter
Number of matched segments in the seed.
MuonVal::ThreeVectorBranch m_seedPos
Simple seed information.
Gaudi::Property< double > m_tolerancePhi
Extra tolerance applied on the bending direction when calculating the matching score.
SG::ReadHandleKey< xAOD::MuonSegmentContainer > SegmentKey_t
Abrivate the ReadHandleKey_t for the segment container.
MuonKey_t m_legacyMuonKey
Legacy muons.
MuonVal::VectorBranch< float > & m_seedLength
Maximum separation between the segments on the reference plane.
MuonVal::UnitThreeVectorBranch m_seedDir
Seed direction vector.
ToolHandle< MuonR4::ISegmentSelectionTool > m_segSelector
Selection tool to quantify the segment candidate quality.
SegmentKey_t m_recoSegmentKey
Primary segment container.
MuonVal::MuonTesterTree m_tree
The output tree object.
std::vector< const xAOD::MuonSegment * > getAssociatedSegments(const xAOD::TrackParticle &idTrack, const EventContext &ctx) const
Returns the collection of reconstructed segments that can be associated to the id track If the track ...
ActsTrk::ContextUtility m_ctxProvider
Context provider for geometry, magnetic field and calibration contexts.
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
SegmentKey_t m_truthSegmentKey
Segment from the truth hits.
MuonVal::VectorBranch< char > & m_seedGood
Does the seeding tool construct valid parameters from the seed.
const Acts::Logger & logger() const
Return the reference to the Acts logger.
std::optional< MuonR4::MsTrackSeed > makeSeedFromTruth(const Acts::GeometryContext &tgContext, const xAOD::TruthParticle &truthMuon) const
Construct MS track seed from the truth associated segments.
StatusCode finalize() override final
std::shared_ptr< TrackSummaryModule > m_seedSummary
Hit summary on the track seed.
Gaudi::Property< double > m_toleranceY0
Extra tolerance applied on the bending intercept when calculating the matching score.
MuonVal::VectorBranch< unsigned short > & m_seedTruthLink
Link to the truth muon.
MuonKey_t m_muonKey
Dependency on the R4 muon container.
Property holding a SG store/key/clid from which a ReadHandle is made.
Class providing the definition of the 4-vector interface.
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Searched the MuTagIMO tag.
std::vector< float > matchScores
chi2 scores of the matching procedure
std::vector< std::uint8_t > recoSegs
Indices of the matched segments in the tree.
std::vector< std::uint8_t > taggedSeg
Flags indicating whether the segment made it onto MuTagIMO.
std::vector< float > deltaTheta
Difference in theta between ID and segment parameters.
std::vector< float > deltaX0
Difference in x0 between ID and segment parameters.
std::vector< float > deltaPhi
Difference in phi between ID and segment parameters.
std::vector< std::uint8_t > goodExtp
Is the extrapolation to the surface good.
std::vector< float > deltaY0
Difference in y0 between ID and segment parameters.