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

Tool doing the L1TopoRDO <-> ByteStream conversion. More...

#include <L1TopoByteStreamTool.h>

Inheritance diagram for L1TopoByteStreamTool:
Collaboration diagram for L1TopoByteStreamTool:

Public Member Functions

 L1TopoByteStreamTool (const std::string &type, const std::string &name, const IInterface *parent)
 Default constructor. More...
 
virtual ~L1TopoByteStreamTool ()
 Default destructor. More...
 
virtual StatusCode initialize ()
 Function to initialise the tool. More...
 
virtual StatusCode finalize ()
 Function to finalise the tool. More...
 
const std::vector< uint32_t > & sourceIDs ()
 return list of L1Topo ROD source IDs to use, defaults to DAQ ROD IDs More...
 
StatusCode convert (const std::string &sgKey, L1TopoRDOCollection *result) const
 Convert ROBFragment to L1TopoRDO. More...
 
StatusCode convert (const ROBF *rob, L1TopoRDO *&result) const
 Convert ROBFragment to L1TopoRDO. More...
 
StatusCode convert (const L1TopoRDO *result, RawEventWrite *re) const
 convert L1TopoRDO to ByteStream 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 OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

L1TopoSrcIdMapm_srcIdMap
 Object to generate and convert between the various IDs of the L1Topo fragment. More...
 
std::vector< uint32_t > m_sourceIDs
 Source IDs of L1Topo RODs. More...
 
BooleanProperty m_doDAQROBs
 
BooleanProperty m_doROIROBs
 
ServiceHandle< IROBDataProviderSvcm_robDataProvider
 Service for reading bytestream. 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 doing the L1TopoRDO <-> ByteStream conversion.

   The actual work of translating the information in a L1TopoRDO object
   into a L1Topo ROB fragment and vice-versa is done with this tool.
   Based on CTPByteStreamTool by David Berge.
See also
L1TopoByteStreamCnv
Author
Simon George
Date
Date
2014-11-12 00:00:00

Definition at line 36 of file L1TopoByteStreamTool.h.

Member Typedef Documentation

◆ ROBF

Definition at line 38 of file L1TopoByteStreamTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ L1TopoByteStreamTool()

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

Default constructor.

The constructor takes care of correctly constructing the base class and declaring the tool's interface to the framework.

Definition at line 36 of file L1TopoByteStreamTool.cxx.

40  m_srcIdMap(0),
41  m_robDataProvider("ROBDataProviderSvc", "L1TopoByteStreamTool") {
42  declareInterface<L1TopoByteStreamTool>(this);
43  declareProperty("ROBSourceIDs", m_sourceIDs,
44  "ROB fragment source identifiers - overrides decodeDAQROBs "
45  "and decodeROIROBs");
47  "decodeDAQROBs", m_doDAQROBs = true,
48  "add standard DAQ ROBs to list of ROBs to decode; default true");
50  "decodeROIROBs", m_doROIROBs = false,
51  "add standard ROI ROBs to list of ROBs to decode; default false");
52 }

◆ ~L1TopoByteStreamTool()

L1TopoByteStreamTool::~L1TopoByteStreamTool ( )
virtual

Default destructor.

The destructor doesn't need to do anything.

Definition at line 57 of file L1TopoByteStreamTool.cxx.

57 {}

Member Function Documentation

◆ convert() [1/3]

StatusCode L1TopoByteStreamTool::convert ( const L1TopoRDO result,
RawEventWrite re 
) const

convert L1TopoRDO to ByteStream

Conversion from RDO to eformat::ROBFragment.

This is called from the L1TopoByteStreamCnv::createRep method.

Definition at line 130 of file L1TopoByteStreamTool.cxx.

131  {
132  ATH_MSG_DEBUG("executing convert() from RDO to ROBFragment");
133 
134  // Create Event Assembler
136 
137  // Reset lumi-block number to 1
138  fea.setDetEvtType(1);
139  // Set L1Apos to center of readout window
140  // uint16_t minorVersion = ( result->getNumberOfBunches() - 1u ) / 2u;
141  // minorVersion &= ctpVersion.getL1APositionMask();
142  // minorVersion <<= ctpVersion.getL1APositionShift();
143  uint16_t minorVersion = 0;
144  fea.setRodMinorVersion(minorVersion);
145 
147 
148  // Source ID of L1Topo
149  // NB needs to change to using list of modules - as it is, it will just
150  // produce one with an unconventional ID of 0x91000000.
151  const uint32_t rodId = m_srcIdMap->getRodID();
152  ATH_MSG_DEBUG(" ROD ID:" << MSG::hex << rodId);
153  ATH_MSG_DEBUG(" ROD IDs:" << MSG::hex << m_sourceIDs << " NOT YET IMPLEMENTED");
154 
155  // get the ROD data container to be filled
156  theROD = fea.getRodData(rodId);
157 
158  ATH_MSG_VERBOSE(" Dumping L1Topo data words:");
159  // fill Data Words
160  const std::vector<uint32_t>& vDataWords = result->getDataWords();
161  std::vector<uint32_t>::const_iterator it = vDataWords.begin();
162  std::vector<uint32_t>::const_iterator end = vDataWords.end();
163  for (; it != end; ++it) {
164  theROD->push_back(*it);
165  ATH_MSG_VERBOSE(" 0x" << MSG::hex << std::setw(8) << (*it));
166  }
167 
168  // Now fill full event
169  ATH_MSG_DEBUG("Now filling the event with the L1Topo fragment");
170  fea.fill(re, msg());
171 
172  return StatusCode::SUCCESS;
173 }

◆ convert() [2/3]

StatusCode L1TopoByteStreamTool::convert ( const ROBF rob,
L1TopoRDO *&  result 
) const

Convert ROBFragment to L1TopoRDO.

Conversion from eformat::ROBFragment to RDO.

This is called from the L1TopoByteStreamCnv::createObj method.

Definition at line 209 of file L1TopoByteStreamTool.cxx.

209  {
210  ATH_MSG_DEBUG("executing convert() from ROBFragment to RDO");
211 
212  uint32_t rodId = rob->rob_source_id();
213 
214  ATH_MSG_DEBUG("expected ROD sub-detector ID: " << MSG::hex << m_sourceIDs
215  << " ID found: " << MSG::hex
216  << rodId << MSG::dec);
217 
218  bool idMatch = false;
219  for (auto id : m_sourceIDs) {
220  if (rodId == id) {
221  idMatch = true;
222  }
223  }
224  if (idMatch) {
225  // Need to check S-link trailer for errors - this would be propagated to
226  // status word, see below.
227  // First use ROB & ROD error check methods
228  bool error_rob(false);
229  bool error_rod(false);
230  try {
231  if (rob->check_rob()) {
232  ATH_MSG_VERBOSE("ROB fragment checked ok");
233  }
234  } catch (std::exception const& ex) {
235  ATH_MSG_WARNING("ROB fragment not valid: " << ex.what());
236  error_rob = true;
237  }
238  try {
239  if (rob->check_rod()) {
240  ATH_MSG_VERBOSE("ROD fragment checked ok");
241  }
242  } catch (std::exception const& ex) {
243  ATH_MSG_WARNING("ROD fragment not valid: " << ex.what());
244  error_rod = true;
245  }
246 
247  // Print some header info
249  MSG::hex << " \n"
250  << " rod_version 0x" << rob->rod_version() << " \n"
251  << " rod_run_no 0x" << MSG::dec
252  << rob->rod_run_no() << " \n"
253  << " rod_lvl1_id 0x" << MSG::hex
254  << rob->rod_lvl1_id() << " \n"
255  << " rod_bc_id 0x" << rob->rod_bc_id() << " \n"
256  << " rod_lvl1_trigger_type 0x" << rob->rod_lvl1_trigger_type()
257  << " \n"
258  << " nchildren 0x" << rob->nchildren() << " \n"
259  << MSG::dec);
260 
261  // print and check status words
262  OFFLINE_FRAGMENTS_NAMESPACE::PointerType it_status = rob->rod_status();
263  const uint32_t nstatus = rob->rod_nstatus();
264  ATH_MSG_VERBOSE("Number of status words: " << nstatus);
265  std::vector<uint32_t> vStatusWords;
266  vStatusWords.reserve(nstatus);
267  ATH_MSG_VERBOSE("Dumping ROD status words:");
268  for (uint32_t i = 0; i < nstatus; ++i, ++it_status) {
269  vStatusWords.push_back(static_cast<uint32_t>(*it_status));
270  ATH_MSG_VERBOSE(" 0x" << MSG::hex << std::setfill('0') << std::setw(8)
271  << *it_status << MSG::dec);
272  }
273  // for definition of first status word see:
274  // - bits 00-15: https://edms.cern.ch/document/445840/5.0a section 5.8
275  // - bits 16-31: bits 16-31:
276  // https://twiki.cern.ch/twiki/bin/viewauth/Atlas/ROBINFragmentErrors
277  // Can do something more specific eventually.
278  bool error_status(false);
279  if (vStatusWords.size() == 0) {
280  ATH_MSG_WARNING("ROD has no status word");
281  }
282  if (vStatusWords.size() > 0 && vStatusWords.at(0) != 0) {
283  ATH_MSG_WARNING("Non-zero first status word, payload may not be valid");
284  error_status = true;
285  }
286 
287  // print and interpret data words and save them for RDO
288  OFFLINE_FRAGMENTS_NAMESPACE::PointerType it_data = rob->rod_data();
289  const uint32_t ndata = rob->rod_ndata();
290  ATH_MSG_VERBOSE("Number of data words: " << ndata);
291 
292  ATH_MSG_VERBOSE("Dumping L1Topo data words:");
293  std::vector<uint32_t> vDataWords;
294  vDataWords.reserve(ndata);
295  for (uint32_t i = 0; i < ndata; ++i, ++it_data) {
296  vDataWords.push_back(static_cast<uint32_t>(*it_data));
297  ATH_MSG_VERBOSE(" 0x" << MSG::hex << std::setfill('0') << std::setw(8)
298  << *it_data << MSG::dec);
299  }
300 
301  // create L1Topo RDO
302  result = new L1TopoRDO();
303  result->setDataWords(std::move(vDataWords));
304  result->setStatusWords(std::move(vStatusWords));
305  if (error_status) {
307  }
308  if (error_rob) {
309  result->setError(L1Topo::Error::ROB_ERROR);
310  }
311  if (error_rod) {
312  result->setError(L1Topo::Error::ROD_ERROR);
313  }
314  result->setSourceID(rodId);
315 
316  return StatusCode::SUCCESS;
317  }
318 
319  ATH_MSG_ERROR("Wrong ROD ID found in the L1Topo ROB fragment!");
320  return StatusCode::FAILURE;
321 }

◆ convert() [3/3]

StatusCode L1TopoByteStreamTool::convert ( const std::string &  sgKey,
L1TopoRDOCollection result 
) const

Convert ROBFragment to L1TopoRDO.

Definition at line 175 of file L1TopoByteStreamTool.cxx.

176  {
177  //
178  // Get the ROB fragment:
179  //
181  m_robDataProvider->getROBData(m_sourceIDs, robFrags);
182 
183  if (robFrags.size() == 0) {
184  ATH_MSG_WARNING("No ROB fragments found");
185  return StatusCode::SUCCESS;
186  }
187 
188  for (auto it : robFrags) {
189  L1TopoRDO* rdo = nullptr;
190  StatusCode sc = convert(ROBData(it).getROBFragment(), rdo);
191  if (sc.isFailure()) {
192  ATH_MSG_ERROR(" Failed to create Objects: " << sgKey);
193  return sc;
194  } else {
195  result->push_back(rdo); // append a copy of the pointer to the
196  // collection, i.e. takes ownership of the new
197  // L1TopoRDO.
198  }
199  }
200  return StatusCode::SUCCESS;
201 }

