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

Tool to perform ROB fragments to CPM towers, CMX-CP TOBs and CMX-CP hits, and CP container to raw data conversions. More...

#include <CpByteStreamV2Tool.h>

Inheritance diagram for LVL1BS::CpByteStreamV2Tool:
Collaboration diagram for LVL1BS::CpByteStreamV2Tool:

Classes

struct  CmxCpHitsData
 
struct  CmxCpTobData
 
struct  CpByteStreamToolData
 
struct  CpmTowerData
 
struct  LocalData
 

Public Member Functions

 CpByteStreamV2Tool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~CpByteStreamV2Tool ()
 
virtual StatusCode initialize () override
 
StatusCode convert (const std::string &sgKey, DataVector< LVL1::CPMTower > *ttCollection) const
 Convert ROB fragments to CPM towers. More...
 
StatusCode convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CPMTower > *ttCollection) const
 
StatusCode convert (const std::string &sgKey, DataVector< LVL1::CMXCPTob > *tobCollection) const
 Convert ROB fragments to CMX-CP TOBs. More...
 
StatusCode convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CMXCPTob > *tobCollection) const
 
StatusCode convert (const std::string &sgKey, DataVector< LVL1::CMXCPHits > *hitCollection) const
 Convert ROB fragments to CMX-CP hits. More...
 
StatusCode convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CMXCPHits > *hitCollection) const
 
StatusCode convert (const LVL1::CPBSCollectionV2 *cp) const
 Convert CP Container to bytestream. More...
 
const std::vector< uint32_t > & sourceIDs () 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

enum  CollectionType { CPM_TOWERS, CMX_CP_TOBS, CMX_CP_HITS }
 
typedef DataVector< LVL1::CPMTowerCpmTowerCollection
 
typedef DataVector< LVL1::CMXCPTobCmxCpTobCollection
 
typedef DataVector< LVL1::CMXCPHitsCmxCpHitsCollection
 
typedef std::map< unsigned int, LVL1::CPMTower * > CpmTowerMap
 
typedef std::map< unsigned int, const LVL1::CPMTower * > ConstCpmTowerMap
 
typedef std::map< int, LVL1::CMXCPTob * > CmxCpTobMap
 
typedef std::map< int, const LVL1::CMXCPTob * > ConstCmxCpTobMap
 
typedef std::map< int, LVL1::CMXCPHits * > CmxCpHitsMap
 
typedef std::map< int, const LVL1::CMXCPHits * > ConstCmxCpHitsMap
 
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 > makeSourceIDs () const
 Create list of all source IDs. More...
 
StatusCode convertBs (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, CpByteStreamToolData &data) const
 Convert bytestream to given container type. More...
 
void decodeCmxCp (CmxCpSubBlock *subBlock, int trigCpm, CpByteStreamToolData &data, LocalData &ld) const
 Unpack CMX-CP sub-block. More...
 
void decodeCpm (CpmSubBlockV2 *subBlock, int trigCpm, CpmTowerData &data, LocalData &ld) const
 Unpack CPM sub-block. More...
 
const LVL1::CPMTowerfindCpmTower (unsigned int key, const ConstCpmTowerMap &ttMap) const
 Find a CPM tower for given key. More...
 
LVL1::CPMTowerfindCpmTower (const CpmTowerData &data, unsigned int key) const
 
const LVL1::CMXCPTobfindCmxCpTob (int key, const ConstCmxCpTobMap &tobMap) const
 Find CMX-CP TOB for given key. More...
 
LVL1::CMXCPTobfindCmxCpTob (const CmxCpTobData &data, int key) const
 
const LVL1::CMXCPHitsfindCmxCpHits (int key, const ConstCmxCpHitsMap &hitsMap) const
 Find CMX-CP hits for given key. More...
 
LVL1::CMXCPHitsfindCmxCpHits (const CmxCpHitsData &data, int key) const
 
void setupCpmTowerMap (const CpmTowerCollection *ttCollection, ConstCpmTowerMap &ttMap, LVL1::TriggerTowerKey &towerKey) const
 Set up CPM tower map. More...
 
void setupCmxCpTobMap (const CmxCpTobCollection *tobCollection, ConstCmxCpTobMap &tobMap) const
 Set up CMX-CP TOB map. More...
 
void setupCmxCpHitsMap (const CmxCpHitsCollection *hitCollection, ConstCmxCpHitsMap &hitsMap) const
 Set up CMX-CP hits map. More...
 
int tobKey (int crate, int cmx, int cpm, int chip, int loc) const
 Key for TOBs. More...
 
int hitsKey (int crate, int cmx, int source) const
 Key for Hits. More...
 
bool slinkSlices (int crate, int module, int modulesPerSlink, int &timeslices, int &trigJem, const ConstCpmTowerMap &ttMap, const ConstCmxCpTobMap &tobMap, const ConstCmxCpHitsMap &hitsMap, LVL1::TriggerTowerKey &towerKey) const
 Get number of slices and triggered slice offset for next slink. 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

Gaudi::Property< bool > m_enableEncoding
 
SmartIF< ByteStreamCnvSvcm_byteStreamCnvSvc
 
ToolHandle< LVL1::IL1CaloMappingToolm_cpmMaps
 Channel mapping tool. More...
 
ToolHandle< LVL1BS::L1CaloErrorByteStreamToolm_errorTool
 Error collection tool. More...
 
ServiceHandle< IROBDataProviderSvcm_robDataProvider
 
int m_crateOffsetHw
 Property: Hardware crate number offset. More...
 
int m_crateOffsetSw
 Property: Software crate number offset. More...
 
int m_version
 Property: Sub_block header version. More...
 
int m_dataFormat
 Property: Data compression format. More...
 
const int m_channels
 Number of channels per module. More...
 
int m_crates
 Property: Number of crates. More...
 
const int m_modules
 Number of CPM modules per crate. More...
 
const int m_cmxs
 Number of CMXs per crate. More...
 
const int m_maxTobs
 Maximum number of TOBS per module. More...
 
const int m_chips
 Number of chips. More...
 
const int m_locs
 Number of Local coordinates. More...
 
int m_slinks
 Property: Number of slinks per crate when writing out bytestream. More...
 
int m_dfltSlices
 Property: Default number of slices in simulation. More...
 
int m_forceSlices
 Property: Force number of slices in bytestream. More...
 
int m_crateMin
 Property: Minimum crate number when writing out bytestream. More...
 
int m_crateMax
 Property: Maximum crate number when writing out bytestream. More...
 
const eformat::SubDetector m_subDetector
 Sub-detector type. More...
 
const L1CaloSrcIdMap m_srcIdMap
 Source ID converter. More...
 
std::vector< uint32_t > m_sourceIDsProp
 Property: ROB source IDs. 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 CPM towers, CMX-CP TOBs and CMX-CP hits, and CP container to raw data conversions.

Based on ROD document version X_xxx.

Author
Peter Faulkner

Definition at line 54 of file CpByteStreamV2Tool.h.

Member Typedef Documentation

◆ CmxCpHitsCollection

Definition at line 135 of file CpByteStreamV2Tool.h.

◆ CmxCpHitsMap

Definition at line 140 of file CpByteStreamV2Tool.h.

◆ CmxCpTobCollection

Definition at line 134 of file CpByteStreamV2Tool.h.

◆ CmxCpTobMap

Definition at line 138 of file CpByteStreamV2Tool.h.

◆ ConstCmxCpHitsMap

Definition at line 141 of file CpByteStreamV2Tool.h.

◆ ConstCmxCpTobMap

Definition at line 139 of file CpByteStreamV2Tool.h.

◆ ConstCpmTowerMap

typedef std::map<unsigned int, const LVL1::CPMTower*> LVL1BS::CpByteStreamV2Tool::ConstCpmTowerMap
private

Definition at line 137 of file CpByteStreamV2Tool.h.

◆ CpmTowerCollection

Definition at line 133 of file CpByteStreamV2Tool.h.

◆ CpmTowerMap

typedef std::map<unsigned int, LVL1::CPMTower*> LVL1BS::CpByteStreamV2Tool::CpmTowerMap
private

Definition at line 136 of file CpByteStreamV2Tool.h.

◆ ROBIterator

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

Definition at line 142 of file CpByteStreamV2Tool.h.

◆ ROBPointer

Definition at line 143 of file CpByteStreamV2Tool.h.

◆ RODPointer

Definition at line 144 of file CpByteStreamV2Tool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ CollectionType

Enumerator
CPM_TOWERS 
CMX_CP_TOBS 
CMX_CP_HITS 

Definition at line 131 of file CpByteStreamV2Tool.h.

Constructor & Destructor Documentation

◆ CpByteStreamV2Tool()

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

Definition at line 51 of file CpByteStreamV2Tool.cxx.

