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::JepByteStreamTool Class Reference

Tool to perform ROB fragments to jet elements, jet hits and energy sums, and JEP container to raw data conversions. More...

#include <JepByteStreamTool.h>

Inheritance diagram for LVL1BS::JepByteStreamTool:
Collaboration diagram for LVL1BS::JepByteStreamTool:

Classes

struct  CmmHitsData
 
struct  CmmSumsData
 
struct  EnergySumsData
 
struct  JepByteStreamToolData
 
struct  JetElementData
 
struct  JetHitsData
 
struct  LocalData
 

Public Member Functions

 JepByteStreamTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~JepByteStreamTool ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
StatusCode convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::JetElement > *jeCollection) const
 Convert ROB fragments to jet elements. More...
 
StatusCode convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::JEMHits > *hitCollection) const
 Convert ROB fragments to jet hits. More...
 
StatusCode convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::JEMEtSums > *etCollection) const
 Convert ROB fragments to energy sums. More...
 
StatusCode convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CMMJetHits > *hitCollection) const
 Convert ROB fragments to CMM jet hits. More...
 
StatusCode convert (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CMMEtSums > *etCollection) const
 Convert ROB fragments to CMM energy sums. More...
 
StatusCode convert (const LVL1::JEPBSCollection *jep) const
 Convert JEP 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 {
  JET_ELEMENTS, JET_HITS, ENERGY_SUMS, CMM_HITS,
  CMM_SUMS
}
 
typedef DataVector< LVL1::JetElementJetElementCollection
 
typedef DataVector< LVL1::JEMHitsJetHitsCollection
 
typedef DataVector< LVL1::JEMEtSumsEnergySumsCollection
 
typedef DataVector< LVL1::CMMJetHitsCmmHitsCollection
 
typedef DataVector< LVL1::CMMEtSumsCmmSumsCollection
 
typedef std::map< unsigned int, LVL1::JetElement * > JetElementMap
 
typedef std::map< unsigned int, const LVL1::JetElement * > ConstJetElementMap
 
typedef std::map< int, LVL1::JEMHits * > JetHitsMap
 
typedef std::map< int, const LVL1::JEMHits * > ConstJetHitsMap
 
typedef std::map< int, LVL1::JEMEtSums * > EnergySumsMap
 
typedef std::map< int, const LVL1::JEMEtSums * > ConstEnergySumsMap
 
typedef std::map< int, LVL1::CMMJetHits * > CmmHitsMap
 
typedef std::map< int, const LVL1::CMMJetHits * > ConstCmmHitsMap
 
typedef std::map< int, LVL1::CMMEtSums * > CmmSumsMap
 
typedef std::map< int, const LVL1::CMMEtSums * > ConstCmmSumsMap
 
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

StatusCode convertBs (const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, JepByteStreamToolData &data) const
 Convert bytestream to given container type. More...
 
void decodeCmmEnergy (CmmEnergySubBlock *subBlock, int trigCmm, CmmSumsData &data, LocalData &ld) const
 Unpack CMM-Energy sub-block. More...
 
void decodeCmmJet (CmmJetSubBlock *subBlock, int trigCmm, CmmHitsData &data, LocalData &ld) const
 Unpack CMM-Jet sub-block. More...
 
void decodeJem (JemSubBlock *subBlock, int trigJem, JepByteStreamToolData &data, LocalData &ld) const
 Unpack JEM sub-block. More...
 
const LVL1::JetElementfindJetElement (double eta, double phi, const ConstJetElementMap &jeMap, LVL1::JetElementKey &elementKey) const
 Find a jet element given eta, phi. More...
 
LVL1::JetElementfindJetElement (const JetElementData &data, double eta, double phi, LVL1::JetElementKey &elementKey) const
 
const LVL1::JEMHitsfindJetHits (int crate, int module, const ConstJetHitsMap &hitsMap) const
 Find jet hits for given crate, module. More...
 
LVL1::JEMHitsfindJetHits (const JetHitsData &data, int crate, int module) const
 
const LVL1::JEMEtSumsfindEnergySums (int crate, int module, const ConstEnergySumsMap &etMap) const
 Find energy sums for given crate, module. More...
 
LVL1::JEMEtSumsfindEnergySums (const EnergySumsData &data, int crate, int module) const
 
const LVL1::CMMJetHitsfindCmmHits (int crate, int dataID, const ConstCmmHitsMap &cmmHitsMap) const
 Find CMM hits for given crate, data ID. More...
 
LVL1::CMMJetHitsfindCmmHits (const CmmHitsData &data, int crate, int dataID) const
 
const LVL1::CMMEtSumsfindCmmSums (int crate, int dataID, const ConstCmmSumsMap &cmmEtMap) const
 Find CMM energy sums for given crate, data ID. More...
 
LVL1::CMMEtSumsfindCmmSums (const CmmSumsData &data, int crate, int dataID) const
 
std::vector< uint32_t > makeSourceIDs () const
 
void setupJeMap (const JetElementCollection *jeCollection, ConstJetElementMap &jeMap, LVL1::JetElementKey &elementKey) const
 Set up jet element map. More...
 
void setupHitsMap (const JetHitsCollection *hitCollection, ConstJetHitsMap &hitsMap) const
 Set up jet hits map. More...
 
void setupEtMap (const EnergySumsCollection *enCollection, ConstEnergySumsMap &etMap) const
 Set up energy sums map. More...
 
void setupCmmHitsMap (const CmmHitsCollection *hitCollection, ConstCmmHitsMap &cmmHitsMap) const
 Set up CMM hits map. More...
 
void setupCmmEtMap (const CmmSumsCollection *enCollection, ConstCmmSumsMap &cmmEtMap) const
 Set up CMM energy sums map. More...
 
bool slinkSlices (int crate, int module, int modulesPerSlink, int &timeslices, int &trigJem, const ConstJetElementMap &jeMap, const ConstJetHitsMap &hitsMap, const ConstEnergySumsMap &etMap, const ConstCmmHitsMap &cmmHitsMap, const ConstCmmSumsMap &cmmEtMap, LVL1::JetElementKey &elementKey) 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

