ATLAS Offline Software
Loading...
Searching...
No Matches
MuonRpcTimingDecorAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONCOMBINEDDECORALGS_MUONRPCTIMINGDECORALG_H
6#define MUONCOMBINEDDECORALGS_MUONRPCTIMINGDECORALG_H
7
9#include "GaudiKernel/ToolHandle.h"
17/*
18 Algorithm to decorate the Rpc position and timing to the Muon particle
19*/
20
22 public:
23 MuonRpcTimingDecorAlg(const std::string& name, ISvcLocator* pSvcLocator);
25
26 virtual StatusCode initialize() override;
27 virtual StatusCode execute(const EventContext& ctx) const override;
28 private:
29 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
30 ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
31 "Handle to the service providing the IMuonEDMHelperSvc interface"};
32
33 SG::ReadHandleKey<xAOD::MuonContainer> m_MuonContainer{this, "MuonContainer", "Muons" ,"Muon container"};
34
35 SG::WriteDecorHandleKey<xAOD::MuonContainer> m_idKey{this, "IdKey", "", "rpcHitIdentifier decoration key"};
36 SG::WriteDecorHandleKey<xAOD::MuonContainer> m_posXKey{this, "PosXkey", "", "rpcHitPositionX decoration key"};
37 SG::WriteDecorHandleKey<xAOD::MuonContainer> m_posYKey{this, "PosYkey", "", "rpcHitPositionY decoration key"};
38 SG::WriteDecorHandleKey<xAOD::MuonContainer> m_posZKey{this, "PosZkey", "", "rpcHitPositionZ decoration key"};
39 SG::WriteDecorHandleKey<xAOD::MuonContainer> m_timeKey{this, "TimeKey", "", "rpcHitTime decoration key"};
40
41 struct RpcInfo{
43 const float time_,
44 const unsigned int id_):
45 pos{pos_},time{time_},id{id_}{}
46 Amg::Vector3D pos{0.,0.,0.};
47 float time{0.f};
48 unsigned int id{0};
49 };
50 void getRpcTiming(const xAOD::TrackParticle* tp, std::vector<RpcInfo>& info) const;
51
52 template <typename T> void insert(const std::vector<RpcInfo>& info,
53 const xAOD::Muon* muon,
54 SG::WriteDecorHandle<xAOD::MuonContainer,std::vector<T>>& decor,
55 std::function<T(const RpcInfo&)>func) const;
56};
57#endif
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.
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
~MuonRpcTimingDecorAlg()=default
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_timeKey
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_idKey
MuonRpcTimingDecorAlg(const std::string &name, ISvcLocator *pSvcLocator)
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainer
virtual StatusCode initialize() override
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_posZKey
void getRpcTiming(const xAOD::TrackParticle *tp, std::vector< RpcInfo > &info) const
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_posXKey
void insert(const std::vector< RpcInfo > &info, const xAOD::Muon *muon, SG::WriteDecorHandle< xAOD::MuonContainer, std::vector< T > > &decor, std::function< T(const RpcInfo &)>func) const
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_posYKey
virtual StatusCode execute(const EventContext &ctx) const override
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.
Handle class for adding a decoration to an object.
Eigen::Matrix< double, 3, 1 > Vector3D
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
RpcInfo(const Amg::Vector3D &pos_, const float time_, const unsigned int id_)