ATLAS Offline Software
Loading...
Searching...
No Matches
TruthSegmentMaker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONTRUTHSEGMENTMAKER_TRUTHSEGMENTMAKER_H
5#define MUONTRUTHSEGMENTMAKER_TRUTHSEGMENTMAKER_H
6
7
14
15
22
24
25namespace MuonR4{
26 /*** @brief The TruthSegmentMaker collects hits inside the chamber stemming from the same HepMC::GenParticle.
27 * The particle state at the first sim hit is propagated via a simple straight line onto the plane
28 * z=0 in the sector frame. The parameters are then translated into the global frame and a xAOD::MuonSegment
29 * is created. The segment hit summary is written based on the sim hit type. If a gasGap has eta & phi measurements,
30 * the counters in the respective categories are each increased for the given sim hit. Finally, a vector of ElementLinks
31 * pointing to the sim hits is decorated to the segment. */
33 public:
34 using AthReentrantAlgorithm::AthReentrantAlgorithm;
35
36 ~TruthSegmentMaker() = default;
37
38 StatusCode initialize() override final;
39 StatusCode execute(const EventContext& ctx) const override;
40
41 private:
45 Amg::Transform3D toChamber(const ActsTrk::GeometryContext& gctx,
46 const Identifier& chanId) const;
47
50 using HitPosTuple_t = std::tuple<const xAOD::MuonSimHit*, Amg::Vector3D, Amg::Vector3D>;
52
53
54
55 using EleLink_t = ElementLink<xAOD::MuonSimHitContainer>;
57 using LinkDecor_t = SG::WriteDecorHandle<xAOD::MuonSegmentContainer, HitLinkVec_t>;
58 using FloatDecor_t = SG::WriteDecorHandle<xAOD::MuonSegmentContainer, float>;
59
60 using SegPars_t = xAOD::MeasVector<Acts::toUnderlying(SegmentFit::ParamDefs::nPars)>;
61 using SegParDecor_t = SG::WriteDecorHandle<xAOD::MuonSegmentContainer, SegPars_t>;
62
89
96 xAOD::MuonSegment* constructSegmentFromHits(const EventContext& ctx,
97 const Amg::Transform3D& locToGlob,
98 const SimHitVec_t& hits,
99 WriteDecorHolder& writeShip) const;
109 void buildSegmentsFromBkg(const EventContext& ctx,
110 const Amg::Transform3D& locToGlob,
111 const SimHitVec_t& simHits,
112 WriteDecorHolder& writeShip) const;
113
115 float muonPt(const xAOD::MuonSimHit& hit, const Amg::Vector3D& globDir) const;
121 float hitUncertainty(const EventContext& ctx, const xAOD::MuonSimHit& hit) const;
123 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
127 SG::ReadHandleKey<ActsTrk::GeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "cond handle key"};
129 SG::WriteHandleKey<xAOD::MuonSegmentContainer> m_segmentKey{this, "WriteKey", "MuonTruthSegments"};
139 Gaudi::Property<bool> m_useOnlyMuonHits{this, "useOnlyMuonHits", true};
141 Gaudi::Property<bool> m_includePileUpHits{this, "includePileUpHits", true};
143 Gaudi::Property<float> m_pileUpHitMinE{this, "energyThresholdPileUp", 1.*Gaudi::Units::GeV};
145 Gaudi::Property<float> m_pileUpHitELoss{this, "pileUpHitELoss", 5.*Gaudi::Units::MeV};
147 Gaudi::Property<float> m_pileUpHitAngleCone{this, "pileUpHitAngleCone", 1.*Gaudi::Units::deg};
149 Gaudi::Property<float> m_pileUpHitDistance{this, "pileUpHitDistance", 2.*Gaudi::Units::m};
151 Gaudi::Property<float> m_idCylinderR{this, "IdCylinderR", 1.1*Gaudi::Units::m};
153 Gaudi::Property<float> m_idCylinderHalfZ{this, "IdCylinderHalfZ", 3.2*Gaudi::Units::m};
158 "Conditions object containing the calibrations"};
159
160 SG::ReadCondHandleKey<NswErrorCalibData> m_nswUncertKey{this, "NswErrorKey", "NswUncertData",
161 "Key of the parametrized NSW uncertainties"};
162 };
163}
164#endif
Eigen::Affine3d Transform3D
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
Property holding a SG store/key/clid from which a WriteHandle is made.
Handle class for recording to StoreGate.
Eigen::Matrix< double, 3, 1 > Vector3D
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_locParKey
Decoration key of the local parameters.
std::vector< HitPosTuple_t > SimHitVec_t
SG::WriteDecorHandle< xAOD::MuonSegmentContainer, SegPars_t > SegParDecor_t
Gaudi::Property< float > m_pileUpHitMinE
Minimum energy threshold for pile up hits to be converted.
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
Key to the geometry context.
StatusCode execute(const EventContext &ctx) const override
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.
Gaudi::Property< float > m_pileUpHitAngleCone
Maximum scattering angle between two pile-up hits.
Gaudi::Property< float > m_idCylinderR
ID / ITk cylinder radius.
Amg::Transform3D toChamber(const ActsTrk::GeometryContext &gctx, const Identifier &chanId) const
Returns the transform from the local simHit frame -> chamber frame.
const MuonGMR4::MuonDetectorManager * m_detMgr
Pointer to the muon readout geometry.
StatusCode initialize() override final
SG::WriteDecorHandle< xAOD::MuonSegmentContainer, HitLinkVec_t > LinkDecor_t
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_eleLinkKey
Decoration key of the associated sim hit links.
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer > m_mdtCalibKey
Data dependency on the Mdt calibration container to calculate the uncertainty.
ElementLink< xAOD::MuonSimHitContainer > EleLink_t
Gaudi::Property< float > m_pileUpHitELoss
Maximum energy loss between two pile-up hits.
std::vector< EleLink_t > HitLinkVec_t
Gaudi::Property< float > m_idCylinderHalfZ
ID / Itk cylinder half length.
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_qKey
Decoration key of the muon charge.
xAOD::MuonSegment * constructSegmentFromHits(const EventContext &ctx, const Amg::Transform3D &locToGlob, const SimHitVec_t &hits, WriteDecorHolder &writeShip) const
Takes a list of related sim hits and transforms them into a truth segment.
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_ptKey
Decoration key of the associated particle pt.
Gaudi::Property< bool > m_useOnlyMuonHits
Build segments from muon hits only.
SG::WriteDecorHandle< xAOD::MuonSegmentContainer, float > FloatDecor_t
void buildSegmentsFromBkg(const EventContext &ctx, const Amg::Transform3D &locToGlob, const SimHitVec_t &simHits, WriteDecorHolder &writeShip) const
Attempts to assemble truth segments from a list of loose sim hits, i.e., the hits are stemming from a...
std::tuple< const xAOD::MuonSimHit *, Amg::Vector3D, Amg::Vector3D > HitPosTuple_t
Tuple consisting out of pointer to the sim hit and the position & direction expressed in the chamber'...
xAOD::MeasVector< Acts::toUnderlying(SegmentFit::ParamDefs::nPars)> SegPars_t
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_segmentKey
Key under which the segment Container will be recorded in StoreGate.
SG::ReadCondHandleKey< NswErrorCalibData > m_nswUncertKey
Data dependency on the Nsw calibration container to estimate the uncertaintys.
Gaudi::Property< bool > m_includePileUpHits
Construct segments from pile-up hits without GenParticleLink.
Gaudi::Property< float > m_pileUpHitDistance
Maximum separation between two pile-up hits.
float hitUncertainty(const EventContext &ctx, const xAOD::MuonSimHit &hit) const
Evaluates the hit uncertainty.
float muonPt(const xAOD::MuonSimHit &hit, const Amg::Vector3D &globDir) const
Returns the muon pt from the sim hit.
SG::ReadHandleKeyArray< xAOD::MuonSimHitContainer > m_readKeys
List of sim hit containers from which the truth segments shall be retrieved.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
SeedingAux::FitParIndex ParamDefs
Use the same parameter indices as used by the CompSpacePointAuxiliaries.
This header ties the generic definitions in this package.
Forward declaration.
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
Definition MuonSimHit.h:12
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Helper struct to ship the write DecorHandles and the reference to the output segment container throug...
FloatDecor_t ptDecor
Decorate the particle's pt at that place.
WriteDecorHolder(xAOD::MuonSegmentContainer &outContainer, const TruthSegmentMaker &parent, const EventContext &ctx)
Constructor taking the reference to the mutable output container storing the truth segments,...
xAOD::MuonSegmentContainer & segments
Reference to the mutable segment container.
FloatDecor_t chargeDecor
Decorate the segment's charge.
SegParDecor_t paramDecor
Decorator to assign the local segment parameters.
LinkDecor_t hitLinkDecor
Decorator to define the links to the sim hits building the truth segment.
#define private