55  m_cpmMaps("LVL1::CpmMappingTool/CpmMappingTool"),
56  m_errorTool("LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
57  m_robDataProvider("ROBDataProviderSvc", name),
58  m_channels(80), m_crates(4), m_modules(14), m_cmxs(2), m_maxTobs(5),
59  m_chips(16), m_locs(4),
60  m_subDetector(eformat::TDAQ_CALO_CLUSTER_PROC_DAQ)
61 {
62  declareInterface<CpByteStreamV2Tool>(this);
63 
64  declareProperty("CpmMappingTool", m_cpmMaps,
65  "Crate/Module/Channel to Eta/Phi/Layer mapping tool");
66  declareProperty("ErrorTool", m_errorTool,
67  "Tool to collect errors for monitoring");
68 
69  declareProperty("CrateOffsetHw", m_crateOffsetHw = 8,
70  "Offset of CP crate numbers in bytestream");
71  declareProperty("CrateOffsetSw", m_crateOffsetSw = 0,
72  "Offset of CP crate numbers in RDOs");
73 
74  // Properties for reading bytestream only
75  declareProperty("ROBSourceIDs", m_sourceIDsProp,
76  "ROB fragment source identifiers");
77 
78  // Properties for writing bytestream only
79  declareProperty("DataVersion", m_version = 2, // <<== CHECK
80  "Format version number in sub-block header");
81  declareProperty("DataFormat", m_dataFormat = 1,
82  "Format identifier (0-1) in sub-block header");
83  declareProperty("SlinksPerCrate", m_slinks = 2,
84  "The number of S-Links per crate");
85  declareProperty("SimulSlices", m_dfltSlices = 1,
86  "The number of slices in the simulation");
87  declareProperty("ForceSlices", m_forceSlices = 0,
88  "If >0, the number of slices in bytestream");
89  declareProperty("CrateMin", m_crateMin = 0,
90  "Minimum crate number, allows partial output");
91  declareProperty("CrateMax", m_crateMax = m_crates - 1,
92  "Maximum crate number, allows partial output");
93 
94 }

◆ ~CpByteStreamV2Tool()

LVL1BS::CpByteStreamV2Tool::~CpByteStreamV2Tool ( )
virtual

Definition at line 98 of file CpByteStreamV2Tool.cxx.

99 {
100 }

Member Function Documentation

◆ convert() [1/7]

StatusCode LVL1BS::CpByteStreamV2Tool::convert ( const LVL1::CPBSCollectionV2 cp) const

Convert CP Container to bytestream.

Definition at line 188 of file CpByteStreamV2Tool.cxx.

189 {
190  if (not m_enableEncoding.value()) {
191  ATH_MSG_ERROR("Encoding method called while " << m_enableEncoding.name() << "=False");
192  return StatusCode::FAILURE;
193  }
194 
195  const bool debug = msgLvl(MSG::DEBUG);
196  if (debug) msg(MSG::DEBUG);
197 
198  // Get the event assembler
199  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
200  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
201  "CpByteStreamV2") );
202  const uint16_t minorVersion = m_srcIdMap.minorVersion();
203  fea->setRodMinorVersion(minorVersion);
204 
205  // Pointer to ROD data vector
206 
208 
209  LVL1::TriggerTowerKey towerKey;
210 
211  // Set up the container maps
212 
213  // CPM tower map
214  ConstCpmTowerMap ttMap;
215  setupCpmTowerMap(cp->towers(), ttMap, towerKey);
216 
217  // CMX-CP TOB map
218  ConstCmxCpTobMap tobMap;
219  setupCmxCpTobMap(cp->tobs(), tobMap);
220 
221  // CMX-CP hits map
222  ConstCmxCpHitsMap hitsMap;
223  setupCmxCpHitsMap(cp->hits(), hitsMap);
224 
225  // Loop over data
226 
227  const bool neutralFormat = m_dataFormat == L1CaloSubBlock::NEUTRAL;
228  const int modulesPerSlink = m_modules / m_slinks;
229  int timeslices = 1;
230  int trigCpm = 0;
231  int timeslicesNew = 1;
232  int trigCpmNew = 0;
233  for (int crate = m_crateMin; crate <= m_crateMax; ++crate)
234  {
235  const int hwCrate = crate + m_crateOffsetHw;
236 
237  // CPM modules are numbered 1 to m_modules
238  for (int module = 1; module <= m_modules; ++module)
239  {
240  const int mod = module - 1;
241 
242  // Pack required number of modules per slink
243 
244  if (mod % modulesPerSlink == 0)
245  {
246  const int daqOrRoi = 0;
247  const int slink = (m_slinks == 2) ? 2 * (mod / modulesPerSlink)
248  : mod / modulesPerSlink;
249  if (debug)
250  {
251  msg() << "Treating crate " << hwCrate
252  << " slink " << slink << endmsg;
253  }
254  // Get number of CPM slices and triggered slice offset
255  // for this slink
256  if ( ! slinkSlices(crate, module, modulesPerSlink,
257  timeslices, trigCpm,
258  ttMap,
259  tobMap,
260  hitsMap,
261  towerKey))
262  {
263  msg(MSG::ERROR) << "Inconsistent number of slices or "
264  << "triggered slice offsets in data for crate "
265  << hwCrate << " slink " << slink << endmsg;
266  return StatusCode::FAILURE;
267  }
268  timeslicesNew = (m_forceSlices) ? m_forceSlices : timeslices;
269  trigCpmNew = ModifySlices::peak(trigCpm, timeslices, timeslicesNew);
270  if (debug)
271  {
272  msg() << "Data Version/Format: " << m_version
273  << " " << m_dataFormat << endmsg
274  << "Slices/offset: " << timeslices << " " << trigCpm;
275  if (timeslices != timeslicesNew)
276  {
277  msg() << " modified to " << timeslicesNew << " " << trigCpmNew;
278  }
279  msg() << endmsg;
280  }
281  L1CaloUserHeader userHeader;
282  userHeader.setCpm(trigCpmNew);
283  const uint32_t rodIdCpm = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
284  m_subDetector);
285  theROD = fea->getRodData(rodIdCpm);
286  theROD->push_back(userHeader.header());
287  }
288  if (debug) msg() << "Module " << module << endmsg;
289 
290  // Create a sub-block for each slice (except Neutral format)
291 
292  DataVector<CpmSubBlockV2> cpmBlocks;
293  for (int slice = 0; slice < timeslicesNew; ++slice)
294  {
295  CpmSubBlockV2 *const subBlock = new CpmSubBlockV2();
296  subBlock->setCpmHeader(m_version, m_dataFormat, slice,
297  hwCrate, module, timeslicesNew);
298  cpmBlocks.push_back(subBlock);
299  if (neutralFormat) break;
300  }
301 
302  // Find CPM towers corresponding to each eta/phi pair and fill
303  // sub-blocks
304 
305  for (int chan = 0; chan < m_channels; ++chan)
306  {
307  double eta = 0.;
308  double phi = 0.;
309  int layer = 0;
310  if (m_cpmMaps->mapping(crate, module, chan, eta, phi, layer))
311  {
312  const unsigned int key = towerKey.ttKey(phi, eta);
313  const LVL1::CPMTower *const tt = findCpmTower(key, ttMap);
314  if (tt )
315  {
316  std::vector<int> emData;
317  std::vector<int> hadData;
318  std::vector<int> emError;
319  std::vector<int> hadError;
320  ModifySlices::data(tt->emEnergyVec(), emData, timeslicesNew);
321  ModifySlices::data(tt->hadEnergyVec(), hadData, timeslicesNew);
322  ModifySlices::data(tt->emErrorVec(), emError, timeslicesNew);
323  ModifySlices::data(tt->hadErrorVec(), hadError, timeslicesNew);
324  for (int slice = 0; slice < timeslicesNew; ++slice)
325  {
326  const LVL1::DataError emErrBits(emError[slice]);
327  const LVL1::DataError hadErrBits(hadError[slice]);
328  const int emErr =
329  (emErrBits.get(LVL1::DataError::LinkDown) << 1) |
330  emErrBits.get(LVL1::DataError::Parity);
331  const int hadErr =
332  (hadErrBits.get(LVL1::DataError::LinkDown) << 1) |
333  hadErrBits.get(LVL1::DataError::Parity);
334  const int index = ( neutralFormat ) ? 0 : slice;
335  CpmSubBlockV2 *const subBlock = cpmBlocks[index];
336  subBlock->fillTowerData(slice, chan, emData[slice],
337  hadData[slice], emErr, hadErr);
338  if ((emErrBits.error() >> LVL1::DataError::GLinkParity))
339  {
340  int gLinkParity = emErrBits.get(LVL1::DataError::GLinkParity);
341  int gLinkProtocol = emErrBits.get(LVL1::DataError::GLinkProtocol);
342  int bCNMismatch = emErrBits.get(LVL1::DataError::BCNMismatch);
343  int fIFOOverflow = emErrBits.get(LVL1::DataError::FIFOOverflow);
344  int moduleError = emErrBits.get(LVL1::DataError::ModuleError);
345  int gLinkDown = emErrBits.get(LVL1::DataError::GLinkDown);
346  int gLinkTimeout = emErrBits.get(LVL1::DataError::GLinkTimeout);
347  uint32_t failingBCN = emErrBits.get(LVL1::DataError::FailingBCN);
348  subBlock->setStatus(failingBCN, gLinkTimeout, gLinkDown,
349  moduleError, fIFOOverflow, bCNMismatch,
350  gLinkProtocol, gLinkParity);
351  }
352  }
353  }
354  }
355  }
356 
357  // Pack and write the sub-blocks
358 
360  for (pos = cpmBlocks.begin(); pos != cpmBlocks.end(); ++pos)
361  {
362  CpmSubBlockV2 *const subBlock = *pos;
363  if ( !subBlock->pack())
364  {
365  msg(MSG::ERROR) << "CPM sub-block packing failed" << endmsg;
366  return StatusCode::FAILURE;
367  }
368  if (debug)
369  {
370  msg() << "CPM sub-block data words: "
371  << subBlock->dataWords() << endmsg;
372  }
373  subBlock->write(theROD);
374  }
375  }
376 
377  // Append CMXs to last S-Link of the crate
378 
379  for (int cmx = 0; cmx < m_cmxs; ++cmx)
380  {
381 
382  // Create a sub-block for each slice (except Neutral format)
383 
384  DataVector<CmxCpSubBlock> cmxBlocks;
385  const int summing = (crate == m_crates - 1) ? CmxSubBlock::SYSTEM
387  for (int slice = 0; slice < timeslicesNew; ++slice)
388  {
389  CmxCpSubBlock *const block = new CmxCpSubBlock();
390  block->setCmxHeader(m_version, m_dataFormat, slice, hwCrate,
391  summing, CmxSubBlock::CMX_CP, cmx, timeslicesNew);
392  cmxBlocks.push_back(block);
393  if (neutralFormat) break;
394  }
395 
396  // CMX-CP Tobs
397 
398  for (int cpm = 1; cpm <= m_modules; ++cpm)
399  {
400  for (int chip = 0; chip < m_chips; ++chip)
401  {
402  for (int loc = 0; loc < m_locs; ++loc)
403  {
404  const int key = tobKey(crate, cmx, cpm, chip, loc);
405  const LVL1::CMXCPTob *const ct = findCmxCpTob(key,
406  tobMap);
407  if ( ct )
408  {
409  std::vector<int> energy;
410  std::vector<int> isolation;
411  std::vector<int> error;
412  std::vector<unsigned int> presence;
413  ModifySlices::data(ct->energyVec(), energy, timeslicesNew);
414  ModifySlices::data(ct->isolationVec(), isolation, timeslicesNew);
415  ModifySlices::data(ct->errorVec(), error, timeslicesNew);
416  ModifySlices::data(ct->presenceMapVec(), presence, timeslicesNew);
417  for (int slice = 0; slice < timeslicesNew; ++slice)
418  {
419  const LVL1::DataError errBits(error[slice]);
420  int err = errBits.get(LVL1::DataError::ParityMerge);
421  err |= (errBits.get(LVL1::DataError::ParityPhase0)) << 1;
422  err |= (errBits.get(LVL1::DataError::ParityPhase1)) << 2;
423  err |= (errBits.get(LVL1::DataError::ParityPhase2)) << 3;
424  err |= (errBits.get(LVL1::DataError::ParityPhase3)) << 4;
425  err |= (errBits.get(LVL1::DataError::Overflow)) << 5;
426  const int index = ( neutralFormat ) ? 0 : slice;
427  CmxCpSubBlock *const subBlock = cmxBlocks[index];
428  subBlock->setTob(slice, cpm, chip, loc, energy[slice],
429  isolation[slice], err);
430  subBlock->setPresenceMap(slice, cpm, presence[slice]);
431  }
432  }
433  }
434  }
435  }
436 
437  // CMX-CP Hits
438 
439  for (int source = 0; source < LVL1::CMXCPHits::MAXSOURCE; ++source)
440  {
441  const int key = hitsKey(crate, cmx, source);
442  const LVL1::CMXCPHits *const ch = findCmxCpHits(key, hitsMap);
443  if ( ch )
444  {
445  std::vector<unsigned int> hits0;
446  std::vector<unsigned int> hits1;
447  std::vector<int> err0;
448  std::vector<int> err1;
449  ModifySlices::data(ch->hitsVec0(), hits0, timeslicesNew);
450  ModifySlices::data(ch->hitsVec1(), hits1, timeslicesNew);
451  ModifySlices::data(ch->errorVec0(), err0, timeslicesNew);
452  ModifySlices::data(ch->errorVec1(), err1, timeslicesNew);
453  for (int slice = 0; slice < timeslicesNew; ++slice)
454  {
455  const LVL1::DataError err0Bits(err0[slice]);
456  const LVL1::DataError err1Bits(err1[slice]);
457  const int index = ( neutralFormat ) ? 0 : slice;
458  CmxCpSubBlock *const subBlock = cmxBlocks[index];
459  subBlock->setHits(slice, source, 0, hits0[slice], // Assuming CMXCPHits::source == CmxCpSubBlock::source
460  err0Bits.get(LVL1::DataError::Parity));
461  subBlock->setHits(slice, source, 1, hits1[slice],
462  err1Bits.get(LVL1::DataError::Parity));
463  if (neutralFormat) // Neutral format wants RoI overflow bit
464  {
465  subBlock->setRoiOverflow(slice, source,
466  err0Bits.get(LVL1::DataError::Overflow));
467  }
468  }
469  }
470  }
471  for (CmxCpSubBlock* subBlock : cmxBlocks)
472  {
473  if ( !subBlock->pack())
474  {
475  msg(MSG::ERROR) << "CMX-Cp sub-block packing failed" << endmsg;
476  return StatusCode::FAILURE;
477  }
478  if (debug)
479  {
480  msg() << "CMX-Cp sub-block data words: "
481  << subBlock->dataWords() << endmsg;
482  }
483  subBlock->write(theROD);
484  }
485  }
486  }
487 
488  return StatusCode::SUCCESS;
489 }

