ATLAS Offline Software
MuonRpcTimingDecorAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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"
11 #include "xAODMuon/MuonContainer.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{
42  RpcInfo(const Amg::Vector3D& _pos,
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
grepfile.info
info
Definition: grepfile.py:38
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
MuonRpcTimingDecorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: MuonRpcTimingDecorAlg.cxx:34
MuonRpcTimingDecorAlg::RpcInfo
Definition: MuonRpcTimingDecorAlg.h:41
ParticleTest.tp
tp
Definition: ParticleTest.py:25
MuonRpcTimingDecorAlg::m_posZKey
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_posZKey
Definition: MuonRpcTimingDecorAlg.h:38
MuonRpcTimingDecorAlg::m_edmHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonRpcTimingDecorAlg.h:30
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
MuonRpcTimingDecorAlg::~MuonRpcTimingDecorAlg
~MuonRpcTimingDecorAlg()=default
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonRpcTimingDecorAlg::MuonRpcTimingDecorAlg
MuonRpcTimingDecorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonRpcTimingDecorAlg.cxx:16
MuonRpcTimingDecorAlg
Definition: MuonRpcTimingDecorAlg.h:21
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
MuonRpcTimingDecorAlg::RpcInfo::RpcInfo
RpcInfo(const Amg::Vector3D &_pos, const float _time, const unsigned int _id)
Definition: MuonRpcTimingDecorAlg.h:42
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
MuonRpcTimingDecorAlg::getRpcTiming
void getRpcTiming(const xAOD::TrackParticle *tp, std::vector< RpcInfo > &info) const
Definition: MuonRpcTimingDecorAlg.cxx:58
WriteDecorHandle.h
Handle class for adding a decoration to an object.
MuonRpcTimingDecorAlg::initialize
virtual StatusCode initialize() override
Definition: MuonRpcTimingDecorAlg.cxx:19
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
MuonRpcTimingDecorAlg::insert
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
Definition: MuonRpcTimingDecorAlg.cxx:85
AthReentrantAlgorithm.h
IMuonEDMHelperSvc.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MuonRpcTimingDecorAlg::m_MuonContainer
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainer
Definition: MuonRpcTimingDecorAlg.h:33
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonContainer.h
MuonRpcTimingDecorAlg::RpcInfo::pos
Amg::Vector3D pos
Definition: MuonRpcTimingDecorAlg.h:46
MuonRpcTimingDecorAlg::m_timeKey
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_timeKey
Definition: MuonRpcTimingDecorAlg.h:39
MuonRpcTimingDecorAlg::RpcInfo::time
float time
Definition: MuonRpcTimingDecorAlg.h:47
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
MuonRpcTimingDecorAlg::m_idKey
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_idKey
Definition: MuonRpcTimingDecorAlg.h:35
MuonRpcTimingDecorAlg::m_posYKey
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_posYKey
Definition: MuonRpcTimingDecorAlg.h:37
MuonRpcTimingDecorAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonRpcTimingDecorAlg.h:29
IMuonIdHelperSvc.h
MuonRpcTimingDecorAlg::m_posXKey
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_posXKey
Definition: MuonRpcTimingDecorAlg.h:36
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
ServiceHandle< Muon::IMuonIdHelperSvc >