ATLAS Offline Software
SegmentDumperAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN
3  for the benefit of the ATLAS collaboration
4 */
5 #ifndef MUONBUCKETDUMP_SegmentDumperAlg_H
6 #define MUONBUCKETDUMP_SegmentDumperAlg_H
7 
9 
13 
17 
21 
22 namespace MuonR4 {
23 
25 public:
27  ~SegmentDumperAlg() override = default;
28 
29  StatusCode initialize() override final;
30  StatusCode execute() override final;
31  StatusCode finalize() override final;
32 
33 private:
36  this, "SpacePointKeys", {"MuonSpacePoints"},
37  "Keys to the SpacePoint containers"};
38 
40  this, "SegmentKeys", "MuonSegmentsFromR4",
41  "Keys to the reconstructed segment containers (aligned by index with SpacePointKeys)"};
42 
45  this, "TruthDecorLinks", {}, "truthParticleLink decoration on segments"};
46 
48  this, "AlignmentKey", "ActsAlignment", "Geometry alignment context"};
49 
51  MuonVal::MuonTesterTree m_tree{"MuonSegmentDump", "MuonSegmentDump"};
52 
53  // Per-bucket scalars
55  m_tree.newScalar<uint16_t>("bucket_spacePoints", 0)};
57  m_tree.newScalar<uint16_t>("bucket_layers", 0)};
59  m_tree.newScalar<uint8_t>("bucket_chamberIndex", 0)};
61  m_tree.newScalar<uint8_t>("bucket_sector", 0)};
62 
63  // Per-segment (reco) vectors
67  m_tree.newVector<float>("segment_chiSquared")};
69  m_tree.newVector<float>("segment_numberDoF")};
70 
71  // NEW: reco η/φ derived from the segment direction (always filled)
73  m_tree.newVector<float>("segmentEta")};
75  m_tree.newVector<float>("segmentPhi")};
76 
77  // Truth labels & kinematics (filled only when a truth match exists)
79  m_tree.newVector<int32_t>("segmentTruthPart")};
81  m_tree.newVector<int32_t>("segmentTruthPDGId")};
83  m_tree.newVector<float>("segmentTruthPt")};
85  m_tree.newVector<float>("segmentTruthEta")};
87  m_tree.newVector<float>("segmentTruthPhi")};
89  m_tree.newVector<uint8_t>("segmentHasTruth")};
90 
91  // Helper: for a given SP bucket, count unique layer numbers
92  uint16_t countLayersInBucket(const SpacePointBucket& bucket) const;
93 };
94 
95 } // namespace MuonR4
96 
97 #endif
ReadHandleKeyArray.h
MuonR4::SegmentDumperAlg::m_segmentDir
MuonVal::ThreeVectorBranch m_segmentDir
Definition: SegmentDumperAlg.h:65
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
MuonR4::SegmentDumperAlg::m_segmentTruthIdx
MuonVal::VectorBranch< int32_t > & m_segmentTruthIdx
Definition: SegmentDumperAlg.h:78
AthHistogramAlgorithm::AthHistogramAlgorithm
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition: AthHistogramAlgorithm.cxx:31
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
MuonR4::SpacePointBucket
: The muon space point bucket represents a collection of points that will bre processed together in t...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:21
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:553
MuonR4::SegmentDumperAlg::m_truthDecorKeys
SG::ReadDecorHandleKeyArray< xAOD::MuonSegmentContainer > m_truthDecorKeys
Truth decoration (MC)
Definition: SegmentDumperAlg.h:44
MuonR4::SegmentDumperAlg::m_segmentTruthPt
MuonVal::VectorBranch< float > & m_segmentTruthPt
Definition: SegmentDumperAlg.h:82
MuonR4::SegmentDumperAlg::execute
StatusCode execute() override final
Definition: SegmentDumperAlg.cxx:63
MuonR4::SegmentDumperAlg::m_tree
MuonVal::MuonTesterTree m_tree
Output tree.
Definition: SegmentDumperAlg.h:51
MuonR4::SegmentDumperAlg::m_spacePointKeys
SG::ReadHandleKeyArray< SpacePointContainer > m_spacePointKeys
Inputs.
Definition: SegmentDumperAlg.h:35
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:45
MuonVal::VectorBranch< float >
MuonTesterTree.h
MuonR4::SegmentDumperAlg::finalize
StatusCode finalize() override final
Definition: SegmentDumperAlg.cxx:58
ThreeVectorBranch.h
SG::ReadHandleKey< xAOD::MuonSegmentContainer >
MuonR4::SegmentDumperAlg::initialize
StatusCode initialize() override final
Definition: SegmentDumperAlg.cxx:43
MuonVal::ThreeVectorBranch
Definition: ThreeVectorBranch.h:19
MuonSegmentContainer.h
AthHistogramAlgorithm.h
MuonR4::SegmentDumperAlg::m_segmentRecoPhi
MuonVal::VectorBranch< float > & m_segmentRecoPhi
Definition: SegmentDumperAlg.h:74
GeometryContext.h
MuonR4::SegmentDumperAlg::m_segment_chiSquared
MuonVal::VectorBranch< float > & m_segment_chiSquared
Definition: SegmentDumperAlg.h:66
MuonR4::SegmentDumperAlg::m_bucket_sector
MuonVal::ScalarBranch< uint8_t > & m_bucket_sector
Definition: SegmentDumperAlg.h:60
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
MuonR4::SegmentDumperAlg::m_segment_numberDoF
MuonVal::VectorBranch< float > & m_segment_numberDoF
Definition: SegmentDumperAlg.h:68
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::ReadHandleKeyArray
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
Definition: StoreGate/StoreGate/ReadHandleKeyArray.h:32
MuonR4::SegmentDumperAlg::m_bucket_spacePoints
MuonVal::ScalarBranch< uint16_t > & m_bucket_spacePoints
Definition: SegmentDumperAlg.h:54
MuonVal::MuonTesterTree::newVector
VectorBranch< T > & newVector(const std::string &name)
Creates new branches and returns their reference.
AthHistogramAlgorithm
Definition: AthHistogramAlgorithm.h:32
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
MuonR4::SegmentDumperAlg::m_bucket_chamberIdx
MuonVal::ScalarBranch< uint8_t > & m_bucket_chamberIdx
Definition: SegmentDumperAlg.h:58
MuonVal::ScalarBranch< uint16_t >
MuonR4::SegmentDumperAlg
Definition: SegmentDumperAlg.h:24
MuonVal::MuonTesterTree::newScalar
ScalarBranch< T > & newScalar(const std::string &name)
MuonR4::SegmentDumperAlg::m_geoCtxKey
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
Definition: SegmentDumperAlg.h:47
MuonR4::SegmentDumperAlg::m_segmentTruthEta
MuonVal::VectorBranch< float > & m_segmentTruthEta
Definition: SegmentDumperAlg.h:84
MuonR4::SegmentDumperAlg::m_segmentTruthPhi
MuonVal::VectorBranch< float > & m_segmentTruthPhi
Definition: SegmentDumperAlg.h:86
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::SegmentDumperAlg::m_segmentKeys
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_segmentKeys
Definition: SegmentDumperAlg.h:39
MuonR4::SegmentDumperAlg::countLayersInBucket
uint16_t countLayersInBucket(const SpacePointBucket &bucket) const
Definition: SegmentDumperAlg.cxx:145
MuonR4::SegmentDumperAlg::~SegmentDumperAlg
~SegmentDumperAlg() override=default
SpacePointContainer.h
MuonR4::SegmentDumperAlg::m_bucket_layers
MuonVal::ScalarBranch< uint16_t > & m_bucket_layers
Definition: SegmentDumperAlg.h:56
private
#define private
Definition: xAODTruthCnvAlg.h:20
MuonR4::SegmentDumperAlg::m_segmentHasTruth
MuonVal::VectorBranch< uint8_t > & m_segmentHasTruth
Definition: SegmentDumperAlg.h:88
MuonR4::SegmentDumperAlg::m_segmentTruthPDGId
MuonVal::VectorBranch< int32_t > & m_segmentTruthPDGId
Definition: SegmentDumperAlg.h:80
ReadDecorHandleKeyArray.h
SpacePointPerLayerSorter.h
MuonR4::SegmentDumperAlg::m_segmentPos
MuonVal::ThreeVectorBranch m_segmentPos
Definition: SegmentDumperAlg.h:64
MuonR4::SegmentDumperAlg::m_segmentRecoEta
MuonVal::VectorBranch< float > & m_segmentRecoEta
Definition: SegmentDumperAlg.h:72