ATLAS Offline Software
MuonEventCnvTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONEVENTCNVTOOL_H
6 #define MUONEVENTCNVTOOL_H
7 
8 #include <string>
9 
11 #include "GaudiKernel/ServiceHandle.h"
21 
22 
23 namespace Trk {
24  class RIO_OnTrack;
25 } // namespace Trk
26 
27 namespace Muon {
28 
30  class MuonEventCnvTool : public extends<AthAlgTool, Trk::ITrkEventCnvTool> {
31  public:
33 
34  MuonEventCnvTool(const std::string&, const std::string&, const IInterface*);
35 
36  virtual StatusCode initialize() override;
37 
39  virtual void checkRoT(const Trk::RIO_OnTrack& rioOnTrack) const override;
40 
41  virtual std::pair<const Trk::TrkDetElementBase*, const Trk::PrepRawData*> getLinks(Trk::RIO_OnTrack& rioOnTrack) const override;
42 
44  virtual void prepareRIO_OnTrack(Trk::RIO_OnTrack* rot) const override;
45 
48  virtual void prepareRIO_OnTrackLink(const Trk::RIO_OnTrack* rot, ELKey_t& key, ELIndex_t& index) const override;
49 
51  virtual void recreateRIO_OnTrack(Trk::RIO_OnTrack* RoT) const override;
52 
54  virtual const Trk::TrkDetElementBase* getDetectorElement(const Identifier& id, const IdentifierHash& idHash) const override;
55 
57  virtual const Trk::TrkDetElementBase* getDetectorElement(const Identifier& id) const override;
58 
59  private:
60  /* Retrieves the PrepRawData container from StorGate and returns the corresponding element with the same identifier */
61  const Trk::PrepRawData* getLink(const Identifier& id, const IdentifierHash& idHash) const;
62 
63  template <class CONT>
64  const Trk::PrepRawData* getLink(const Identifier& id, const IdentifierHash& idHash, const SG::ReadHandleKey<CONT>& handle,
65  const EventContext& ctx) const;
66 
67  private:
68  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
69 
70  SG::ReadHandleKey<RpcPrepDataContainer> m_rpcPrdKey{this, "RpcClusterContainer", "RPC_Measurements", "Location for RPC PRDs"};
71  SG::ReadHandleKey<CscPrepDataContainer> m_cscPrdKey{this, "CscClusterContainer", "CSC_Clusters", "Location for CSC PRDs"};
72  SG::ReadHandleKey<TgcPrepDataContainer> m_tgcPrdKey{this, "TgcClusterContainer", "TGC_MeasurementsAllBCs", "Location for TGC PRDs"};
73  SG::ReadHandleKey<MdtPrepDataContainer> m_mdtPrdKey{this, "MdtClusterContainer", "MDT_DriftCircles", "Location for MDT PRDs"};
74  SG::ReadHandleKey<MMPrepDataContainer> m_mmPrdKey{this, "MM_ClusterContainer", "MM_Measurements", "Location for MM PRDs"};
75  SG::ReadHandleKey<sTgcPrepDataContainer> m_stgcPrdKey{this, "STGC_ClusterContainer", "STGC_Measurements", "Location for sTGC PRDs"};
76 
77  SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_detectorManagerKey{this, "DetectorManagerKey", "MuonDetectorManager",
78  "Key of input MuonDetectorManager condition data"};
79 
82  Gaudi::Property<bool> m_manuallyFindPRDs{this, "FindPRDsManually", false,
83  "If true, search for PRDs manually - i.e. do not rely on ElementLink working"};
84  Gaudi::Property<bool> m_fixTGCs{this, "FixTGCs", false, "If true, try to fix broken EL, e.g. ATLASRECTS-5151"};
85  };
86 
87 } // namespace Muon
88 #endif // MOORETOTRACKTOOL_H
Muon::MuonEventCnvTool::checkRoT
virtual void checkRoT(const Trk::RIO_OnTrack &rioOnTrack) const override
check that the RoT is correctly filled
Definition: MuonEventCnvTool.cxx:46
Muon::MuonEventCnvTool::STGC
@ STGC
Definition: MuonEventCnvTool.h:32
Muon::MuonEventCnvTool::m_mmPrdKey
SG::ReadHandleKey< MMPrepDataContainer > m_mmPrdKey
Definition: MuonEventCnvTool.h:74
Muon::MuonEventCnvTool::m_rpcPrdKey
SG::ReadHandleKey< RpcPrepDataContainer > m_rpcPrdKey
Definition: MuonEventCnvTool.h:70
Muon::MuonEventCnvTool::getLinks
virtual std::pair< const Trk::TrkDetElementBase *, const Trk::PrepRawData * > getLinks(Trk::RIO_OnTrack &rioOnTrack) const override
Definition: MuonEventCnvTool.cxx:70
index
Definition: index.py:1
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
MMPrepDataContainer.h
RpcPrepDataContainer.h
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::MuonEventCnvTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonEventCnvTool.h:68
sTgcPrepDataContainer.h
Muon::MuonEventCnvTool::m_manuallyFindPRDs
Gaudi::Property< bool > m_manuallyFindPRDs
If true, search for PRDs manually - i.e.
Definition: MuonEventCnvTool.h:82
Muon::MuonEventCnvTool
Tool used in the persisency convertors to help rebuild EDM objects.
Definition: MuonEventCnvTool.h:30
ITrkEventCnvTool.h
MdtPrepDataContainer.h
Muon::MuonEventCnvTool::getLink
const Trk::PrepRawData * getLink(const Identifier &id, const IdentifierHash &idHash) const
Definition: MuonEventCnvTool.cxx:198
Muon::MuonEventCnvTool::m_fixTGCs
Gaudi::Property< bool > m_fixTGCs
Definition: MuonEventCnvTool.h:84
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TgcPrepDataContainer.h
Muon::MuonEventCnvTool::TGC
@ TGC
Definition: MuonEventCnvTool.h:32
AthAlgTool.h
Muon::MuonEventCnvTool::prepareRIO_OnTrack
virtual void prepareRIO_OnTrack(Trk::RIO_OnTrack *rot) const override
Definition: MuonEventCnvTool.cxx:94
Muon::MuonEventCnvTool::RPC
@ RPC
Definition: MuonEventCnvTool.h:32
Muon::MuonEventCnvTool::MuonConcreteType
MuonConcreteType
Definition: MuonEventCnvTool.h:32
Muon::MuonEventCnvTool::MuonEventCnvTool
MuonEventCnvTool(const std::string &, const std::string &, const IInterface *)
Definition: MuonEventCnvTool.cxx:31
Muon::MuonEventCnvTool::TypeUnknown
@ TypeUnknown
Definition: MuonEventCnvTool.h:32
Muon::MuonEventCnvTool::initialize
virtual StatusCode initialize() override
Definition: MuonEventCnvTool.cxx:33
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
CscPrepDataContainer.h
Muon::MuonEventCnvTool::recreateRIO_OnTrack
virtual void recreateRIO_OnTrack(Trk::RIO_OnTrack *RoT) const override
Take the passed RoT and recreate it (i.e.
Definition: MuonEventCnvTool.cxx:160
Muon::MuonEventCnvTool::MM
@ MM
Definition: MuonEventCnvTool.h:32
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
MuonDetectorManager.h
Muon::MuonEventCnvTool::CSC
@ CSC
Definition: MuonEventCnvTool.h:32
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager >
Muon::MuonEventCnvTool::getDetectorElement
virtual const Trk::TrkDetElementBase * getDetectorElement(const Identifier &id, const IdentifierHash &idHash) const override
Return the detectorElement associated with this Identifier.
Definition: MuonEventCnvTool.cxx:165
Muon::MuonEventCnvTool::MDT
@ MDT
Definition: MuonEventCnvTool.h:32
Muon::MuonEventCnvTool::m_detectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detectorManagerKey
Definition: MuonEventCnvTool.h:77
Muon::MuonEventCnvTool::prepareRIO_OnTrackLink
virtual void prepareRIO_OnTrackLink(const Trk::RIO_OnTrack *rot, ELKey_t &key, ELIndex_t &index) const override
Similar, but just return the EL components rather then changing ROT.
Definition: MuonEventCnvTool.cxx:127
Muon::MuonEventCnvTool::m_mdtPrdKey
SG::ReadHandleKey< MdtPrepDataContainer > m_mdtPrdKey
Definition: MuonEventCnvTool.h:73
Muon::MuonEventCnvTool::m_tgcPrdKey
SG::ReadHandleKey< TgcPrepDataContainer > m_tgcPrdKey
Definition: MuonEventCnvTool.h:72
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
IMuonIdHelperSvc.h
Muon::MuonEventCnvTool::m_stgcPrdKey
SG::ReadHandleKey< sTgcPrepDataContainer > m_stgcPrdKey
Definition: MuonEventCnvTool.h:75
Muon::MuonEventCnvTool::m_cscPrdKey
SG::ReadHandleKey< CscPrepDataContainer > m_cscPrdKey
Definition: MuonEventCnvTool.h:71
ServiceHandle< Muon::IMuonIdHelperSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14