◆ 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 L1TopoByteStreamTool::finalize ( )
virtual

Function to finalise the tool.

The function deletes the L1TopoSrcIdMap object and finalises the base class.

Definition at line 85 of file L1TopoByteStreamTool.cxx.

85  {
86  delete m_srcIdMap;
87  return AlgTool::finalize();
88 }

◆ initialize()

StatusCode L1TopoByteStreamTool::initialize ( )
virtual

Function to initialise the tool.

The function creates a L1TopoSrcIdMap object that is used in the conversion and initialises the base class.

Definition at line 63 of file L1TopoByteStreamTool.cxx.

63  {
64  m_srcIdMap = new L1TopoSrcIdMap();
66  if (!m_sourceIDs.empty()) {
68  "ROBSourceIDs property is set: this overrides decodeDAQROBs and "
69  "decodeROIROBs");
70  } else {
72  }
75  ATH_MSG_DEBUG("using sourceIDs " << std::hex << std::showbase << m_sourceIDs
76  << std::dec << std::noshowbase);
77 
78  CHECK(m_robDataProvider.retrieve());
79  return AlgTool::initialize();
80 }

◆ 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 & L1TopoByteStreamTool::interfaceID ( )
static

AlgTool InterfaceID.

This function is needed by the framework to know what kind of tool this is.

Definition at line 28 of file L1TopoByteStreamTool.cxx.

28  {
29  return IID_IL1TopoByteStreamTool;
30 }

◆ 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 > & L1TopoByteStreamTool::sourceIDs ( )

return list of L1Topo ROD source IDs to use, defaults to DAQ ROD IDs

Return list of L1Topo source IDs to use for conversion.

By default the list of DAQ IDs are generated Will generate list according to algorithm herein, if not already provided via properties. Used by L1TopoByteStreamCnv and L1TopoByteStreamTool. The boolean properties decodeDAQROBs and decodeROIROBs are used to determine which ROB source IDs are added to the list.

Definition at line 100 of file L1TopoByteStreamTool.cxx.

100  {
101  if (m_sourceIDs.empty()) {
102  // iterate over link numbers: 0 is DAQ link, 1 is ROIB, 2 for New ROIB
103  for (unsigned int slink : {0, 1, 2}) {
104  unsigned int roiOrDaq = 0;
105  if (slink > 0) { // 0 means DAQ-type link, 1 means ROI-type link
106  roiOrDaq = 1;
107  }
108  if (roiOrDaq == 0 && !m_doDAQROBs) {
109  continue; // skip DAQ ROBs
110  } else if (roiOrDaq == 1 && !m_doROIROBs) {
111  continue; // skip ROI ROBs
112  }
113  for (unsigned int module :
114  {0, 1}) { // could be upgraded to 3 modules eventually?
115  const uint32_t moduleId =
116  L1Topo::ModuleID(slink, module, roiOrDaq).id();
117  eformat::helper::SourceIdentifier sourceId(eformat::TDAQ_CALO_TOPO_PROC, moduleId);
118 
119  m_sourceIDs.push_back(sourceId.code());
120  }
121  }
122  }
123  return m_sourceIDs;
124 }

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

BooleanProperty L1TopoByteStreamTool::m_doDAQROBs
private

Definition at line 71 of file L1TopoByteStreamTool.h.

◆ m_doROIROBs

BooleanProperty L1TopoByteStreamTool::m_doROIROBs
private

Definition at line 72 of file L1TopoByteStreamTool.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> L1TopoByteStreamTool::m_robDataProvider
private

Service for reading bytestream.

Definition at line 76 of file L1TopoByteStreamTool.h.

◆ m_sourceIDs

std::vector<uint32_t> L1TopoByteStreamTool::m_sourceIDs
private

