ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_RodDecoder.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 TRT_RAWDATABYTESTREAM_TRT_RODDECODER_H
6#define TRT_RAWDATABYTESTREAM_TRT_RODDECODER_H
7
8
9/*
10 * Base class
11 */
13
14/*
15 * Interface class for this Tool
16 */
18
19/*
20 * TRT Tools we use
21 */
23
24/*
25 * Framework Headers
26 * Service & Tool Handles
27 */
28#include "GaudiKernel/ServiceHandle.h"
29#include "GaudiKernel/ToolHandle.h"
30#include "GaudiKernel/ContextSpecificPtr.h"
31#include "GaudiKernel/ICondSvc.h"
36
37/*
38 * For cache
39 */
42
43/*
44 * STL
45 */
46#include <atomic>
47#include <map>
48#include <vector>
49#include <cstdint>
50#include <memory>
51
52class TRT_ID;
53
54// the tool to decode a ROB frament
55
56class TRT_RodDecoder : public extends<AthAlgTool, ITRT_RodDecoder>
57{
58public:
60 TRT_RodDecoder(const std::string& type, const std::string& name,
61 const IInterface* parent ) ;
63 virtual ~TRT_RodDecoder();
65 virtual StatusCode initialize() override;
67 virtual StatusCode finalize() override;
68
70 virtual StatusCode fillCollection ( const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment* robFrag,
71 TRT_RDO_Container* rdoIdc,
72 TRT_BSErrContainer* bserr,
73 DataPool<TRT_LoLumRawData>* dataItemsPool,
74 const EventContext& ctx,
75 const std::vector<IdentifierHash>* vecHash = 0) const override;
76
77
78 private:
79
81
82 /*
83 * Do we look for Front-End Errors at all?
84 */
86
87 /*
88 * Do we look for these types of Front-End Errors?
89 */
95
101
102 const TRT_ID* m_trt_id{};
104
105 BooleanProperty m_TB04_RawData; // true to create TRT_TB04_RawData RDOs
106 BooleanProperty m_LoLumRawData; // true to create TRT_LoLumRawData RDOs
107
108 bool m_eventTypeIsSim{}; // look at first event to decide if RODBlockVersion
109 // is incorrect.
110
111 uint32_t m_escape_marker{}; // Straw word that means escaped literal
112
113 bool m_sortCollections{}; // sort collections by identifiers if required
114
115#define CTABLE_FC_LENGTH 33
116#define CTABLE_LI_LENGTH 33
118 // The TableVersion is a compression scheme.
119 // There are presently 6 TableVersions for the different run periods of ATLAS.
120 // Any IoV of /TRT/onl/ROD/Compress has one (and only one) of these as an attribute.
121 // The code takes advantage of this and caches locally any TableVersion that is encountered
124 int m_lengths_integral[CTABLE_FC_LENGTH]{}; // ..[i] = Sum(numl[0,i-1])
125 std::unique_ptr<unsigned int[]> m_syms; // Array of symbols (straw data words)
127 } ;
128
129 std::vector<CxxUtils::CachedUniquePtr<t_CompressTable> > m_CompressionTables;
130
131 mutable std::atomic<uint32_t> m_Nrdos; // Number of RDOs created
132
133 mutable std::atomic<int> m_err_count_fillCollection{0};
134 mutable std::atomic<int> m_err_count_int_fillMinimalCompress{0};
135 mutable std::atomic<int> m_err_count_int_fillFullCompress{0};
136
137 // This replaces the IOVCALLBACK
138 SG::ReadCondHandleKey<CondAttrListCollection> m_CompressKey{this,"keyName","/TRT/Onl/ROD/Compress","in-key"};
139 StatusCode update(const EventContext& ctx) const;
140
142private:
143 StatusCode int_fillExpanded(
145 TRT_RDO_Container* rodIdc, DataPool<TRT_LoLumRawData>* dataItemsPool,
146 const std::vector<IdentifierHash>* vecHash = 0) const;
147
148 StatusCode int_fillMinimalCompress(
150 TRT_RDO_Container* rdoIdo, DataPool<TRT_LoLumRawData>* dataItemsPool,
151 const std::vector<IdentifierHash>* vecHash = 0) const;
152
153 StatusCode int_fillFullCompress(
155 TRT_RDO_Container* rdoIdo, DataPool<TRT_LoLumRawData>* dataItemsPool,
156 const t_CompressTable& Ctable,
157 const std::vector<IdentifierHash>* vecHash = 0) const;
158
159 StatusCode ReadCompressTableFile(const std::string& TableFilename);
160 StatusCode ReadCompressTableDB(std::string Tag);
161
163 m_lastPrint ATLAS_THREAD_SAFE;
164
165 mutable std::atomic<unsigned int> m_skip{};
166 mutable std::atomic<unsigned int> m_accept{};
167};
168
169#endif
Maintain a set of objects, one per slot.
Cached unique_ptr with atomic update.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
InDetRawDataContainer< InDetRawDataCollection< TRT_RDORawData > > TRT_RDO_Container
#define CTABLE_FC_LENGTH
Define macros for attributes used to control the static checker.
a typed memory pool that saves time spent allocation small object.
Definition DataPool.h:63
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition IdContext.h:26
Maintain a set of objects, one per slot.
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:84
StatusCode int_fillExpanded(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *robFrag, TRT_RDO_Container *rodIdc, DataPool< TRT_LoLumRawData > *dataItemsPool, const std::vector< IdentifierHash > *vecHash=0) const
private methods
std::atomic< int > m_err_count_fillCollection
SG::ReadCondHandleKey< CondAttrListCollection > m_CompressKey
virtual ~TRT_RodDecoder()
destructor
StatusCode ReadCompressTableFile(const std::string &TableFilename)
StatusCode ReadCompressTableDB(std::string Tag)
StatusCode update(const EventContext &ctx) const
std::vector< CxxUtils::CachedUniquePtr< t_CompressTable > > m_CompressionTables
IdContext m_straw_layer_context
uint32_t m_escape_marker
std::vector< int > m_LoadCompressTableVersions
StatusCode int_fillMinimalCompress(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *robFrag, TRT_RDO_Container *rdoIdo, DataPool< TRT_LoLumRawData > *dataItemsPool, const std::vector< IdentifierHash > *vecHash=0) const
virtual StatusCode initialize() override
initialize
std::atomic< uint32_t > m_Nrdos
std::atomic< unsigned int > m_skip
TRT_RodDecoder(const std::string &type, const std::string &name, const IInterface *parent)
constructor
bool m_loadCompressTableFile
SG::SlotSpecificObj< std::atomic< EventContext::ContextEvt_t > > m_lastPrint ATLAS_THREAD_SAFE
BooleanProperty m_LoLumRawData
std::atomic< unsigned int > m_accept
StatusCode int_fillFullCompress(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *robFrag, TRT_RDO_Container *rdoIdo, DataPool< TRT_LoLumRawData > *dataItemsPool, const t_CompressTable &Ctable, const std::vector< IdentifierHash > *vecHash=0) const
std::atomic< int > m_err_count_int_fillFullCompress
ServiceHandle< ITRT_CablingSvc > m_CablingSvc
BooleanProperty m_TB04_RawData
virtual StatusCode finalize() override
finalize
virtual StatusCode fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *robFrag, TRT_RDO_Container *rdoIdc, TRT_BSErrContainer *bserr, DataPool< TRT_LoLumRawData > *dataItemsPool, const EventContext &ctx, const std::vector< IdentifierHash > *vecHash=0) const override
the method to fill the IDC
std::atomic< int > m_err_count_int_fillMinimalCompress
const int m_maxCompressionVersion
const TRT_ID * m_trt_id
eformat::ROBFragment< PointerType > ROBFragment
Definition RawEvent.h:27
int m_lengths_integral[CTABLE_FC_LENGTH]
std::unique_ptr< unsigned int[]> m_syms
int m_firstcode[CTABLE_FC_LENGTH]