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
18
21
25
28
31
32class MdtDigit;
33
34namespace Muon {
38
39 class MdtRdoToPrepDataToolMT : public extends<AthAlgTool, IMuonRdoToPrepDataTool> {
40 public:
41 using base_class::base_class;
42
44 virtual ~MdtRdoToPrepDataToolMT() = default;
45
47 virtual StatusCode initialize() override;
48
50 virtual StatusCode decode(const EventContext& ctx, const std::vector<IdentifierHash>& idVect) const override;
51 virtual StatusCode provideEmptyContainer(const EventContext& ctx) const override;
52 // new decode method for Rob based readout
53 virtual StatusCode decode(const EventContext& ctx, const std::vector<uint32_t>& robIds) const override;
54
55 protected:
56 void printPrepDataImpl(const Muon::MdtPrepDataContainer* mdtPrepDataContainer) const;
57
59 Muon::MdtDriftCircleStatus getMdtTwinPosition(const MdtDigit& prompt_digit, const MdtDigit& twin_digit, double& radius,
60 double& errRadius, double& zTwin, double& errZTwin, bool& twinIsPrompt) const;
61
62
64 struct ConvCache {
65 ConvCache(const Muon::IMuonIdHelperSvc* idHelperSvc);
71 StatusCode finalize(MsgStream& msg);
72
76
85 const TwinTubeMap* twinTubeMap{nullptr};
86
88 bool isValid{false};
89 std::vector<std::unique_ptr<MdtPrepDataCollection>> addedCols{};
90 };
91
92 StatusCode processCsm(const EventContext& ctx, ConvCache& mdtPrepDataContainer,
93 const MdtCsm* rdoColl) const;
94
95 StatusCode processCsmTwin(const EventContext& ctx,
96 ConvCache& mdtPrepDataContainer,
97 const MdtCsm* rdoColll) const;
98
100 std::unique_ptr<MdtPrepData> createPrepData(const MdtCalibInput& calibInput,
101 const MdtCalibOutput& calibOutput,
102 ConvCache& cache) const;
104 ConvCache setupMdtPrepDataContainer(const EventContext& ctx) const;
105
107 const MdtCsmContainer* getRdoContainer(const EventContext& ctx) const;
108
109 void processPRDHashes(const EventContext& ctx, ConvCache& mdtPrepDataContainer,
110 const std::vector<IdentifierHash>& chamberHashInRobs) const;
111
112 bool handlePRDHash(const EventContext& ctx, ConvCache& mdtPrepDataContainer,
113 IdentifierHash rdoHash) const;
114
115 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
116
118 ToolHandle<IMdtCalibrationTool> m_calibrationTool{this, "CalibrationTool", "MdtCalibrationTool"};
119
120
121 Gaudi::Property<bool> m_useNewGeo{this, "UseR4DetMgr", false,
122 "Switch between the legacy and the new geometry"};
123
125 SG::ReadHandleKey<ActsTrk::GeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "Stored alignment"};
126
127
130
132
133
135 Gaudi::Property<int> m_adcCut{this, "AdcCut", 50,
136 "Minimal cut on the adc to convert it into a prepdata object"};
137 Gaudi::Property<bool> m_calibratePrepData{this, "CalibratePrepData", true};
138 Gaudi::Property<bool> m_decodeData{this, "DecodeData", true};
139 bool m_sortPrepData = false;
140
141 ToolHandle<Muon::IMDT_RDO_Decoder> m_mdtDecoder{this, "Decoder", "Muon::MdtRDO_Decoder/MdtRDO_Decoder"};
142
143 bool m_BMGpresent{false};
144 int m_BMGid{-1};
145
146 // + TWIN TUBE
147 Gaudi::Property<bool> m_useTwin{this, "UseTwin", true};
148 Gaudi::Property<bool> m_discardSecondaryHitTwin{this, "DiscardSecondaryHitTwin", false};
149
150 // - TWIN TUBE
151 SG::ReadCondHandleKey<TwinTubeMap> m_twinTubeKey{this, "TwinTubeKey", "MdtTwinTubeMap"};
152
153 std::unordered_set<Identifier> m_DeadChannels{};
154 void initDeadChannels(const MuonGM::MdtReadoutElement* mydetEl);
155
156 SG::ReadCondHandleKey<MuonMDT_CablingMap> m_readKey{this, "ReadKey", "MuonMDT_CablingMap", "Key of MuonMDT_CablingMap"};
157
158 SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muDetMgrKey{this, "DetectorManagerKey", "MuonDetectorManager",
159 "Key of input MuonDetectorManager condition data"};
160
162 "Optional external cache for the MDT PRD container"};
163
164 // xAOD PRDs
165 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"};
166 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"};
167
168 };
169} // namespace Muon
170
171#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:22
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