Source IDs of L1Topo RODs.

Definition at line 69 of file L1TopoByteStreamTool.h.

◆ m_srcIdMap

L1TopoSrcIdMap* L1TopoByteStreamTool::m_srcIdMap
private

Object to generate and convert between the various IDs of the L1Topo fragment.

Definition at line 67 of file L1TopoByteStreamTool.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:
L1TopoRDO
The class that represents the raw data received from an L1Topo board.
Definition: L1TopoRDO.h:29
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
L1TopoByteStreamTool::m_sourceIDs
std::vector< uint32_t > m_sourceIDs
Source IDs of L1Topo RODs.
Definition: L1TopoByteStreamTool.h:69
get_generator_info.result
result
Definition: get_generator_info.py:21
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition: FullEventAssembler.h:40
L1TopoByteStreamTool::m_doROIROBs
BooleanProperty m_doROIROBs
Definition: L1TopoByteStreamTool.h:72
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
ROBData
ROBData_T< OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment, OFFLINE_FRAGMENTS_NAMESPACE::PointerType > ROBData
Definition: ROBData.h:225
L1TopoSrcIdMap
This class provides conversion between Lower level Source ID to higher level source ID for L1Topo Byt...
Definition: L1TopoSrcIdMap.h:17
initialize
void initialize()
Definition: run_EoverP.cxx:894
skel.it
it
Definition: skel.GENtoEVGEN.py:423
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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
python.PyAthena.module
module
Definition: PyAthena.py:134
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:92
L1TopoByteStreamTool::m_srcIdMap
L1TopoSrcIdMap * m_srcIdMap
Object to generate and convert between the various IDs of the L1Topo fragment.
Definition: L1TopoByteStreamTool.h:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
L1TopoByteStreamTool::convert
StatusCode convert(const std::string &sgKey, L1TopoRDOCollection *result) const
Convert ROBFragment to L1TopoRDO.
Definition: L1TopoByteStreamTool.cxx:175
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
calibdata.exception
exception
Definition: calibdata.py:496
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
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
L1Topo::Error::ROD_ERROR
@ ROD_ERROR
L1Topo::Error::SLINK_STATUS_ERROR
@ SLINK_STATUS_ERROR
L1TopoByteStreamTool::sourceIDs
const std::vector< uint32_t > & sourceIDs()
return list of L1Topo ROD source IDs to use, defaults to DAQ ROD IDs
Definition: L1TopoByteStreamTool.cxx:100
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
L1TopoByteStreamTool::m_doDAQROBs
BooleanProperty m_doDAQROBs
Definition: L1TopoByteStreamTool.h:71
L1TopoByteStreamTool::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Service for reading bytestream.
Definition: L1TopoByteStreamTool.h:76
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
L1Topo::ModuleID
Represents the L1Topo module ID, with decoder and encoder.
Definition: ModuleID.h:28
a
TList * a
Definition: liststreamerinfos.cxx:10
h
FullEventAssembler::setRodMinorVersion
void setRodMinorVersion(uint16_t m)
change the ROD minor version
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
L1Topo::Error::ROB_ERROR
@ ROB_ERROR
re
const boost::regex re(r_e)
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
L1TopoSrcIdMap::getRodID
uint32_t getRodID() const
get a ROD Source ID (deprecated)
Definition: L1TopoSrcIdMap.cxx:22
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
FullEventAssembler::RODDATA
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
Definition: FullEventAssembler.h:54
L1Topo::ModuleID::id
uint16_t id() const
access method
Definition: ModuleID.cxx:41
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
FullEventAssembler::getRodData
RODDATA * getRodData(uint32_t id)
get a block of ROD data
FullEventAssembler::setDetEvtType
void setDetEvtType(uint32_t m)
change Detector Event Type
FullEventAssembler::fill
void fill(RawEventWrite *re, MsgStream &log)
Fill the FullEventFragment with all the ROD data stored in this.
fitman.k
k
Definition: fitman.py:528