◆ convert() [2/7]

StatusCode LVL1BS::CpByteStreamV2Tool::convert ( const std::string &  sgKey,
const IROBDataProviderSvc::VROBFRAG robFrags,
DataVector< LVL1::CMXCPHits > *  hitCollection 
) const

Definition at line 177 of file CpByteStreamV2Tool.cxx.

181 {
182  CmxCpHitsData data (hitCollection);
183  return convertBs(sgKey, robFrags, data);
184 }

◆ convert() [3/7]

StatusCode LVL1BS::CpByteStreamV2Tool::convert ( const std::string &  sgKey,
const IROBDataProviderSvc::VROBFRAG robFrags,
DataVector< LVL1::CMXCPTob > *  tobCollection 
) const

Definition at line 155 of file CpByteStreamV2Tool.cxx.

159 {
160  CmxCpTobData data (tobCollection);
161  return convertBs(sgKey, robFrags, data);
162 }

◆ convert() [4/7]

StatusCode LVL1BS::CpByteStreamV2Tool::convert ( const std::string &  sgKey,
const IROBDataProviderSvc::VROBFRAG robFrags,
DataVector< LVL1::CPMTower > *  ttCollection 
) const

Definition at line 133 of file CpByteStreamV2Tool.cxx.

137 {
138  CpmTowerData data (ttCollection);
139  return convertBs(sgKey, robFrags, data);
140 }

◆ convert() [5/7]

StatusCode LVL1BS::CpByteStreamV2Tool::convert ( const std::string &  sgKey,
DataVector< LVL1::CMXCPHits > *  hitCollection 
) const

Convert ROB fragments to CMX-CP hits.

Definition at line 165 of file CpByteStreamV2Tool.cxx.

168 {
169  const std::vector<uint32_t>& vID(sourceIDs());
170  // // get ROB fragments
172  m_robDataProvider->getROBData(vID, robFrags, "CpByteStreamV2Tool");
173  ATH_MSG_DEBUG("Number of ROB fragments:" << robFrags.size());
174  return convert(sgKey, robFrags, hitCollection);
175 }

◆ convert() [6/7]

StatusCode LVL1BS::CpByteStreamV2Tool::convert ( const std::string &  sgKey,
DataVector< LVL1::CMXCPTob > *  tobCollection 
) const

Convert ROB fragments to CMX-CP TOBs.

Definition at line 143 of file CpByteStreamV2Tool.cxx.

146 {
147  const std::vector<uint32_t>& vID(sourceIDs());
148  // // get ROB fragments
150  m_robDataProvider->getROBData(vID, robFrags, "CpByteStreamV2Tool");
151  ATH_MSG_DEBUG("Number of ROB fragments:" << robFrags.size());
152  return convert(sgKey, robFrags, tobCollection);
153 }

◆ convert() [7/7]

StatusCode LVL1BS::CpByteStreamV2Tool::convert ( const std::string &  sgKey,
DataVector< LVL1::CPMTower > *  ttCollection 
) const

Convert ROB fragments to CPM towers.

Definition at line 121 of file CpByteStreamV2Tool.cxx.

124 {
125  const std::vector<uint32_t>& vID(sourceIDs());
126  // // get ROB fragments
128  m_robDataProvider->getROBData(vID, robFrags, "CpByteStreamV2Tool");
129  ATH_MSG_DEBUG("Number of ROB fragments:" << robFrags.size());
130  return convert(sgKey, robFrags, ttCollection);
131 }

◆ convertBs()

StatusCode LVL1BS::CpByteStreamV2Tool::convertBs ( const std::string &  sgKey,
const IROBDataProviderSvc::VROBFRAG robFrags,
CpByteStreamToolData data 
) const
private

Convert bytestream to given container type.

Definition at line 526 of file CpByteStreamV2Tool.cxx.

530 {
531  LocalData ld;
532 
533  ld.coreOverlap =
534  CxxUtils::ends_with (sgKey, "Overlap") || CxxUtils::ends_with (sgKey, "OverlapAux.");
535 
536  const bool debug = msgLvl(MSG::DEBUG);
537  if (debug) msg(MSG::DEBUG);
538 
539  CmxCpSubBlock cmxCpSubBlock;
540  CpmSubBlockV2 cpmSubBlock;
541 
542  // Loop over ROB fragments
543 
544  int robCount = 0;
545  std::set<uint32_t> dupCheck;
546  ROBIterator rob = robFrags.begin();
547  ROBIterator robEnd = robFrags.end();
548  for (; rob != robEnd; ++rob)
549  {
550  ++robCount;
551  ATH_MSG_DEBUG("Treating ROB fragment " << robCount << " source_id = " << std::hex << (*rob)->rob_source_id() << std::dec);
552 
553  // Skip fragments with ROB status errors
554 
555  const uint32_t robid = (*rob)->source_id();
556  if ((*rob)->nstatus() > 0)
557  {
558  ROBPointer robData;
559  (*rob)->status(robData);
560  if (*robData != 0)
561  {
562  m_errorTool->robError(robid, *robData);
563  if (debug) msg() << "ROB status error - skipping fragment" << endmsg;
564  continue;
565  }
566  }
567 
568  // Skip duplicate fragments
569 
570  if (!dupCheck.insert(robid).second)
571  {
573  if (debug) msg() << "Skipping duplicate ROB fragment" << endmsg;
574  continue;
575  }
576 
577  // Unpack ROD data (slinks)
578 
579  RODPointer payloadBeg;
581  RODPointer payloadEnd;
582  (*rob)->rod_data(payloadBeg);
583  payloadEnd = payloadBeg + (*rob)->rod_ndata();
584  payload = payloadBeg;
585  if (payload == payloadEnd)
586  {
587  if (debug) msg() << "ROB fragment empty" << endmsg;
588  continue;
589  }
590 
591  // Check identifier
592  const uint32_t sourceID = (*rob)->rod_source_id();
593  if (m_srcIdMap.getRobID(sourceID) != robid ||
594  m_srcIdMap.subDet(sourceID) != m_subDetector ||
595  m_srcIdMap.daqOrRoi(sourceID) != 0 ||
596  (m_srcIdMap.slink(sourceID) != 0 && m_srcIdMap.slink(sourceID) != 2) ||
597  m_srcIdMap.crate(sourceID) < m_crateOffsetHw ||
598  m_srcIdMap.crate(sourceID) >= m_crateOffsetHw + m_crates)
599  {
600  m_errorTool->rodError(robid, L1CaloSubBlock::ERROR_ROD_ID);
601  if (debug)
602  {
603  msg() << "Wrong source identifier in data: ROD "
604  << MSG::hex << sourceID << " ROB " << robid
605  << MSG::dec << endmsg;
606  }
607  continue;
608  }
609 
610  // Check minor version
611  const int minorVersion = (*rob)->rod_version() & 0xffff;
612 
613  if (minorVersion <= m_srcIdMap.minorVersionPreLS1())
614  {
615  if (debug) msg() << "Skipping pre-LS1 data" << endmsg;
616  continue;
617  }
618  const int rodCrate = m_srcIdMap.crate(sourceID);
619  if (debug)
620  {
621  msg() << "Treating crate " << rodCrate
622  << " slink " << m_srcIdMap.slink(sourceID) << endmsg;
623  }
624 
625  // First word should be User Header
627  {
629  if (debug) msg() << "Invalid or missing user header" << endmsg;
630  continue;
631  }
632  L1CaloUserHeader userHeader(*payload);
633  userHeader.setVersion(minorVersion);
634  const int headerWords = userHeader.words();
635  if (headerWords != 1)
636  {
638  if (debug) msg() << "Unexpected number of user header words: "
639  << headerWords << endmsg;
640  continue;
641  }
642  for (int i = 0; i < headerWords; ++i) ++payload;
643  // triggered slice offset
644  const int trigCpm = userHeader.cpm();
645  if (debug)
646  {
647  msg() << "Minor format version number: " << MSG::hex
648  << minorVersion << MSG::dec << endmsg
649  << "Triggered slice offset: " << trigCpm << endmsg;
650  }
651 
652  // Loop over sub-blocks
653 
655  while (payload != payloadEnd)
656  {
658  {
659  if (debug) msg() << "Unexpected data sequence" << endmsg;
661  break;
662  }
663 
664  // TODO: (sasha) Comment this check since firmware does not ready
665  // Select right tool by ROD version
666  // if (L1CaloSubBlock::version(*payload) == 1) {
667  // if (debug) msg() << "Skipping pre-LS1 data" << endmsg;
668  // break;
669  // }
670 
672  {
673  // CMX
675  {
676  cmxCpSubBlock.clear();
677  payload = cmxCpSubBlock.read(payload, payloadEnd);
678  if (cmxCpSubBlock.crate() != rodCrate)
679  {
680  if (debug) msg() << "Inconsistent crate number in ROD source ID"
681  << endmsg;
683  break;
684  }
685 
686  if (data.m_collection == CMX_CP_TOBS || data.m_collection == CMX_CP_HITS)
687  {
688  decodeCmxCp(&cmxCpSubBlock, trigCpm, data, ld);
689  if (ld.rodErr != L1CaloSubBlock::ERROR_NONE)
690  {
691  if (debug) msg() << "decodeCmxCp failed" << endmsg;
692  break;
693  }
694  }
695  }
696  else
697  {
698  if (debug) msg() << "Invalid CMX type in module field" << endmsg;
700  break;
701  }
702  }
703  else
704  {
705  // CPM
706  cpmSubBlock.clear();
707  payload = cpmSubBlock.read(payload, payloadEnd);
708  if (cpmSubBlock.crate() != rodCrate)
709  {
710  if (debug) msg() << "Inconsistent crate number in ROD source ID"
711  << endmsg;
713  break;
714  }
715  if (data.m_collection == CPM_TOWERS)
716  {
717  decodeCpm(&cpmSubBlock, trigCpm, static_cast<CpmTowerData&>(data), ld);
718  if (ld.rodErr != L1CaloSubBlock::ERROR_NONE)
719  {
720  if (debug) msg() << "decodeCpm failed" << endmsg;
721  break;
722  }
723  }
724  }
725  }
726  if (ld.rodErr != L1CaloSubBlock::ERROR_NONE)
727  {
728  m_errorTool->rodError(robid, ld.rodErr);
729  }
730  }
731  return StatusCode::SUCCESS;
732 }

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

