ATLAS Offline Software
Loading...
Searching...
No Matches
TrigCaloDataAccessSvc.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 TrigT2CaloCommon_TrigCaloDataAccessSvc_h
6#define TrigT2CaloCommon_TrigCaloDataAccessSvc_h
7
8
12
32
33#include <mutex>
34#include <algorithm> //std::copy
35#include <string>
36#include <vector>
37#include <cstdint>
38#include <iterator> //std::back_inserter
39#include <set>
40#include <initializer_list>
41#include <memory>
42
43class IRoiDescriptor;
44
45
46class TrigCaloDataAccessSvc : public extends<AthService, ITrigCaloDataAccessSvc> {
47 public:
48 using base_class::base_class;
49 using ITrigCaloDataAccessSvc::Status;
50
51
52 virtual StatusCode initialize() override;
53 virtual StatusCode finalize() override;
54
55 virtual StatusCode loadCollections ( const EventContext& context,
56 const IRoiDescriptor& roi,
57 const DETID detID,
58 const int sampling,
59 LArTT_Selector<LArCellCont>& loadedCells ) override;
60
61 virtual StatusCode loadCollections ( const EventContext& context,
62 const IRoiDescriptor& roi,
63 std::vector<const TileCell*>& loadedCells ) override;
64
65 virtual StatusCode loadMBTS ( const EventContext& context,
66 std::vector<const TileCell*>& loadedCells ) override;
67
68
69
70 virtual StatusCode loadFullCollections ( const EventContext& context,
71 CaloConstCellContainer& cont ) override;
72
73 private:
74
75 PublicToolHandle<LArRodDecoder> m_larDecoder { this, "LArDecoderTool", "LArRodDecoder/LArRodDecoder", "Tool to decode LAr raw data" };
76 PublicToolHandle<TileROD_Decoder> m_tileDecoder { this, "TileDecoderTool", "TileROD_Decoder/TileROD_Decoder", "Tool to decode Tile raw data" };
77
78 ToolHandle<GenericMonitoringTool> m_monTool{ this, "MonTool", "", "Tool to monitor performance of the service" };
79
80 ServiceHandle<IROBDataProviderSvc> m_robDataProvider{ this, "ROBDataProvider", "ROBDataProviderSvc/ROBDataProviderSvc", ""};
81 ToolHandle<IRegSelTool> m_regionSelector_TTEM { this, "RegSelToolEM", "RegSelTool/RegSelTool_TTEM" };
82 ToolHandle<IRegSelTool> m_regionSelector_TTHEC { this, "RegSelToolHEC", "RegSelTool/RegSelTool_TTHEC" };
83 ToolHandle<IRegSelTool> m_regionSelector_FCALEM { this, "RegSelToolFCALEM", "RegSelTool/RegSelTool_FCALEM" };
84 ToolHandle<IRegSelTool> m_regionSelector_FCALHAD { this, "RegSelToolFCALHAD", "RegSelTool/RegSelTool_FCALHAD" };
85 ToolHandle<IRegSelTool> m_regionSelector_TILE { this, "RegSelToolTILE", "RegSelTool/RegSelTool_TILE" };
86
87 Gaudi::Property<bool> m_applyOffsetCorrection { this, "ApplyOffsetCorrection", true, "Enable offset correction" };
88
90 {this, "BCIDAvgKey", "CaloBCIDAverage", "SG Key of CaloBCIDAverage object"} ;
92 {this, "MCSymKey", "LArMCSym", "SG Key of LArMCSym object"} ;
94 {this, "CablingKey", "LArOnOffIdMap", "SG Key for LArOnOffIdMapping"} ;
96 {this, "RodFebKey", "LArFebRodMap", "SG Key for LArFebRodMapping"} ;
98 {this, "LArBadChannelKey", "LArBadChannel", "Key of the LArBadChannelCont CDO" };
100 {this, "LArRoIMapKey", "LArRoIMap", "Key of the LArRoIMap CDO" };
102 {this, "CaloDetDescrManager", "CaloDetDescrManager", "SG Key for CaloDetDescrManager in the Condition Store" };
104 {this, "TileHid2RESrcID", "TileHid2RESrcIDHLT", "SG Key of TileHid2RESrcID object"} ;
106 {this, "LArDeadOTXFromSC", "DeadOTXFromSC", "Key of the DeadOTXFromSC CDO" };
107 bool m_correctDead{false};
108
113 std::mutex mutex;
114 std::unique_ptr<LArCellCont> larContainer;
115 LArRodBlockStructure* larRodBlockStructure_per_slot; // LAr Rod Block to ease decoding
117 uint32_t robBlockType;
118 std::unique_ptr<TileCellCont> tileContainer;
119 std::unique_ptr<CaloCellContainer> fullcont;
120 std::unique_ptr<TileROD_Decoder::D0CellsHLT> d0cells;
121 unsigned int lastFSEvent;
122 };
123
124 // cells created in lateInit which must be deleted in finalize
125 std::vector<unsigned int> m_insertedCells;
126
128
129 std::mutex m_getCollMutex; // Make sure writing to a collection is protected
130 std::mutex m_lardecoderProtect; // protection for the larRodDecoder
131 std::mutex m_tiledecoderProtect; // protection for the tileRodDecoder
132
135
136 void lateInit( const EventContext& context );
137 std::once_flag m_lateInitFlag;
138
139 void convertROBs(const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& robFrags, LArCellCont* larcell, LArRodBlockStructure*& larRodBlockStructure, uint16_t rodMinorVersion, uint32_t robBlockType, const LArDeadOTXFromSC* dead );
140 void convertROBs( const EventContext& context, const std::vector<IdentifierHash>& rIds, TileCellCont* tilecell, TileROD_Decoder::D0CellsHLT* d0cells );
141
142
146 void missingROBs( const std::vector<uint32_t>& request,
147 const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& response,
148 std::set<uint32_t>& missing ) const;
149
153 void clearMissing( const std::vector<uint32_t>& request,
154 const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& response,
155 LArCellCont* larcell );
156
160 StatusCode prepareLArCollections( const EventContext& context,
161 const IRoiDescriptor& roi,
162 const int sampling,
163 DETID detector );
164
165 StatusCode prepareTileCollections( const EventContext& context,
166 const IRoiDescriptor& roi );
167
168 StatusCode prepareMBTSCollections( const EventContext& context);
169
170 StatusCode prepareLArFullCollections( const EventContext& context );
171
172 StatusCode prepareTileFullCollections( const EventContext& context );
173
174 std::vector<uint32_t> m_vrodid32fullDet;
175 std::vector<uint32_t> m_vrodid32tile;
176 std::vector<unsigned int> m_mbts_add_rods;
177 std::vector<IdentifierHash> m_rIdstile;
178 std::vector<std::vector<uint32_t> > m_vrodid32fullDetHG;
179};
180
181
182#endif
Maintain a set of objects, one per slot.
Definition of CaloDetDescrManager.
Mapping between calorimeter trigger id to offline/online Identifier.
MDT_Response response
DETID
An enum to define subdetector names.
Definition RegSelEnums.h:23
Property holding a SG store/key/clid from which a ReadHandle is made.
CaloCellContainer that can accept const cell pointers.
Describes the API of the Region of Ineterest geometry.
Container Class for LArCell in a ROB used by EF.
Class which contains statically allocated LArCellCollections.
Definition LArCellCont.h:42
Property holding a SG store/key/clid from which a ReadHandle is made.
Maintain a set of objects, one per slot.
This class builds the Tile cells.
PublicToolHandle< TileROD_Decoder > m_tileDecoder
std::vector< unsigned int > m_mbts_add_rods
ToolHandle< IRegSelTool > m_regionSelector_TTHEC
SG::ReadCondHandleKey< TileHid2RESrcID > m_tileHid2RESrcIDKey
StatusCode prepareLArFullCollections(const EventContext &context)
SG::ReadHandleKey< CaloBCIDAverage > m_bcidAvgKey
void lateInit(const EventContext &context)
void reset_TileCol(TileCellCollection *col)
void convertROBs(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &robFrags, LArCellCont *larcell, LArRodBlockStructure *&larRodBlockStructure, uint16_t rodMinorVersion, uint32_t robBlockType, const LArDeadOTXFromSC *dead)
StatusCode prepareMBTSCollections(const EventContext &context)
void clearMissing(const std::vector< uint32_t > &request, const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &response, LArCellCont *larcell)
clear fragments of the collection for which ROBs were not available
SG::ReadCondHandleKey< LArFebRodMapping > m_febRodMappingKey
Gaudi::Property< bool > m_applyOffsetCorrection
SG::ReadCondHandleKey< LArOnOffIdMapping > m_onOffIdMappingKey
std::vector< uint32_t > m_vrodid32tile
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
PublicToolHandle< LArRodDecoder > m_larDecoder
ToolHandle< GenericMonitoringTool > m_monTool
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
virtual StatusCode initialize() override
virtual StatusCode loadCollections(const EventContext &context, const IRoiDescriptor &roi, const DETID detID, const int sampling, LArTT_Selector< LArCellCont > &loadedCells) override
ToolHandle< IRegSelTool > m_regionSelector_FCALEM
SG::ReadHandleKey< LArDeadOTXFromSC > m_deadOTXFromSCKey
virtual StatusCode loadMBTS(const EventContext &context, std::vector< const TileCell * > &loadedCells) override
SG::ReadCondHandleKey< LArRoIMap > m_larRoIMapKey
std::vector< std::vector< uint32_t > > m_vrodid32fullDetHG
ToolHandle< IRegSelTool > m_regionSelector_TTEM
StatusCode prepareTileFullCollections(const EventContext &context)
SG::SlotSpecificObj< HLTCaloEventCache > m_hLTCaloSlot
StatusCode prepareLArCollections(const EventContext &context, const IRoiDescriptor &roi, const int sampling, DETID detector)
LAr TT collections preparation code.
std::vector< unsigned int > m_insertedCells
void missingROBs(const std::vector< uint32_t > &request, const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &response, std::set< uint32_t > &missing) const
fill the set of missing robs given the request and response from RoBDatProvider
std::vector< uint32_t > m_vrodid32fullDet
ToolHandle< IRegSelTool > m_regionSelector_FCALHAD
ToolHandle< IRegSelTool > m_regionSelector_TILE
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
SG::ReadCondHandleKey< LArMCSym > m_mcsymKey
StatusCode prepareTileCollections(const EventContext &context, const IRoiDescriptor &roi)
void reset_LArCol(LArCellCollection *coll)
virtual StatusCode finalize() override
std::vector< IdentifierHash > m_rIdstile
virtual StatusCode loadFullCollections(const EventContext &context, CaloConstCellContainer &cont) override
convience structure to keep together a collection and auxiliar full collection selectors
std::unique_ptr< TileCellCont > tileContainer
std::unique_ptr< CaloCellContainer > fullcont
std::unique_ptr< TileROD_Decoder::D0CellsHLT > d0cells
std::unique_ptr< LArCellCont > larContainer