ATLAS Offline Software
Loading...
Searching...
No Matches
TRTRawDataProviderTool Class Reference

#include <TRTRawDataProviderTool.h>

Inheritance diagram for TRTRawDataProviderTool:
Collaboration diagram for TRTRawDataProviderTool:

Public Member Functions

 TRTRawDataProviderTool (const std::string &type, const std::string &name, const IInterface *parent)
 constructor
virtual StatusCode initialize () override
 initialize
virtual StatusCode convert (const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, TRT_RDO_Container *rdoIdc, TRT_BSErrContainer *bsErrCont, DataPool< TRT_LoLumRawData > *dataItemsPool, const EventContext &ctx) const override
 this is the main decoding method

Private Attributes

ToolHandle< ITRT_RodDecoderm_decoder
SG::WriteHandleKey< InDetTimeCollectionm_lvl1idkey {this,"LVL1IDKey","TRT_LVL1ID","TRT_LVL1ID out-key"}
SG::WriteHandleKey< InDetTimeCollectionm_bcidkey {this,"BCIDKey","TRT_BCID","TRT_BCID out-key"}
Gaudi::Property< bool > m_storeInDetTimeColls {this, "StoreInDetTimeCollections", true, "Store LVL1ID and BCID"}

Detailed Description

Definition at line 28 of file TRTRawDataProviderTool.h.

Constructor & Destructor Documentation

◆ TRTRawDataProviderTool()

TRTRawDataProviderTool::TRTRawDataProviderTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

constructor

Definition at line 26 of file TRTRawDataProviderTool.cxx.

28 : base_class( type, name, parent ),
29 m_decoder ("TRT_RodDecoder",this)
30{
31 declareProperty ("Decoder", m_decoder);
32}
ToolHandle< ITRT_RodDecoder > m_decoder

Member Function Documentation

◆ convert()

StatusCode TRTRawDataProviderTool::convert ( const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > & vecRobs,
TRT_RDO_Container * rdoIdc,
TRT_BSErrContainer * bsErrCont,
DataPool< TRT_LoLumRawData > * dataItemsPool,
const EventContext & ctx ) const
overridevirtual

this is the main decoding method

Definition at line 55 of file TRTRawDataProviderTool.cxx.

60{
61
62 static std::atomic_int DecodeErrCount = 0;
63
64 if(vecRobs.empty())
65 return StatusCode::SUCCESS;
66
67
68 std::unique_ptr<InDetTimeCollection> LVL1Collection;
69 std::unique_ptr<InDetTimeCollection> BCCollection;
70 std::vector<const ROBFragment*>::const_iterator rob_it = vecRobs.begin();
71
72
74 // Create Collections for per ROD vectors on L1ID and BCID
75 LVL1Collection = std::make_unique<InDetTimeCollection>();
76 LVL1Collection->reserve(vecRobs.size());
77
78 BCCollection = std::make_unique<InDetTimeCollection>();
79 BCCollection->reserve(vecRobs.size());
80 }
81
82 // loop over the ROB fragments
83 for(; rob_it!=vecRobs.end(); ++rob_it)
84 {
85
86 uint32_t robid = (*rob_it)->rod_source_id();
87
89 /*
90 * Add to vector containing pairs of (ROD ID, [L1ID,BCID])
91 */
92
93 unsigned int lvl1id = (*rob_it)->rod_lvl1_id();
94 LVL1Collection->emplace_back(robid, lvl1id);
95
96 unsigned int bcid = (*rob_it)->rod_bc_id();
97 BCCollection->emplace_back(robid, bcid);
98
99#ifdef TRT_BSC_DEBUG
100 ATH_MSG_DEBUG( "Stored LVL1ID " << lvl1id << " and BCID " << bcid << " in InDetTimeCollections" );
101#endif
102 }
103 StatusCode sc = m_decoder->fillCollection( &**rob_it, rdoIdc, bserr, dataItemsPool, ctx);
104 if ( sc == StatusCode::FAILURE )
105 {
106 if (DecodeErrCount < 100) {
107 ATH_MSG_INFO("Problem with TRT ByteStream Decoding!");
108 DecodeErrCount++;
109 } else if (100 == DecodeErrCount) {
111 "Too many Problem with TRT Decoding messages. Turning message "
112 "off.");
113 DecodeErrCount++;
114 }
115 // return sc; Don't return on single ROD failure
116 }
117 }
118
119 /*
120 * record per ROD L1ID and BCID collections
121 */
122 if ( m_storeInDetTimeColls ) {
123
124 SG::WriteHandle<InDetTimeCollection> lvl1id(m_lvl1idkey,ctx);
125 ATH_CHECK(lvl1id.record(std::move(LVL1Collection)));
126
127 SG::WriteHandle<InDetTimeCollection> bcid(m_bcidkey,ctx);
128 ATH_CHECK(bcid.record(std::move(BCCollection)));
129 }
130
131 return StatusCode::SUCCESS;
132}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
SG::WriteHandleKey< InDetTimeCollection > m_lvl1idkey
SG::WriteHandleKey< InDetTimeCollection > m_bcidkey
Gaudi::Property< bool > m_storeInDetTimeColls
::StatusCode StatusCode
StatusCode definition for legacy code.
setEventNumber setTimeStamp bcid
setEventNumber uint32_t

◆ initialize()

StatusCode TRTRawDataProviderTool::initialize ( )
overridevirtual

initialize

Definition at line 37 of file TRTRawDataProviderTool.cxx.

38{
39
40 ATH_CHECK( AlgTool::initialize() );
41
42 ATH_CHECK( m_decoder.retrieve() );
43 ATH_MSG_INFO( "Retrieved tool " << m_decoder );
44
45 //initialize write handles
48
49 return StatusCode::SUCCESS;
50}

Member Data Documentation

◆ m_bcidkey

SG::WriteHandleKey<InDetTimeCollection> TRTRawDataProviderTool::m_bcidkey {this,"BCIDKey","TRT_BCID","TRT_BCID out-key"}
private

Definition at line 50 of file TRTRawDataProviderTool.h.

50{this,"BCIDKey","TRT_BCID","TRT_BCID out-key"};

◆ m_decoder

ToolHandle<ITRT_RodDecoder> TRTRawDataProviderTool::m_decoder
private

Definition at line 47 of file TRTRawDataProviderTool.h.

◆ m_lvl1idkey

SG::WriteHandleKey<InDetTimeCollection> TRTRawDataProviderTool::m_lvl1idkey {this,"LVL1IDKey","TRT_LVL1ID","TRT_LVL1ID out-key"}
private

Definition at line 49 of file TRTRawDataProviderTool.h.

49{this,"LVL1IDKey","TRT_LVL1ID","TRT_LVL1ID out-key"};

◆ m_storeInDetTimeColls

Gaudi::Property<bool> TRTRawDataProviderTool::m_storeInDetTimeColls {this, "StoreInDetTimeCollections", true, "Store LVL1ID and BCID"}
private

Definition at line 51 of file TRTRawDataProviderTool.h.

51{this, "StoreInDetTimeCollections", true, "Store LVL1ID and BCID"};

The documentation for this class was generated from the following files: