ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
LVL1BS::RodHeaderByteStreamTool Class Reference

Tool to perform ROB fragments to ROD Header conversions. More...

#include <RodHeaderByteStreamTool.h>

Inheritance diagram for LVL1BS::RodHeaderByteStreamTool:
Collaboration diagram for LVL1BS::RodHeaderByteStreamTool:

Public Member Functions

 RodHeaderByteStreamTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~RodHeaderByteStreamTool ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
StatusCode convert (const std::string &name, DataVector< LVL1::RODHeader > *rhCollection) const
 Convert ROB fragments to RODHeaders. More...
 
StatusCode convert (const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::RODHeader > *rhCollection) const
 
const std::vector< uint32_t > & sourceIDs (const std::string &sgKey) const
 Return reference to vector with all possible Source Identifiers. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool InterfaceID. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef DataVector< LVL1::RODHeaderRodHeaderCollection
 
typedef IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
 
typedef OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
 
typedef OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

std::vector< uint32_t > makeAllRobIds () const
 Fill vector with ROB IDs for given sub-detector. More...
 
std::vector< uint32_t > makeRobIds (int numCrates, int crateOffset, const std::vector< int > &slinks, int daqOrRoi, eformat::SubDetector subdet, const std::vector< uint32_t > &prop) const
 
bool isAppended (const std::string &sgKey, const std::string &flag) const
 Return true if StoreGate key ends in given string. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ServiceHandle< IROBDataProviderSvcm_robDataProvider
 Service for reading bytestream. More...
 
ToolHandle< LVL1BS::L1CaloErrorByteStreamToolm_errorTool
 Error collection tool. More...
 
std::vector< uint32_t > m_sourceIDsProp
 ROB source IDs. More...
 
std::vector< uint32_t > m_sourceIDsPPProp
 
std::vector< uint32_t > m_sourceIDsCPProp
 
std::vector< uint32_t > m_sourceIDsJEPProp
 
std::vector< uint32_t > m_sourceIDsCPRoIProp
 
std::vector< uint32_t > m_sourceIDsJEPRoIProp
 
std::vector< uint32_t > m_sourceIDsCPRoIBProp
 
std::vector< uint32_t > m_sourceIDsJEPRoIBProp
 
const L1CaloSrcIdMap m_srcIdMap
 Source ID converter. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Tool to perform ROB fragments to ROD Header conversions.

Based on ROD document version 1_09h.

Author
Peter Faulkner

Definition at line 43 of file RodHeaderByteStreamTool.h.

Member Typedef Documentation

◆ ROBIterator

typedef IROBDataProviderSvc::VROBFRAG::const_iterator LVL1BS::RodHeaderByteStreamTool::ROBIterator
private

Definition at line 68 of file RodHeaderByteStreamTool.h.

◆ ROBPointer

Definition at line 69 of file RodHeaderByteStreamTool.h.

◆ RodHeaderCollection

Definition at line 67 of file RodHeaderByteStreamTool.h.

◆ RODPointer

Definition at line 70 of file RodHeaderByteStreamTool.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ RodHeaderByteStreamTool()

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

Definition at line 46 of file RodHeaderByteStreamTool.cxx.

50  m_robDataProvider("ROBDataProviderSvc", name),
51  m_errorTool("LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool")
52 {
53  declareInterface<RodHeaderByteStreamTool>(this);
54 
55  declareProperty("ErrorTool", m_errorTool,
56  "Tool to collect errors for monitoring");
57  declareProperty("ROBSourceIDs", m_sourceIDsProp,
58  "ROB fragment source identifiers - All except RoIB");
59  declareProperty("ROBSourceIDsPP", m_sourceIDsPPProp,
60  "ROB fragment source identifiers - PP only");
61  declareProperty("ROBSourceIDsCP", m_sourceIDsCPProp,
62  "ROB fragment source identifiers - CP DAQ only");
63  declareProperty("ROBSourceIDsJEP", m_sourceIDsJEPProp,
64  "ROB fragment source identifiers - JEP DAQ only");
65  declareProperty("ROBSourceIDsCPRoI", m_sourceIDsCPRoIProp,
66  "ROB fragment source identifiers - CP RoI only");
67  declareProperty("ROBSourceIDsJEPRoI", m_sourceIDsJEPRoIProp,
68  "ROB fragment source identifiers - JEP RoI only");
69  declareProperty("ROBSourceIDsCPRoIB", m_sourceIDsCPRoIBProp,
70  "ROB fragment source identifiers - CP RoIB only");
71  declareProperty("ROBSourceIDsJEPRoIB", m_sourceIDsJEPRoIBProp,
72  "ROB fragment source identifiers - JEP RoIB only");
73 }

◆ ~RodHeaderByteStreamTool()

LVL1BS::RodHeaderByteStreamTool::~RodHeaderByteStreamTool ( )
virtual

Definition at line 77 of file RodHeaderByteStreamTool.cxx.

78 {
79 }

Member Function Documentation

◆ convert() [1/2]

StatusCode LVL1BS::RodHeaderByteStreamTool::convert ( const IROBDataProviderSvc::VROBFRAG robFrags,
DataVector< LVL1::RODHeader > *  rhCollection 
) const

Definition at line 115 of file RodHeaderByteStreamTool.cxx.

118 {
119  const bool debug = msgLvl(MSG::DEBUG);
120  if (debug) msg(MSG::DEBUG);
121 
122  // Loop over ROB fragments
123 
124  int robCount = 0;
125  std::set<uint32_t> dupCheck;
126  ROBIterator rob = robFrags.begin();
127  ROBIterator robEnd = robFrags.end();
128  for (; rob != robEnd; ++rob) {
129 
130  if (debug) {
131  ++robCount;
132  msg() << "Treating ROB fragment " << robCount << endmsg;
133  }
134 
135  // Skip fragments with ROB status errors
136 
137  uint32_t robid = (*rob)->source_id();
138  if ((*rob)->nstatus() > 0) {
139  ROBPointer robData;
140  (*rob)->status(robData);
141  if (*robData != 0) {
142  m_errorTool->robError(robid, *robData);
143  if (debug) msg() << "ROB status error - skipping fragment" << endmsg;
144  continue;
145  }
146  }
147 
148  // Skip duplicate fragments
149 
150  if (!dupCheck.insert(robid).second) {
152  if (debug) msg() << "Skipping duplicate ROB fragment" << endmsg;
153  continue;
154  }
155 
156  // Unpack ROD header info
157 
158  const uint32_t version = (*rob)->rod_version();
159  const uint32_t sourceId = (*rob)->rod_source_id();
160  const uint32_t run = (*rob)->rod_run_no();
161  const uint32_t lvl1Id = (*rob)->rod_lvl1_id();
162  const uint32_t bcId = (*rob)->rod_bc_id();
163  const uint32_t trigType = (*rob)->rod_lvl1_trigger_type();
164  const uint32_t detType = (*rob)->rod_detev_type();
165  const uint32_t nData = (*rob)->rod_ndata();
166 
167  // Unpack status words
168 
169  std::vector<uint32_t> statusWords;
170  unsigned int nstatus = (*rob)->rod_nstatus();
171  if (nstatus <= 2) {
173  RODPointer statusEnd;
174  (*rob)->rod_status(status);
175  statusEnd = status + nstatus;
176  for (; status != statusEnd; ++status) statusWords.push_back(*status);
177  } else { // Likely corruption
179  continue;
180  }
181 
182  // Save
183 
184  rhCollection->push_back(new LVL1::RODHeader(version, sourceId, run, lvl1Id,
185  bcId, trigType, detType, statusWords, nData));
186  if (debug) {
187  msg() << MSG::hex
188  << "ROD Header version/sourceId/run/lvl1Id/bcId/trigType/detType/nData: "
189  << version << "/" << sourceId << "/" << run << "/" << lvl1Id << "/"
190  << bcId << "/" << trigType << "/" << detType << "/" << nData
191  << endmsg << "ROD Status Words:";
192  std::vector<uint32_t>::const_iterator pos = statusWords.begin();
193  std::vector<uint32_t>::const_iterator pose = statusWords.end();
194  for (; pos != pose; ++pos) msg() << " " << *pos;
195  msg() << MSG::dec << endmsg;
196  }
197  }
198 
199  return StatusCode::SUCCESS;
200 }

◆ convert() [2/2]

StatusCode LVL1BS::RodHeaderByteStreamTool::convert ( const std::string &  name,
DataVector< LVL1::RODHeader > *  rhCollection 
) const

Convert ROB fragments to RODHeaders.

Definition at line 103 of file RodHeaderByteStreamTool.cxx.

106 {
107  const std::vector<uint32_t>& vID(sourceIDs(sgKey));
108  // // get ROB fragments
110  m_robDataProvider->getROBData(vID, robFrags, "RodHeaderByteStreamTool");
111  ATH_MSG_DEBUG("Number of ROB fragments:" << robFrags.size());
112  return convert(robFrags, rhCollection);
113 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode LVL1BS::RodHeaderByteStreamTool::finalize ( )
overridevirtual

Definition at line 95 of file RodHeaderByteStreamTool.cxx.

96 {
97  return StatusCode::SUCCESS;
98 }

◆ initialize()

StatusCode LVL1BS::RodHeaderByteStreamTool::initialize ( )
overridevirtual

Definition at line 84 of file RodHeaderByteStreamTool.cxx.

85 {
86  ATH_MSG_INFO( "Initializing " << name() );
87 
88  ATH_CHECK( m_errorTool.retrieve() );
89 
90  return StatusCode::SUCCESS;
91 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & LVL1BS::RodHeaderByteStreamTool::interfaceID ( )
static

AlgTool InterfaceID.

Definition at line 39 of file RodHeaderByteStreamTool.cxx.

40 {
41  return IID_IRodHeaderByteStreamTool;
42 }

◆ isAppended()

bool LVL1BS::RodHeaderByteStreamTool::isAppended ( const std::string &  sgKey,
const std::string &  flag 
) const
private

Return true if StoreGate key ends in given string.

Definition at line 316 of file RodHeaderByteStreamTool.cxx.

318 {
319 
320  return ::hasEnding(sgKey, flag) || ::hasEnding(sgKey, flag + "Aux.");
321 }

◆ makeAllRobIds()

std::vector< uint32_t > LVL1BS::RodHeaderByteStreamTool::makeAllRobIds ( ) const
private

Fill vector with ROB IDs for given sub-detector.

Definition at line 270 of file RodHeaderByteStreamTool.cxx.

271 {
272  std::vector<uint32_t> robIds;
273 
274  auto append = [&robIds] (const std::vector<uint32_t>& v)
275  { robIds.insert (robIds.end(), v.begin(), v.end()); };
276 
277  append (sourceIDs ("PP"));
278  append (sourceIDs ("CP"));
279  append (sourceIDs ("CPRoI"));
280  append (sourceIDs ("JEP"));
281  append (sourceIDs ("JEPRoI"));
282 
283  // Don't include RoIBs (LVL2) in complete set
284  return robIds;
285 }

◆ makeRobIds()

std::vector< uint32_t > LVL1BS::RodHeaderByteStreamTool::makeRobIds ( int  numCrates,
int  crateOffset,
const std::vector< int > &  slinks,
int  daqOrRoi,
eformat::SubDetector  subdet,
const std::vector< uint32_t > &  prop 
) const
private

Definition at line 288 of file RodHeaderByteStreamTool.cxx.

294 {
295  std::vector<uint32_t> robs;
296 
297  if (!prop.empty()) {
298  robs = prop;
299  }
300  else {
301  for (int crate = 0; crate < numCrates; ++crate) {
302  const int numSlinks = slinks.size();
303  for (int i = 0; i < numSlinks; ++i) {
304  const uint32_t rodId = m_srcIdMap.getRodID(crate + crateOffset,
305  slinks[i], daqOrRoi, subdet);
306  const uint32_t robId = m_srcIdMap.getRobID(rodId);
307  robs.push_back (robId);
308  }
309  }
310  }
311  return robs;
312 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sourceIDs()

const std::vector< uint32_t > & LVL1BS::RodHeaderByteStreamTool::sourceIDs ( const std::string &  sgKey) const

Return reference to vector with all possible Source Identifiers.

Definition at line 204 of file RodHeaderByteStreamTool.cxx.

206 {
207  if (isAppended(sgKey, "PP")) {
208  static const std::vector<int> slinksPP { 0, 1, 2, 3 };
209  static const std::vector<uint32_t> sourceIDsPP =
210  makeRobIds(8, 0, slinksPP, 0, eformat::TDAQ_CALO_PREPROC,
212  return sourceIDsPP;
213  }
214 
215  if (isAppended(sgKey, "CP")) {
216  static const std::vector<int> slinksCP { 0, 2 };
217  static const std::vector<uint32_t> sourceIDsCP =
218  makeRobIds(4, 8, slinksCP, 0, eformat::TDAQ_CALO_CLUSTER_PROC_DAQ,
220  return sourceIDsCP;
221  }
222 
223  if (isAppended(sgKey, "CPRoI")) {
224  static const std::vector<int> slinksCPRoI { 0 };
225  static const std::vector<uint32_t> sourceIDsCPRoI =
226  makeRobIds(4, 8, slinksCPRoI, 1, eformat::TDAQ_CALO_CLUSTER_PROC_ROI,
228  return sourceIDsCPRoI;
229  }
230 
231  if (isAppended(sgKey, "JEP")) {
232  static const std::vector<int> slinksJEP { 0, 1, 2, 3 };
233  static const std::vector<uint32_t> sourceIDsJEP =
234  makeRobIds(2, 12, slinksJEP, 0, eformat::TDAQ_CALO_JET_PROC_DAQ,
236  return sourceIDsJEP;
237  }
238 
239  if (isAppended(sgKey, "JEPRoI")) {
240  static const std::vector<int> slinksJEPRoI { 0 };
241  static const std::vector<uint32_t> sourceIDsJEPRoI =
242  makeRobIds(2, 12, slinksJEPRoI, 1, eformat::TDAQ_CALO_JET_PROC_ROI,
244  return sourceIDsJEPRoI;
245  }
246 
247  if (isAppended(sgKey, "CPRoIB")) {
248  static const std::vector<int> slinksCPRoIB { 2 };
249  static const std::vector<uint32_t> sourceIDsCPRoIB =
250  makeRobIds(4, 8, slinksCPRoIB, 1, eformat::TDAQ_CALO_CLUSTER_PROC_ROI,
252  return sourceIDsCPRoIB;
253  }
254 
255  if (isAppended(sgKey, "JEPRoIB")) {
256  static const std::vector<int> slinksJEPRoIB { 2 };
257  static const std::vector<uint32_t> sourceIDsJEPRoIB =
258  makeRobIds(2, 12, slinksJEPRoIB, 1, eformat::TDAQ_CALO_JET_PROC_ROI,
260  return sourceIDsJEPRoIB;
261  }
262 
263  // all
264  static const std::vector<uint32_t> sourceIDs = makeAllRobIds();
265  return sourceIDs;
266 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_errorTool

ToolHandle<LVL1BS::L1CaloErrorByteStreamTool> LVL1BS::RodHeaderByteStreamTool::m_errorTool
private

Error collection tool.

Definition at line 86 of file RodHeaderByteStreamTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_robDataProvider

ServiceHandle<IROBDataProviderSvc> LVL1BS::RodHeaderByteStreamTool::m_robDataProvider
private

Service for reading bytestream.

Definition at line 84 of file RodHeaderByteStreamTool.h.

◆ m_sourceIDsCPProp

std::vector<uint32_t> LVL1BS::RodHeaderByteStreamTool::m_sourceIDsCPProp
private

Definition at line 91 of file RodHeaderByteStreamTool.h.

◆ m_sourceIDsCPRoIBProp

std::vector<uint32_t> LVL1BS::RodHeaderByteStreamTool::m_sourceIDsCPRoIBProp
private

Definition at line 95 of file RodHeaderByteStreamTool.h.

◆ m_sourceIDsCPRoIProp

std::vector<uint32_t> LVL1BS::RodHeaderByteStreamTool::m_sourceIDsCPRoIProp
private

Definition at line 93 of file RodHeaderByteStreamTool.h.

◆ m_sourceIDsJEPProp

std::vector<uint32_t> LVL1BS::RodHeaderByteStreamTool::m_sourceIDsJEPProp
private

Definition at line 92 of file RodHeaderByteStreamTool.h.

◆ m_sourceIDsJEPRoIBProp

std::vector<uint32_t> LVL1BS::RodHeaderByteStreamTool::m_sourceIDsJEPRoIBProp
private

Definition at line 96 of file RodHeaderByteStreamTool.h.

◆ m_sourceIDsJEPRoIProp

std::vector<uint32_t> LVL1BS::RodHeaderByteStreamTool::m_sourceIDsJEPRoIProp
private

Definition at line 94 of file RodHeaderByteStreamTool.h.

◆ m_sourceIDsPPProp

std::vector<uint32_t> LVL1BS::RodHeaderByteStreamTool::m_sourceIDsPPProp
private

Definition at line 90 of file RodHeaderByteStreamTool.h.

◆ m_sourceIDsProp

std::vector<uint32_t> LVL1BS::RodHeaderByteStreamTool::m_sourceIDsProp
private

ROB source IDs.

Definition at line 89 of file RodHeaderByteStreamTool.h.

◆ m_srcIdMap

const L1CaloSrcIdMap LVL1BS::RodHeaderByteStreamTool::m_srcIdMap
private

Source ID converter.

Definition at line 98 of file RodHeaderByteStreamTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
LVL1BS::RodHeaderByteStreamTool::makeAllRobIds
std::vector< uint32_t > makeAllRobIds() const
Fill vector with ROB IDs for given sub-detector.
Definition: RodHeaderByteStreamTool.cxx:270
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LVL1BS::RodHeaderByteStreamTool::m_sourceIDsProp
std::vector< uint32_t > m_sourceIDsProp
ROB source IDs.
Definition: RodHeaderByteStreamTool.h:89
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LVL1BS::L1CaloSubBlock::ERROR_DUPLICATE_ROB
@ ERROR_DUPLICATE_ROB
Definition: L1CaloSubBlock.h:31
LVL1BS::RodHeaderByteStreamTool::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Service for reading bytestream.
Definition: RodHeaderByteStreamTool.h:84
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
LVL1BS::RodHeaderByteStreamTool::ROBIterator
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Definition: RodHeaderByteStreamTool.h:68
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
LVL1BS::L1CaloSrcIdMap::getRobID
uint32_t getRobID(uint32_t rod_id) const
Make a ROB Source ID from a ROD source ID.
Definition: L1CaloSrcIdMap.cxx:27
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LVL1::RODHeader
ROD Header data and status words.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/RODHeader.h:17
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
LVL1BS::L1CaloSubBlock::ERROR_ROD_NSTATUS
@ ERROR_ROD_NSTATUS
Definition: L1CaloSubBlock.h:32
LVL1BS::RodHeaderByteStreamTool::m_sourceIDsJEPRoIBProp
std::vector< uint32_t > m_sourceIDsJEPRoIBProp
Definition: RodHeaderByteStreamTool.h:96
LVL1BS::RodHeaderByteStreamTool::m_srcIdMap
const L1CaloSrcIdMap m_srcIdMap
Source ID converter.
Definition: RodHeaderByteStreamTool.h:98
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
LVL1BS::RodHeaderByteStreamTool::m_errorTool
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_errorTool
Error collection tool.
Definition: RodHeaderByteStreamTool.h:86
LVL1BS::RodHeaderByteStreamTool::m_sourceIDsCPRoIBProp
std::vector< uint32_t > m_sourceIDsCPRoIBProp
Definition: RodHeaderByteStreamTool.h:95
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
python.HLT.CommonSequences.EventBuildingSequences.robs
robs
Definition: EventBuildingSequences.py:400
master.flag
bool flag
Definition: master.py:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1BS::RodHeaderByteStreamTool::m_sourceIDsCPProp
std::vector< uint32_t > m_sourceIDsCPProp
Definition: RodHeaderByteStreamTool.h:91
run
Definition: run.py:1
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition: IROBDataProviderSvc.h:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
LVL1BS::RodHeaderByteStreamTool::makeRobIds
std::vector< uint32_t > makeRobIds(int numCrates, int crateOffset, const std::vector< int > &slinks, int daqOrRoi, eformat::SubDetector subdet, const std::vector< uint32_t > &prop) const
Definition: RodHeaderByteStreamTool.cxx:288
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
LVL1BS::RodHeaderByteStreamTool::isAppended
bool isAppended(const std::string &sgKey, const std::string &flag) const
Return true if StoreGate key ends in given string.
Definition: RodHeaderByteStreamTool.cxx:316
bcId
uint16_t bcId(uint32_t data)
Definition: TgcByteStreamData.h:329
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
LVL1BS::RodHeaderByteStreamTool::m_sourceIDsJEPProp
std::vector< uint32_t > m_sourceIDsJEPProp
Definition: RodHeaderByteStreamTool.h:92
python.PyAthena.v
v
Definition: PyAthena.py:157
LVL1BS::RodHeaderByteStreamTool::m_sourceIDsJEPRoIProp
std::vector< uint32_t > m_sourceIDsJEPRoIProp
Definition: RodHeaderByteStreamTool.h:94
get_generator_info.version
version
Definition: get_generator_info.py:33
LVL1BS::RodHeaderByteStreamTool::convert
StatusCode convert(const std::string &name, DataVector< LVL1::RODHeader > *rhCollection) const
Convert ROB fragments to RODHeaders.
Definition: RodHeaderByteStreamTool.cxx:103
a
TList * a
Definition: liststreamerinfos.cxx:10
LVL1BS::RodHeaderByteStreamTool::RODPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
Definition: RodHeaderByteStreamTool.h:70
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LVL1BS::RodHeaderByteStreamTool::m_sourceIDsCPRoIProp
std::vector< uint32_t > m_sourceIDsCPRoIProp
Definition: RodHeaderByteStreamTool.h:93
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
LVL1BS::RodHeaderByteStreamTool::ROBPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
Definition: RodHeaderByteStreamTool.h:69
LVL1BS::L1CaloSrcIdMap::getRodID
uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet) const
Make a ROD Source ID.
Definition: L1CaloSrcIdMap.cxx:16
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
merge.status
status
Definition: merge.py:17
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
LVL1BS::RodHeaderByteStreamTool::sourceIDs
const std::vector< uint32_t > & sourceIDs(const std::string &sgKey) const
Return reference to vector with all possible Source Identifiers.
Definition: RodHeaderByteStreamTool.cxx:204
LVL1BS::RodHeaderByteStreamTool::m_sourceIDsPPProp
std::vector< uint32_t > m_sourceIDsPPProp
Definition: RodHeaderByteStreamTool.h:90