◆ decodeCmxCp()

void LVL1BS::CpByteStreamV2Tool::decodeCmxCp ( CmxCpSubBlock subBlock,
int  trigCpm,
CpByteStreamToolData data,
LocalData ld 
) const
private

Unpack CMX-CP sub-block.

Definition at line 736 of file CpByteStreamV2Tool.cxx.

739 {
740  const bool debug = msgLvl(MSG::DEBUG);
741  if (debug) msg(MSG::DEBUG);
742 
743  const int hwCrate = subBlock->crate();
744  const int cmx = subBlock->cmxPosition();
745  const int firmware = subBlock->cmxFirmware();
746  const int summing = subBlock->cmxSumming();
747  const int timeslices = subBlock->timeslices();
748  const int sliceNum = subBlock->slice();
749  if (debug)
750  {
751  msg() << "CMX-CP: Crate " << hwCrate
752  << " Position " << cmx
753  << " Firmware " << firmware
754  << " Summing " << summing
755  << " Total slices " << timeslices
756  << " Slice " << sliceNum
757  << endmsg;
758  }
759  if (timeslices <= trigCpm)
760  {
761  if (debug) msg() << "Triggered slice from header "
762  << "inconsistent with number of slices: "
763  << trigCpm << ", " << timeslices << endmsg;
765  return;
766  }
767  if (timeslices <= sliceNum)
768  {
769  if (debug) msg() << "Total slices inconsistent with slice number: "
770  << timeslices << ", " << sliceNum << endmsg;
772  return;
773  }
774  // Unpack sub-block
775  if (subBlock->dataWords() && !subBlock->unpack())
776  {
777  if (debug)
778  {
779  std::string errMsg(subBlock->unpackErrorMsg());
780  msg() << "CMX-CP sub-block unpacking failed: " << errMsg << endmsg;
781  }
782  ld.rodErr = subBlock->unpackErrorCode();
783  return;
784  }
785 
786  // Retrieve required data
787 
788  const bool neutralFormat = subBlock->format() == L1CaloSubBlock::NEUTRAL;
789  LVL1::DataError dErr;
790  dErr.set(LVL1::DataError::SubStatusWord, subBlock->subStatus());
791  const int subStatus = dErr.error();
792  const int crate = hwCrate - m_crateOffsetHw;
793  const int swCrate = crate + m_crateOffsetSw;
794  const int maxSid = CmxCpSubBlock::MAX_SOURCE_ID;
795  const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
796  const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
797  for (int slice = sliceBeg; slice < sliceEnd; ++slice)
798  {
799 
800  if (data.m_collection == CMX_CP_TOBS)
801  {
802  CmxCpTobData& tdata = static_cast<CmxCpTobData&> (data);
803 
804  // TOBs
805 
806  for (int cpm = 1; cpm <= m_modules; ++cpm)
807  {
808  const unsigned int presenceMap = subBlock->presenceMap(slice, cpm);
809  for (int tob = 0; tob < m_maxTobs; ++tob)
810  {
811  const int energy = subBlock->energy(slice, cpm, tob);
812  const int isolation = subBlock->isolation(slice, cpm, tob);
813  int error = subBlock->tobError(slice, cpm, tob);
814  if (energy == 0 && isolation == 0 && error == 0) break;
815  const int loc = subBlock->localCoord(slice, cpm, tob);
816  const int chip = subBlock->chip(slice, cpm, tob);
817  LVL1::DataError errBits(subStatus);
818  if (error)
819  {
820  errBits.set(LVL1::DataError::ParityPhase0, error);
821  errBits.set(LVL1::DataError::ParityPhase1, (error >> 1));
822  errBits.set(LVL1::DataError::ParityPhase2, (error >> 2));
823  errBits.set(LVL1::DataError::ParityPhase3, (error >> 3));
824  errBits.set(LVL1::DataError::Overflow, (error >> 4));
825  errBits.set(LVL1::DataError::ParityMerge, (error >> 5));
826  errBits.set(LVL1::DataError::Parity, (error & 0x2f) ? 1 : 0);
827  }
828  error = errBits.error();
829  const int key = tobKey(crate, cmx, cpm, chip, loc);
830  LVL1::CMXCPTob *tb = findCmxCpTob(tdata, key);
831  if ( ! tb ) // create new CMX TOB
832  {
833  ld.energyVec.assign(timeslices, 0);
834  ld.isolVec.assign(timeslices, 0);
835  ld.errorVec.assign(timeslices, 0);
836  ld.presenceMapVec.assign(timeslices, 0);
837  ld.energyVec[slice] = energy;
838  ld.isolVec[slice] = isolation;
839  ld.errorVec[slice] = error;
840  ld.presenceMapVec[slice] = presenceMap;
841  auto tbp =
842  std::make_unique<LVL1::CMXCPTob>(swCrate, cmx, cpm, chip, loc,
843  ld.energyVec, ld.isolVec, ld.errorVec,
844  ld.presenceMapVec, trigCpm);
845  tdata.m_tobMap.insert(std::make_pair(key, tbp.get()));
846  tdata.m_tobCollection->push_back(std::move(tbp));
847  }
848  else
849  {
850  ld.energyVec = tb->energyVec();
851  ld.isolVec = tb->isolationVec();
852  ld.errorVec = tb->errorVec();
853  ld.presenceMapVec = tb->presenceMapVec();
854  const int nsl = ld.energyVec.size();
855  if (timeslices != nsl)
856  {
857  if (debug) msg() << "Inconsistent number of slices in sub-blocks"
858  << endmsg;
860  return;
861  }
862  if (ld.energyVec[slice] != 0 || ld.isolVec[slice] != 0 ||
863  ld.errorVec[slice] != 0)
864  {
865  if (debug) msg() << "Duplicate data for slice " << slice << endmsg;
867  return;
868  }
869  ld.energyVec[slice] = energy;
870  ld.isolVec[slice] = isolation;
871  ld.errorVec[slice] = error;
872  ld.presenceMapVec[slice] = presenceMap;
873  tb->addTob(ld.energyVec, ld.isolVec, ld.errorVec, ld.presenceMapVec);
874  }
875  }
876  }
877 
878  }
879  else if (data.m_collection == CMX_CP_HITS)
880  {
881  CmxCpHitsData& hdata = static_cast<CmxCpHitsData&> (data);
882 
883  // Hit/Topo counts
884 
885  for (int source = 0; source < maxSid; ++source)
886  {
887  if (summing == CmxSubBlock::CRATE &&
888  (source == CmxCpSubBlock::REMOTE_0 ||
889  source == CmxCpSubBlock::REMOTE_1 ||
890  source == CmxCpSubBlock::REMOTE_2 ||
891  source == CmxCpSubBlock::TOTAL)) continue;
892  const unsigned int hits0 = subBlock->hits(slice, source, 0); //low
893  const unsigned int hits1 = subBlock->hits(slice, source, 1); //high
894  int err0 = subBlock->hitsError(slice, source, 0);
895  int err1 = subBlock->hitsError(slice, source, 1);
896  int overflow = subBlock->roiOverflow(slice, source);
897  LVL1::DataError err0Bits(subStatus);
898  err0Bits.set(LVL1::DataError::Parity, err0);
899  err0Bits.set(LVL1::DataError::Overflow, overflow);
900  err0 = err0Bits.error();
901  LVL1::DataError err1Bits(subStatus);
902  err1Bits.set(LVL1::DataError::Parity, err1);
903  err1Bits.set(LVL1::DataError::Overflow, overflow);
904  err1 = err1Bits.error();
905  if (hits0 || hits1 || err0 || err1)
906  {
907  const int key = hitsKey(crate, cmx, source);
908  LVL1::CMXCPHits *ch = findCmxCpHits(hdata, key);
909  if ( ! ch ) // create new CMX hits
910  {
911  ld.hitsVec0.assign(timeslices, 0);
912  ld.hitsVec1.assign(timeslices, 0);
913  ld.errVec0.assign(timeslices, 0);
914  ld.errVec1.assign(timeslices, 0);
915  ld.hitsVec0[slice] = hits0;
916  ld.hitsVec1[slice] = hits1;
917  ld.errVec0[slice] = err0;
918  ld.errVec1[slice] = err1;
919  auto chp =
920  std::make_unique<LVL1::CMXCPHits>(swCrate, cmx, source,
921  ld.hitsVec0, ld.hitsVec1,
922  ld.errVec0, ld.errVec1, trigCpm);
923  hdata.m_hitsMap.insert(std::make_pair(key, chp.get()));
924  hdata.m_hitCollection->push_back(std::move(chp));
925  }
926  else
927  {
928  ld.hitsVec0 = ch->hitsVec0();
929  ld.hitsVec1 = ch->hitsVec1();
930  ld.errVec0 = ch->errorVec0();
931  ld.errVec1 = ch->errorVec1();
932  const int nsl = ld.hitsVec0.size();
933  if (timeslices != nsl)
934  {
935  if (debug) msg() << "Inconsistent number of slices in sub-blocks"
936  << endmsg;
938  return;
939  }
940  if (ld.hitsVec0[slice] != 0 || ld.hitsVec1[slice] != 0 ||
941  ld.errVec0[slice] != 0 || ld.errVec1[slice] != 0)
942  {
943  if (debug) msg() << "Duplicate data for slice " << slice << endmsg;
945  return;
946  }
947  ld.hitsVec0[slice] = hits0;
948  ld.hitsVec1[slice] = hits1;
949  ld.errVec0[slice] = err0;
950  ld.errVec1[slice] = err1;
951  ch->addHits(ld.hitsVec0, ld.hitsVec1, ld.errVec0, ld.errVec1);
952  }
953  }
954  }
955  }
956  }
957 
958  return;
959 }

◆ decodeCpm()

void LVL1BS::CpByteStreamV2Tool::decodeCpm ( CpmSubBlockV2 subBlock,
int  trigCpm,
CpmTowerData data,
LocalData ld 
) const
private

Unpack CPM sub-block.

Definition at line 963 of file CpByteStreamV2Tool.cxx.

