ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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 More...
 
virtual StatusCode initialize () override
 initialize More...
 
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 More...
 

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 }

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 
73  if ( m_storeInDetTimeColls ) {
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) {
110  ATH_MSG_INFO(
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 
125  ATH_CHECK(lvl1id.record(std::move(LVL1Collection)));
126 
128  ATH_CHECK(bcid.record(std::move(BCCollection)));
129  }
130 
131  return StatusCode::SUCCESS;
132 }

◆ initialize()

StatusCode TRTRawDataProviderTool::initialize ( )
overridevirtual

initialize

Definition at line 37 of file TRTRawDataProviderTool.cxx.

38 {
39 
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.

◆ 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.

◆ m_storeInDetTimeColls

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

Definition at line 51 of file TRTRawDataProviderTool.h.


The documentation for this class was generated from the following files:
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
initialize
void initialize()
Definition: run_EoverP.cxx:894
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TRTRawDataProviderTool::m_decoder
ToolHandle< ITRT_RodDecoder > m_decoder
Definition: TRTRawDataProviderTool.h:47
TRTRawDataProviderTool::m_lvl1idkey
SG::WriteHandleKey< InDetTimeCollection > m_lvl1idkey
Definition: TRTRawDataProviderTool.h:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
plotBeamSpotVxVal.bserr
float bserr
Definition: plotBeamSpotVxVal.py:283
TRTRawDataProviderTool::m_bcidkey
SG::WriteHandleKey< InDetTimeCollection > m_bcidkey
Definition: TRTRawDataProviderTool.h:50
TRTRawDataProviderTool::m_storeInDetTimeColls
Gaudi::Property< bool > m_storeInDetTimeColls
Definition: TRTRawDataProviderTool.h:51