ServiceHandle< ByteStreamCnvSvcm_byteStreamCnvSvc { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" }
 
ToolHandle< LVL1::IL1CaloMappingToolm_jemMaps
 Property: Channel mapping tool. More...
 
ToolHandle< LVL1BS::L1CaloErrorByteStreamToolm_errorTool
 Error collection tool. More...
 
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...
 
const int m_crates
 Number of crates. More...
 
const int m_modules
 Number of JEM modules per crate. 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...
 
std::vector< uint32_t > m_sourceIDsProp
 Property: ROB source IDs. More...
 
const eformat::SubDetector m_subDetector
 Sub-detector type. More...
 
const L1CaloSrcIdMap m_srcIdMap
 Source ID converter. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Tool to perform ROB fragments to jet elements, jet hits and energy sums, and JEP container to raw data conversions.

Based on ROD document version 1_09h.

Author
Peter Faulkner

Definition at line 57 of file JepByteStreamTool.h.

Member Typedef Documentation

◆ CmmHitsCollection

Definition at line 133 of file JepByteStreamTool.h.

◆ CmmHitsMap

Definition at line 141 of file JepByteStreamTool.h.

◆ CmmSumsCollection

Definition at line 134 of file JepByteStreamTool.h.

◆ CmmSumsMap

typedef std::map<int, LVL1::CMMEtSums*> LVL1BS::JepByteStreamTool::CmmSumsMap
private

Definition at line 143 of file JepByteStreamTool.h.

◆ ConstCmmHitsMap

Definition at line 142 of file JepByteStreamTool.h.

◆ ConstCmmSumsMap

Definition at line 144 of file JepByteStreamTool.h.

◆ ConstEnergySumsMap

Definition at line 140 of file JepByteStreamTool.h.

◆ ConstJetElementMap

typedef std::map<unsigned int, const LVL1::JetElement*> LVL1BS::JepByteStreamTool::ConstJetElementMap
private

Definition at line 136 of file JepByteStreamTool.h.

◆ ConstJetHitsMap

Definition at line 138 of file JepByteStreamTool.h.

◆ EnergySumsCollection

Definition at line 132 of file JepByteStreamTool.h.

◆ EnergySumsMap

Definition at line 139 of file JepByteStreamTool.h.

◆ JetElementCollection

Definition at line 130 of file JepByteStreamTool.h.

◆ JetElementMap

typedef std::map<unsigned int, LVL1::JetElement*> LVL1BS::JepByteStreamTool::JetElementMap
private

Definition at line 135 of file JepByteStreamTool.h.

◆ JetHitsCollection

Definition at line 131 of file JepByteStreamTool.h.

◆ JetHitsMap

typedef std::map<int, LVL1::JEMHits*> LVL1BS::JepByteStreamTool::JetHitsMap
private

Definition at line 137 of file JepByteStreamTool.h.

◆ ROBIterator

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

Definition at line 145 of file JepByteStreamTool.h.

◆ ROBPointer

Definition at line 146 of file JepByteStreamTool.h.

◆ RODPointer

Definition at line 147 of file JepByteStreamTool.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
JET_ELEMENTS 
JET_HITS 
ENERGY_SUMS 
CMM_HITS 
CMM_SUMS 

Definition at line 127 of file JepByteStreamTool.h.

Constructor & Destructor Documentation

◆ JepByteStreamTool()

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

Definition at line 50 of file JepByteStreamTool.cxx.

54  m_jemMaps("LVL1::JemMappingTool/JemMappingTool"),
55  m_errorTool("LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
56  m_channels(44), m_crates(2), m_modules(16),
57  m_subDetector(eformat::TDAQ_CALO_JET_PROC_DAQ)
58 {
59  declareInterface<JepByteStreamTool>(this);
60 
61  declareProperty("JemMappingTool", m_jemMaps,
62  "Crate/Module/Channel to Eta/Phi/Layer mapping tool");
63 
64  declareProperty("CrateOffsetHw", m_crateOffsetHw = 12,
65  "Offset of JEP crate numbers in bytestream");
66  declareProperty("CrateOffsetSw", m_crateOffsetSw = 0,
67  "Offset of JEP crate numbers in RDOs");
68  declareProperty("SlinksPerCrate", m_slinks = 4,
69  "The number of S-Links per crate");
70 
71  // Properties for reading bytestream only
72  declareProperty("ROBSourceIDs", m_sourceIDsProp,
73  "ROB fragment source identifiers");
74 
75  // Properties for writing bytestream only
76  declareProperty("DataVersion", m_version = 1,
77  "Format version number in sub-block header");
78  declareProperty("DataFormat", m_dataFormat = 1,
79  "Format identifier (0-1) in sub-block header");
80  declareProperty("SimulSlices", m_dfltSlices = 1,
81  "The number of slices in the simulation");
82  declareProperty("ForceSlices", m_forceSlices = 0,
83  "If >0, the number of slices in bytestream");
84 
85 }

◆ ~JepByteStreamTool()

LVL1BS::JepByteStreamTool::~JepByteStreamTool ( )
virtual

Definition at line 89 of file JepByteStreamTool.cxx.

90 {
91 }

Member Function Documentation

◆ convert() [1/6]

StatusCode LVL1BS::JepByteStreamTool::convert ( const LVL1::JEPBSCollection jep) const

Convert JEP Container to bytestream.

Definition at line 182 of file JepByteStreamTool.cxx.

183 {
184  const bool debug = msgLvl(MSG::DEBUG);
185  if (debug) msg(MSG::DEBUG);
186 
187  // Get the event assembler
188  FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
189  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
190  "JepByteStream") );
191  const uint16_t minorVersion = m_srcIdMap.minorVersion();
192  fea->setRodMinorVersion(minorVersion);
193 
194  // Pointer to ROD data vector
195 
197 
198  // Jet element key provider
199  LVL1::JetElementKey elementKey;
200 
201  // Set up the container maps
202 
203  // Jet element map
204  ConstJetElementMap jeMap;
205  setupJeMap(jep->JetElements(), jeMap, elementKey);
206 
207  // Jet hits map
208  ConstJetHitsMap hitsMap;
209  setupHitsMap(jep->JetHits(), hitsMap);
210 
211  // Energy sums map
212  ConstEnergySumsMap etMap;
213  setupEtMap(jep->EnergySums(), etMap);
214 
215  // CMM hits map
216  ConstCmmHitsMap cmmHitsMap;
217  setupCmmHitsMap(jep->CmmHits(), cmmHitsMap);
218 
219  // CMM energy sums map
220  ConstCmmSumsMap cmmEtMap;
221  setupCmmEtMap(jep->CmmSums(), cmmEtMap);
222 
223  // Loop over data
224 
225  const bool neutralFormat = m_dataFormat == L1CaloSubBlock::NEUTRAL;
226  const int modulesPerSlink = m_modules / m_slinks;
227  int timeslices = 1;
228  int trigJem = 0;
229  int timeslicesNew = 1;
230  int trigJemNew = 0;
231  for (int crate = 0; crate < m_crates; ++crate) {
232  const int hwCrate = crate + m_crateOffsetHw;
233 
234  for (int module = 0; module < m_modules; ++module) {
235 
236  // Pack required number of modules per slink
237 
238  if (module % modulesPerSlink == 0) {
239  const int daqOrRoi = 0;
240  const int slink = module / modulesPerSlink;
241  if (debug) {
242  msg() << "Treating crate " << hwCrate
243  << " slink " << slink << endmsg;
244  }
245  // Get number of JEM slices and triggered slice offset
246  // for this slink
247  if ( ! slinkSlices(crate, module, modulesPerSlink,
248  timeslices, trigJem,
249  jeMap,
250  hitsMap,
251  etMap,
252  cmmHitsMap,
253  cmmEtMap,
254  elementKey))
255  {
256  msg(MSG::ERROR) << "Inconsistent number of slices or "
257  << "triggered slice offsets in data for crate "
258  << hwCrate << " slink " << slink << endmsg;
259  return StatusCode::FAILURE;
260  }
261  timeslicesNew = (m_forceSlices) ? m_forceSlices : timeslices;
262  trigJemNew = ModifySlices::peak(trigJem, timeslices, timeslicesNew);
263  if (debug) {
264  msg() << "Data Version/Format: " << m_version
265  << " " << m_dataFormat << endmsg
266  << "Slices/offset: " << timeslices << " " << trigJem;
267  if (timeslices != timeslicesNew) {
268  msg() << " modified to " << timeslicesNew << " " << trigJemNew;
269  }
270  msg() << endmsg;
271  }
272  L1CaloUserHeader userHeader;
273  userHeader.setJem(trigJemNew);
274  const uint32_t rodIdJem = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
275  m_subDetector);
276  theROD = fea->getRodData(rodIdJem);
277  theROD->push_back(userHeader.header());
278  }
279  if (debug) msg() << "Module " << module << endmsg;
280 
281  // Create a sub-block for each slice (except Neutral format)
282 
283  // Vector for current JEM sub-blocks
284  DataVector<JemSubBlock> jemBlocks;
285 
286  for (int slice = 0; slice < timeslicesNew; ++slice) {
287  JemSubBlock* const subBlock = new JemSubBlock();
288  subBlock->setJemHeader(m_version, m_dataFormat, slice,
289  hwCrate, module, timeslicesNew);
290  jemBlocks.push_back(subBlock);
291  if (neutralFormat) break;
292  }
293 
294  // Find jet elements corresponding to each eta/phi pair and fill
295  // sub-blocks
296 
297  for (int chan = 0; chan < m_channels; ++chan) {
298  double eta = 0.;
299  double phi = 0.;
300  int layer = 0;
301  if (m_jemMaps->mapping(crate, module, chan, eta, phi, layer)) {
302  const LVL1::JetElement* const je = findJetElement(eta, phi, jeMap, elementKey);
303  if (je ) {
304  std::vector<int> emData;
305  std::vector<int> hadData;
306  std::vector<int> emErrors;
307  std::vector<int> hadErrors;
308  ModifySlices::data(je->emEnergyVec(), emData, timeslicesNew);
309  ModifySlices::data(je->hadEnergyVec(), hadData, timeslicesNew);
310  ModifySlices::data(je->emErrorVec(), emErrors, timeslicesNew);
311  ModifySlices::data(je->hadErrorVec(), hadErrors, timeslicesNew);
312  for (int slice = 0; slice < timeslicesNew; ++slice) {
313  const LVL1::DataError emErrBits(emErrors[slice]);
314  const LVL1::DataError hadErrBits(hadErrors[slice]);
315  const int index = ( neutralFormat ) ? 0 : slice;
316  JemSubBlock* const subBlock = jemBlocks[index];
317  const JemJetElement jetEle(chan, emData[slice], hadData[slice],
318  emErrBits.get(LVL1::DataError::Parity),
319  hadErrBits.get(LVL1::DataError::Parity),
320  emErrBits.get(LVL1::DataError::LinkDown) +
321  (hadErrBits.get(LVL1::DataError::LinkDown) << 1));
322  subBlock->fillJetElement(slice, jetEle);
323  }
324  }
325  }
326  }
327 
328  // Add jet hits and energy subsums
329 
330  const LVL1::JEMHits* const hits = findJetHits(crate, module, hitsMap);
331  if (hits) {
332  std::vector<unsigned int> vec;
333  ModifySlices::data(hits->JetHitsVec(), vec, timeslicesNew);
334  for (int slice = 0; slice < timeslicesNew; ++slice) {
335  const int index = ( neutralFormat ) ? 0 : slice;
336  JemSubBlock* const subBlock = jemBlocks[index];
337  subBlock->setJetHits(slice, vec[slice]);
338  }
339  }
340  const LVL1::JEMEtSums* const et = findEnergySums(crate, module, etMap);
341  if (et) {
342  std::vector<unsigned int> exVec;
343  std::vector<unsigned int> eyVec;
344  std::vector<unsigned int> etVec;
345  ModifySlices::data(et->ExVec(), exVec, timeslicesNew);
346  ModifySlices::data(et->EyVec(), eyVec, timeslicesNew);
347  ModifySlices::data(et->EtVec(), etVec, timeslicesNew);
348  for (int slice = 0; slice < timeslicesNew; ++slice) {
349  const int index = ( neutralFormat ) ? 0 : slice;
350  JemSubBlock* const subBlock = jemBlocks[index];
351  subBlock->setEnergySubsums(slice, exVec[slice], eyVec[slice],
352  etVec[slice]);
353  }
354  }
355 
356  // Pack and write the sub-blocks
357 
359  for (pos = jemBlocks.begin(); pos != jemBlocks.end(); ++pos) {
360  JemSubBlock* const subBlock = *pos;
361  if ( !subBlock->pack()) {
362  msg(MSG::ERROR) << "JEM sub-block packing failed" << endmsg;
363  return StatusCode::FAILURE;
364  }
365  if (debug) {
366  msg() << "JEM sub-block data words: "
367  << subBlock->dataWords() << endmsg;
368  }
369  subBlock->write(theROD);
370  }
371  }
372 
373  // Append CMMs to last S-Link of the crate
374 
375  // Create a sub-block for each slice (except Neutral format)
376 
377  // Vector for current CMM-Energy sub-blocks
378  DataVector<CmmEnergySubBlock> cmmEnergyBlocks;
379  // Vector for current CMM-Jet sub-blocks
380  DataVector<CmmJetSubBlock> cmmJetBlocks;
381 
382  const int summing = (crate == m_crates - 1) ? CmmSubBlock::SYSTEM
384  for (int slice = 0; slice < timeslicesNew; ++slice) {
385  CmmEnergySubBlock* const enBlock = new CmmEnergySubBlock();
386  const int cmmEnergyVersion = 2; // with Missing-ET-Sig
387  enBlock->setCmmHeader(cmmEnergyVersion, m_dataFormat, slice, hwCrate,
388  summing, CmmSubBlock::CMM_ENERGY,
389  CmmSubBlock::LEFT, timeslicesNew);
390  cmmEnergyBlocks.push_back(enBlock);
391  CmmJetSubBlock* const jetBlock = new CmmJetSubBlock();
392  jetBlock->setCmmHeader(m_version, m_dataFormat, slice, hwCrate,
393  summing, CmmSubBlock::CMM_JET,
394  CmmSubBlock::RIGHT, timeslicesNew);
395  cmmJetBlocks.push_back(jetBlock);
396  if (neutralFormat) break;
397  }
398 
399  // CMM-Energy
400 
401  int maxDataID = static_cast<int>(LVL1::CMMEtSums::MAXID);
402  for (int dataID = 0; dataID < maxDataID; ++dataID) {
403  int source = dataID;
404  if (dataID >= m_modules) {
405  if (summing == CmmSubBlock::CRATE &&
406  dataID != LVL1::CMMEtSums::LOCAL) continue;
407  // coverity[mixed_enums : FALSE]
408  // coverity[switch_on_enum : FALSE]
409  // coverity[first_enum_type : FALSE]
410  switch (dataID) {
412  source = CmmEnergySubBlock::LOCAL;
413  break;
415  source = CmmEnergySubBlock::REMOTE;
416  break;
418  source = CmmEnergySubBlock::TOTAL;
419  break;
423  break;
424  default:
425  continue;
426  }
427  }
428  const LVL1::CMMEtSums* const sums = findCmmSums(crate, dataID, cmmEtMap);
429  if ( sums ) {
430  std::vector<unsigned int> ex;
431  std::vector<unsigned int> ey;
432  std::vector<unsigned int> et;
433  std::vector<int> exErr;
434  std::vector<int> eyErr;
435  std::vector<int> etErr;
436  ModifySlices::data(sums->ExVec(), ex, timeslicesNew);
437  ModifySlices::data(sums->EyVec(), ey, timeslicesNew);
438  ModifySlices::data(sums->EtVec(), et, timeslicesNew);
439  ModifySlices::data(sums->ExErrorVec(), exErr, timeslicesNew);
440  ModifySlices::data(sums->EyErrorVec(), eyErr, timeslicesNew);
441  ModifySlices::data(sums->EtErrorVec(), etErr, timeslicesNew);
442  for (int slice = 0; slice < timeslicesNew; ++slice) {
443  const LVL1::DataError exErrBits(exErr[slice]);
444  const LVL1::DataError eyErrBits(eyErr[slice]);
445  const LVL1::DataError etErrBits(etErr[slice]);
446  int exError = exErrBits.get(LVL1::DataError::Parity);
447  int eyError = eyErrBits.get(LVL1::DataError::Parity);
448  int etError = etErrBits.get(LVL1::DataError::Parity);
449  if (dataID == LVL1::CMMEtSums::LOCAL ||
450  dataID == LVL1::CMMEtSums::REMOTE ||
451  dataID == LVL1::CMMEtSums::TOTAL) {
452  exError = (exError << 1) + exErrBits.get(LVL1::DataError::Overflow);
453  eyError = (eyError << 1) + eyErrBits.get(LVL1::DataError::Overflow);
454  etError = (etError << 1) + etErrBits.get(LVL1::DataError::Overflow);
455  }
456  const int index = ( neutralFormat ) ? 0 : slice;
457  CmmEnergySubBlock* const subBlock = cmmEnergyBlocks[index];
458  if (dataID == LVL1::CMMEtSums::MISSING_ET_MAP) {
459  subBlock->setMissingEtHits(slice, et[slice]);
460  } else if (dataID == LVL1::CMMEtSums::SUM_ET_MAP) {
461  subBlock->setSumEtHits(slice, et[slice]);
462  } else if (dataID == LVL1::CMMEtSums::MISSING_ET_SIG_MAP) {
463  subBlock->setMissingEtSigHits(slice, et[slice]);
464  } else {
465  subBlock->setSubsums(slice, source,
466  ex[slice], ey[slice], et[slice],
467  exError, eyError, etError);
468  }
469  }
470  }
471  }
473  pos = cmmEnergyBlocks.begin();
474  for (; pos != cmmEnergyBlocks.end(); ++pos) {
475  CmmEnergySubBlock* const subBlock = *pos;
476  if ( !subBlock->pack()) {
477  msg(MSG::ERROR) << "CMM-Energy sub-block packing failed" << endmsg;
478  return StatusCode::FAILURE;
479  }
480  if (debug) {
481  msg() << "CMM-Energy sub-block data words: "
482  << subBlock->dataWords() << endmsg;
483  }
484  subBlock->write(theROD);
485  }
486 
487  // CMM-Jet
488 
489  maxDataID = static_cast<int>(LVL1::CMMJetHits::MAXID);
490  for (int dataID = 0; dataID < maxDataID; ++dataID) {
491  int source = dataID;
492  if (dataID >= m_modules) {
493  if (summing == CmmSubBlock::CRATE &&
494  dataID != LVL1::CMMJetHits::LOCAL_MAIN &&
495  dataID != LVL1::CMMJetHits::LOCAL_FORWARD) continue;
496  switch (dataID) {
499  break;
502  break;
505  break;
508  break;
511  break;
514  break;
516  break;
517  default:
518  continue;
519  }
520  }
521  const LVL1::CMMJetHits* const ch = findCmmHits(crate, dataID, cmmHitsMap);
522  if ( ch ) {
523  std::vector<unsigned int> hits;
524  std::vector<int> errs;
525  ModifySlices::data(ch->HitsVec(), hits, timeslicesNew);
526  ModifySlices::data(ch->ErrorVec(), errs, timeslicesNew);
527  for (int slice = 0; slice < timeslicesNew; ++slice) {
528  const LVL1::DataError errBits(errs[slice]);
529  const int index = ( neutralFormat ) ? 0 : slice;
530  CmmJetSubBlock* const subBlock = cmmJetBlocks[index];
531  if (dataID == LVL1::CMMJetHits::ET_MAP) {
532  subBlock->setJetEtMap(slice, hits[slice]);
533  } else {
534  subBlock->setJetHits(slice, source, hits[slice],
535  errBits.get(LVL1::DataError::Parity));
536  }
537  }
538  }
539  }
541  jos = cmmJetBlocks.begin();
542  for (; jos != cmmJetBlocks.end(); ++jos) {
543  CmmJetSubBlock* const subBlock = *jos;
544  if ( !subBlock->pack()) {
545  msg(MSG::ERROR) << "CMM-Jet sub-block packing failed" << endmsg;
546  return StatusCode::FAILURE;
547  }
548  if (debug) {
549  msg() << "CMM-Jet sub-block data words: "
550  << subBlock->dataWords() << endmsg;
551  }
552  subBlock->write(theROD);
553  }
554  }
555 
556  return StatusCode::SUCCESS;
557 }

◆ convert() [2/6]

StatusCode LVL1BS::JepByteStreamTool::convert ( const std::string &  sgKey,
const IROBDataProviderSvc::VROBFRAG robFrags,
DataVector< LVL1::CMMEtSums > *  etCollection 
) const

Convert ROB fragments to CMM energy sums.

Definition at line 170 of file JepByteStreamTool.cxx.

174 {
175  CmmSumsData data (etCollection);
176  return convertBs(sgKey, robFrags, data);
177 }

◆ convert() [3/6]

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

Convert ROB fragments to CMM jet hits.

Definition at line 159 of file JepByteStreamTool.cxx.

163 {
164  CmmHitsData data (hitCollection);
165  return convertBs(sgKey, robFrags, data);
166 }

◆ convert() [4/6]

StatusCode LVL1BS::JepByteStreamTool::convert ( const std::string &  sgKey,
const IROBDataProviderSvc::VROBFRAG robFrags,
DataVector< LVL1::JEMEtSums > *  etCollection 
) const

Convert ROB fragments to energy sums.

Definition at line 148 of file JepByteStreamTool.cxx.

152 {
153  EnergySumsData data (etCollection);
154  return convertBs(sgKey, robFrags, data);
155 }

