ATLAS Offline Software
TruthSegmentMaker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONTRUTHSEGMENTMAKER_TRUTHSEGMENTMAKER_H
5 #define MUONTRUTHSEGMENTMAKER_TRUTHSEGMENTMAKER_H
6 
7 
12 
17 
18 namespace MuonR4{
19  /*** @brief The TruthSegmentMaker collects hits inside the chamber stemming from the same HepMC::GenParticle.
20  * The particle state at the first sim hit is propagated via a simple straight line onto the plane
21  * z=0 in the sector frame. The parameters are then translated into the global frame and a xAOD::MuonSegment
22  * is created. The segment hit summary is written based on the sim hit type. If a gasGap has eta & phi measurements,
23  * the counters in the respective categories are each increased for the given sim hit. Finally, a vector of ElementLinks
24  * pointing to the sim hits is decorated to the segment. */
26  public:
28 
29  ~TruthSegmentMaker() = default;
30 
31  StatusCode initialize() override final;
32  StatusCode execute(const EventContext& ctx) const override;
33 
34  private:
40  template <class ContainerType> StatusCode retrieveContainer(const EventContext& ctx,
41  const SG::ReadHandleKey<ContainerType>& key,
42  const ContainerType* & contToPush) const;
47  const Identifier& chanId) const;
49  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
53  SG::ReadHandleKey<ActsGeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "cond handle key"};
55  SG::WriteHandleKey<xAOD::MuonSegmentContainer> m_segmentKey{this, "WriteKey", "TruthSegmentsR4"};
65  Gaudi::Property<bool> m_useOnlyMuonHits{this, "useOnlyMuonHits", true};
68  };
69 }
70 #endif
ReadHandleKeyArray.h
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
MuonR4::TruthSegmentMaker::m_eleLinkKey
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_eleLinkKey
Decoration key of the associated sim hit links.
Definition: TruthSegmentMaker.h:57
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
MuonR4::TruthSegmentMaker::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Key to the geometry context.
Definition: TruthSegmentMaker.h:53
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
MuonR4::TruthSegmentMaker::execute
StatusCode execute(const EventContext &ctx) const override
Definition: TruthSegmentMaker.cxx:72
taskman.template
dictionary template
Definition: taskman.py:317
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
MuonR4::TruthSegmentMaker::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Pointer to the muon readout geometry.
Definition: TruthSegmentMaker.h:67
MuonR4::TruthSegmentMaker::m_qKey
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_qKey
Decoration key of the muon charge
Definition: TruthSegmentMaker.h:63
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
SG::ReadHandleKey< ActsGeometryContext >
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
MuonR4::TruthSegmentMaker::m_ptKey
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_ptKey
Decoration key of the associated particle pt.
Definition: TruthSegmentMaker.h:59
MuonSegmentContainer.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonR4::TruthSegmentMaker::m_useOnlyMuonHits
Gaudi::Property< bool > m_useOnlyMuonHits
Build segments from muon hits only.
Definition: TruthSegmentMaker.h:65
MuonR4::TruthSegmentMaker::m_locParKey
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_locParKey
Decoration key of the local parameters.
Definition: TruthSegmentMaker.h:61
MuonR4::TruthSegmentMaker
Definition: TruthSegmentMaker.h:25
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
MuonR4::TruthSegmentMaker::retrieveContainer
StatusCode retrieveContainer(const EventContext &ctx, const SG::ReadHandleKey< ContainerType > &key, const ContainerType *&contToPush) const
Helper method to retrieve any kind of container from a ReadHandleKey.
Definition: TruthSegmentMaker.cxx:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonDetectorManager.h
MuonSimHitContainer.h
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
AthReentrantAlgorithm.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
MuonR4::TruthSegmentMaker::initialize
StatusCode initialize() override final
Definition: TruthSegmentMaker.cxx:45
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::TruthSegmentMaker::toChamber
Amg::Transform3D toChamber(const ActsGeometryContext &gctx, const Identifier &chanId) const
Returns the transform from the local simHit frame -> chamber frame.
Definition: TruthSegmentMaker.cxx:63
MuonR4::TruthSegmentMaker::m_readKeys
SG::ReadHandleKeyArray< xAOD::MuonSimHitContainer > m_readKeys
List of sim hit containers from which the truth segments shall be retrieved.
Definition: TruthSegmentMaker.h:51
MuonR4::TruthSegmentMaker::m_segmentKey
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_segmentKey
Key under which the segment Container will be recorded in StoreGate.
Definition: TruthSegmentMaker.h:55
MuonR4::TruthSegmentMaker::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.
Definition: TruthSegmentMaker.h:49
MuonR4::TruthSegmentMaker::~TruthSegmentMaker
~TruthSegmentMaker()=default
IMuonIdHelperSvc.h
ServiceHandle
Definition: ClusterMakerTool.h:37
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14