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