◆ convert() [5/6]

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

Convert ROB fragments to jet hits.

Definition at line 137 of file JepByteStreamTool.cxx.

141 {
142  JetHitsData data (hitCollection);
143  return convertBs(sgKey, robFrags, data);
144 }

◆ convert() [6/6]

StatusCode LVL1BS::JepByteStreamTool::convert ( const std::string &  sgKey,
const IROBDataProviderSvc::VROBFRAG robFrags,
DataVector< LVL1::JetElement > *  jeCollection 
) const

Convert ROB fragments to jet elements.

Definition at line 126 of file JepByteStreamTool.cxx.

130 {
131  JetElementData data (jeCollection);
132  return convertBs(sgKey, robFrags, data);
133 }

◆ convertBs()

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

Convert bytestream to given container type.

Definition at line 594 of file JepByteStreamTool.cxx.

598 {
599  LocalData ld;
600 
601  // Check if overlap jet element channels wanted
602  const std::string flag("Overlap");
603  const std::string::size_type pos = sgKey.find(flag);
604  ld.coreOverlap =
605  (pos == std::string::npos || pos != sgKey.length() - flag.length()) ? 0 : 1;
606 
607  const bool debug = msgLvl(MSG::DEBUG);
608  if (debug) msg(MSG::DEBUG);
609 
610  // JemSubBlock for unpacking
611  JemSubBlock jemSubBlock;
612  // CmmEnergySubBlock for unpacking
613  CmmEnergySubBlock cmmEnergySubBlock;
614  // CmmJetSubBlock for unpacking
615  CmmJetSubBlock cmmJetSubBlock;
616 
617  // Loop over ROB fragments
618 
619  int robCount = 0;
620  std::set<uint32_t> dupCheck;
621  ROBIterator rob = robFrags.begin();
622  ROBIterator robEnd = robFrags.end();
623  for (; rob != robEnd; ++rob) {
624 
625  if (debug) {
626  ++robCount;
627  msg() << "Treating ROB fragment " << robCount << endmsg;
628  }
629 
630  // Skip fragments with ROB status errors
631 
632  uint32_t robid = (*rob)->source_id();
633  if ((*rob)->nstatus() > 0) {
634  ROBPointer robData;
635  (*rob)->status(robData);
636  if (*robData != 0) {
637  m_errorTool->robError(robid, *robData);
638  if (debug) msg() << "ROB status error - skipping fragment" << endmsg;
639  continue;
640  }
641  }
642 
643  // Skip duplicate fragments
644 
645  if (!dupCheck.insert(robid).second) {
647  if (debug) msg() << "Skipping duplicate ROB fragment" << endmsg;
648  continue;
649  }
650 
651  // Unpack ROD data (slinks)
652 
653  RODPointer payloadBeg;
655  RODPointer payloadEnd;
656  (*rob)->rod_data(payloadBeg);
657  payloadEnd = payloadBeg + (*rob)->rod_ndata();
658  payload = payloadBeg;
659  if (payload == payloadEnd) {
660  if (debug) msg() << "ROB fragment empty" << endmsg;
661  continue;
662  }
663 
664  // Check identifier
665  const uint32_t sourceID = (*rob)->rod_source_id();
666  if (m_srcIdMap.getRobID(sourceID) != robid ||
667  m_srcIdMap.subDet(sourceID) != m_subDetector ||
668  m_srcIdMap.daqOrRoi(sourceID) != 0 ||
669  m_srcIdMap.slink(sourceID) >= m_slinks ||
670  m_srcIdMap.crate(sourceID) < m_crateOffsetHw ||
671  m_srcIdMap.crate(sourceID) >= m_crateOffsetHw + m_crates) {
672  m_errorTool->rodError(robid, L1CaloSubBlock::ERROR_ROD_ID);
673  if (debug) {
674  msg() << "Wrong source identifier in data: ROD "
675  << MSG::hex << sourceID << " ROB " << robid
676  << MSG::dec << endmsg;
677  }
678  continue;
679  }
680  const int rodCrate = m_srcIdMap.crate(sourceID);
681  if (debug) {
682  msg() << "Treating crate " << rodCrate
683  << " slink " << m_srcIdMap.slink(sourceID) << endmsg;
684  }
685 
686  // First word should be User Header
689  if (debug) msg() << "Invalid or missing user header" << endmsg;
690  continue;
691  }
692  L1CaloUserHeader userHeader(*payload);
693  const int minorVersion = (*rob)->rod_version() & 0xffff;
694  userHeader.setVersion(minorVersion);
695  const int headerWords = userHeader.words();
696  if (headerWords != 1) {
698  if (debug) msg() << "Unexpected number of user header words: "
699  << headerWords << endmsg;
700  continue;
701  }
702  for (int i = 0; i < headerWords; ++i) ++payload;
703  // triggered slice offsets
704  int trigJem = userHeader.jem();
705  int trigCmm = userHeader.jepCmm();
706  if (debug) {
707  msg() << "Minor format version number: " << MSG::hex
708  << minorVersion << MSG::dec << endmsg
709  << "JEM triggered slice offset: " << trigJem << endmsg
710  << "CMM triggered slice offset: " << trigCmm << endmsg;
711  }
712  if (trigJem != trigCmm) {
713  const int newTrig = (trigJem > trigCmm) ? trigJem : trigCmm;
714  trigJem = newTrig;
715  trigCmm = newTrig;
716  if (debug) msg() << "Changed both offsets to " << newTrig << endmsg;
717  }
718 
719  // Loop over sub-blocks
720 
722  while (payload != payloadEnd) {
723 
725  if (debug) msg() << "Unexpected data sequence" << endmsg;
727  break;
728  }
730  // CMMs
732  cmmJetSubBlock.clear();
733  payload = cmmJetSubBlock.read(payload, payloadEnd);
734  if (cmmJetSubBlock.crate() != rodCrate) {
735  if (debug) msg() << "Inconsistent crate number in ROD source ID"
736  << endmsg;
738  break;
739  }
740  if (data.m_collection == CMM_HITS) {
741  decodeCmmJet(&cmmJetSubBlock, trigCmm, static_cast<CmmHitsData&>(data), ld);
742  if (ld.rodErr != L1CaloSubBlock::ERROR_NONE) {
743  if (debug) msg() << "decodeCmmJet failed" << endmsg;
744  break;
745  }
746  }
748  cmmEnergySubBlock.clear();
749  payload = cmmEnergySubBlock.read(payload, payloadEnd);
750  if (cmmEnergySubBlock.crate() != rodCrate) {
751  if (debug) msg() << "Inconsistent crate number in ROD source ID"
752  << endmsg;
754  break;
755  }
756  if (data.m_collection == CMM_SUMS) {
757  decodeCmmEnergy(&cmmEnergySubBlock, trigCmm, static_cast<CmmSumsData&>(data), ld);
758  if (ld.rodErr != L1CaloSubBlock::ERROR_NONE) {
759  if (debug) msg() << "decodeCmmEnergy failed" << endmsg;
760  break;
761  }
762  }
763  } else {
764  if (debug) msg() << "Invalid CMM type in module field" << endmsg;
766  break;
767  }
768  } else {
769  // JEM
770  jemSubBlock.clear();
771  payload = jemSubBlock.read(payload, payloadEnd);
772  if (jemSubBlock.crate() != rodCrate) {
773  if (debug) msg() << "Inconsistent crate number in ROD source ID"
774  << endmsg;
776  break;
777  }
778  if (data.m_collection == JET_ELEMENTS || data.m_collection == JET_HITS ||
779  data.m_collection == ENERGY_SUMS) {
780  decodeJem(&jemSubBlock, trigJem, data, ld);
781  if (ld.rodErr != L1CaloSubBlock::ERROR_NONE) {
782  if (debug) msg() << "decodeJem failed" << endmsg;
783  break;
784  }
785  }
786  }
787  }
788  if (ld.rodErr != L1CaloSubBlock::ERROR_NONE)
789  m_errorTool->rodError(robid, ld.rodErr);
790  }
791 
792  return StatusCode::SUCCESS;
793 }

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

◆ decodeCmmEnergy()

void LVL1BS::JepByteStreamTool::decodeCmmEnergy ( CmmEnergySubBlock subBlock,
int  trigCmm,
CmmSumsData data,
LocalData ld 
) const
private

Unpack CMM-Energy sub-block.

Definition at line 797 of file JepByteStreamTool.cxx.

801 {
802  const bool debug = msgLvl(MSG::DEBUG);
803  if (debug) msg(MSG::DEBUG);
804 
805  const int hwCrate = subBlock->crate();
806  const int module = subBlock->cmmPosition();
807  const int firmware = subBlock->cmmFirmware();
808  const int summing = subBlock->cmmSumming();
809  const int timeslices = subBlock->timeslices();
810  const int sliceNum = subBlock->slice();
811  if (debug) {
812  msg() << "CMM-Energy: Crate " << hwCrate
813  << " Module " << module
814  << " Firmware " << firmware
815  << " Summing " << summing
816  << " Total slices " << timeslices
817  << " Slice " << sliceNum << endmsg;
818  }
819  if (timeslices <= trigCmm) {
820  if (debug) msg() << "Triggered CMM slice from header "
821  << "inconsistent with number of slices: "
822  << trigCmm << ", " << timeslices << endmsg;
824  return;
825  }
826  if (timeslices <= sliceNum) {
827  if (debug) msg() << "Total slices inconsistent with slice number: "
828  << timeslices << ", " << sliceNum << endmsg;
830  return;
831  }
832  // Unpack sub-block
833  if (subBlock->dataWords() && !subBlock->unpack()) {
834  if (debug) {
835  std::string errMsg(subBlock->unpackErrorMsg());
836  msg() << "CMM-Energy sub-block unpacking failed: " << errMsg << endmsg;
837  }
838  ld.rodErr = subBlock->unpackErrorCode();
839  return;
840  }
841 
842  // Retrieve required data
843 
844  const bool neutralFormat = subBlock->format() == L1CaloSubBlock::NEUTRAL;
845  const int crate = hwCrate - m_crateOffsetHw;
846  const int swCrate = crate + m_crateOffsetSw;
847  const int maxSid = static_cast<int>(CmmEnergySubBlock::MAX_SOURCE_ID);
848  LVL1::DataError derr;
849  derr.set(LVL1::DataError::SubStatusWord, subBlock->subStatus());
850  const int ssError = derr.error();
851  const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
852  const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
853  for (int slice = sliceBeg; slice < sliceEnd; ++slice) {
854 
855  // Energy sums
856 
857  for (int source = 0; source < maxSid; ++source) {
858  int dataID = source;
859  if (source >= m_modules) {
860  if (summing == CmmSubBlock::CRATE &&
861  source != CmmEnergySubBlock::LOCAL) continue;
862  // coverity[mixed_enums : FALSE]
863  // coverity[switch_on_enum : FALSE]
864  // coverity[first_enum_type : FALSE]
865  switch (source) {
867  dataID = LVL1::CMMEtSums::LOCAL;
868  break;
870  dataID = LVL1::CMMEtSums::REMOTE;
871  break;
873  dataID = LVL1::CMMEtSums::TOTAL;
874  break;
875  default:
876  continue;
877  }
878  }
879  const unsigned int ex = subBlock->ex(slice, source);
880  const unsigned int ey = subBlock->ey(slice, source);
881  const unsigned int et = subBlock->et(slice, source);
882  int exErr = subBlock->exError(slice, source);
883  int eyErr = subBlock->eyError(slice, source);
884  int etErr = subBlock->etError(slice, source);
885  LVL1::DataError exErrBits(ssError);
886  LVL1::DataError eyErrBits(ssError);
887  LVL1::DataError etErrBits(ssError);
888  // coverity[mixed_enums : FALSE]
889  // coverity[switch_on_enum : FALSE]
890  // coverity[first_enum_type : FALSE]
891  if (dataID == LVL1::CMMEtSums::LOCAL ||
892  dataID == LVL1::CMMEtSums::REMOTE ||
893  dataID == LVL1::CMMEtSums::TOTAL) {
894  exErrBits.set(LVL1::DataError::Overflow, exErr);
895  exErrBits.set(LVL1::DataError::Parity, exErr >> 1);
896  eyErrBits.set(LVL1::DataError::Overflow, eyErr);
897  eyErrBits.set(LVL1::DataError::Parity, eyErr >> 1);
898  etErrBits.set(LVL1::DataError::Overflow, etErr);
899  etErrBits.set(LVL1::DataError::Parity, etErr >> 1);
900  } else {
901  exErrBits.set(LVL1::DataError::Parity, exErr);
902  eyErrBits.set(LVL1::DataError::Parity, eyErr);
903  etErrBits.set(LVL1::DataError::Parity, etErr);
904  }
905  exErr = exErrBits.error();
906  eyErr = eyErrBits.error();
907  etErr = etErrBits.error();
908  if (ex || ey || et || exErr || eyErr || etErr) {
909  LVL1::CMMEtSums* sums = findCmmSums(data, crate, dataID);
910  if ( ! sums ) { // create new CMM energy sums
911  ld.exVec.assign(timeslices, 0);
912  ld.eyVec.assign(timeslices, 0);
913  ld.etVec.assign(timeslices, 0);
914  ld.exErrVec.assign(timeslices, 0);
915  ld.eyErrVec.assign(timeslices, 0);
916  ld.etErrVec.assign(timeslices, 0);
917  ld.exVec[slice] = ex;
918  ld.eyVec[slice] = ey;
919  ld.etVec[slice] = et;
920  ld.exErrVec[slice] = exErr;
921  ld.eyErrVec[slice] = eyErr;
922  ld.etErrVec[slice] = etErr;
923  auto sumsp =
924  std::make_unique<LVL1::CMMEtSums>(swCrate, dataID, ld.etVec, ld.exVec, ld.eyVec,
925  ld.etErrVec, ld.exErrVec, ld.eyErrVec, trigCmm);
926  const int key = crate * 100 + dataID;
927  data.m_cmmEtMap.insert(std::make_pair(key, sumsp.get()));
928  data.m_cmmEtCollection->push_back(std::move(sumsp));
929  } else {
930  ld.exVec = sums->ExVec();
931  ld.eyVec = sums->EyVec();
932  ld.etVec = sums->EtVec();
933  ld.exErrVec = sums->ExErrorVec();
934  ld.eyErrVec = sums->EyErrorVec();
935  ld.etErrVec = sums->EtErrorVec();
936  const int nsl = ld.exVec.size();
937  if (timeslices != nsl) {
938  if (debug) msg() << "Inconsistent number of slices in sub-blocks"
939  << endmsg;
941  return;
942  }
943  if (ld.exVec[slice] != 0 || ld.eyVec[slice] != 0 || ld.etVec[slice] != 0 ||
944  ld.exErrVec[slice] != 0 || ld.eyErrVec[slice] != 0 ||
945  ld.etErrVec[slice] != 0) {
946  if (debug) msg() << "Duplicate data for slice " << slice << endmsg;
948  return;
949  }
950  ld.exVec[slice] = ex;
951  ld.eyVec[slice] = ey;
952  ld.etVec[slice] = et;
953  ld.exErrVec[slice] = exErr;
954  ld.eyErrVec[slice] = eyErr;
955  ld.etErrVec[slice] = etErr;
956  sums->addEx(ld.exVec, ld.exErrVec);
957  sums->addEy(ld.eyVec, ld.eyErrVec);
958  sums->addEt(ld.etVec, ld.etErrVec);
959  }
960  }
961  }
962 
963  // Hit maps - store as Et
964 
965  if (summing == CmmSubBlock::SYSTEM) {
966  const unsigned int missEt = subBlock->missingEtHits(slice);
967  if ( missEt || ssError ) {
968  const int dataID = LVL1::CMMEtSums::MISSING_ET_MAP;
969  LVL1::CMMEtSums* map = findCmmSums(data, crate, dataID);
970  if ( ! map ) {
971  ld.etVec.assign(timeslices, 0);
972  ld.etErrVec.assign(timeslices, 0);
973  ld.etVec[slice] = missEt;
974  ld.etErrVec[slice] = ssError;
975  auto mapp =
976  std::make_unique<LVL1::CMMEtSums>(swCrate, dataID,
977  ld.etVec, ld.etVec, ld.etVec,
978  ld.etErrVec, ld.etErrVec, ld.etErrVec, trigCmm);
979  const int key = crate * 100 + dataID;
980  data.m_cmmEtMap.insert(std::make_pair(key, mapp.get()));
981  data.m_cmmEtCollection->push_back(std::move(mapp));
982  } else {
983  ld.etVec = map->EtVec();
984  ld.etErrVec = map->EtErrorVec();
985  const int nsl = ld.etVec.size();
986  if (timeslices != nsl) {
987  if (debug) msg() << "Inconsistent number of slices in sub-blocks"
988  << endmsg;
990  return;
991  }
992  if (ld.etVec[slice] != 0 || ld.etErrVec[slice] != 0) {
993  if (debug) msg() << "Duplicate data for slice " << slice << endmsg;
995  return;
996  }
997  ld.etVec[slice] = missEt;
998  ld.etErrVec[slice] = ssError;
999  map->addEx(ld.etVec, ld.etErrVec);
1000  map->addEy(ld.etVec, ld.etErrVec);
1001  map->addEt(ld.etVec, ld.etErrVec);
1002  }
1003  }
1004  const unsigned int sumEt = subBlock->sumEtHits(slice);
1005  if ( sumEt || ssError ) {
1006  const int dataID = LVL1::CMMEtSums::SUM_ET_MAP;
1007  LVL1::CMMEtSums* map = findCmmSums(data, crate, dataID);
1008  if ( ! map ) {
1009  ld.etVec.assign(timeslices, 0);
1010  ld.etErrVec.assign(timeslices, 0);
1011  ld.etVec[slice] = sumEt;
1012  ld.etErrVec[slice] = ssError;
1013  auto mapp =
1014  std::make_unique<LVL1::CMMEtSums>(swCrate, dataID,
1015  ld.etVec, ld.etVec, ld.etVec,
1016  ld.etErrVec, ld.etErrVec, ld.etErrVec, trigCmm);
1017  const int key = crate * 100 + dataID;
1018  data.m_cmmEtMap.insert(std::make_pair(key, mapp.get()));
1019  data.m_cmmEtCollection->push_back(std::move(mapp));
1020  } else {
1021  ld.etVec = map->EtVec();
1022  ld.etErrVec = map->EtErrorVec();
1023  const int nsl = ld.etVec.size();
1024  if (timeslices != nsl) {
1025  if (debug) msg() << "Inconsistent number of slices in sub-blocks"
1026  << endmsg;
1028  return;
1029  }
1030  if (ld.etVec[slice] != 0 || ld.etErrVec[slice] != 0) {
1031  if (debug) msg() << "Duplicate data for slice " << slice << endmsg;
1033  return;
1034  }
1035  ld.etVec[slice] = sumEt;
1036  ld.etErrVec[slice] = ssError;
1037  map->addEx(ld.etVec, ld.etErrVec);
1038  map->addEy(ld.etVec, ld.etErrVec);
1039  map->addEt(ld.etVec, ld.etErrVec);
1040  }
1041  }
1042  if (subBlock->version() > 1) {
1043  const unsigned int missEtSig = subBlock->missingEtSigHits(slice);
1044  if ( missEtSig || ssError ) {
1045  const int dataID = LVL1::CMMEtSums::MISSING_ET_SIG_MAP;
1046  LVL1::CMMEtSums* map = findCmmSums(data, crate, dataID);
1047  if ( ! map ) {
1048  ld.etVec.assign(timeslices, 0);
1049  ld.etErrVec.assign(timeslices, 0);
1050  ld.etVec[slice] = missEtSig;
1051  ld.etErrVec[slice] = ssError;
1052  auto mapp =
1053  std::make_unique<LVL1::CMMEtSums>(swCrate, dataID,
1054  ld.etVec, ld.etVec, ld.etVec,
1055  ld.etErrVec, ld.etErrVec, ld.etErrVec, trigCmm);
1056  const int key = crate * 100 + dataID;
1057  data.m_cmmEtMap.insert(std::make_pair(key, mapp.get()));
1058  data.m_cmmEtCollection->push_back(std::move(mapp));
1059  } else {
1060  ld.etVec = map->EtVec();
1061  ld.etErrVec = map->EtErrorVec();
1062  const int nsl = ld.etVec.size();
1063  if (timeslices != nsl) {
1064  if (debug) msg() << "Inconsistent number of slices in sub-blocks"
1065  << endmsg;
1067  return;
1068  }
1069  if (ld.etVec[slice] != 0 || ld.etErrVec[slice] != 0) {
1070  if (debug) msg() << "Duplicate data for slice "
1071  << slice << endmsg;
1073  return;
1074  }
1075  ld.etVec[slice] = missEtSig;
1076  ld.etErrVec[slice] = ssError;
1077  map->addEx(ld.etVec, ld.etErrVec);
1078  map->addEy(ld.etVec, ld.etErrVec);
1079  map->addEt(ld.etVec, ld.etErrVec);
1080  }
1081  }
1082  }
1083  }
1084  }
1085 
1086  return;
1087 }

◆ decodeCmmJet()

void LVL1BS::JepByteStreamTool::decodeCmmJet ( CmmJetSubBlock subBlock,
int  trigCmm,
CmmHitsData data,
LocalData ld 
) const
private

Unpack CMM-Jet sub-block.

Definition at line 1091 of file JepByteStreamTool.cxx.

1094 {
1095  const bool debug = msgLvl(MSG::DEBUG);
1096  if (debug) msg(MSG::DEBUG);
1097 
1098  const int hwCrate = subBlock->crate();
1099  const int module = subBlock->cmmPosition();
1100  const int firmware = subBlock->cmmFirmware();
1101  const int summing = subBlock->cmmSumming();
1102  const int timeslices = subBlock->timeslices();
1103  const int sliceNum = subBlock->slice();
1104  if (debug) {
1105  msg() << "CMM-Jet: Crate " << hwCrate
1106  << " Module " << module
1107  << " Firmware " << firmware
1108  << " Summing " << summing
1109  << " Total slices " << timeslices
1110  << " Slice " << sliceNum << endmsg;
1111  }
1112  if (timeslices <= trigCmm) {
1113  if (debug) msg() << "Triggered CMM slice from header "
1114  << "inconsistent with number of slices: "
1115  << trigCmm << ", " << timeslices << endmsg;
1117  return;
1118  }
1119  if (timeslices <= sliceNum) {
1120  if (debug) msg() << "Total slices inconsistent with slice number: "
1121  << timeslices << ", " << sliceNum << endmsg;
1123  return;
1124  }
1125  // Unpack sub-block
1126  if (subBlock->dataWords() && !subBlock->unpack()) {
1127  if (debug) {
1128  std::string errMsg(subBlock->unpackErrorMsg());
1129  msg() << "CMM-Jet sub-block unpacking failed: " << errMsg << endmsg;
1130  }
1131  ld.rodErr = subBlock->unpackErrorCode();
1132  return;
1133  }
1134 
1135  // Retrieve required data
1136 
1137  const bool neutralFormat = subBlock->format() == L1CaloSubBlock::NEUTRAL;
1138  const int crate = hwCrate - m_crateOffsetHw;
1139  const int swCrate = crate + m_crateOffsetSw;
1140  const int maxSid = static_cast<int>(CmmJetSubBlock::MAX_SOURCE_ID);
1141  LVL1::DataError derr;
1142  derr.set(LVL1::DataError::SubStatusWord, subBlock->subStatus());
1143  const int ssError = derr.error();
1144  const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
1145  const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
1146  for (int slice = sliceBeg; slice < sliceEnd; ++slice) {
1147 
1148  // Jet hit counts
1149 
1150  for (int source = 0; source < maxSid; ++source) {
1151  int dataID = source;
1152  if (source >= m_modules) {
1153  if (summing == CmmSubBlock::CRATE &&
1154  source != CmmJetSubBlock::LOCAL_MAIN &&
1155  source != CmmJetSubBlock::LOCAL_FORWARD) continue;
1156  switch (source) {
1159  break;
1162  break;
1165  break;
1168  break;
1171  break;
1174  break;
1175  default:
1176  continue;
1177  }
1178  }
1179  const unsigned int hits = subBlock->jetHits(slice, source);
1180  LVL1::DataError errBits(ssError);
1181  errBits.set(LVL1::DataError::Parity,
1182  subBlock->jetHitsError(slice, source));
1183  const int err = errBits.error();
1184  if (hits || err) {
1185  LVL1::CMMJetHits* jh = findCmmHits(data, crate, dataID);
1186  if ( ! jh ) { // create new CMM hits
1187  ld.hitsVec.assign(timeslices, 0);
1188  ld.errVec.assign(timeslices, 0);
1189  ld.hitsVec[slice] = hits;
1190  ld.errVec[slice] = err;
1191  auto jhp =
1192  std::make_unique<LVL1::CMMJetHits>(swCrate, dataID, ld.hitsVec, ld.errVec, trigCmm);
1193  const int key = crate * 100 + dataID;
1194  data.m_cmmHitsMap.insert(std::make_pair(key, jhp.get()));
1195  data.m_cmmHitCollection->push_back(std::move(jhp));
1196  } else {
1197  ld.hitsVec = jh->HitsVec();
1198  ld.errVec = jh->ErrorVec();
1199  const int nsl = ld.hitsVec.size();
1200  if (timeslices != nsl) {
1201  if (debug) msg() << "Inconsistent number of slices in sub-blocks"
1202  << endmsg;
1204  return;
1205  }
1206  if (ld.hitsVec[slice] != 0 || ld.errVec[slice] != 0) {
1207  if (debug) msg() << "Duplicate data for slice " << slice << endmsg;
1209  return;
1210  }
1211  ld.hitsVec[slice] = hits;
1212  ld.errVec[slice] = err;
1213  jh->addHits(ld.hitsVec, ld.errVec);
1214  }
1215  }
1216  }
1217 
1218  // Hit map - store as hits
1219 
1220  if (summing == CmmSubBlock::SYSTEM) {
1221  const unsigned int etMap = subBlock->jetEtMap(slice);
1222  if ( etMap || ssError ) {
1223  const int dataID = LVL1::CMMJetHits::ET_MAP;
1224  LVL1::CMMJetHits* map = findCmmHits(data, crate, dataID);
1225  if ( ! map ) {
1226  ld.hitsVec.assign(timeslices, 0);
1227  ld.errVec.assign(timeslices, 0);
1228  ld.hitsVec[slice] = etMap;
1229  ld.errVec[slice] = ssError;
1230  auto mapp =
1231  std::make_unique<LVL1::CMMJetHits>(swCrate, dataID, ld.hitsVec, ld.errVec, trigCmm);
1232  const int key = crate * 100 + dataID;
1233  data.m_cmmHitsMap.insert(std::make_pair(key, mapp.get()));
1234  data.m_cmmHitCollection->push_back(std::move(mapp));
1235  } else {
1236  ld.hitsVec = map->HitsVec();
1237  ld.errVec = map->ErrorVec();
1238  const int nsl = ld.hitsVec.size();
1239  if (timeslices != nsl) {
1240  if (debug) msg() << "Inconsistent number of slices in sub-blocks"
1241  << endmsg;
1243  return;
1244  }
1245  if (ld.hitsVec[slice] != 0 || ld.errVec[slice] != 0) {
1246  if (debug) msg() << "Duplicate data for slice " << slice << endmsg;
1248  return;
1249  }
1250  ld.hitsVec[slice] = etMap;
1251  ld.errVec[slice] = ssError;
1252  map->addHits(ld.hitsVec, ld.errVec);
1253  }
1254  }
1255  }
1256  }
1257 
1258  return;
1259 }