966 {
967  const bool debug = msgLvl(MSG::DEBUG);
968  const bool verbose = msgLvl(MSG::VERBOSE);
969  if (debug) msg(MSG::DEBUG);
970 
971  const int hwCrate = subBlock->crate();
972  const int module = subBlock->module();
973  const int timeslices = subBlock->timeslices();
974  const int sliceNum = subBlock->slice();
975  if (debug)
976  {
977  msg() << "CPM: Crate " << hwCrate
978  << " Module " << module
979  << " Total slices " << timeslices
980  << " Slice " << sliceNum << endmsg;
981  }
982  if (module < 1 || module > m_modules)
983  {
984  if (debug) msg() << "Unexpected module number: " << module << endmsg;
986  return;
987  }
988  if (timeslices <= trigCpm)
989  {
990  if (debug) msg() << "Triggered slice from header "
991  << "inconsistent with number of slices: "
992  << trigCpm << ", " << timeslices << endmsg;
994  return;
995  }
996  if (timeslices <= sliceNum)
997  {
998  if (debug) msg() << "Total slices inconsistent with slice number: "
999  << timeslices << ", " << sliceNum << endmsg;
1001  return;
1002  }
1003  // Unpack sub-block
1004  if (subBlock->dataWords() && !subBlock->unpack())
1005  {
1006  if (debug)
1007  {
1008  std::string errMsg(subBlock->unpackErrorMsg());
1009  msg() << "CPM sub-block unpacking failed: " << errMsg << endmsg;
1010  }
1011  ld.rodErr = subBlock->unpackErrorCode();
1012  return;
1013  }
1014 
1015  // Retrieve required data
1016  const bool neutralFormat = subBlock->format() == L1CaloSubBlock::NEUTRAL;
1017  LVL1::DataError dErr;
1018  dErr.set(LVL1::DataError::SubStatusWord, subBlock->subStatus());
1019  const int subStatus = dErr.error();
1020  const int crate = hwCrate - m_crateOffsetHw;
1021  const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
1022  const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
1023  for (int slice = sliceBeg; slice < sliceEnd; ++slice)
1024  {
1025 
1026  // Loop over tower channels and fill CPM towers
1027 
1028  for (int chan = 0; chan < m_channels; ++chan)
1029  {
1030  if (!subStatus && !subBlock->anyTowerData(chan)) continue;
1031  const int em = subBlock->emData(slice, chan);
1032  const int had = subBlock->hadData(slice, chan);
1033  const int emErr = subBlock->emError(slice, chan);
1034  const int hadErr = subBlock->hadError(slice, chan);
1035  int emErr1 = subStatus;
1036  if (emErr)
1037  {
1038  LVL1::DataError emErrBits(emErr1);
1039  emErrBits.set(LVL1::DataError::Parity, emErr & 0x1);
1040  emErrBits.set(LVL1::DataError::LinkDown, (emErr >> 1) & 0x1);
1041  emErr1 = emErrBits.error();
1042  }
1043  int hadErr1 = subStatus;
1044  if (hadErr)
1045  {
1046  LVL1::DataError hadErrBits(hadErr1);
1047  hadErrBits.set(LVL1::DataError::Parity, hadErr & 0x1);
1048  hadErrBits.set(LVL1::DataError::LinkDown, (hadErr >> 1) & 0x1);
1049  hadErr1 = hadErrBits.error();
1050  }
1051  if (em || had || emErr1 || hadErr1)
1052  {
1053  double eta = 0.;
1054  double phi = 0.;
1055  int layer = 0;
1056  if (m_cpmMaps->mapping(crate, module, chan, eta, phi, layer))
1057  {
1058  if (layer == ld.coreOverlap)
1059  {
1060  const unsigned int key = ld.towerKey.ttKey(phi, eta);
1062  if ( ! tt ) // create new CPM tower
1063  {
1064  ld.emVec.assign(timeslices, 0);
1065  ld.hadVec.assign(timeslices, 0);
1066  ld.emErrVec.assign(timeslices, 0);
1067  ld.hadErrVec.assign(timeslices, 0);
1068  ld.emVec[slice] = em;
1069  ld.hadVec[slice] = had;
1070  ld.emErrVec[slice] = emErr1;
1071  ld.hadErrVec[slice] = hadErr1;
1072  auto ttp =
1073  std::make_unique<LVL1::CPMTower>(phi, eta, ld.emVec, ld.emErrVec,
1074  ld.hadVec, ld.hadErrVec, trigCpm);
1075  data.m_ttMap.insert(std::make_pair(key, ttp.get()));
1076  data.m_ttCollection->push_back(std::move(ttp));
1077  }
1078  else
1079  {
1080  ld.emVec = tt->emEnergyVec();
1081  ld.hadVec = tt->hadEnergyVec();
1082  ld.emErrVec = tt->emErrorVec();
1083  ld.hadErrVec = tt->hadErrorVec();
1084  const int nsl = ld.emVec.size();
1085  if (timeslices != nsl)
1086  {
1087  if (debug)
1088  {
1089  msg() << "Inconsistent number of slices in sub-blocks"
1090  << endmsg;
1091  }
1093  return;
1094  }
1095  if (ld.emVec[slice] != 0 || ld.hadVec[slice] != 0 ||
1096  ld.emErrVec[slice] != 0 || ld.hadErrVec[slice] != 0)
1097  {
1098  if (debug) msg() << "Duplicate data for slice "
1099  << slice << endmsg;
1101  return;
1102  }
1103  ld.emVec[slice] = em;
1104  ld.hadVec[slice] = had;
1105  ld.emErrVec[slice] = emErr1;
1106  ld.hadErrVec[slice] = hadErr1;
1107  tt->fill(ld.emVec, ld.emErrVec, ld.hadVec, ld.hadErrVec, trigCpm);
1108  }
1109  }
1110  }
1111  else if (verbose && (em || had || emErr || hadErr))
1112  {
1113  msg(MSG::VERBOSE) << "Non-zero data but no channel mapping for channel "
1114  << chan << endmsg;
1115  msg(MSG::DEBUG);
1116  }
1117  }
1118  else if (verbose)
1119  {
1120  msg(MSG::VERBOSE) << "No CPM tower data for channel "
1121  << chan << " slice " << slice << endmsg;
1122  msg(MSG::DEBUG);
1123  }
1124  }
1125  }
1126  return;
1127 }

◆ 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

◆ findCmxCpHits() [1/2]

LVL1::CMXCPHits * LVL1BS::CpByteStreamV2Tool::findCmxCpHits ( const CmxCpHitsData data,
int  key 
) const
private

Definition at line 1178 of file CpByteStreamV2Tool.cxx.

1180 {
1181  CmxCpHitsMap::const_iterator mapIter = data.m_hitsMap.find(key);
1182  if (mapIter != data.m_hitsMap.end()) return mapIter->second;
1183  return nullptr;
1184 }

◆ findCmxCpHits() [2/2]

const LVL1::CMXCPHits * LVL1BS::CpByteStreamV2Tool::findCmxCpHits ( int  key,
const ConstCmxCpHitsMap hitsMap 
) const
private

Find CMX-CP hits for given key.

Definition at line 1170 of file CpByteStreamV2Tool.cxx.

1172 {
1173  ConstCmxCpHitsMap::const_iterator mapIter = hitsMap.find(key);
1174  if (mapIter != hitsMap.end()) return mapIter->second;
1175  return nullptr;
1176 }

◆ findCmxCpTob() [1/2]

LVL1::CMXCPTob * LVL1BS::CpByteStreamV2Tool::findCmxCpTob ( const CmxCpTobData data,
int  key 
) const
private

Definition at line 1159 of file CpByteStreamV2Tool.cxx.

1161 {
1162  CmxCpTobMap::const_iterator mapIter = data.m_tobMap.find(key);
1163  if (mapIter != data.m_tobMap.end()) return mapIter->second;
1164  return nullptr;
1165 }

◆ findCmxCpTob() [2/2]

const LVL1::CMXCPTob * LVL1BS::CpByteStreamV2Tool::findCmxCpTob ( int  key,
const ConstCmxCpTobMap tobMap 
) const
private

Find CMX-CP TOB for given key.

Definition at line 1151 of file CpByteStreamV2Tool.cxx.

1153 {
1154  ConstCmxCpTobMap::const_iterator mapIter = tobMap.find(key);
1155  if (mapIter != tobMap.end()) return mapIter->second;
1156  return nullptr;
1157 }

◆ findCpmTower() [1/2]

LVL1::CPMTower * LVL1BS::CpByteStreamV2Tool::findCpmTower ( const CpmTowerData data,
unsigned int  key 
) const
private

Definition at line 1140 of file CpByteStreamV2Tool.cxx.

1142 {
1143  CpmTowerMap::const_iterator mapIter = data.m_ttMap.find(key);
1144  if (mapIter != data.m_ttMap.end()) return mapIter->second;
1145  return nullptr;
1146 }

◆ findCpmTower() [2/2]

const LVL1::CPMTower * LVL1BS::CpByteStreamV2Tool::findCpmTower ( unsigned int  key,
const ConstCpmTowerMap ttMap 
) const
private

Find a CPM tower for given key.

Definition at line 1132 of file CpByteStreamV2Tool.cxx.

1134 {
1135  ConstCpmTowerMap::const_iterator mapIter = ttMap.find(key);
1136  if (mapIter != ttMap.end()) return mapIter->second;
1137  return nullptr;
1138 }

◆ hitsKey()

int LVL1BS::CpByteStreamV2Tool::hitsKey ( int  crate,
int  cmx,
int  source 
) const
private

Key for Hits.

Definition at line 1265 of file CpByteStreamV2Tool.cxx.

1267 {
1268  return (((crate << 1) | cmx) << 3) | source;
1269 }

◆ initialize()

StatusCode LVL1BS::CpByteStreamV2Tool::initialize ( )
overridevirtual

Definition at line 105 of file CpByteStreamV2Tool.cxx.

106 {
107  ATH_MSG_INFO( "Initializing " << name() );
108 
109  CHECK(m_cpmMaps.retrieve());
110  CHECK(m_errorTool.retrieve());
111  CHECK(m_robDataProvider.retrieve());
112  if (m_enableEncoding.value()) {
113  m_byteStreamCnvSvc = serviceLocator()->service("ByteStreamCnvSvc");
114  ATH_CHECK(m_byteStreamCnvSvc.isValid());
115  }
116 
117  return StatusCode::SUCCESS;
118 }

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

AlgTool InterfaceID.

Definition at line 44 of file CpByteStreamV2Tool.cxx.

45 {
46  return IID_ICpByteStreamV2Tool;
47 }

◆ makeSourceIDs()

std::vector< uint32_t > LVL1BS::CpByteStreamV2Tool::makeSourceIDs ( ) const
private

Create list of all source IDs.

Definition at line 493 of file CpByteStreamV2Tool.cxx.

494 {
495  std::vector<uint32_t> sourceIDs;
496 
497  if (!m_sourceIDsProp.empty()) {
499  }
500  else {
501  const int maxCrates = m_crates + m_crateOffsetHw;
502  const int maxSlinks = m_srcIdMap.maxSlinks();
503  for (int hwCrate = m_crateOffsetHw; hwCrate < maxCrates; ++hwCrate)
504  {
505  for (int slink = 0; slink < maxSlinks; ++slink)
506  {
507  const int daqOrRoi = 0;
508  const uint32_t rodId = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
509  m_subDetector);
510  const uint32_t robId = m_srcIdMap.getRobID(rodId);
511  sourceIDs.push_back(robId);
512  }
513  }
514  }
515  return sourceIDs;
516 }

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

◆ setupCmxCpHitsMap()

void LVL1BS::CpByteStreamV2Tool::setupCmxCpHitsMap ( const CmxCpHitsCollection hitCollection,
ConstCmxCpHitsMap hitsMap 
) const
private

Set up CMX-CP hits map.

Definition at line 1234 of file CpByteStreamV2Tool.cxx.

1237 {
1238  hitsMap.clear();
1239  if (hitCollection)
1240  {
1241  CmxCpHitsCollection::const_iterator pos = hitCollection->begin();
1242  CmxCpHitsCollection::const_iterator pose = hitCollection->end();
1243  for (; pos != pose; ++pos)
1244  {
1245  const LVL1::CMXCPHits *const hits = *pos;
1246  const int crate = hits->crate() - m_crateOffsetSw;
1247  const int cmx = hits->cmx();
1248  const int source = hits->source();
1249  const int key = hitsKey(crate, cmx, source);
1250  hitsMap.insert(std::make_pair(key, hits));
1251  }
1252  }
1253 }

