ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_RodDecoder.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 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/ThreadLocalContext.h"
32#include "GaudiKernel/ICondSvc.h"
36
37#include "CoralBase/Attribute.h"
38
39/*
40 * Identifier
41 */
43
44/*
45 * For cache
46 */
49
50/*
51 * STL
52 */
53#include <atomic>
54#include <map>
55#include <vector>
56
57// the tool to decode a ROB frament
58
59class TRT_RodDecoder : public extends<AthAlgTool, ITRT_RodDecoder>
60{
61public:
63 TRT_RodDecoder(const std::string& type, const std::string& name,
64 const IInterface* parent ) ;
66 virtual ~TRT_RodDecoder();
68 virtual StatusCode initialize() override;
70 virtual StatusCode finalize() override;
71
73 virtual StatusCode fillCollection ( const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment* robFrag,
74 TRT_RDO_Container* rdoIdc,
75 TRT_BSErrContainer* bserr,
76 DataPool<TRT_LoLumRawData>* dataItemsPool,
77 const EventContext& ctx,
78 const std::vector<IdentifierHash>* vecHash = 0) const override;
79
80
81 private:
82
84
85 /*
86 * Do we look for Front-End Errors at all?
87 */
89
90 /*
91 * Do we look for these types of Front-End Errors?
92 */
98
104
107
108 BooleanProperty m_TB04_RawData; // true to create TRT_TB04_RawData RDOs
109 BooleanProperty m_LoLumRawData; // true to create TRT_LoLumRawData RDOs
110
111 bool m_eventTypeIsSim; // look at first event to decide if RODBlockVersion
112 // is incorrect.
113
114 uint32_t m_escape_marker; // Straw word that means escaped literal
115
116 bool m_sortCollections{}; // sort collections by identifiers if required
117
118#define CTABLE_FC_LENGTH 33
119#define CTABLE_LI_LENGTH 33
120 typedef struct {
121 // The TableVersion is a compression scheme.
122 // There are presently 6 TableVersions for the different run periods of ATLAS.
123 // Any IoV of /TRT/onl/ROD/Compress has one (and only one) of these as an attribute.
124 // The code takes advantage of this and caches locally any TableVersion that is encountered
127 int m_lengths_integral[CTABLE_FC_LENGTH]; // ..[i] = Sum(numl[0,i-1])
128 std::unique_ptr<unsigned int[]> m_syms; // Array of symbols (straw data words)
131
132 std::vector<CxxUtils::CachedUniquePtr<t_CompressTable> > m_CompressionTables;
133
134 mutable std::atomic<uint32_t> m_Nrdos; // Number of RDOs created
135
136 mutable std::atomic<int> m_err_count_fillCollection{0};
137 mutable std::atomic<int> m_err_count_int_fillMinimalCompress{0};
138 mutable std::atomic<int> m_err_count_int_fillFullCompress{0};
139
140 // This replaces the IOVCALLBACK
141 SG::ReadCondHandleKey<CondAttrListCollection> m_CompressKey{this,"keyName","/TRT/Onl/ROD/Compress","in-key"};
142 StatusCode update(const EventContext& ctx) const;
143
145private:
146 StatusCode int_fillExpanded(
148 TRT_RDO_Container* rodIdc, DataPool<TRT_LoLumRawData>* dataItemsPool,
149 const std::vector<IdentifierHash>* vecHash = 0) const;
150
151 StatusCode int_fillMinimalCompress(
153 TRT_RDO_Container* rdoIdo, DataPool<TRT_LoLumRawData>* dataItemsPool,
154 const std::vector<IdentifierHash>* vecHash = 0) const;
155
156 StatusCode int_fillFullCompress(
158 TRT_RDO_Container* rdoIdo, DataPool<TRT_LoLumRawData>* dataItemsPool,
159 const t_CompressTable& Ctable,
160 const std::vector<IdentifierHash>* vecHash = 0) const;
161
162 StatusCode ReadCompressTableFile(const std::string& TableFilename);
163 StatusCode ReadCompressTableDB(std::string Tag);
164
166 m_lastPrint ATLAS_THREAD_SAFE;
167
168 mutable std::atomic<unsigned int> m_skip{};
169 mutable std::atomic<unsigned int> m_accept{};
170};
171
172#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...
This is an Identifier helper class for the TRT subdetector.
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:82
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]