◆ decodeJem()

void LVL1BS::JepByteStreamTool::decodeJem ( JemSubBlock subBlock,
int  trigJem,
JepByteStreamToolData data,
LocalData ld 
) const
private

Unpack JEM sub-block.

Definition at line 1263 of file JepByteStreamTool.cxx.

1266 {
1267  const bool debug = msgLvl(MSG::DEBUG);
1268  const bool verbose = msgLvl(MSG::VERBOSE);
1269  if (debug) msg(MSG::DEBUG);
1270 
1271  const int hwCrate = subBlock->crate();
1272  const int module = subBlock->module();
1273  const int timeslices = subBlock->timeslices();
1274  const int sliceNum = subBlock->slice();
1275  if (debug) {
1276  msg() << "JEM: Crate " << hwCrate
1277  << " Module " << module
1278  << " Total slices " << timeslices
1279  << " Slice " << sliceNum << endmsg;
1280  }
1281  if (timeslices <= trigJem) {
1282  if (debug) msg() << "Triggered JEM slice from header "
1283  << "inconsistent with number of slices: "
1284  << trigJem << ", " << timeslices << endmsg;
1286  return;
1287  }
1288  if (timeslices <= sliceNum) {
1289  if (debug) msg() << "Total slices inconsistent with slice number: "
1290  << timeslices << ", " << sliceNum << endmsg;
1292  return;
1293  }
1294  // Unpack sub-block
1295  if (subBlock->dataWords() && !subBlock->unpack()) {
1296  if (debug) {
1297  std::string errMsg(subBlock->unpackErrorMsg());
1298  msg() << "JEM sub-block unpacking failed: " << errMsg << endmsg;
1299  }
1300  ld.rodErr = subBlock->unpackErrorCode();
1301  return;
1302  }
1303 
1304  // Retrieve required data
1305 
1306  const bool neutralFormat = subBlock->format() == L1CaloSubBlock::NEUTRAL;
1307  const int crate = hwCrate - m_crateOffsetHw;
1308  const int swCrate = crate + m_crateOffsetSw;
1309  LVL1::DataError derr;
1310  derr.set(LVL1::DataError::SubStatusWord, subBlock->subStatus());
1311  const int ssError = derr.error();
1312  std::vector<int> dummy(timeslices);
1313  const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
1314  const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
1315  for (int slice = sliceBeg; slice < sliceEnd; ++slice) {
1316 
1317  if (data.m_collection == JET_ELEMENTS) {
1318  JetElementData& jedata = static_cast<JetElementData&>(data);
1319 
1320  // Loop over jet element channels and fill jet elements
1321 
1322  for (int chan = 0; chan < m_channels; ++chan) {
1323  const JemJetElement jetEle(subBlock->jetElement(slice, chan));
1324  if (jetEle.data() || ssError) {
1325  double eta = 0.;
1326  double phi = 0.;
1327  int layer = 0;
1328  if (m_jemMaps->mapping(crate, module, chan, eta, phi, layer)) {
1329  if (layer == ld.coreOverlap) {
1330  LVL1::JetElement* je = findJetElement(jedata, eta, phi, ld.elementKey);
1331  if ( ! je ) { // create new jet element
1332  const unsigned int key = ld.elementKey.jeKey(phi, eta);
1333  auto jep =
1334  std::make_unique<LVL1::JetElement>(phi, eta, dummy, dummy, key,
1335  dummy, dummy, dummy, trigJem);
1336  je = jep.get();
1337  jedata.m_jeMap.insert(std::make_pair(key, jep.get()));
1338  jedata.m_jeCollection->push_back(std::move(jep));
1339  } else {
1340  const std::vector<int>& emEnergy(je->emEnergyVec());
1341  const std::vector<int>& hadEnergy(je->hadEnergyVec());
1342  const std::vector<int>& emError(je->emErrorVec());
1343  const std::vector<int>& hadError(je->hadErrorVec());
1344  const int nsl = emEnergy.size();
1345  if (timeslices != nsl) {
1346  if (debug) {
1347  msg() << "Inconsistent number of slices in sub-blocks"
1348  << endmsg;
1349  }
1351  return;
1352  }
1353  if (emEnergy[slice] != 0 || hadEnergy[slice] != 0 ||
1354  emError[slice] != 0 || hadError[slice] != 0) {
1355  if (debug) msg() << "Duplicate data for slice "
1356  << slice << endmsg;
1358  return;
1359  }
1360  }
1361  LVL1::DataError emErrBits(ssError);
1362  LVL1::DataError hadErrBits(ssError);
1363  const int linkError = jetEle.linkError();
1364  emErrBits.set(LVL1::DataError::Parity, jetEle.emParity());
1365  emErrBits.set(LVL1::DataError::LinkDown, linkError);
1366  hadErrBits.set(LVL1::DataError::Parity, jetEle.hadParity());
1367  hadErrBits.set(LVL1::DataError::LinkDown, linkError >> 1);
1368  je->addSlice(slice, jetEle.emData(), jetEle.hadData(),
1369  emErrBits.error(), hadErrBits.error(),
1370  linkError);
1371  }
1372  } else if (verbose && jetEle.data()) {
1373  msg(MSG::VERBOSE) << "Non-zero data but no channel mapping for channel "
1374  << chan << endmsg;
1375  msg(MSG::DEBUG);
1376  }
1377  } else if (verbose) {
1378  msg(MSG::VERBOSE) << "No jet element data for channel "
1379  << chan << " slice " << slice << endmsg;
1380  msg(MSG::DEBUG);
1381  }
1382  }
1383  } else if (data.m_collection == JET_HITS) {
1384  JetHitsData& jhdata = static_cast<JetHitsData&>(data);
1385 
1386  // Get jet hits
1387 
1388  const unsigned int hits = subBlock->jetHits(slice);
1389  if (hits) {
1390  LVL1::JEMHits* jh = findJetHits(jhdata, crate, module);
1391  if ( ! jh ) { // create new jet hits
1392  ld.hitsVec.assign(timeslices, 0);
1393  ld.hitsVec[slice] = hits;
1394  auto jhp =
1395  std::make_unique<LVL1::JEMHits>(swCrate, module, ld.hitsVec, trigJem);
1396  jhdata.m_hitsMap.insert(std::make_pair(crate * m_modules + module, jhp.get()));
1397  jhdata.m_hitCollection->push_back(std::move(jhp));
1398  } else {
1399  ld.hitsVec = jh->JetHitsVec();
1400  const int nsl = ld.hitsVec.size();
1401  if (timeslices != nsl) {
1402  if (debug) {
1403  msg() << "Inconsistent number of slices in sub-blocks"
1404  << endmsg;
1405  }
1407  return;
1408  }
1409  if (ld.hitsVec[slice] != 0) {
1410  if (debug) msg() << "Duplicate data for slice "
1411  << slice << endmsg;
1413  return;
1414  }
1415  ld.hitsVec[slice] = hits;
1416  jh->addJetHits(ld.hitsVec);
1417  }
1418  } else if (verbose) {
1419  msg(MSG::VERBOSE) << "No jet hits data for crate/module/slice "
1420  << hwCrate << "/" << module << "/" << slice
1421  << endmsg;
1422  msg(MSG::DEBUG);
1423  }
1424  } else if (data.m_collection == ENERGY_SUMS) {
1425  EnergySumsData& sumdata = static_cast<EnergySumsData&>(data);
1426 
1427  // Get energy subsums
1428 
1429  const unsigned int ex = subBlock->ex(slice);
1430  const unsigned int ey = subBlock->ey(slice);
1431  const unsigned int et = subBlock->et(slice);
1432  if (ex | ey | et) {
1433  LVL1::JEMEtSums* sums = findEnergySums(sumdata, crate, module);
1434  if ( ! sums ) { // create new energy sums
1435  ld.exVec.assign(timeslices, 0);
1436  ld.eyVec.assign(timeslices, 0);
1437  ld.etVec.assign(timeslices, 0);
1438  ld.exVec[slice] = ex;
1439  ld.eyVec[slice] = ey;
1440  ld.etVec[slice] = et;
1441  auto sumsp =
1442  std::make_unique<LVL1::JEMEtSums>(swCrate, module, ld.etVec, ld.exVec, ld.eyVec,
1443  trigJem);
1444  sumdata.m_etMap.insert(std::make_pair(crate * m_modules + module, sumsp.get()));
1445  sumdata.m_etCollection->push_back(std::move(sumsp));
1446  } else {
1447  ld.exVec = sums->ExVec();
1448  ld.eyVec = sums->EyVec();
1449  ld.etVec = sums->EtVec();
1450  const int nsl = ld.exVec.size();
1451  if (timeslices != nsl) {
1452  if (debug) {
1453  msg() << "Inconsistent number of slices in sub-blocks"
1454  << endmsg;
1455  }
1457  return;
1458  }
1459  if (ld.exVec[slice] != 0 || ld.eyVec[slice] != 0 || ld.etVec[slice] != 0) {
1460  if (debug) msg() << "Duplicate data for slice "
1461  << slice << endmsg;
1463  return;
1464  }
1465  ld.exVec[slice] = ex;
1466  ld.eyVec[slice] = ey;
1467  ld.etVec[slice] = et;
1468  sums->addEx(ld.exVec);
1469  sums->addEy(ld.eyVec);
1470  sums->addEt(ld.etVec);
1471  }
1472  } else if (verbose) {
1473  msg(MSG::VERBOSE) << "No energy sums data for crate/module/slice "
1474  << hwCrate << "/" << module << "/" << slice
1475  << endmsg;
1476  msg(MSG::DEBUG);
1477  }
1478  }
1479  }
1480  return;
1481 }

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ finalize()

StatusCode LVL1BS::JepByteStreamTool::finalize ( )
virtual

Definition at line 119 of file JepByteStreamTool.cxx.

120 {
121  return StatusCode::SUCCESS;
122 }

◆ findCmmHits() [1/2]

LVL1::CMMJetHits * LVL1BS::JepByteStreamTool::findCmmHits ( const CmmHitsData data,
int  crate,
int  dataID 
) const
private

Definition at line 1562 of file JepByteStreamTool.cxx.

1565 {
1566  CmmHitsMap::const_iterator mapIter = data.m_cmmHitsMap.find(crate * 100 + dataID);
1567  if (mapIter != data.m_cmmHitsMap.end()) return mapIter->second;
1568  return nullptr;
1569 }

◆ findCmmHits() [2/2]

const LVL1::CMMJetHits * LVL1BS::JepByteStreamTool::findCmmHits ( int  crate,
int  dataID,
const ConstCmmHitsMap cmmHitsMap 
) const
private

Find CMM hits for given crate, data ID.

Definition at line 1553 of file JepByteStreamTool.cxx.

1556 {
1557  ConstCmmHitsMap::const_iterator mapIter = cmmHitsMap.find(crate * 100 + dataID);
1558  if (mapIter != cmmHitsMap.end()) return mapIter->second;
1559  return nullptr;
1560 }

◆ findCmmSums() [1/2]

LVL1::CMMEtSums * LVL1BS::JepByteStreamTool::findCmmSums ( const CmmSumsData data,
int  crate,
int  dataID 
) const
private

Definition at line 1583 of file JepByteStreamTool.cxx.

1586 {
1587  CmmSumsMap::const_iterator mapIter = data.m_cmmEtMap.find(crate * 100 + dataID);
1588  if (mapIter != data.m_cmmEtMap.end()) return mapIter->second;
1589  return nullptr;
1590 }

◆ findCmmSums() [2/2]

const LVL1::CMMEtSums * LVL1BS::JepByteStreamTool::findCmmSums ( int  crate,
int  dataID,
const ConstCmmSumsMap cmmEtMap 
) const
private

Find CMM energy sums for given crate, data ID.

Definition at line 1574 of file JepByteStreamTool.cxx.

1577 {
1578  ConstCmmSumsMap::const_iterator mapIter = cmmEtMap.find(crate * 100 + dataID);
1579  if (mapIter != cmmEtMap.end()) return mapIter->second;
1580  return nullptr;
1581 }

◆ findEnergySums() [1/2]

LVL1::JEMEtSums * LVL1BS::JepByteStreamTool::findEnergySums ( const EnergySumsData data,
int  crate,
int  module 
) const
private

Definition at line 1541 of file JepByteStreamTool.cxx.

1544 {
1545  EnergySumsMap::const_iterator mapIter = data.m_etMap.find(crate * m_modules + module);
1546  if (mapIter != data.m_etMap.end()) return mapIter->second;
1547  return nullptr;
1548 }

◆ findEnergySums() [2/2]

const LVL1::JEMEtSums * LVL1BS::JepByteStreamTool::findEnergySums ( int  crate,
int  module,
const ConstEnergySumsMap etMap 
) const
private

Find energy sums for given crate, module.

Definition at line 1532 of file JepByteStreamTool.cxx.

1535 {
1536  ConstEnergySumsMap::const_iterator mapIter = etMap.find(crate * m_modules + module);
1537  if (mapIter != etMap.end()) return mapIter->second;
1538  return nullptr;
1539 }

◆ findJetElement() [1/2]

LVL1::JetElement * LVL1BS::JepByteStreamTool::findJetElement ( const JetElementData data,
double  eta,
double  phi,
LVL1::JetElementKey elementKey 
) const
private

Definition at line 1497 of file JepByteStreamTool.cxx.

1501 {
1502  const unsigned int key = elementKey.jeKey(phi, eta);
1503  JetElementMap::const_iterator mapIter = data.m_jeMap.find(key);
1504  if (mapIter != data.m_jeMap.end()) return mapIter->second;
1505  return nullptr;
1506 }

◆ findJetElement() [2/2]

const LVL1::JetElement * LVL1BS::JepByteStreamTool::findJetElement ( double  eta,
double  phi,
const ConstJetElementMap jeMap,
LVL1::JetElementKey elementKey 
) const
private

