ATLAS Offline Software
Loading...
Searching...
No Matches
MdtRdoToPrepDataToolMT.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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
27
28class MdtDigit;
29
30namespace Muon {
34
35 class MdtRdoToPrepDataToolMT : public extends<AthAlgTool, IMuonRdoToPrepDataTool> {
36 public:
37 using base_class::base_class;
38
40 virtual ~MdtRdoToPrepDataToolMT() = default;
41
43 virtual StatusCode initialize() override;
44
46 virtual StatusCode decode(const EventContext& ctx, const std::vector<IdentifierHash>& idVect) const override;
47 virtual StatusCode provideEmptyContainer(const EventContext& ctx) const override;
48 // new decode method for Rob based readout
49 virtual StatusCode decode(const EventContext& ctx, const std::vector<uint32_t>& robIds) const override;
50
51 protected:
52 void printPrepDataImpl(const Muon::MdtPrepDataContainer* mdtPrepDataContainer) const;
53
55 Muon::MdtDriftCircleStatus getMdtTwinPosition(const MdtDigit& prompt_digit, const MdtDigit& twin_digit, double& radius,
56 double& errRadius, double& zTwin, double& errZTwin, bool& twinIsPrompt) const;
57
58
60 struct ConvCache {
61 ConvCache(const Muon::IMuonIdHelperSvc* idHelperSvc);
67 StatusCode finalize(MsgStream& msg);
68
70
75 const TwinTubeMap* twinTubeMap{nullptr};
76
78 bool isValid{false};
79 std::vector<std::unique_ptr<MdtPrepDataCollection>> addedCols{};
80 };
81
82 StatusCode processCsm(const EventContext& ctx, ConvCache& mdtPrepDataContainer,
83 const MdtCsm* rdoColl) const;
84
85 StatusCode processCsmTwin(const EventContext& ctx,
86 ConvCache& mdtPrepDataContainer,
87 const MdtCsm* rdoColll) const;
88
90 std::unique_ptr<MdtPrepData> createPrepData(const MdtCalibInput& calibInput,
91 const MdtCalibOutput& calibOutput) const;
93 ConvCache setupMdtPrepDataContainer(const EventContext& ctx) const;
94
96 const MdtCsmContainer* getRdoContainer(const EventContext& ctx) const;
97
98 void processPRDHashes(const EventContext& ctx, ConvCache& mdtPrepDataContainer,
99 const std::vector<IdentifierHash>& chamberHashInRobs) const;
100
101 bool handlePRDHash(const EventContext& ctx, ConvCache& mdtPrepDataContainer,
102 IdentifierHash rdoHash) const;
103
104 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
105
107 ToolHandle<IMdtCalibrationTool> m_calibrationTool{this, "CalibrationTool", "MdtCalibrationTool"};
108
111
113
114
116 Gaudi::Property<int> m_adcCut{this, "AdcCut", 50,
117 "Minimal cut on the adc to convert it into a prepdata object"};
118 Gaudi::Property<bool> m_calibratePrepData{this, "CalibratePrepData", true};
119 Gaudi::Property<bool> m_decodeData{this, "DecodeData", true};
120 bool m_sortPrepData = false;
121
122 ToolHandle<Muon::IMDT_RDO_Decoder> m_mdtDecoder{this, "Decoder", "Muon::MdtRDO_Decoder/MdtRDO_Decoder"};
123
124 bool m_BMGpresent{false};
125 int m_BMGid{-1};
126
127 // + TWIN TUBE
128 Gaudi::Property<bool> m_useTwin{this, "UseTwin", true};
129 Gaudi::Property<bool> m_discardSecondaryHitTwin{this, "DiscardSecondaryHitTwin", false};
130
131 // - TWIN TUBE
132 SG::ReadCondHandleKey<TwinTubeMap> m_twinTubeKey{this, "TwinTubeKey", "MdtTwinTubeMap"};
133
134 std::unordered_set<Identifier> m_DeadChannels{};
135 void initDeadChannels(const MuonGM::MdtReadoutElement* mydetEl);
136
137 SG::ReadCondHandleKey<MuonMDT_CablingMap> m_readKey{this, "ReadKey", "MuonMDT_CablingMap", "Key of MuonMDT_CablingMap"};
138
139 SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muDetMgrKey{this, "DetectorManagerKey", "MuonDetectorManager",
140 "Key of input MuonDetectorManager condition data"};
141
143 "Optional external cache for the MDT PRD container"};
144
145 };
146} // namespace Muon
147
148#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.
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.
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
const MdtCsmContainer * getRdoContainer(const EventContext &ctx) const
Loads the input RDO container from StoreGate.
ToolHandle< IMdtCalibrationTool > m_calibrationTool
MDT calibration service.
std::unique_ptr< MdtPrepData > createPrepData(const MdtCalibInput &calibInput, const MdtCalibOutput &calibOutput) const
Creates the PRD object.
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.
void printPrepDataImpl(const Muon::MdtPrepDataContainer *mdtPrepDataContainer) const
virtual ~MdtRdoToPrepDataToolMT()=default
default destructor
std::unordered_set< Identifier > m_DeadChannels
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Gaudi::Property< int > m_adcCut
member variables for algorithm properties:
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muDetMgrKey
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
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
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 MuonGM::MuonDetectorManager * legacyDetMgr
Detector manager from the conditions store.
MsgStream & msg
Definition testRead.cxx:32