◆ setupCmxCpTobMap()

void LVL1BS::CpByteStreamV2Tool::setupCmxCpTobMap ( const CmxCpTobCollection tobCollection,
ConstCmxCpTobMap tobMap 
) const
private

Set up CMX-CP TOB map.

Definition at line 1209 of file CpByteStreamV2Tool.cxx.

1212 {
1213  tobMap.clear();
1214  if (tobCollection)
1215  {
1216  CmxCpTobCollection::const_iterator pos = tobCollection->begin();
1217  CmxCpTobCollection::const_iterator pose = tobCollection->end();
1218  for (; pos != pose; ++pos)
1219  {
1220  const LVL1::CMXCPTob *const tob = *pos;
1221  const int crate = tob->crate() - m_crateOffsetSw;
1222  const int cmx = tob->cmx();
1223  const int cpm = tob->cpm();
1224  const int chip = tob->chip();
1225  const int loc = tob->location();
1226  const int key = tobKey(crate, cmx, cpm, chip, loc);
1227  tobMap.insert(std::make_pair(key, tob));
1228  }
1229  }
1230 }

◆ setupCpmTowerMap()

void LVL1BS::CpByteStreamV2Tool::setupCpmTowerMap ( const CpmTowerCollection ttCollection,
ConstCpmTowerMap ttMap,
LVL1::TriggerTowerKey towerKey 
) const
private

Set up CPM tower map.

Definition at line 1188 of file CpByteStreamV2Tool.cxx.

1192 {
1193  ttMap.clear();
1194  if (ttCollection)
1195  {
1196  CpmTowerCollection::const_iterator pos = ttCollection->begin();
1197  CpmTowerCollection::const_iterator pose = ttCollection->end();
1198  for (; pos != pose; ++pos)
1199  {
1200  const LVL1::CPMTower *const tt = *pos;
1201  const unsigned int key = towerKey.ttKey(tt->phi(), tt->eta());
1202  ttMap.insert(std::make_pair(key, tt));
1203  }
1204  }
1205 }

◆ slinkSlices()

bool LVL1BS::CpByteStreamV2Tool::slinkSlices ( int  crate,
int  module,
int  modulesPerSlink,
int &  timeslices,
int &  trigJem,
const ConstCpmTowerMap ttMap,
const ConstCmxCpTobMap tobMap,
const ConstCmxCpHitsMap hitsMap,
LVL1::TriggerTowerKey towerKey 
) const
private

Get number of slices and triggered slice offset for next slink.

Definition at line 1273 of file CpByteStreamV2Tool.cxx.

1279 {
1280  int slices = -1;
1281  int trigC = m_dfltSlices / 2;
1282  for (int mod = module; mod < module + modulesPerSlink; ++mod)
1283  {
1284  for (int chan = 0; chan < m_channels; ++chan)
1285  {
1286  double eta = 0.;
1287  double phi = 0.;
1288  int layer = 0;
1289  if ( !m_cpmMaps->mapping(crate, mod, chan, eta, phi, layer)) continue;
1290  const unsigned int key = towerKey.ttKey(phi, eta);
1291  const LVL1::CPMTower *const tt = findCpmTower(key, ttMap);
1292  if ( !tt ) continue;
1293  const int numdat = 4;
1294  std::vector<int> sums(numdat);
1295  std::vector<int> sizes(numdat);
1296  sums[0] = std::accumulate((tt->emEnergyVec()).begin(),
1297  (tt->emEnergyVec()).end(), 0);
1298  sums[1] = std::accumulate((tt->hadEnergyVec()).begin(),
1299  (tt->hadEnergyVec()).end(), 0);
1300  sums[2] = std::accumulate((tt->emErrorVec()).begin(),
1301  (tt->emErrorVec()).end(), 0);
1302  sums[3] = std::accumulate((tt->hadErrorVec()).begin(),
1303  (tt->hadErrorVec()).end(), 0);
1304  sizes[0] = (tt->emEnergyVec()).size();
1305  sizes[1] = (tt->hadEnergyVec()).size();
1306  sizes[2] = (tt->emErrorVec()).size();
1307  sizes[3] = (tt->hadErrorVec()).size();
1308  const int peak = tt->peak();
1309  for (int i = 0; i < numdat; ++i)
1310  {
1311  if (sums[i] == 0) continue;
1312  if (slices < 0)
1313  {
1314  slices = sizes[i];
1315  trigC = peak;
1316  }
1317  else if (slices != sizes[i] || trigC != peak) return false;
1318  }
1319  }
1320  }
1321  // CMXs last slink of crate
1322  if (module / modulesPerSlink == m_slinks - 1)
1323  {
1324  for (int cmx = 0; cmx < m_cmxs; ++cmx)
1325  {
1326  for (int cpm = 1; cpm <= m_modules; ++ cpm)
1327  {
1328  for (int chip = 0; chip < m_chips; ++chip)
1329  {
1330  for (int loc = 0; loc < m_locs; ++loc)
1331  {
1332  const int key = tobKey(crate, cmx, cpm, chip, loc);
1333  const LVL1::CMXCPTob *const tob = findCmxCpTob(key,
1334  tobMap);
1335  if (tob)
1336  {
1337  const int numdat = 3;
1338  std::vector<int> sums(numdat);
1339  std::vector<int> sizes(numdat);
1340  sums[0] = std::accumulate((tob->energyVec()).begin(),
1341  (tob->energyVec()).end(), 0);
1342  sums[1] = std::accumulate((tob->isolationVec()).begin(),
1343  (tob->isolationVec()).end(), 0);
1344  sums[2] = std::accumulate((tob->errorVec()).begin(),
1345  (tob->errorVec()).end(), 0);
1346  sizes[0] = (tob->energyVec()).size();
1347  sizes[1] = (tob->isolationVec()).size();
1348  sizes[2] = (tob->errorVec()).size();
1349  const int peak = tob->peak();
1350  for (int i = 0; i < numdat; ++i)
1351  {
1352  if (sums[i] == 0) continue;
1353  if (slices < 0)
1354  {
1355  slices = sizes[i];
1356  trigC = peak;
1357  }
1358  else if (slices != sizes[i] || trigC != peak) return false;
1359  }
1360  }
1361  }
1362  }
1363  }
1364  for (int source = 0; source < LVL1::CMXCPHits::MAXSOURCE; ++source)
1365  {
1366  const int key = hitsKey(crate, cmx, source);
1367 
1368  const LVL1::CMXCPHits *const hits = findCmxCpHits(key,
1369  hitsMap);
1370  if (hits)
1371  {
1372  const int numdat = 4;
1373  std::vector<unsigned int> sums(numdat);
1374  std::vector<int> sizes(numdat);
1375  sums[0] = std::accumulate((hits->hitsVec0()).begin(),
1376  (hits->hitsVec0()).end(), 0);
1377  sums[1] = std::accumulate((hits->hitsVec1()).begin(),
1378  (hits->hitsVec1()).end(), 0);
1379  sums[2] = std::accumulate((hits->errorVec0()).begin(),
1380  (hits->errorVec0()).end(), 0);
1381  sums[3] = std::accumulate((hits->errorVec1()).begin(),
1382  (hits->errorVec1()).end(), 0);
1383  sizes[0] = (hits->hitsVec0()).size();
1384  sizes[1] = (hits->hitsVec1()).size();
1385  sizes[2] = (hits->errorVec0()).size();
1386  sizes[3] = (hits->errorVec1()).size();
1387  const int peak = hits->peak();
1388  for (int i = 0; i < numdat; ++i)
1389  {
1390  if (sums[i] == 0) continue;
1391  if (slices < 0)
1392  {
1393  slices = sizes[i];
1394  trigC = peak;
1395  }
1396  else if (slices != sizes[i] || trigC != peak) return false;
1397  }
1398  }
1399  }
1400  }
1401  }
1402  if (slices < 0) slices = m_dfltSlices;
1403  timeslices = slices;
1404  trigCpm = trigC;
1405  return true;
1406 }

◆ sourceIDs()

const std::vector< uint32_t > & LVL1BS::CpByteStreamV2Tool::sourceIDs ( ) const

Return reference to vector with all possible Source Identifiers.

Definition at line 518 of file CpByteStreamV2Tool.cxx.

519 {
520  static const std::vector<uint32_t> sourceIDs = makeSourceIDs();
521  return sourceIDs;
522 }

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

◆ tobKey()

int LVL1BS::CpByteStreamV2Tool::tobKey ( int  crate,
int  cmx,
int  cpm,
int  chip,
int  loc 
) const
private

Key for TOBs.

Definition at line 1257 of file CpByteStreamV2Tool.cxx.

1259 {
1260  return (((((((crate << 1) | cmx) << 4) | cpm) << 4) | chip) << 2) | loc;
1261 }

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

SmartIF<ByteStreamCnvSvc> LVL1BS::CpByteStreamV2Tool::m_byteStreamCnvSvc
private

Definition at line 95 of file CpByteStreamV2Tool.h.

◆ m_channels

const int LVL1BS::CpByteStreamV2Tool::m_channels
private

Number of channels per module.

Definition at line 239 of file CpByteStreamV2Tool.h.

◆ m_chips

const int LVL1BS::CpByteStreamV2Tool::m_chips
private

Number of chips.

Definition at line 249 of file CpByteStreamV2Tool.h.

◆ m_cmxs

const int LVL1BS::CpByteStreamV2Tool::m_cmxs
private

Number of CMXs per crate.

Definition at line 245 of file CpByteStreamV2Tool.h.

◆ m_cpmMaps

ToolHandle<LVL1::IL1CaloMappingTool> LVL1BS::CpByteStreamV2Tool::m_cpmMaps
private

Channel mapping tool.

Definition at line 226 of file CpByteStreamV2Tool.h.

◆ m_crateMax

int LVL1BS::CpByteStreamV2Tool::m_crateMax
private

Property: Maximum crate number when writing out bytestream.

Definition at line 261 of file CpByteStreamV2Tool.h.

◆ m_crateMin

int LVL1BS::CpByteStreamV2Tool::m_crateMin
private

Property: Minimum crate number when writing out bytestream.

Definition at line 259 of file CpByteStreamV2Tool.h.

◆ m_crateOffsetHw

int LVL1BS::CpByteStreamV2Tool::m_crateOffsetHw
private

Property: Hardware crate number offset.

Definition at line 231 of file CpByteStreamV2Tool.h.

◆ m_crateOffsetSw

int LVL1BS::CpByteStreamV2Tool::m_crateOffsetSw
private

Property: Software crate number offset.

Definition at line 233 of file CpByteStreamV2Tool.h.

◆ m_crates

int LVL1BS::CpByteStreamV2Tool::m_crates
private

Property: Number of crates.

Definition at line 241 of file CpByteStreamV2Tool.h.

◆ m_dataFormat

int LVL1BS::CpByteStreamV2Tool::m_dataFormat
private

Property: Data compression format.

Definition at line 237 of file CpByteStreamV2Tool.h.

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

int LVL1BS::CpByteStreamV2Tool::m_dfltSlices
private

Property: Default number of slices in simulation.

Definition at line 255 of file CpByteStreamV2Tool.h.

◆ m_enableEncoding