Find a jet element given eta, phi.

Definition at line 1486 of file JepByteStreamTool.cxx.

1490 {
1491  const unsigned int key = elementKey.jeKey(phi, eta);
1492  ConstJetElementMap::const_iterator mapIter = jeMap.find(key);
1493  if (mapIter != jeMap.end()) return mapIter->second;
1494  return nullptr;
1495 }

◆ findJetHits() [1/2]

LVL1::JEMHits * LVL1BS::JepByteStreamTool::findJetHits ( const JetHitsData data,
int  crate,
int  module 
) const
private

Definition at line 1520 of file JepByteStreamTool.cxx.

1523 {
1524  JetHitsMap::const_iterator mapIter = data.m_hitsMap.find(crate * m_modules + module);
1525  if (mapIter != data.m_hitsMap.end()) return mapIter->second;
1526  return nullptr;
1527 }

◆ findJetHits() [2/2]

const LVL1::JEMHits * LVL1BS::JepByteStreamTool::findJetHits ( int  crate,
int  module,
const ConstJetHitsMap hitsMap 
) const
private

Find jet hits for given crate, module.

Definition at line 1511 of file JepByteStreamTool.cxx.

1514 {
1515  ConstJetHitsMap::const_iterator mapIter = hitsMap.find(crate * m_modules + module);
1516  if (mapIter != hitsMap.end()) return mapIter->second;
1517  return nullptr;
1518 }

◆ initialize()

StatusCode LVL1BS::JepByteStreamTool::initialize ( )
virtual

Definition at line 96 of file JepByteStreamTool.cxx.

97 {
98  msg(MSG::INFO) << "Initializing " << name() << endmsg;
99 
100  StatusCode sc = m_jemMaps.retrieve();
101  if (sc.isFailure()) {
102  msg(MSG::ERROR) << "Failed to retrieve tool " << m_jemMaps << endmsg;
103  return sc;
104  } else msg(MSG::INFO) << "Retrieved tool " << m_jemMaps << endmsg;
105 
106  sc = m_errorTool.retrieve();
107  if (sc.isFailure()) {
108  msg(MSG::ERROR) << "Failed to retrieve tool " << m_errorTool << endmsg;
109  return sc;
110  } else msg(MSG::INFO) << "Retrieved tool " << m_errorTool << endmsg;
111 
112  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
113 
114  return StatusCode::SUCCESS;
115 }

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

AlgTool InterfaceID.

Definition at line 43 of file JepByteStreamTool.cxx.

44 {
45  return IID_IJepByteStreamTool;
46 }

◆ makeSourceIDs()

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

Definition at line 561 of file JepByteStreamTool.cxx.

562 {
563  std::vector<uint32_t> sourceIDs;
564 
565  if (!m_sourceIDsProp.empty()) {
567  }
568  else {
569  const int maxCrates = m_crates + m_crateOffsetHw;
570  const int maxSlinks = m_srcIdMap.maxSlinks();
571  for (int hwCrate = m_crateOffsetHw; hwCrate < maxCrates; ++hwCrate)
572  {
573  for (int slink = 0; slink < maxSlinks; ++slink)
574  {
575  const int daqOrRoi = 0;
576  const uint32_t rodId = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
577  m_subDetector);
578  const uint32_t robId = m_srcIdMap.getRobID(rodId);
579  sourceIDs.push_back(robId);
580  }
581  }
582  }
583  return sourceIDs;
584 }

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

◆ setupCmmEtMap()

void LVL1BS::JepByteStreamTool::setupCmmEtMap ( const CmmSumsCollection enCollection,
ConstCmmSumsMap cmmEtMap 
) const
private

Set up CMM energy sums map.

Definition at line 1670 of file JepByteStreamTool.cxx.

1673 {
1674  cmmEtMap.clear();
1675  if (etCollection) {
1676  CmmSumsCollection::const_iterator pos = etCollection->begin();
1677  CmmSumsCollection::const_iterator pose = etCollection->end();
1678  for (; pos != pose; ++pos) {
1679  const LVL1::CMMEtSums* const sums = *pos;
1680  const int crate = sums->crate() - m_crateOffsetSw;
1681  const int key = crate * 100 + sums->dataID();
1682  cmmEtMap.insert(std::make_pair(key, sums));
1683  }
1684  }
1685 }

◆ setupCmmHitsMap()

void LVL1BS::JepByteStreamTool::setupCmmHitsMap ( const CmmHitsCollection hitCollection,
ConstCmmHitsMap cmmHitsMap 
) const
private

Set up CMM hits map.

Definition at line 1651 of file JepByteStreamTool.cxx.

1654 {
1655  cmmHitsMap.clear();
1656  if (hitCollection) {
1657  CmmHitsCollection::const_iterator pos = hitCollection->begin();
1658  CmmHitsCollection::const_iterator pose = hitCollection->end();
1659  for (; pos != pose; ++pos) {
1660  const LVL1::CMMJetHits* const hits = *pos;
1661  const int crate = hits->crate() - m_crateOffsetSw;
1662  const int key = crate * 100 + hits->dataID();
1663  cmmHitsMap.insert(std::make_pair(key, hits));
1664  }
1665  }
1666 }

◆ setupEtMap()

void LVL1BS::JepByteStreamTool::setupEtMap ( const EnergySumsCollection enCollection,
ConstEnergySumsMap etMap 
) const
private

Set up energy sums map.

Definition at line 1632 of file JepByteStreamTool.cxx.

1635 {
1636  etMap.clear();
1637  if (etCollection) {
1638  EnergySumsCollection::const_iterator pos = etCollection->begin();
1639  EnergySumsCollection::const_iterator pose = etCollection->end();
1640  for (; pos != pose; ++pos) {
1641  const LVL1::JEMEtSums* const sums = *pos;
1642  const int crate = sums->crate() - m_crateOffsetSw;
1643  const int key = m_modules * crate + sums->module();
1644  etMap.insert(std::make_pair(key, sums));
1645  }
1646  }
1647 }

◆ setupHitsMap()

void LVL1BS::JepByteStreamTool::setupHitsMap ( const JetHitsCollection hitCollection,
ConstJetHitsMap hitsMap 
) const
private

Set up jet hits map.

Definition at line 1613 of file JepByteStreamTool.cxx.

1616 {
1617  hitsMap.clear();
1618  if (hitCollection) {
1619  JetHitsCollection::const_iterator pos = hitCollection->begin();
1620  JetHitsCollection::const_iterator pose = hitCollection->end();
1621  for (; pos != pose; ++pos) {
1622  const LVL1::JEMHits* const hits = *pos;
1623  const int crate = hits->crate() - m_crateOffsetSw;
1624  const int key = m_modules * crate + hits->module();
1625  hitsMap.insert(std::make_pair(key, hits));
1626  }
1627  }
1628 }

◆ setupJeMap()

void LVL1BS::JepByteStreamTool::setupJeMap ( const JetElementCollection jeCollection,
ConstJetElementMap jeMap,
LVL1::JetElementKey elementKey 
) const
private

Set up jet element map.

Definition at line 1594 of file JepByteStreamTool.cxx.

1598 {
1599  jeMap.clear();
1600  if (jeCollection) {
1602  JetElementCollection::const_iterator pose = jeCollection->end();
1603  for (; pos != pose; ++pos) {
1604  const LVL1::JetElement* const je = *pos;
1605  const unsigned int key = elementKey.jeKey(je->phi(), je->eta());
1606  jeMap.insert(std::make_pair(key, je));
1607  }
1608  }
1609 }

◆ slinkSlices()

bool LVL1BS::JepByteStreamTool::slinkSlices ( int  crate,
int  module,
int  modulesPerSlink,
int &  timeslices,
int &  trigJem,
const ConstJetElementMap jeMap,
const ConstJetHitsMap hitsMap,
const ConstEnergySumsMap etMap,
const ConstCmmHitsMap cmmHitsMap,
const ConstCmmSumsMap cmmEtMap,
LVL1::JetElementKey elementKey 
) const
private

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

Definition at line 1689 of file JepByteStreamTool.cxx.

1699 {
1700  int slices = -1;
1701  int trigJ = m_dfltSlices / 2;
1702  for (int mod = module; mod < module + modulesPerSlink; ++mod) {
1703  for (int chan = 0; chan < m_channels; ++chan) {
1704  double eta = 0.;
1705  double phi = 0.;
1706  int layer = 0;
1707  if ( !m_jemMaps->mapping(crate, mod, chan, eta, phi, layer)) continue;
1708  const LVL1::JetElement* const je = findJetElement(eta, phi, jeMap, elementKey);
1709  if ( !je ) continue;
1710  const int numdat = 5;
1711  std::vector<int> sums(numdat);
1712  std::vector<int> sizes(numdat);
1713  sums[0] = std::accumulate((je->emEnergyVec()).begin(),
1714  (je->emEnergyVec()).end(), 0);
1715  sums[1] = std::accumulate((je->hadEnergyVec()).begin(),
1716  (je->hadEnergyVec()).end(), 0);
1717  sums[2] = std::accumulate((je->emErrorVec()).begin(),
1718  (je->emErrorVec()).end(), 0);
1719  sums[3] = std::accumulate((je->hadErrorVec()).begin(),
1720  (je->hadErrorVec()).end(), 0);
1721  sums[4] = std::accumulate((je->linkErrorVec()).begin(),
1722  (je->linkErrorVec()).end(), 0);
1723  sizes[0] = (je->emEnergyVec()).size();
1724  sizes[1] = (je->hadEnergyVec()).size();
1725  sizes[2] = (je->emErrorVec()).size();
1726  sizes[3] = (je->hadErrorVec()).size();
1727  sizes[4] = (je->linkErrorVec()).size();
1728  const int peak = je->peak();
1729  for (int i = 0; i < numdat; ++i) {
1730  if (sums[i] == 0) continue;
1731  if (slices < 0) {
1732  slices = sizes[i];
1733  trigJ = peak;
1734  } else if (slices != sizes[i] || trigJ != peak) return false;
1735  }
1736  }
1737  const LVL1::JEMHits* const hits = findJetHits(crate, mod, hitsMap);
1738  if (hits) {
1739  const unsigned int sum = std::accumulate((hits->JetHitsVec()).begin(),
1740  (hits->JetHitsVec()).end(), 0);
1741  if (sum) {
1742  const int size = (hits->JetHitsVec()).size();
1743  const int peak = hits->peak();
1744  if (slices < 0) {
1745  slices = size;
1746  trigJ = peak;
1747  } else if (slices != size || trigJ != peak) return false;
1748  }
1749  }
1750  const LVL1::JEMEtSums* const et = findEnergySums(crate, mod, etMap);
1751  if (et) {
1752  const int numdat = 3;
1753  std::vector<unsigned int> sums(numdat);
1754  std::vector<int> sizes(numdat);
1755  sums[0] = std::accumulate((et->ExVec()).begin(),
1756  (et->ExVec()).end(), 0);
1757  sums[1] = std::accumulate((et->EyVec()).begin(),
1758  (et->EyVec()).end(), 0);
1759  sums[2] = std::accumulate((et->EtVec()).begin(),
1760  (et->EtVec()).end(), 0);
1761  sizes[0] = (et->ExVec()).size();
1762  sizes[1] = (et->EyVec()).size();
1763  sizes[2] = (et->EtVec()).size();
1764  const int peak = et->peak();
1765  for (int i = 0; i < numdat; ++i) {
1766  if (sums[i] == 0) continue;
1767  if (slices < 0) {
1768  slices = sizes[i];
1769  trigJ = peak;
1770  } else if (slices != sizes[i] || trigJ != peak) return false;
1771  }
1772  }
1773  }
1774  // CMM last slink of crate
1775  if (module / modulesPerSlink == m_slinks - 1) {
1776  const int maxDataID1 = LVL1::CMMJetHits::MAXID;
1777  const int maxDataID2 = LVL1::CMMEtSums::MAXID;
1778  const int maxDataID = (maxDataID1 > maxDataID2) ? maxDataID1 : maxDataID2;
1779  for (int dataID = 0; dataID < maxDataID; ++dataID) {
1780  const int numdat = 6;
1781  std::vector<unsigned int> sums(numdat);
1782  std::vector<int> sizes(numdat);
1783  const LVL1::CMMJetHits* hits = 0;
1784  if (dataID < maxDataID1) hits = findCmmHits(crate, dataID, cmmHitsMap);
1785  if (hits) {
1786  sums[0] = std::accumulate((hits->HitsVec()).begin(),
1787  (hits->HitsVec()).end(), 0);
1788  sums[1] = std::accumulate((hits->ErrorVec()).begin(),
1789  (hits->ErrorVec()).end(), 0);
1790  sizes[0] = (hits->HitsVec()).size();
1791  sizes[1] = (hits->ErrorVec()).size();
1792  const int peak = hits->peak();
1793  for (int i = 0; i < 2; ++i) {
1794  if (sums[i] == 0) continue;
1795  if (slices < 0) {
1796  slices = sizes[i];
1797  trigJ = peak;
1798  } else if (slices != sizes[i] || trigJ != peak) return false;
1799  }
1800  }
1801  const LVL1::CMMEtSums* et = 0;
1802  if (dataID < maxDataID2) et = findCmmSums(crate, dataID, cmmEtMap);
1803  if (et) {
1804  sums[0] = std::accumulate((et->ExVec()).begin(),
1805  (et->ExVec()).end(), 0);
1806  sums[1] = std::accumulate((et->EyVec()).begin(),
1807  (et->EyVec()).end(), 0);
1808  sums[2] = std::accumulate((et->EtVec()).begin(),
1809  (et->EtVec()).end(), 0);
1810  sums[3] = std::accumulate((et->ExErrorVec()).begin(),
1811  (et->ExErrorVec()).end(), 0);
1812  sums[4] = std::accumulate((et->EyErrorVec()).begin(),
1813  (et->EyErrorVec()).end(), 0);
1814  sums[5] = std::accumulate((et->EtErrorVec()).begin(),
1815  (et->EtErrorVec()).end(), 0);
1816  sizes[0] = (et->ExVec()).size();
1817  sizes[1] = (et->EyVec()).size();
1818  sizes[2] = (et->EtVec()).size();
1819  sizes[3] = (et->ExErrorVec()).size();
1820  sizes[4] = (et->EyErrorVec()).size();
1821  sizes[5] = (et->EtErrorVec()).size();
1822  const int peak = et->peak();
1823  for (int i = 0; i < numdat; ++i) {
1824  if (sums[i] == 0) continue;
1825  if (slices < 0) {
1826  slices = sizes[i];
1827  trigJ = peak;
1828  } else if (slices != sizes[i] || trigJ != peak) return false;
1829  }
1830  }
1831  }
1832  }
1833  if (slices < 0) slices = m_dfltSlices;
1834  timeslices = slices;
1835  trigJem = trigJ;
1836  return true;
1837 }

