ATLAS Offline Software
Loading...
Searching...
No Matches
MsTrackTester.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#include "MsTrackTester.h"
5
14
15#include "Acts/Definitions/Units.hpp"
16
17#include <format>
18
19using namespace MuonVal;
20using namespace MuonPRDTest;
21using namespace MuonR4;
22using namespace Acts::UnitLiterals;
23
24namespace {
26 using SegLinkVec_t = std::vector<SegLink_t>;
27 static const SG::ConstAccessor<SegLinkVec_t> acc_truthSegLinks{"truthSegmentLinks"};
28 constexpr double MeVtoGeV = 1.e-3;
29
30 using Location = MsTrackSeeder::Location;
31
32
33 constexpr int overlapSector(const int sec1 , const int sec2) {
34 constexpr int nSec = Muon::MuonStationIndex::numberOfSectors();
35 if (sec2 > sec1) return overlapSector(sec2, sec1);
36 if (sec1 == 1 && sec2 == nSec) return 0;
37 return sec1 + sec2;
38 }
39
40}
41
42namespace MuonValR4 {
43 std::optional<MsTrackSeed> MsTrackTester::makeSeedFromTruth(const ActsTrk::GeometryContext& gctx,
44 const xAOD::TruthParticle& truthMuon) const {
45 int secMax{-1}, secMin{100};
46 std::vector<const xAOD::MuonSegment*> matchedSegs = MuonR4::getTruthSegments(truthMuon);
47 if (matchedSegs.empty()) {
48 return std::nullopt;
49 }
50 for (const xAOD::MuonSegment* seg : matchedSegs) {
51 secMax = std::max(secMax, seg->sector());
52 secMin = std::min(secMin, seg->sector());
53 }
54 const int orSec = overlapSector(secMax, secMin);
56 MsTrackSeed barrelSeed{Location::Barrel, orSec};
57 MsTrackSeed endcapSeed{Location::Endcap, orSec};
58 for (const xAOD::MuonSegment* seg : matchedSegs) {
59 barrelSeed.addSegment(seg);
60 endcapSeed.addSegment(seg);
61 }
62 barrelSeed.setPosition(matchedSegs[0]->position());
63 endcapSeed.setPosition(matchedSegs[0]->position());
64 const auto [barrelLength, barrelTheta] = calcSeedLength(gctx, barrelSeed);
65 const auto [endcapLength, endcapTheta] = calcSeedLength(gctx, endcapSeed);
66 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Constructed new seed from truth muon wih pT:"
67 <<(truthMuon.pt()/ Gaudi::Units::GeV)<<" [GeV], eta: "<<truthMuon.eta()
68 <<", phi: "<<(truthMuon.phi() / 1._degree)<<", q: "<<truthMuon.charge()
69 <<", matchedSeg: "<<matchedSegs.size()<< " barrel (L/theta): "<<barrelLength
70 <<"/"<<(barrelTheta / 1._degree)<<" - endcap (L/theta): "
71 <<endcapLength<<"/"<<(endcapTheta / 1._degree)<<"\n"<<barrelSeed);
72 if (barrelLength < 0 && endcapLength < 0) {
73 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Invalid seed");
74 return std::nullopt;
75 }
76 return barrelLength < 0 || std::abs(endcapLength) < barrelLength
77 ? endcapSeed : barrelSeed;
78 }
79
80 std::pair<double, double> MsTrackTester::calcSeedLength(const ActsTrk::GeometryContext& gctx,
81 const MuonR4::MsTrackSeed& seed) const {
82 double maxL{-1.*Gaudi::Units::km}, minL{1.*Gaudi::Units::km},
83 maxTheta{-M_PI}, minTheta{M_PI};
84 for (const xAOD::MuonSegment* seg : seed.segments()) {
85 const auto secProj = m_seeder->projectorFromSeed(*seg, seed);
86 const Amg::Vector2D projPos{m_seeder->expressOnCylinder(gctx, *seg, seed.location(), secProj)};
87 if (!m_seeder->withinBounds(projPos, seed.location())) {
88 continue;
89 }
90 const double projected = projPos[seed.location()==Location::Barrel];
91 const double theta = seg->direction().theta();
92 minL = std::min(minL, projected);
93 maxL = std::max(maxL, projected);
94 minTheta = std::min(minTheta, theta);
95 maxTheta = std::max(maxTheta, theta);
96 }
97 return std::make_pair(maxL - minL, maxTheta - minTheta);
98 }
101 ATH_CHECK(m_truthKey.initialize(m_isMC));
102 ATH_CHECK(m_msTrkSeedKey.initialize());
103 ATH_CHECK(m_recoSegmentKey.initialize());
104 ATH_CHECK(m_segSelector.retrieve());
105 ATH_CHECK(m_geoCtxKey.initialize());
106 ATH_CHECK(m_fieldCacheKey.initialize());
107 ATH_CHECK(m_trackKey.initialize());
108 ATH_CHECK(m_summaryTool.retrieve());
109 ATH_CHECK(m_legacyTrackKey.initialize(!m_legacyTrackKey.empty()));
110 ATH_CHECK(detStore()->retrieve(m_detMgr));
111
112 MsTrackSeeder::Config seederCfg{};
113 seederCfg.detMgr = m_detMgr;
114 seederCfg.seedHalfLength = 2.*Gaudi::Units::m;
115 seederCfg.endcapDiscRadius = 40.*Gaudi::Units::m;
116 m_seeder = std::make_unique<MuonR4::MsTrackSeeder>(name(), std::move(seederCfg));
117
118 int evOpts{0};
119
120 m_recoSegs = std::make_unique<SegmentVariables>(m_tree, m_recoSegmentKey.key(), "Segments", msgLevel());
122 "Segments_passSeedQual",[this](const SG::AuxElement* aux){
123 const auto* seg = static_cast<const xAOD::MuonSegment*>(aux);
124 return m_segSelector->passSeedingQuality(Gaudi::Hive::currentContext(),
125 *MuonR4::detailedSegment(*seg)); }));
127 "Segments_passTrackQual",[this](const SG::AuxElement* aux){
128 const auto* seg = static_cast<const xAOD::MuonSegment*>(aux);
129 return m_segSelector->passTrackQuality(Gaudi::Hive::currentContext(),
131 }));
132 if (m_isMC) {
133 evOpts |= EventInfoBranch::isMC;
135 "Segments_truthSegLink",[this](const SG::AuxElement* aux){
136 const auto* seg = static_cast<const xAOD::MuonSegment*>(aux);
138 const unsigned linkIdx = truthS ? m_truthSegs->push_back(*truthS) : -1;
140 if (truthS) {
141 m_truthSegToRecoLink.push_back(linkIdx, m_recoSegs->push_back(*seg));
142 const xAOD::TruthParticle* truthMuon = MuonR4::getTruthMatchedParticle(*truthS);
143 if (truthMuon){
144 m_truthTrks->push_back(truthMuon);
145 m_truthMuRecoSegLinks[m_truthTrks->find(truthMuon)].push_back(m_recoSegs->push_back(*seg));
146 }
147 }
148 return linkIdx;
149 }));
150
151 m_truthSegs = std::make_unique<SegmentVariables>(m_tree, m_truthSegmentKey.key(), "TruthSegments", msgLevel());
152
154 "TruthSegments_truthLink",[this](const SG::AuxElement* aux){
155 const auto* seg = static_cast<const xAOD::MuonSegment*>(aux);
157 m_truthTrks->push_back(truthP);
158 unsigned short linkIdx = m_truthTrks->find(truthP);
159 return linkIdx;
160 }));
162 "TruthSegments_hasBarrelProj", [this](const SG::AuxElement* aux){
163 const auto* seg = static_cast<const xAOD::MuonSegment*>(aux);
164 const ActsTrk::GeometryContext* gctx{nullptr};
165 SG::get(gctx, m_geoCtxKey, Gaudi::Hive::currentContext()).ignore();
167 for (const auto proj : {leftOverlap, center, rightOverlap}) {
168 const Amg::Vector2D projPos{m_seeder->expressOnCylinder(*gctx, *seg, Location::Barrel, proj)};
169 if (m_seeder->withinBounds(projPos, Location::Barrel)) {
170 return 1;
171 }
172 }
173 return 0;
174 }));
175
177 "TruthSegments_hasEndcapProj", [this](const SG::AuxElement* aux){
178 const auto* seg = static_cast<const xAOD::MuonSegment*>(aux);
179 const ActsTrk::GeometryContext* gctx{nullptr};
180 SG::get(gctx, m_geoCtxKey, Gaudi::Hive::currentContext()).ignore();
182 for (const auto proj : {leftOverlap, center, rightOverlap}) {
183 const Amg::Vector2D projPos{m_seeder->expressOnCylinder(*gctx, *seg, Location::Endcap, proj)};
184 if (m_seeder->withinBounds(projPos, Location::Endcap)) {
185 return 1;
186 }
187 }
188 return 0;
189 }));
190 m_tree.addBranch(m_truthSegs);
191
192 m_truthTrks = std::make_unique<IParticleFourMomBranch>(m_tree, "TruthMuons");
193 m_tree.addBranch(m_truthTrks);
194 m_trkTruthLinks.emplace_back(m_truthSegmentKey, "truthParticleLink");
195 m_trkTruthLinks.emplace_back(m_truthKey, "truthSegmentLinks");
196 m_trkTruthLinks.emplace_back(m_recoSegmentKey, "truthSegmentLink");
197 }
198
199 m_tree.addBranch(m_recoSegs);
200 m_tree.addBranch(std::make_unique<EventInfoBranch>(m_tree, evOpts));
201 m_tree.addBranch(std::make_unique<TrackContainerModule>(m_tree, m_trackKey.key(), msgLevel()));
202
203 if(!m_legacyTrackKey.empty()) {
204 m_legacyTrks = std::make_unique<IParticleFourMomBranch>(m_tree, "LegacyMSTrks");
205 m_legacyTrks->addVariable(std::make_unique<TrackChi2Branch>(*m_legacyTrks));
206 if (m_isMC) {
208 return xAOD::TruthHelpers::getTruthParticle(*trk); }, "truth", "LegacyMS");
209 }
210 for (const auto& summary :{
211 // Inner
212 "innerSmallHits", "innerLargeHits", "innerSmallHoles", "innerLargeHoles",
213 // Middle
214 "middleSmallHits", "middleLargeHits", "middleSmallHoles",
215 "middleLargeHoles",
216 // Outer
217 "outerSmallHits", "outerLargeHits", "outerSmallHoles", "outerLargeHoles",
218 // Extended
219 "extendedSmallHits", "extendedLargeHits", "extendedSmallHoles",
220 "extendedLargeHoles",
221 "etaLayer1Hits", "phiLayer1Hits", "etaLayer2Hits", "phiLayer2Hits",
222 "etaLayer3Hits", "phiLayer3Hits", "etaLayer4Hits", "phiLayer4Hits",
223 "etaLayer1Holes", "phiLayer1Holes", "etaLayer2Holes", "phiLayer2Holes",
224 "etaLayer3Holes", "phiLayer3Holes", "etaLayer4Holes", "phiLayer4Holes" }) {
225 m_legacyTrks->addVariable<uint8_t>(-1, summary);
226 }
227
228 m_tree.addBranch(m_legacyTrks);
229 }
230
231
232 m_seedSummary = std::make_shared<TrackSummaryModule>(m_tree, "MsTrkSeed", m_summaryTool.get());
233 m_trackSummary = std::make_shared<TrackSummaryModule>(m_tree, "ActsMsTracks", m_summaryTool.get());
234 m_tree.addBranch(m_seedSummary);
235 m_tree.addBranch(m_trackSummary);
236
237 ATH_CHECK(m_trkTruthLinks.initialize());
238 ATH_CHECK(m_tree.init(this));
239 return StatusCode::SUCCESS;
240 }
242 const EventContext& ctx{Gaudi::Hive::currentContext()};
243
244 const xAOD::TrackParticleContainer* legacyTrks{nullptr};
245 ATH_CHECK(SG::get(legacyTrks, m_legacyTrackKey, ctx));
246 if (legacyTrks){
247 for (const xAOD::TrackParticle* track : *legacyTrks) {
248 m_summaryTool->copySummary(m_summaryTool->makeSummary(ctx, *track->track()),
249 *track);
250 m_legacyTrks->push_back(track);
251 }
252 }
254 const xAOD::MuonSegmentContainer* recoSegments{nullptr};
255 ATH_CHECK(SG::get(recoSegments, m_recoSegmentKey, ctx));
256 if (recoSegments->empty()){
257 return StatusCode::SUCCESS;
258 }
259 const MuonR4::MsTrackSeedContainer* trkSeeds{nullptr};
260 ATH_CHECK(SG::get(trkSeeds, m_msTrkSeedKey, ctx));
261 const ActsTrk::GeometryContext* gctx{nullptr};
262 ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
263 const AtlasFieldCacheCondObj* magCache{nullptr};
264 ATH_CHECK(SG::get(magCache, m_fieldCacheKey, ctx));
265
266 std::map<const xAOD::TruthParticle*, std::vector<unsigned>> truthToSeedMatchCounter{};
267 for (const MuonR4::MsTrackSeed& seed : *trkSeeds) {
268 unsigned int seedIdx = m_seedPos.size();
269 m_seedPos += seed.position();
270 m_seedType+= Acts::toUnderlying(seed.location());
271 m_seedSummary->push_back(ctx, seed);
272 ATH_MSG_VERBOSE(" Dump new seed: "<<seed);
273 for (const xAOD::MuonSegment* seg : seed.segments()){
274 m_seedRecoSegMatch[seedIdx].push_back(m_recoSegs->push_back(*seg));
275 if (const xAOD::MuonSegment* truthSeg = MuonR4::getMatchedTruthSegment(*seg);
276 truthSeg != nullptr) {
277 std::vector<unsigned>& matchCounter = truthToSeedMatchCounter[MuonR4::getTruthMatchedParticle(*truthSeg)];
278 if (seedIdx >= matchCounter.size()) {
279 matchCounter.resize(seedIdx +1);
280 }
281 ++matchCounter[seedIdx];
282 }
283 }
284 const auto[seedLength, theta] = calcSeedLength(*gctx, seed);
285 m_seedLength+= seedLength;
287 m_seedQP += m_seeder->estimateQtimesP(*gctx, *magCache, seed) / Gaudi::Units::GeV;
288 }
289 for (const xAOD::MuonSegment* seg : *recoSegments) {
290 m_recoSegs->push_back(*seg);
291 }
293 const xAOD::MuonSegmentContainer* truthSegs{nullptr};
294 ATH_CHECK(SG::get(truthSegs, m_truthSegmentKey, ctx));
295 if (truthSegs) {
296 for (const xAOD::MuonSegment* seg : *truthSegs) {
297 ATH_MSG_VERBOSE(std::format( "Dump truth segment {:} @{:}, eta: {:.2f}, phi {:.2f}",
298 printID(*seg), Amg::toString(seg->position()),
299 seg->direction().eta(), seg->direction().phi() / 1._degree));
300 m_truthSegs->push_back(*seg);
301 }
302 if (truthSegs->size()) {
303 m_truthSegToRecoLink[truthSegs->size()-1];
304 }
305 }
307 const xAOD::TruthParticleContainer* truthMuons{nullptr};
308 ATH_CHECK(SG::get(truthMuons, m_truthKey, ctx));
309 if (truthMuons && truthMuons->size()) {
311 m_truthMuToSeedIdx[truthMuons->size() -1];
312 m_truthMuToSeedCounter[truthMuons->size() -1];
313 m_truthMuTruthSegLinks[truthMuons->size() -1];
314 m_truthMuRecoSegLinks[truthMuons->size() -1];
315
316 for (const xAOD::TruthParticle* truth : *truthMuons) {
317 ATH_MSG_DEBUG("Truth muon: pT: "<<(truth->pt() *MeVtoGeV)<<", eta: "<<truth->eta()
318 <<", phi: "<<(truth->phi() / 1._degree)<<", q: "<<truth->charge());
319
320 m_truthTrks->push_back(*truth);
321 unsigned truthIdx = m_truthTrks->find(truth);
322 std::vector<unsigned>& matchCounter = truthToSeedMatchCounter[truth];
323 std::vector<unsigned>::iterator maxSeed = matchCounter.begin();
325 while ( (maxSeed = std::ranges::max_element(matchCounter))!=matchCounter.end() && (*maxSeed) > 0) {
326 m_truthMuToSeedIdx[truthIdx].push_back(std::distance(matchCounter.begin(), maxSeed));
327 m_truthMuToSeedCounter[truthIdx].push_back(*maxSeed);
328 (*maxSeed) = 0;
329 }
330
331 std::vector<unsigned short>& truthSegLinks = m_truthMuTruthSegLinks[truthIdx];
332 const std::vector<const xAOD::MuonSegment*> truthSegs = getTruthSegments(*truth);
333 m_truthMuTruthNSegs += truthSegs.size();
334 for (const xAOD::MuonSegment* truthSeg: truthSegs) {
335 truthSegLinks.push_back(m_truthSegs->push_back(*truthSeg));
336 }
337
338 auto truthSeed = makeSeedFromTruth(*gctx, *truth);
339 if (!truthSeed) {
340 m_truthMuonsSeedLength[truthIdx] = -1;
341 m_truthMuonsSeedCone[truthIdx] = -1;
342 m_truthMuonQP[truthIdx] =0;
343 } else {
344 const auto [length, cone] = calcSeedLength(*gctx, *truthSeed);
345 m_truthMuonsSeedLength[truthIdx] = length;
346 m_truthMuonsSeedCone [truthIdx] = cone;
347 m_truthMuonQP[truthIdx] = m_seeder->estimateQtimesP(*gctx, *magCache, *truthSeed) / Gaudi::Units::GeV;
348 }
349
350 }
351 }
352 const ActsTrk::TrackContainer* msTracks{nullptr};
353 ATH_CHECK(SG::get(msTracks, m_trackKey, ctx));
354 for (const auto trk : *msTracks) {
355 m_trackSummary->push_back(ctx, trk);
356 }
357
358 ATH_CHECK(m_tree.fill(ctx));
359 return StatusCode::SUCCESS;
360 }
362 ATH_CHECK(m_tree.write());
363 return StatusCode::SUCCESS;
364 }
365}
#define M_PI
Scalar theta() const
theta method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
double length(const pvec &v)
Handle class for reading from StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
void addSegment(const xAOD::MuonSegment *seg)
Append a segment to the seed.
void setPosition(Amg::Vector3D &&pos)
set the seed's position
MsTrackSeed::Location Location
Enum toggling whether the segment is in the endcap or barrel.
SectorProjector
Enumeration to select the sector projection.
const MuonGMR4::MuonDetectorManager * m_detMgr
std::optional< MuonR4::MsTrackSeed > makeSeedFromTruth(const ActsTrk::GeometryContext &gctx, const xAOD::TruthParticle &truthMuon) const
Construct MS track seed from the truth associated segments.
ToolHandle< MuonR4::ITrackSummaryTool > m_summaryTool
Hit summary tool.
ParticleBranchPtr_t m_truthTrks
std::unique_ptr< MuonR4::MsTrackSeeder > m_seeder
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
MuonVal::MatrixBranch< unsigned short > & m_truthMuRecoSegLinks
Links from the truth muon to the segments.
MuonVal::MatrixBranch< unsigned short > & m_truthMuToSeedIdx
Links to all MsTrkSeeds that could be matched to the truthMuon, i.e.
StatusCode execute() override final
MuonVal::VectorBranch< float > & m_truthMuonQP
Estimated Q x P from the seeder algorithm class.
MuonVal::VectorBranch< float > & m_truthMuonsSeedLength
MuonVal::VectorBranch< char > & m_seedType
Is the seed in the encap or in the barrel chambers.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_legacyTrackKey
Legacy track reconstruction chain.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthKey
Key to the truth particle collection.
Gaudi::Property< bool > m_isMC
MuonVal::MatrixBranch< unsigned short > & m_truthSegToRecoLink
Link of the truth segments to the matchin reco segments.
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheKey
Dependency on the magnetic field.
SegmentBranchPtr_t m_recoSegs
SG::ReadHandleKey< MuonR4::MsTrackSeedContainer > m_msTrkSeedKey
Temporary container write handle to push the seeds to store gate for later efficiency analysis.
SG::ReadDecorHandleKeyArray< SG::AuxVectorBase > m_trkTruthLinks
Decoration dependency to the MS truth track links.
MuonVal::MatrixBranch< unsigned short > & m_truthMuTruthSegLinks
Links from the truth muon to the segments.
MuonVal::VectorBranch< float > & m_truthMuonsSeedCone
Angular deviation of the true segment seed.
StatusCode initialize() override final
MuonVal::MatrixBranch< unsigned short > & m_seedRecoSegMatch
Link of the track seed to the building segment.
MuonVal::VectorBranch< float > & m_seedQP
Estimated momentum times charge from the track seed.
MuonVal::MatrixBranch< unsigned short > & m_truthMuToSeedCounter
Corresponding matching counter of reconstructed segments.
MuonVal::VectorBranch< unsigned short > & m_truthMuTruthNSegs
Number of associated truth muon segments.
MuonVal::ThreeVectorBranch m_seedPos
Simple seed information.
MuonVal::VectorBranch< float > & m_seedLength
Maximum separation between the segments on the reference plane.
SG::ReadHandleKey< ActsTrk::TrackContainer > m_trackKey
Dependency on the R4 MS track container.
ToolHandle< MuonR4::ISegmentSelectionTool > m_segSelector
Segment selection tool to pick the good quality segments.
SegmentKey_t m_recoSegmentKey
Primary segment container.
MuonVal::MuonTesterTree m_tree
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
Dependency on the geometry alignment.
SegmentKey_t m_truthSegmentKey
Segment from the truth hits.
std::shared_ptr< TrackSummaryModule > m_trackSummary
Hit summary on the reconstructed track.
StatusCode finalize() override final
std::shared_ptr< TrackSummaryModule > m_seedSummary
Hit summary on the track seed.
std::pair< double, double > calcSeedLength(const ActsTrk::GeometryContext &gctx, const MuonR4::MsTrackSeed &seed) const
static bool connectCollections(ParticleBranch_ptr primColl, ParticleBranch_ptr secondColl, Linker_t fromPrimToSec, const std::string &altPrimName="", const std::string &altSecName="")
@ isMC
Flag determining whether the branch is simulation.
Generic branch object where the information is evaluated by a std::function instead reading it from t...
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
Helper class to provide constant type-safe access to aux data.
Class providing the definition of the 4-vector interface.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, 2, 1 > Vector2D
constexpr float MeVtoGeV
This header ties the generic definitions in this package.
const xAOD::TruthParticle * getTruthMatchedParticle(const xAOD::MuonSegment &segment)
Returns the particle truth-matched to the segment.
std::vector< MsTrackSeed > MsTrackSeedContainer
Definition MsTrackSeed.h:63
std::string printID(const xAOD::MuonSegment &seg)
Print the chamber ID of a segment, e.g.
std::vector< const xAOD::MuonSegment * > getTruthSegments(const xAOD::TruthParticle &truthMuon)
Returns the segments associated to the truth muon.
const xAOD::MuonSegment * getMatchedTruthSegment(const xAOD::MuonSegment &segment)
Returns the truth-matched segment.
ElementLink< MuonR4::SegmentContainer > SegLink_t
Abrivation of the link to the reco segment container.
std::vector< SegLink_t > SegLinkVec_t
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Class to store array like branches into the n-tuples.
Definition HitValAlg.cxx:19
constexpr unsigned numberOfSectors()
return total number of sectors
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
MuonSegment_v1 MuonSegment
Reference the current persistent version:
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
Configuration object.
double endcapDiscRadius
Radius of the endcap discs.
const MuonGMR4::MuonDetectorManager * detMgr
Detector manager to fetch the sector enevelope transforms.
double seedHalfLength
Maximum separation of point on the cylinder to be picked up onto a seed.