ATLAS Offline Software
Loading...
Searching...
No Matches
MdtRdoToPrepDataToolMT.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 MUONMdtRdoToPrepDataToolMT_H
6#define MUONMdtRdoToPrepDataToolMT_H
7
8
12
14
19
22
26
29
32
33class MdtDigit;
34
35namespace Muon {
39
40 class MdtRdoToPrepDataToolMT : public extends<AthAlgTool, IMuonRdoToPrepDataTool> {
41 public:
42 using base_class::base_class;
43
45 virtual ~MdtRdoToPrepDataToolMT() = default;
46
48 virtual StatusCode initialize() override;
49
51 virtual StatusCode decode(const EventContext& ctx, const std::vector<IdentifierHash>& idVect) const override;
52 virtual StatusCode provideEmptyContainer(const EventContext& ctx) const override;
53 // new decode method for Rob based readout
54 virtual StatusCode decode(const EventContext& ctx, const std::vector<uint32_t>& robIds) const override;
55
56 protected:
57 void printPrepDataImpl(const Muon::MdtPrepDataContainer* mdtPrepDataContainer) const;
58
60 Muon::MdtDriftCircleStatus getMdtTwinPosition(const MdtDigit& prompt_digit, const MdtDigit& twin_digit, double& radius,
61 double& errRadius, double& zTwin, double& errZTwin, bool& twinIsPrompt) const;
62
63
65 struct ConvCache {
66 ConvCache(const Muon::IMuonIdHelperSvc* idHelperSvc);
72 StatusCode finalize(MsgStream& msg);
73
77
86 const TwinTubeMap* twinTubeMap{nullptr};
87
89 bool isValid{false};
90 std::vector<std::unique_ptr<MdtPrepDataCollection>> addedCols{};
91 };
92
93 StatusCode processCsm(const EventContext& ctx, ConvCache& mdtPrepDataContainer,
94 const MdtCsm* rdoColl) const;
95
96 StatusCode processCsmTwin(const EventContext& ctx,
97 ConvCache& mdtPrepDataContainer,
98 const MdtCsm* rdoColll) const;
99
101 std::unique_ptr<MdtPrepData> createPrepData(const MdtCalibInput& calibInput,
102 const MdtCalibOutput& calibOutput,
103 ConvCache& cache) const;
105 ConvCache setupMdtPrepDataContainer(const EventContext& ctx) const;
106
108 const MdtCsmContainer* getRdoContainer(const EventContext& ctx) const;
109
110 void processPRDHashes(const EventContext& ctx, ConvCache& mdtPrepDataContainer,
111 const std::vector<IdentifierHash>& chamberHashInRobs) const;
112
113 bool handlePRDHash(const EventContext& ctx, ConvCache& mdtPrepDataContainer,
114 IdentifierHash rdoHash) const;
115
116 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
117
119 ToolHandle<IMdtCalibrationTool> m_calibrationTool{this, "CalibrationTool", "MdtCalibrationTool"};
120
121
122 Gaudi::Property<bool> m_useNewGeo{this, "UseR4DetMgr", false,
123 "Switch between the legacy and the new geometry"};
124
126 SG::ReadHandleKey<ActsTrk::GeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "Stored alignment"};
127
128
131
133
134
136 Gaudi::Property<int> m_adcCut{this, "AdcCut", 50,
137 "Minimal cut on the adc to convert it into a prepdata object"};
138 Gaudi::Property<bool> m_calibratePrepData{this, "CalibratePrepData", true};
139 Gaudi::Property<bool> m_decodeData{this, "DecodeData", true};
140 bool m_sortPrepData = false;
141
142 ToolHandle<Muon::IMDT_RDO_Decoder> m_mdtDecoder{this, "Decoder", "Muon::MdtRDO_Decoder/MdtRDO_Decoder"};
143
144 bool m_BMGpresent{false};
145 int m_BMGid{-1};
146
147 // + TWIN TUBE
148 Gaudi::Property<bool> m_useTwin{this, "UseTwin", true};
149 Gaudi::Property<bool> m_discardSecondaryHitTwin{this, "DiscardSecondaryHitTwin", false};
150
151 // - TWIN TUBE
152 SG::ReadCondHandleKey<TwinTubeMap> m_twinTubeKey{this, "TwinTubeKey", "MdtTwinTubeMap"};
153
154 std::unordered_set<Identifier> m_DeadChannels{};
155 void initDeadChannels(const MuonGM::MdtReadoutElement* mydetEl);
156
157 SG::ReadCondHandleKey<MuonMDT_CablingMap> m_readKey{this, "ReadKey", "MuonMDT_CablingMap", "Key of MuonMDT_CablingMap"};
158
159 SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muDetMgrKey{this, "DetectorManagerKey", "MuonDetectorManager",
160 "Key of input MuonDetectorManager condition data"};
161
163 "Optional external cache for the MDT PRD container"};
164
165 // xAOD PRDs
166 SG::WriteHandleKey<xAOD::MdtDriftCircleContainer> m_xAODKey{this, "xAODKey", "", "If empty, do not produce xAOD, otherwise this is the key of the output xAOD MDT PRD container"};
167 SG::WriteHandleKey<xAOD::MdtTwinDriftCircleContainer> m_xAODTwinKey{this, "xAODTwinKey", "", "If empty, do not produce xAOD, otherwise this is the key of the output xAOD MDT PRD container"};
168
169 };
170} // namespace Muon
171
172#endif
Property holding a SG store/key/clid from which a WriteHandle is made.
This is a "hash" representation of an Identifier.
This container provides acces to the MDT RDOs.
MDT RDOs : Chamber Service Module, container of AmtHits of a single Mdt chamber.
Definition MdtCsm.h:19
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
std::unique_ptr< MdtPrepData > createPrepData(const MdtCalibInput &calibInput, const MdtCalibOutput &calibOutput, ConvCache &cache) const
Creates the PRD object.
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_readKey
virtual StatusCode provideEmptyContainer(const EventContext &ctx) const override
SG::ReadHandleKey< MdtCsmContainer > m_rdoContainerKey
SG::UpdateHandleKey< MdtPrepDataCollection_Cache > m_prdContainerCacheKey
This is the key for the cache for the MDT PRD containers, can be empty.
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
ConvCache setupMdtPrepDataContainer(const EventContext &ctx) const
Creates the prep data container to be written.
Muon::MdtDriftCircleStatus getMdtTwinPosition(const MdtDigit &prompt_digit, const MdtDigit &twin_digit, double &radius, double &errRadius, double &zTwin, double &errZTwin, bool &twinIsPrompt) const
method to get the twin tube 2nd coordinate
SG::WriteHandleKey< xAOD::MdtTwinDriftCircleContainer > m_xAODTwinKey
const MdtCsmContainer * getRdoContainer(const EventContext &ctx) const
Loads the input RDO container from StoreGate.
ToolHandle< IMdtCalibrationTool > m_calibrationTool
MDT calibration service.
StatusCode processCsm(const EventContext &ctx, ConvCache &mdtPrepDataContainer, const MdtCsm *rdoColl) const
Gaudi::Property< bool > m_calibratePrepData
toggle on/off calibration of MdtPrepData
SG::ReadCondHandleKey< TwinTubeMap > m_twinTubeKey
Gaudi::Property< bool > m_discardSecondaryHitTwin
SG::WriteHandleKey< Muon::MdtPrepDataContainer > m_mdtPrepDataContainerKey
MdtPrepRawData containers.
const MuonGMR4::MuonDetectorManager * m_detMgrR4
void printPrepDataImpl(const Muon::MdtPrepDataContainer *mdtPrepDataContainer) const
virtual ~MdtRdoToPrepDataToolMT()=default
default destructor
std::unordered_set< Identifier > m_DeadChannels
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::WriteHandleKey< xAOD::MdtDriftCircleContainer > m_xAODKey
Gaudi::Property< int > m_adcCut
member variables for algorithm properties:
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muDetMgrKey
Gaudi::Property< bool > m_useNewGeo
void processPRDHashes(const EventContext &ctx, ConvCache &mdtPrepDataContainer, const std::vector< IdentifierHash > &chamberHashInRobs) const
Gaudi::Property< bool > m_decodeData
toggle on/off the decoding of MDT RDO into MdtPrepData
bool m_sortPrepData
Toggle on/off the sorting of the MdtPrepData.
virtual StatusCode decode(const EventContext &ctx, const std::vector< IdentifierHash > &idVect) const override
Decode method - declared in Muon::IMuonRdoToPrepDataTool.
virtual StatusCode initialize() override
standard Athena-Algorithm method
bool handlePRDHash(const EventContext &ctx, ConvCache &mdtPrepDataContainer, IdentifierHash rdoHash) const
void initDeadChannels(const MuonGM::MdtReadoutElement *mydetEl)
StatusCode processCsmTwin(const EventContext &ctx, ConvCache &mdtPrepDataContainer, const MdtCsm *rdoColll) const
ToolHandle< Muon::IMDT_RDO_Decoder > m_mdtDecoder
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which an UpdateHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
MuonPrepDataContainerT< MdtPrepData > MdtPrepDataContainer
MdtDriftCircleStatus
Enum to represent the 'status' of Mdt measurements e.g.
MuonPrepDataCollection< MdtPrepData > MdtPrepDataCollection
MdtTwinDriftCircleContainer_v1 MdtTwinDriftCircleContainer
MdtDriftCircleContainer_v1 MdtDriftCircleContainer
bool isValid
Flag set to indicate that the complete validation was successful.
const TwinTubeMap * twinTubeMap
Pointer to the map having the mapping of twin tube pairs.
const Muon::IMuonIdHelperSvc * m_idHelperSvc
xAOD::MdtTwinDriftCircleContainer * xAODTwinPrd
ConvCache(const Muon::IMuonIdHelperSvc *idHelperSvc)
std::vector< std::unique_ptr< MdtPrepDataCollection > > addedCols
StatusCode finalize(MsgStream &msg)
Copy the non-empty collections into the created prd container.
MdtPrepDataCollection * createCollection(const Identifier &id)
Creates a new MdtPrepDataCollection, if it's neccessary and also possible.
const ActsTrk::GeometryContext * gctx
Acts Geometry context.
const MuonGM::MuonDetectorManager * legacyDetMgr
Detector manager from the conditions store.
xAOD::MdtDriftCircleContainer * xAODPrd
const MuonGMR4::MuonDetectorManager * r4DetMgr
Detector manger from R4.
MsgStream & msg
Definition testRead.cxx:32