Gaudi::Property<bool> LVL1BS::CpByteStreamV2Tool::m_enableEncoding
private
Initial value:
{
this, "enableEncoding", true, "Enable conversion from RDO to ByteStream"}

Definition at line 93 of file CpByteStreamV2Tool.h.

◆ m_errorTool

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

Error collection tool.

Definition at line 228 of file CpByteStreamV2Tool.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_forceSlices

int LVL1BS::CpByteStreamV2Tool::m_forceSlices
private

Property: Force number of slices in bytestream.

Definition at line 257 of file CpByteStreamV2Tool.h.

◆ m_locs

const int LVL1BS::CpByteStreamV2Tool::m_locs
private

Number of Local coordinates.

Definition at line 251 of file CpByteStreamV2Tool.h.

◆ m_maxTobs

const int LVL1BS::CpByteStreamV2Tool::m_maxTobs
private

Maximum number of TOBS per module.

Definition at line 247 of file CpByteStreamV2Tool.h.

◆ m_modules

const int LVL1BS::CpByteStreamV2Tool::m_modules
private

Number of CPM modules per crate.

Definition at line 243 of file CpByteStreamV2Tool.h.

◆ m_robDataProvider

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

Definition at line 229 of file CpByteStreamV2Tool.h.

◆ m_slinks

int LVL1BS::CpByteStreamV2Tool::m_slinks
private

Property: Number of slinks per crate when writing out bytestream.

Definition at line 253 of file CpByteStreamV2Tool.h.

◆ m_sourceIDsProp

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

Property: ROB source IDs.

Definition at line 267 of file CpByteStreamV2Tool.h.

◆ m_srcIdMap

const L1CaloSrcIdMap LVL1BS::CpByteStreamV2Tool::m_srcIdMap
private

Source ID converter.

Definition at line 265 of file CpByteStreamV2Tool.h.

◆ m_subDetector

const eformat::SubDetector LVL1BS::CpByteStreamV2Tool::m_subDetector
private

Sub-detector type.

Definition at line 263 of file CpByteStreamV2Tool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_version

int LVL1BS::CpByteStreamV2Tool::m_version
private

Property: Sub_block header version.