◆ sourceIDs()

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

Return reference to vector with all possible Source Identifiers.

Definition at line 586 of file JepByteStreamTool.cxx.

587 {
588  static const std::vector<uint32_t> sourceIDs = makeSourceIDs();
589  return sourceIDs;
590 }

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

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

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_byteStreamCnvSvc

ServiceHandle<ByteStreamCnvSvc> LVL1BS::JepByteStreamTool::m_byteStreamCnvSvc { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" }
private

Definition at line 98 of file JepByteStreamTool.h.

◆ m_channels

const int LVL1BS::JepByteStreamTool::m_channels
private

Number of channels per module.

Definition at line 272 of file JepByteStreamTool.h.

◆ m_crateOffsetHw

int LVL1BS::JepByteStreamTool::m_crateOffsetHw
private

Property: Hardware crate number offset.

Definition at line 264 of file JepByteStreamTool.h.

◆ m_crateOffsetSw

int LVL1BS::JepByteStreamTool::m_crateOffsetSw
private

Property: Software crate number offset.

Definition at line 266 of file JepByteStreamTool.h.

◆ m_crates

const int LVL1BS::JepByteStreamTool::m_crates
private

Number of crates.

Definition at line 274 of file JepByteStreamTool.h.

◆ m_dataFormat

int LVL1BS::JepByteStreamTool::m_dataFormat
private

Property: Data compression format.

Definition at line 270 of file JepByteStreamTool.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::JepByteStreamTool::m_dfltSlices
private

Property: Default number of slices in simulation.

Definition at line 280 of file JepByteStreamTool.h.

◆ m_errorTool

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

Error collection tool.

Definition at line 261 of file JepByteStreamTool.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::JepByteStreamTool::m_forceSlices
private

Property: Force number of slices in bytestream.

Definition at line 282 of file JepByteStreamTool.h.

◆ m_jemMaps

ToolHandle<LVL1::IL1CaloMappingTool> LVL1BS::JepByteStreamTool::m_jemMaps
private

Property: Channel mapping tool.

Definition at line 259 of file JepByteStreamTool.h.

◆ m_modules

const int LVL1BS::JepByteStreamTool::m_modules
private

Number of JEM modules per crate.

Definition at line 276 of file JepByteStreamTool.h.

◆ m_slinks

int LVL1BS::JepByteStreamTool::m_slinks
private

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

Definition at line 278 of file JepByteStreamTool.h.

◆ m_sourceIDsProp

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

Property: ROB source IDs.

Definition at line 284 of file JepByteStreamTool.h.

◆ m_srcIdMap

const L1CaloSrcIdMap LVL1BS::JepByteStreamTool::m_srcIdMap
private

Source ID converter.

Definition at line 288 of file JepByteStreamTool.h.

◆ m_subDetector

const eformat::SubDetector LVL1BS::JepByteStreamTool::m_subDetector
private

Sub-detector type.

Definition at line 286 of file JepByteStreamTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_version

int LVL1BS::JepByteStreamTool::m_version
private

Property: Sub_block header version.

Definition at line 268 of file JepByteStreamTool.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
LVL1BS::CmmSubBlock::cmmType
static CmmFirmwareCode cmmType(uint32_t word)
CMM differentiation (CMM_CP, CMM_JET, or CMM_ENERGY)
Definition: CmmSubBlock.cxx:60
LVL1::CMMJetHits::LOCAL_FORWARD
@ LOCAL_FORWARD
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMJetHits.h:36
LVL1BS::JepByteStreamTool::m_byteStreamCnvSvc
ServiceHandle< ByteStreamCnvSvc > m_byteStreamCnvSvc
Definition: JepByteStreamTool.h:99
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
LVL1BS::JepByteStreamTool::JET_ELEMENTS
@ JET_ELEMENTS
Definition: JepByteStreamTool.h:127
LVL1::JEPBSCollection::JetHits
const DataVector< JEMHits > * JetHits() const
Return pointer to hit sums collection.
Definition: JEPBSCollection.h:66
et
Extra patterns decribing particle interation process.
LVL1BS::CmmJetSubBlock::TOTAL_MAIN
@ TOTAL_MAIN
Definition: CmmJetSubBlock.h:26
LVL1::DataError::LinkDown
@ LinkDown
Definition: DataError.h:31
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
LVL1BS::CmmSubBlock::RIGHT
@ RIGHT
Definition: CmmSubBlock.h:28
LVL1BS::L1CaloSubBlock::ERROR_MISSING_HEADER
@ ERROR_MISSING_HEADER
Definition: L1CaloSubBlock.h:33
LVL1BS::CmmSubBlock::CMM_JET
@ CMM_JET
Definition: CmmSubBlock.h:25
LVL1BS::JepByteStreamTool::m_subDetector
const eformat::SubDetector m_subDetector
Sub-detector type.
Definition: JepByteStreamTool.h:286
LVL1BS::JepByteStreamTool::m_dataFormat
int m_dataFormat
Property: Data compression format.
Definition: JepByteStreamTool.h:270
LVL1::DataError
Error data.
Definition: DataError.h:27
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LVL1::JetElement::emEnergyVec
const std::vector< int > & emEnergyVec() const
Return data for all slices.
Definition: JetElement.cxx:245
LVL1::CMMEtSums::SUM_ET_MAP
@ SUM_ET_MAP
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMEtSums.h:37
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
LVL1::JetElement::addSlice
void addSlice(int slice, int emEnergy, int hadEnergy, int emError, int hadError, int linkError)
add data for one timeslice.
Definition: JetElement.cxx:174
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition: FullEventAssembler.h:40
LVL1::JetElementKeyBase::jeKey
virtual unsigned int jeKey(const xAOD::TriggerTower &tower)
returns key of passed tower
Definition: JetElementKeyBase.cxx:157
LVL1BS::CmmSubBlock::CRATE
@ CRATE
Definition: CmmSubBlock.h:27
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
DataVector< LVL1::CMMEtSums >::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
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
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::CMMEtSums
CMMEtSums object stores Et sums from the Energy CMMs.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMEtSums.h:33
LVL1BS::L1CaloSubBlock::ERROR_DUPLICATE_ROB
@ ERROR_DUPLICATE_ROB
Definition: L1CaloSubBlock.h:31
LVL1BS::JepByteStreamTool::CMM_HITS
@ CMM_HITS
Definition: JepByteStreamTool.h:128
LVL1::JetElement::peak
int peak() const
return triggered slice offset
Definition: JetElement.cxx:240
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
LVL1::CMMEtSums::LOCAL
@ LOCAL
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMEtSums.h:36
LVL1BS::CmmSubBlock::cmmBlock
static bool cmmBlock(uint32_t word)
Determine if header word corresponds to CMM.
Definition: CmmSubBlock.cxx:84
LVL1BS::JepByteStreamTool::findCmmSums
const LVL1::CMMEtSums * findCmmSums(int crate, int dataID, const ConstCmmSumsMap &cmmEtMap) const
Find CMM energy sums for given crate, data ID.
Definition: JepByteStreamTool.cxx:1574
LVL1BS::JepByteStreamTool::setupHitsMap
void setupHitsMap(const JetHitsCollection *hitCollection, ConstJetHitsMap &hitsMap) const
Set up jet hits map.
Definition: JepByteStreamTool.cxx:1613
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
LVL1BS::JepByteStreamTool::ConstJetElementMap
std::map< unsigned int, const LVL1::JetElement * > ConstJetElementMap
Definition: JepByteStreamTool.h:136
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
LVL1BS::JepByteStreamTool::decodeCmmEnergy
void decodeCmmEnergy(CmmEnergySubBlock *subBlock, int trigCmm, CmmSumsData &data, LocalData &ld) const
Unpack CMM-Energy sub-block.
Definition: JepByteStreamTool.cxx:797
LVL1::CMMEtSums::ExErrorVec
const std::vector< int > & ExErrorVec() const
returns module Ex errors
Definition: CMMEtSums.cxx:140
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::JEMEtSums::EyVec
const std::vector< unsigned int > & EyVec() const
returns module Ey sum
Definition: JEMEtSums.cxx:103
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
LVL1BS::L1CaloSubBlock::NEUTRAL
@ NEUTRAL
Definition: L1CaloSubBlock.h:28
LVL1::JEMEtSums::module
int module() const
returns module number
Definition: JEMEtSums.cxx:73
LVL1BS::JepByteStreamTool::ROBIterator
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Definition: JepByteStreamTool.h:145
LVL1::CMMEtSums::EyErrorVec
const std::vector< int > & EyErrorVec() const
returns module Ey errors
Definition: CMMEtSums.cxx:145
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LVL1::CMMEtSums::REMOTE
@ REMOTE
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMEtSums.h:36
LVL1::CMMJetHits::TOTAL_MAIN
@ TOTAL_MAIN
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMJetHits.h:35
LVL1BS::JepByteStreamTool::m_crateOffsetSw
int m_crateOffsetSw
Property: Software crate number offset.
Definition: JepByteStreamTool.h:266
LVL1BS::CmmEnergySubBlock::TOTAL
@ TOTAL
Definition: CmmEnergySubBlock.h:26
LVL1BS::CmmEnergySubBlock::REMOTE
@ REMOTE
Definition: CmmEnergySubBlock.h:26
LVL1::JEMEtSums::addEy
void addEy(const std::vector< unsigned int > &Ey)
Update Ey sum.
Definition: JEMEtSums.cxx:123
LVL1::CMMJetHits::REMOTE_FORWARD
@ REMOTE_FORWARD
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMJetHits.h:36
LVL1BS::L1CaloSubBlock::HEADER
@ HEADER
Definition: L1CaloSubBlock.h:27
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LVL1BS::CmmJetSubBlock::LOCAL_FORWARD
@ LOCAL_FORWARD
Definition: CmmJetSubBlock.h:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
LVL1BS::JepByteStreamTool::m_crates
const int m_crates
Number of crates.
Definition: JepByteStreamTool.h:274
LVL1::CMMEtSums::dataID
int dataID() const
returns data ID
Definition: CMMEtSums.cxx:85
LVL1BS::JepByteStreamTool::m_jemMaps
ToolHandle< LVL1::IL1CaloMappingTool > m_jemMaps
Property: Channel mapping tool.
Definition: JepByteStreamTool.h:259
LVL1::CMMEtSums::MAXID
@ MAXID
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMEtSums.h:37
LVL1::DataError::SubStatusWord
@ SubStatusWord
Definition: DataError.h:44
LVL1BS::JepByteStreamTool::setupCmmEtMap
void setupCmmEtMap(const CmmSumsCollection *enCollection, ConstCmmSumsMap &cmmEtMap) const
Set up CMM energy sums map.
Definition: JepByteStreamTool.cxx:1670
LVL1::JetElement::hadEnergyVec
const std::vector< int > & hadEnergyVec() const
return Had energy vector reference (all timeslices)
Definition: JetElement.cxx:250
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
python.PyAthena.module
module
Definition: PyAthena.py:134
LVL1BS::JepByteStreamTool::decodeCmmJet
void decodeCmmJet(CmmJetSubBlock *subBlock, int trigCmm, CmmHitsData &data, LocalData &ld) const
Unpack CMM-Jet sub-block.
Definition: JepByteStreamTool.cxx:1091
LVL1BS::JepByteStreamTool::CMM_SUMS
@ CMM_SUMS
Definition: JepByteStreamTool.h:128
LVL1BS::L1CaloSubBlock::ERROR_ROD_ID
@ ERROR_ROD_ID
Definition: L1CaloSubBlock.h:31
LVL1BS::JepByteStreamTool::findJetHits
const LVL1::JEMHits * findJetHits(int crate, int module, const ConstJetHitsMap &hitsMap) const
Find jet hits for given crate, module.
Definition: JepByteStreamTool.cxx:1511
AthCommonDataStore
Definition: AthCommonDataStore.h:52
LVL1BS::CmmJetSubBlock::REMOTE_FORWARD
@ REMOTE_FORWARD
Definition: CmmJetSubBlock.h:27
LVL1::JetElement
Jet elements are the inputs to the Jet, ETmiss and ETsum triggers.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/JetElement.h:43
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
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
LVL1::JEMEtSums::crate
int crate() const
returns crate number
Definition: JEMEtSums.cxx:68
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::CmmJetSubBlock::LOCAL_MAIN
@ LOCAL_MAIN
Definition: CmmJetSubBlock.h:26
LVL1BS::JepByteStreamTool::setupEtMap
void setupEtMap(const EnergySumsCollection *enCollection, ConstEnergySumsMap &etMap) const
Set up energy sums map.
Definition: JepByteStreamTool.cxx:1632
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
LVL1::CMMEtSums::addEt
void addEt(const std::vector< unsigned int > &Et, const std::vector< int > &EtError)
Add data to existing objects.
Definition: CMMEtSums.cxx:150
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:92
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
LVL1::JEPBSCollection::JetElements
const DataVector< JetElement > * JetElements() const
Return pointer to jet element collection.
Definition: JEPBSCollection.h:61
LVL1BS::L1CaloSubBlock::ERROR_DUPLICATE_DATA
@ ERROR_DUPLICATE_DATA
Definition: L1CaloSubBlock.h:35
LVL1::JEMHits::JetHitsVec
const std::vector< unsigned int > & JetHitsVec() const
returns jet hits
Definition: JEMHits.cxx:75
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1::CMMEtSums::EyVec
const std::vector< unsigned int > & EyVec() const
returns module Ey sum
Definition: CMMEtSums.cxx:130
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
LVL1::JEMHits::addJetHits
void addJetHits(const std::vector< unsigned int > &hits)
Set Jet hits.
Definition: JEMHits.cxx:85
LVL1::CMMJetHits::MAXID
@ MAXID
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMJetHits.h:37
master.flag
bool flag
Definition: master.py:29
LVL1BS::JepByteStreamTool::ConstJetHitsMap
std::map< int, const LVL1::JEMHits * > ConstJetHitsMap
Definition: JepByteStreamTool.h:138
LVL1::CMMJetHits::REMOTE_MAIN
@ REMOTE_MAIN
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMJetHits.h:35
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1BS::JepByteStreamTool::m_srcIdMap
const L1CaloSrcIdMap m_srcIdMap
Source ID converter.
Definition: JepByteStreamTool.h:288
LVL1BS::JepByteStreamTool::m_slinks
int m_slinks
Property: Number of slinks per crate when writing out bytestream.
Definition: JepByteStreamTool.h:278
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
LVL1BS::L1CaloSubBlock::ERROR_NONE
@ ERROR_NONE
Definition: L1CaloSubBlock.h:31
LVL1::CMMEtSums::EtVec
const std::vector< unsigned int > & EtVec() const
Access multi-slice data.
Definition: CMMEtSums.cxx:120
LVL1::DataError::Parity
@ Parity
Definition: DataError.h:31
LVL1BS::JepByteStreamTool::m_modules
const int m_modules
Number of JEM modules per crate.
Definition: JepByteStreamTool.h:276
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
LVL1::CMMEtSums::addEy
void addEy(const std::vector< unsigned int > &Ey, const std::vector< int > &EyError)
Update Ey sum.
Definition: CMMEtSums.cxx:164
LVL1::JetElement::eta
double eta() const
Eta of centre of JetElement.
Definition: JetElement.cxx:82
LVL1BS::L1CaloSubBlock::wordType
static SubBlockWordType wordType(uint32_t word)
Word identification.
Definition: L1CaloSubBlock.cxx:479
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
LVL1::JEPBSCollection::CmmHits
const DataVector< CMMJetHits > * CmmHits() const
Return pointer to CMM hit sums collection.
Definition: JEPBSCollection.h:76
LVL1::DataError::error
int error() const
Return the full error word.
Definition: DataError.h:78
LVL1::CMMJetHits::ET_MAP
@ ET_MAP
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMJetHits.h:37
LVL1::CMMJetHits::LOCAL_MAIN
@ LOCAL_MAIN
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMJetHits.h:35
LVL1::JEPBSCollection::CmmSums
const DataVector< CMMEtSums > * CmmSums() const
Return pointer to CMM energy sums collection.
Definition: JEPBSCollection.h:81
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
LVL1BS::CmmJetSubBlock::TOTAL_FORWARD
@ TOTAL_FORWARD
Definition: CmmJetSubBlock.h:27
LVL1BS::JepByteStreamTool::ConstEnergySumsMap
std::map< int, const LVL1::JEMEtSums * > ConstEnergySumsMap
Definition: JepByteStreamTool.h:140
LVL1::JetElementKey
The JetElementKey object provides the key for each JetElement depending on its eta,...
Definition: JetElementKey.h:51
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
LVL1::CMMJetHits::addHits
void addHits(const std::vector< unsigned int > &hits, const std::vector< int > &errors)
Add hits to existing object.
Definition: CMMJetHits.cxx:93
LVL1BS::JepByteStreamTool::setupJeMap
void setupJeMap(const JetElementCollection *jeCollection, ConstJetElementMap &jeMap, LVL1::JetElementKey &elementKey) const
Set up jet element map.
Definition: JepByteStreamTool.cxx:1594
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
LVL1::JEMEtSums::ExVec
const std::vector< unsigned int > & ExVec() const
returns module Ex sum
Definition: JEMEtSums.cxx:98
LVL1::CMMEtSums::crate
int crate() const
Data accessors.
Definition: CMMEtSums.cxx:80
LVL1BS::JepByteStreamTool::decodeJem
void decodeJem(JemSubBlock *subBlock, int trigJem, JepByteStreamToolData &data, LocalData &ld) const
Unpack JEM sub-block.
Definition: JepByteStreamTool.cxx:1263
LVL1::JetElement::hadErrorVec
const std::vector< int > & hadErrorVec() const
return Had error vector reference (all timeslices)
Definition: JetElement.cxx:260
LVL1BS::JepByteStreamTool::findCmmHits
const LVL1::CMMJetHits * findCmmHits(int crate, int dataID, const ConstCmmHitsMap &cmmHitsMap) const
Find CMM hits for given crate, data ID.
Definition: JepByteStreamTool.cxx:1553
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
LVL1BS::JepByteStreamTool::m_forceSlices
int m_forceSlices
Property: Force number of slices in bytestream.
Definition: JepByteStreamTool.h:282
LVL1BS::JepByteStreamTool::ConstCmmSumsMap
std::map< int, const LVL1::CMMEtSums * > ConstCmmSumsMap
Definition: JepByteStreamTool.h:144
LVL1BS::JepByteStreamTool::makeSourceIDs
std::vector< uint32_t > makeSourceIDs() const
Definition: JepByteStreamTool.cxx:561
LVL1BS::JepByteStreamTool::RODPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
Definition: JepByteStreamTool.h:147
LVL1BS::JepByteStreamTool::slinkSlices
bool slinkSlices(int crate, int module, int modulesPerSlink, int &timeslices, int &trigJem, const ConstJetElementMap &jeMap, const ConstJetHitsMap &hitsMap, const ConstEnergySumsMap &etMap, const ConstCmmHitsMap &cmmHitsMap, const ConstCmmSumsMap &cmmEtMap, LVL1::JetElementKey &elementKey) const
Get number of slices and triggered slice offset for next slink.
Definition: JepByteStreamTool.cxx:1689
LVL1BS::JepByteStreamTool::convertBs
StatusCode convertBs(const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, JepByteStreamToolData &data) const
Convert bytestream to given container type.
Definition: JepByteStreamTool.cxx:594
LVL1BS::JepByteStreamTool::m_sourceIDsProp
std::vector< uint32_t > m_sourceIDsProp
Property: ROB source IDs.
Definition: JepByteStreamTool.h:284
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
LVL1BS::JepByteStreamTool::JET_HITS
@ JET_HITS
Definition: JepByteStreamTool.h:127
LVL1BS::L1CaloSrcIdMap::subDet
eformat::SubDetector subDet(uint32_t code) const
Return sub-detector for given ID.
Definition: L1CaloSrcIdMap.cxx:84
LVL1BS::CmmEnergySubBlock::LOCAL
@ LOCAL
Definition: CmmEnergySubBlock.h:26
LVL1BS::JepByteStreamTool::m_errorTool
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_errorTool
Error collection tool.
Definition: JepByteStreamTool.h:261
LVL1BS::CmmSubBlock::SYSTEM
@ SYSTEM
Definition: CmmSubBlock.h:27
LVL1::CMMJetHits::TOTAL_FORWARD
@ TOTAL_FORWARD
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMJetHits.h:36
DeMoScan.index
string index
Definition: DeMoScan.py:362
a
TList * a
Definition: liststreamerinfos.cxx:10
h
LVL1BS::CmmJetSubBlock::MAX_SOURCE_ID
@ MAX_SOURCE_ID
Definition: CmmJetSubBlock.h:28
LVL1::JEPBSCollection::EnergySums
const DataVector< JEMEtSums > * EnergySums() const
Return pointer to energy sums collection.
Definition: JEPBSCollection.h:71
LVL1::JEMEtSums::addEt
void addEt(const std::vector< unsigned int > &Et)
Update ET sum.
Definition: JEMEtSums.cxx:113
LVL1::CMMEtSums::addEx
void addEx(const std::vector< unsigned int > &Ex, const std::vector< int > &ExError)
Update Ex sum.
Definition: CMMEtSums.cxx:157
LVL1BS::JepByteStreamTool::findJetElement
const LVL1::JetElement * findJetElement(double eta, double phi, const ConstJetElementMap &jeMap, LVL1::JetElementKey &elementKey) const
Find a jet element given eta, phi.
Definition: JepByteStreamTool.cxx:1486
FullEventAssembler::setRodMinorVersion
void setRodMinorVersion(uint16_t m)
change the ROD minor version
LVL1::CMMEtSums::MISSING_ET_SIG_MAP
@ MISSING_ET_SIG_MAP
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMEtSums.h:37
LVL1::JEMEtSums
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/JEMEtSums.h:27
LVL1::JetElement::phi
double phi() const
Phi of centre of JetElement.
Definition: JetElement.cxx:87
LVL1BS::CmmSubBlock::CMM_ENERGY
@ CMM_ENERGY
Definition: CmmSubBlock.h:25
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1BS::JepByteStreamTool::m_dfltSlices
int m_dfltSlices
Property: Default number of slices in simulation.
Definition: JepByteStreamTool.h:280
LVL1BS::L1CaloSubBlock::ERROR_SLICES
@ ERROR_SLICES
Definition: L1CaloSubBlock.h:35
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LVL1BS::CmmSubBlock::LEFT
@ LEFT
Definition: CmmSubBlock.h:28
LVL1::JEMHits
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/JEMHits.h:27
LVL1BS::JepByteStreamTool::m_channels
const int m_channels
Number of channels per module.
Definition: JepByteStreamTool.h:272
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
LVL1::CMMJetHits
CMMJetHits class stores Jet hit multiplicities received by and read out from the Jet CMMs.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMJetHits.h:32
LVL1BS::JepByteStreamTool::sourceIDs
const std::vector< uint32_t > & sourceIDs() const
Return reference to vector with all possible Source Identifiers.
Definition: JepByteStreamTool.cxx:586
LVL1BS::CmmEnergySubBlock::MAX_SOURCE_ID
@ MAX_SOURCE_ID
Definition: CmmEnergySubBlock.h:26
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
LVL1::CMMEtSums::MISSING_ET_MAP
@ MISSING_ET_MAP
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMEtSums.h:37
LVL1BS::JepByteStreamTool::ENERGY_SUMS
@ ENERGY_SUMS
Definition: JepByteStreamTool.h:127
LVL1::JEMEtSums::EtVec
const std::vector< unsigned int > & EtVec() const
returns module ET sum
Definition: JEMEtSums.cxx:93
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
LVL1::JEMEtSums::addEx
void addEx(const std::vector< unsigned int > &Ex)
Update Ex sum.
Definition: JEMEtSums.cxx:118
LVL1BS::JepByteStreamTool::findEnergySums
const LVL1::JEMEtSums * findEnergySums(int crate, int module, const ConstEnergySumsMap &etMap) const
Find energy sums for given crate, module.
Definition: JepByteStreamTool.cxx:1532
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
LVL1::JetElement::emErrorVec
const std::vector< int > & emErrorVec() const
return Em error vector reference (all timeslices)
Definition: JetElement.cxx:255
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
LVL1BS::CmmJetSubBlock::REMOTE_MAIN
@ REMOTE_MAIN
Definition: CmmJetSubBlock.h:26
LVL1::CMMEtSums::EtErrorVec
const std::vector< int > & EtErrorVec() const
returns module ET errors
Definition: CMMEtSums.cxx:135
LVL1::JetElement::linkErrorVec
const std::vector< int > & linkErrorVec() const
return link error vector reference (all timeslices)
Definition: JetElement.cxx:265
LVL1BS::L1CaloSrcIdMap::maxSlinks
int maxSlinks() const
Return the maximum possible number of slinks.
Definition: L1CaloSrcIdMap.cxx:77
LVL1BS::JepByteStreamTool::m_crateOffsetHw
int m_crateOffsetHw
Property: Hardware crate number offset.
Definition: JepByteStreamTool.h:264
LVL1::CMMEtSums::TOTAL
@ TOTAL
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMEtSums.h:36
LVL1BS::L1CaloUserHeader::isValid
static bool isValid(uint32_t word)
Test for valid header word.
Definition: L1CaloUserHeader.cxx:36
LVL1BS::JepByteStreamTool::ConstCmmHitsMap
std::map< int, const LVL1::CMMJetHits * > ConstCmmHitsMap
Definition: JepByteStreamTool.h:142
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
LVL1BS::JepByteStreamTool::ROBPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
Definition: JepByteStreamTool.h:146
geometry_dat_to_json.ld
ld
Definition: geometry_dat_to_json.py:14
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
keylayer_zslicemap.slices
slices
Definition: keylayer_zslicemap.py:112
LVL1BS::JepByteStreamTool::setupCmmHitsMap
void setupCmmHitsMap(const CmmHitsCollection *hitCollection, ConstCmmHitsMap &cmmHitsMap) const
Set up CMM hits map.
Definition: JepByteStreamTool.cxx:1651
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::CMMEtSums::ExVec
const std::vector< unsigned int > & ExVec() const
returns module Ex sum
Definition: CMMEtSums.cxx:125
LVL1::CMMJetHits::HitsVec
const std::vector< unsigned int > & HitsVec() const
Multi-slice accessors.
Definition: CMMJetHits.cxx:83
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
LVL1::CMMJetHits::ErrorVec
const std::vector< int > & ErrorVec() const
returns errors
Definition: CMMJetHits.cxx:88
LVL1BS::JepByteStreamTool::m_version
int m_version
Property: Sub_block header version.
Definition: JepByteStreamTool.h:268