Definition at line 235 of file CpByteStreamV2Tool.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:
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
LVL1BS::L1CaloSrcIdMap::minorVersionPreLS1
uint16_t minorVersionPreLS1() const
Return last ROD header minor version for pre-LS1 data.
Definition: L1CaloSrcIdMap.h:59
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LVL1BS::L1CaloSrcIdMap::slink
int slink(uint32_t code) const
Return slink from unpacked moduleID.
Definition: L1CaloSrcIdMap.cxx:68
LVL1::DataError::LinkDown
@ LinkDown
Definition: DataError.h:31
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
LVL1BS::L1CaloSubBlock::ERROR_MISSING_HEADER
@ ERROR_MISSING_HEADER
Definition: L1CaloSubBlock.h:33
LVL1::DataError
Error data.
Definition: DataError.h:27
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LVL1::CMXCPTob::cmx
int cmx() const
returns CMX number (0/1)==(Left/Right)==(Tau/Em)
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPTob.h:86
LVL1BS::CpByteStreamV2Tool::m_enableEncoding
Gaudi::Property< bool > m_enableEncoding
Definition: CpByteStreamV2Tool.h:93
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LVL1BS::CpByteStreamV2Tool::decodeCpm
void decodeCpm(CpmSubBlockV2 *subBlock, int trigCpm, CpmTowerData &data, LocalData &ld) const
Unpack CPM sub-block.
Definition: CpByteStreamV2Tool.cxx:963
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition: FullEventAssembler.h:40
LVL1BS::CmxCpSubBlock::REMOTE_2
@ REMOTE_2
Definition: CmxCpSubBlock.h:28
LVL1BS::CpByteStreamV2Tool::findCpmTower
const LVL1::CPMTower * findCpmTower(unsigned int key, const ConstCpmTowerMap &ttMap) const
Find a CPM tower for given key.
Definition: CpByteStreamV2Tool.cxx:1132
DataVector< LVL1::CMXCPHits >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition: DataVector.h:837
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
CxxUtils::ends_with
bool ends_with(const char *s, const char *suffix)
Test whether one null-terminated byte string ends with another.
LVL1BS::CpByteStreamV2Tool::m_crateOffsetHw
int m_crateOffsetHw
Property: Hardware crate number offset.
Definition: CpByteStreamV2Tool.h:231
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
LVL1::DataError::ParityPhase0
@ ParityPhase0
Definition: DataError.h:37
LVL1BS::ModifySlices::peak
static int peak(int oldPeak, int oldSlices, int newSlices)
Return new triggered slice offset.
Definition: ModifySlices.cxx:12
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LVL1::DataError::ModuleError
@ ModuleError
Definition: DataError.h:41
LVL1BS::CpByteStreamV2Tool::m_byteStreamCnvSvc
SmartIF< ByteStreamCnvSvc > m_byteStreamCnvSvc
Definition: CpByteStreamV2Tool.h:95
LVL1BS::L1CaloSubBlock::ERROR_DUPLICATE_ROB
@ ERROR_DUPLICATE_ROB
Definition: L1CaloSubBlock.h:31
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
LVL1BS::CpByteStreamV2Tool::CPM_TOWERS
@ CPM_TOWERS
Definition: CpByteStreamV2Tool.h:131
LVL1::CMXCPTob::errorVec
const std::vector< int > & errorVec() const
returns error
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPTob.h:136
LVL1BS::CpByteStreamV2Tool::findCmxCpTob
const LVL1::CMXCPTob * findCmxCpTob(int key, const ConstCmxCpTobMap &tobMap) const
Find CMX-CP TOB for given key.
Definition: CpByteStreamV2Tool.cxx:1151
LVL1BS::CpByteStreamV2Tool::m_errorTool
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_errorTool
Error collection tool.
Definition: CpByteStreamV2Tool.h:228
LVL1::CMXCPHits
Summary of CP (EM/tau) hits produced by the merger modules.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPHits.h:24
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
DataVector::get
const T * get(size_type n) const
Access an element, as an rvalue.
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
LVL1::DataError::ParityPhase1
@ ParityPhase1
Definition: DataError.h:37
LVL1BS::CpByteStreamV2Tool::CMX_CP_HITS
@ CMX_CP_HITS
Definition: CpByteStreamV2Tool.h:131
LVL1BS::CpByteStreamV2Tool::ROBIterator
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Definition: CpByteStreamV2Tool.h:142
LVL1BS::L1CaloSubBlock::NEUTRAL
@ NEUTRAL
Definition: L1CaloSubBlock.h:28
LVL1BS::CpByteStreamV2Tool::m_subDetector
const eformat::SubDetector m_subDetector
Sub-detector type.
Definition: CpByteStreamV2Tool.h:263
LVL1::DataError::GLinkParity
@ GLinkParity
Definition: DataError.h:40
LVL1::DataError::GLinkDown
@ GLinkDown
Definition: DataError.h:41
LVL1BS::CmxCpSubBlock::TOTAL
@ TOTAL
Definition: CmxCpSubBlock.h:28
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LVL1BS::CpByteStreamV2Tool::makeSourceIDs
std::vector< uint32_t > makeSourceIDs() const
Create list of all source IDs.
Definition: CpByteStreamV2Tool.cxx:493
LVL1BS::CpByteStreamV2Tool::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Definition: CpByteStreamV2Tool.h:229
LVL1BS::CpByteStreamV2Tool::m_crateMin
int m_crateMin
Property: Minimum crate number when writing out bytestream.
Definition: CpByteStreamV2Tool.h:259
LVL1BS::CmxSubBlock::cmxBlock
static bool cmxBlock(uint32_t word)
Determine if header word corresponds to CMX.
Definition: CmxSubBlock.cxx:84
LVL1BS::L1CaloSubBlock::HEADER
@ HEADER
Definition: L1CaloSubBlock.h:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
LVL1::CMXCPTob::isolationVec
const std::vector< int > & isolationVec() const
returns isolation
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPTob.h:131
LVL1::DataError::SubStatusWord
@ SubStatusWord
Definition: DataError.h:44
LVL1BS::CpByteStreamV2Tool::m_crates
int m_crates
Property: Number of crates.
Definition: CpByteStreamV2Tool.h:241
LVL1BS::CpByteStreamV2Tool::m_cmxs
const int m_cmxs
Number of CMXs per crate.
Definition: CpByteStreamV2Tool.h:245
LVL1BS::CpByteStreamV2Tool::m_srcIdMap
const L1CaloSrcIdMap m_srcIdMap
Source ID converter.
Definition: CpByteStreamV2Tool.h:265
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
python.PyAthena.module
module
Definition: PyAthena.py:134
Execution.tb
tb
Definition: Execution.py:15
LVL1::CPMTower
The CPMTower class contains the TriggerTower information received by the Cluster Processor Modules.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CPMTower.h:36
LVL1BS::CpByteStreamV2Tool::m_forceSlices
int m_forceSlices
Property: Force number of slices in bytestream.
Definition: CpByteStreamV2Tool.h:257
LVL1BS::L1CaloSubBlock::ERROR_ROD_ID
@ ERROR_ROD_ID
Definition: L1CaloSubBlock.h:31
AthCommonDataStore
Definition: AthCommonDataStore.h:52
LVL1BS::CpByteStreamV2Tool::slinkSlices
bool slinkSlices(int crate, int module, int modulesPerSlink, int &timeslices, int &trigJem, const ConstCpmTowerMap &ttMap, const ConstCmxCpTobMap &tobMap, const ConstCmxCpHitsMap &hitsMap, LVL1::TriggerTowerKey &towerKey) const
Get number of slices and triggered slice offset for next slink.
Definition: CpByteStreamV2Tool.cxx:1273
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LVL1BS::ModifySlices::data
static void data(const std::vector< int > &oldVec, std::vector< int > &newVec, int newSlices)
Return modified data vector<int>
Definition: ModifySlices.cxx:20
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
LVL1BS::L1CaloSubBlock::ERROR_CRATE_NUMBER
@ ERROR_CRATE_NUMBER
Definition: L1CaloSubBlock.h:34
LVL1::DataError::Overflow
@ Overflow
Definition: DataError.h:31
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
LVL1BS::CpByteStreamV2Tool::convertBs
StatusCode convertBs(const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, CpByteStreamToolData &data) const
Convert bytestream to given container type.
Definition: CpByteStreamV2Tool.cxx:526
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:92
LVL1::CMXCPTob::energyVec
const std::vector< int > & energyVec() const
For multi-slice readout.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPTob.h:126
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
LVL1::DataError::GLinkProtocol
@ GLinkProtocol
Definition: DataError.h:40
LVL1BS::L1CaloSubBlock::ERROR_DUPLICATE_DATA
@ ERROR_DUPLICATE_DATA
Definition: L1CaloSubBlock.h:35
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LVL1::DataError::set
void set(ErrorBit bit, int value=1)
Set an error bit or data.
Definition: DataError.cxx:28
LArG4ShowerLibProcessing.hits
hits
Definition: LArG4ShowerLibProcessing.py:136
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LVL1BS::L1CaloSrcIdMap::crate
int crate(uint32_t code) const
Return crate from unpacked moduleID.
Definition: L1CaloSrcIdMap.cxx:52
LVL1BS::CpByteStreamV2Tool::m_maxTobs
const int m_maxTobs
Maximum number of TOBS per module.
Definition: CpByteStreamV2Tool.h:247
LVL1BS::CpByteStreamV2Tool::convert
StatusCode convert(const std::string &sgKey, DataVector< LVL1::CPMTower > *ttCollection) const
Convert ROB fragments to CPM towers.
Definition: CpByteStreamV2Tool.cxx:121
LVL1BS::CpByteStreamV2Tool::m_chips
const int m_chips
Number of chips.
Definition: CpByteStreamV2Tool.h:249
LVL1BS::CpByteStreamV2Tool::setupCmxCpTobMap
void setupCmxCpTobMap(const CmxCpTobCollection *tobCollection, ConstCmxCpTobMap &tobMap) const
Set up CMX-CP TOB map.
Definition: CpByteStreamV2Tool.cxx:1209
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1BS::CmxSubBlock::SYSTEM
@ SYSTEM
Definition: CmxSubBlock.h:27
LVL1BS::CpByteStreamV2Tool::setupCmxCpHitsMap
void setupCmxCpHitsMap(const CmxCpHitsCollection *hitCollection, ConstCmxCpHitsMap &hitsMap) const
Set up CMX-CP hits map.
Definition: CpByteStreamV2Tool.cxx:1234
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
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
LVL1BS::CmxCpSubBlock::REMOTE_0
@ REMOTE_0
Definition: CmxCpSubBlock.h:28
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
LVL1BS::CpByteStreamV2Tool::findCmxCpHits
const LVL1::CMXCPHits * findCmxCpHits(int key, const ConstCmxCpHitsMap &hitsMap) const
Find CMX-CP hits for given key.
Definition: CpByteStreamV2Tool.cxx:1170
LVL1BS::L1CaloSubBlock::ERROR_NONE
@ ERROR_NONE
Definition: L1CaloSubBlock.h:31
LVL1BS::CpByteStreamV2Tool::decodeCmxCp
void decodeCmxCp(CmxCpSubBlock *subBlock, int trigCpm, CpByteStreamToolData &data, LocalData &ld) const
Unpack CMX-CP sub-block.
Definition: CpByteStreamV2Tool.cxx:736
LVL1::DataError::Parity
@ Parity
Definition: DataError.h:31
LVL1BS::CpByteStreamV2Tool::ConstCmxCpTobMap
std::map< int, const LVL1::CMXCPTob * > ConstCmxCpTobMap
Definition: CpByteStreamV2Tool.h:139
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
LVL1BS::L1CaloSubBlock::wordType
static SubBlockWordType wordType(uint32_t word)
Word identification.
Definition: L1CaloSubBlock.cxx:479
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
calibdata.ct
ct
Definition: calibdata.py:418
LVL1BS::CpByteStreamV2Tool::m_channels
const int m_channels
Number of channels per module.
Definition: CpByteStreamV2Tool.h:239
LVL1::DataError::error
int error() const
Return the full error word.
Definition: DataError.h:78
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
LVL1::DataError::GLinkTimeout
@ GLinkTimeout
Definition: DataError.h:42
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
LVL1::CMXCPTob::chip
int chip() const
returns chip number (3 or 4 bits?)
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPTob.h:96
LVL1::CMXCPTob::crate
int crate() const
Data accessors.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPTob.h:81
LVL1::DataError::FailingBCN
@ FailingBCN
Definition: DataError.h:42
LVL1::DataError::ParityMerge
@ ParityMerge
Definition: DataError.h:37
LVL1BS::L1CaloSrcIdMap::minorVersion
uint16_t minorVersion() const
Return ROD header minor version to use when writing BS.
Definition: L1CaloSrcIdMap.h:56
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
LVL1BS::CpByteStreamV2Tool::ConstCpmTowerMap
std::map< unsigned int, const LVL1::CPMTower * > ConstCpmTowerMap
Definition: CpByteStreamV2Tool.h:137
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
LVL1BS::CpByteStreamV2Tool::ConstCmxCpHitsMap
std::map< int, const LVL1::CMXCPHits * > ConstCmxCpHitsMap
Definition: CpByteStreamV2Tool.h:141
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
LArNewCalib_PedestalAutoCorr.cp
cp
Definition: LArNewCalib_PedestalAutoCorr.py:175
LVL1BS::CpByteStreamV2Tool::RODPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
Definition: CpByteStreamV2Tool.h:144
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
LVL1BS::CpByteStreamV2Tool::m_locs
const int m_locs
Number of Local coordinates.
Definition: CpByteStreamV2Tool.h:251
LVL1BS::CpByteStreamV2Tool::m_crateOffsetSw
int m_crateOffsetSw
Property: Software crate number offset.
Definition: CpByteStreamV2Tool.h:233
LVL1BS::CmxSubBlock::CMX_CP
@ CMX_CP
Definition: CmxSubBlock.h:25
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
LVL1BS::CmxCpSubBlock::REMOTE_1
@ REMOTE_1
Definition: CmxCpSubBlock.h:28
LVL1BS::CmxSubBlock::cmxType
static CmxFirmwareCode cmxType(uint32_t word)
CMX differentiation (CMX_CP, CMX_JET, or CMX_ENERGY)
Definition: CmxSubBlock.cxx:60
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
LVL1::CMXCPTob::peak
int peak() const
returns peak slice number
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPTob.h:162
LVL1BS::L1CaloSrcIdMap::subDet
eformat::SubDetector subDet(uint32_t code) const
Return sub-detector for given ID.
Definition: L1CaloSrcIdMap.cxx:84
LVL1BS::CpByteStreamV2Tool::m_slinks
int m_slinks
Property: Number of slinks per crate when writing out bytestream.
Definition: CpByteStreamV2Tool.h:253
DeMoScan.index
string index
Definition: DeMoScan.py:362
LVL1BS::CpByteStreamV2Tool::m_modules
const int m_modules
Number of CPM modules per crate.
Definition: CpByteStreamV2Tool.h:243
a
TList * a
Definition: liststreamerinfos.cxx:10
h
FullEventAssembler::setRodMinorVersion
void setRodMinorVersion(uint16_t m)
change the ROD minor version
LVL1BS::CpByteStreamV2Tool::m_dataFormat
int m_dataFormat
Property: Data compression format.
Definition: CpByteStreamV2Tool.h:237
LVL1::DataError::BCNMismatch
@ BCNMismatch
Definition: DataError.h:40
LVL1::DataError::FIFOOverflow
@ FIFOOverflow
Definition: DataError.h:41
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1BS::L1CaloSubBlock::ERROR_SLICES
@ ERROR_SLICES
Definition: L1CaloSubBlock.h:35
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
LVL1::CMXCPTob::cpm
int cpm() const
returns CPM number
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPTob.h:91
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LVL1BS::CpByteStreamV2Tool::m_crateMax
int m_crateMax
Property: Maximum crate number when writing out bytestream.
Definition: CpByteStreamV2Tool.h:261
LVL1BS::L1CaloSubBlock::ERROR_MODULE_NUMBER
@ ERROR_MODULE_NUMBER
Definition: L1CaloSubBlock.h:34
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
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
LVL1BS::CpByteStreamV2Tool::m_cpmMaps
ToolHandle< LVL1::IL1CaloMappingTool > m_cpmMaps
Channel mapping tool.
Definition: CpByteStreamV2Tool.h:226
LVL1BS::CpByteStreamV2Tool::CMX_CP_TOBS
@ CMX_CP_TOBS
Definition: CpByteStreamV2Tool.h:131
LVL1BS::CpByteStreamV2Tool::m_dfltSlices
int m_dfltSlices
Property: Default number of slices in simulation.
Definition: CpByteStreamV2Tool.h:255
LVL1::CMXCPTob::location
int location() const
returns location (3 or 2 bits?)
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPTob.h:101
LVL1::DataError::ParityPhase3
@ ParityPhase3
Definition: DataError.h:38
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
LVL1BS::CpByteStreamV2Tool::tobKey
int tobKey(int crate, int cmx, int cpm, int chip, int loc) const
Key for TOBs.
Definition: CpByteStreamV2Tool.cxx:1257
LVL1BS::CmxSubBlock::CRATE
@ CRATE
Definition: CmxSubBlock.h:27
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
LVL1::TriggerTowerKey::ttKey
virtual unsigned int ttKey(const TriggerTower &tower)
returns the key of the passed tower
Definition: TriggerTowerKey.cxx:143
LVL1BS::L1CaloSrcIdMap::maxSlinks
int maxSlinks() const
Return the maximum possible number of slinks.
Definition: L1CaloSrcIdMap.cxx:77
LVL1::CMXCPTob
TOB data received by the merger modules.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPTob.h:24
get_generator_info.error
error
Definition: get_generator_info.py:40
LVL1BS::CpByteStreamV2Tool::hitsKey
int hitsKey(int crate, int cmx, int source) const
Key for Hits.
Definition: CpByteStreamV2Tool.cxx:1265
error
Definition: IImpactPoint3dEstimator.h:70
LVL1BS::L1CaloUserHeader::isValid
static bool isValid(uint32_t word)
Test for valid header word.
Definition: L1CaloUserHeader.cxx:36
LVL1BS::CpByteStreamV2Tool::sourceIDs
const std::vector< uint32_t > & sourceIDs() const
Return reference to vector with all possible Source Identifiers.
Definition: CpByteStreamV2Tool.cxx:518
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
LVL1BS::L1CaloSrcIdMap::daqOrRoi
int daqOrRoi(uint32_t code) const
Return daqOrRoi from unpacked moduleID.
Definition: L1CaloSrcIdMap.cxx:60
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
geometry_dat_to_json.ld
ld
Definition: geometry_dat_to_json.py:14
LVL1BS::CpByteStreamV2Tool::setupCpmTowerMap
void setupCpmTowerMap(const CpmTowerCollection *ttCollection, ConstCpmTowerMap &ttMap, LVL1::TriggerTowerKey &towerKey) const
Set up CPM tower map.
Definition: CpByteStreamV2Tool.cxx:1188
LVL1::DataError::ParityPhase2
@ ParityPhase2
Definition: DataError.h:38
LVL1::TriggerTowerKey
The TriggerTowerKey object provides the key for each trigger tower depending on its eta-phi coords.
Definition: TriggerTowerKey.h:56
LVL1BS::CpByteStreamV2Tool::m_sourceIDsProp
std::vector< uint32_t > m_sourceIDsProp
Property: ROB source IDs.
Definition: CpByteStreamV2Tool.h:267
LVL1BS::L1CaloSubBlock::ERROR_USER_HEADER
@ ERROR_USER_HEADER
Definition: L1CaloSubBlock.h:32
FullEventAssembler::getRodData
RODDATA * getRodData(uint32_t id)
get a block of ROD data
LVL1BS::CmxCpSubBlock::MAX_SOURCE_ID
@ MAX_SOURCE_ID
Definition: CmxCpSubBlock.h:30
LVL1BS::CpByteStreamV2Tool::ROBPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
Definition: CpByteStreamV2Tool.h:143
LVL1BS::CpByteStreamV2Tool::m_version
int m_version
Property: Sub_block header version.
Definition: CpByteStreamV2Tool.h:235
keylayer_zslicemap.slices
slices
Definition: keylayer_zslicemap.py:112
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
LVL1::CMXCPHits::MAXSOURCE
@ MAXSOURCE
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXCPHits.h:29
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37