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

Tool to perform ROB fragments to trigger towers and trigger towers to raw data conversions. More...

#include <PpmByteStreamV1Tool.h>

Inheritance diagram for LVL1BS::PpmByteStreamV1Tool:
Collaboration diagram for LVL1BS::PpmByteStreamV1Tool:

Classes

struct  SlotData
 

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

Private Types

typedef DataVector< LVL1::TriggerTowerTriggerTowerCollection
 
typedef std::vector< LVL1::TriggerTower * > TriggerTowerVector
 
typedef std::map< unsigned int, int > TriggerTowerMap
 
typedef std::map< unsigned int, const LVL1::TriggerTower * > TriggerTowerMapConst
 
typedef std::vector< uint32_t > ChannelBitVector
 
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

void addCompStats (const std::vector< uint32_t > &stats) const
 Add compression stats to totals. More...
 
void printCompStats () const
 Print compression stats. More...
 
const LVL1::TriggerTowerfindLayerTriggerTower (double eta, double phi, int layer, const TriggerTowerMapConst &ttEmMap, const TriggerTowerMapConst &ttHadMap, LVL1::TriggerTowerKey &towerKey) const
 Find a trigger tower using separate layer maps. More...
 
void setupTTMaps (const TriggerTowerCollection *ttCollection, TriggerTowerMapConst &ttEmMap, TriggerTowerMapConst &ttHadMap, LVL1::TriggerTowerKey &towerKey) const
 Set up separate Em and Had trigger tower maps. More...
 
bool slinkSlices (int crate, int module, int modulesPerSlink, int &slicesLut, int &slicesFadc, int &trigLut, int &trigFadc, const TriggerTowerMapConst &ttEmMap, const TriggerTowerMapConst &ttHadMap, LVL1::TriggerTowerKey &towerKey) const
 Get number of slices and triggered slice offsets for next slink. More...
 
std::vector< uint32_t > makeSourceIDs (bool spareChannels, bool muonChannels) const
 
void printVec (const std::vector< int > &vec) const
 Print a vector. 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

SG::SlotSpecificObj< SlotData > m_slotData ATLAS_THREAD_SAFE
 
ToolHandle< LVL1::IL1CaloMappingToolm_ppmMaps
 Property: Channel mapping tool. More...
 
ToolHandle< LVL1BS::L1CaloErrorByteStreamToolm_errorTool
 Property: Error collection tool. More...
 
ServiceHandle< SegMemSvcm_sms
 Memory pool service. More...
 
const int m_version
 Sub_block header version. More...
 
int m_dataFormat
 Property: Data compression format. More...
 
const int m_compVers
 Compression version. More...
 
int m_printCompStats
 Property: Compression statistics print flag. More...
 
int m_slinks
 Property: Number of slinks per crate when writing out bytestream. More...
 
int m_dfltSlicesLut
 Property: Default number of LUT slices in simulation. More...
 
int m_dfltSlicesFadc
 Property: Default number of FADC slices in simulation. More...
 
int m_forceSlicesLut
 Property: Force number of LUT slices in bytestream. More...
 
int m_forceSlicesFadc
 Property: Force number of FADC slices in bytestream. More...
 
int m_crateMin
 Property: Minimum crate number when writing out bytestream. More...
 
int m_crateMax
 Property: Maximum crate number when writing out bytestream. More...
 
int m_pedestal
 Property: Pedestal value. More...
 
int m_fadcBaseline
 Property: FADC baseline lower bound. More...
 
int m_fadcThreshold
 Property: FADC threshold for super-compressed format. More...
 
int m_zeroSuppress
 Property: Zero suppression on input. 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...
 
std::atomic< uint32_t > m_compStats [MAXFORMATS]
 
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
 

Static Private Attributes

static constexpr unsigned int MAXFORMATS = 10
 Vector for compression statistics. More...
 
static const int s_crates = 8
 
static const int s_modules = 16
 
static const int s_channels = 64
 
static const int s_dataSize = 3584
 

Detailed Description

Tool to perform ROB fragments to trigger towers and trigger towers to raw data conversions.

Based on ROD document version 1_09h.

Author
Peter Faulkner

Definition at line 56 of file PpmByteStreamV1Tool.h.

Member Typedef Documentation

◆ ChannelBitVector

typedef std::vector<uint32_t> LVL1BS::PpmByteStreamV1Tool::ChannelBitVector
private

Definition at line 88 of file PpmByteStreamV1Tool.h.

◆ ROBIterator

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

Definition at line 89 of file PpmByteStreamV1Tool.h.

◆ ROBPointer

Definition at line 90 of file PpmByteStreamV1Tool.h.

◆ RODPointer

Definition at line 91 of file PpmByteStreamV1Tool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TriggerTowerCollection

Definition at line 83 of file PpmByteStreamV1Tool.h.

◆ TriggerTowerMap

typedef std::map<unsigned int, int> LVL1BS::PpmByteStreamV1Tool::TriggerTowerMap
private

Definition at line 85 of file PpmByteStreamV1Tool.h.

◆ TriggerTowerMapConst

Definition at line 87 of file PpmByteStreamV1Tool.h.

◆ TriggerTowerVector

Definition at line 84 of file PpmByteStreamV1Tool.h.

Constructor & Destructor Documentation

◆ PpmByteStreamV1Tool()

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

Definition at line 52 of file PpmByteStreamV1Tool.cxx.

56  m_ppmMaps("LVL1::PpmMappingTool/PpmMappingTool"),
57  m_errorTool("LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
58  m_sms("SegMemSvc/SegMemSvc", name),
59  m_version(1), m_compVers(4),
60  m_subDetector(eformat::TDAQ_CALO_PREPROC)
61 {
62  declareInterface<PpmByteStreamV1Tool>(this);
63 
64  declareProperty("PpmMappingTool", m_ppmMaps,
65  "Crate/Module/Channel to Eta/Phi/Layer mapping tool");
66  declareProperty("ErrorTool", m_errorTool,
67  "Tool to collect errors for monitoring");
68 
69  declareProperty("PrintCompStats", m_printCompStats = 0,
70  "Print compressed format statistics");
71  declareProperty("SlinksPerCrate", m_slinks = 4,
72  "The number of S-Links per crate");
73 
74  // Properties for reading bytestream only
75  declareProperty("ZeroSuppress", m_zeroSuppress = 0,
76  "Only make trigger towers with non-zero EM or Had energy");
77  declareProperty("ROBSourceIDs", m_sourceIDsProp,
78  "ROB fragment source identifiers");
79  declareProperty("PedestalValue", m_pedestal = 10,
80  "Pedestal value - needed for compressed formats 0,1 only");
81 
82  // Properties for writing bytestream only
83  declareProperty("DataFormat", m_dataFormat = 1,
84  "Format identifier (0-3) in sub-block header");
85  declareProperty("FADCBaseline", m_fadcBaseline = 0,
86  "FADC baseline lower bound for compressed formats");
87  declareProperty("FADCThreshold", m_fadcThreshold = 1,
88  "FADC threshold for super-compressed format");
89  declareProperty("SimulSlicesLUT", m_dfltSlicesLut = 1,
90  "The number of LUT slices in the simulation");
91  declareProperty("SimulSlicesFADC", m_dfltSlicesFadc = 7,
92  "The number of FADC slices in the simulation");
93  declareProperty("ForceSlicesLUT", m_forceSlicesLut = 0,
94  "If >0, the number of LUT slices in bytestream");
95  declareProperty("ForceSlicesFADC", m_forceSlicesFadc = 0,
96  "If >0, the number of FADC slices in bytestream");
97  declareProperty("CrateMin", m_crateMin = 0,
98  "Minimum crate number, allows partial output");
99  declareProperty("CrateMax", m_crateMax = s_crates - 1,
100  "Maximum crate number, allows partial output");
101 
102 }

◆ ~PpmByteStreamV1Tool()

LVL1BS::PpmByteStreamV1Tool::~PpmByteStreamV1Tool ( )
virtual

Definition at line 106 of file PpmByteStreamV1Tool.cxx.

107 {
108 }

Member Function Documentation

◆ addCompStats()

void LVL1BS::PpmByteStreamV1Tool::addCompStats ( const std::vector< uint32_t > &  stats) const
private

Add compression stats to totals.

Definition at line 1058 of file PpmByteStreamV1Tool.cxx.

1059 {
1060  if (stats.empty()) return;
1061  const int n = std::min (stats.size(), static_cast<size_t>(MAXFORMATS));
1062  for (int i = 0; i < n; ++i) {
1063  std::atomic<uint32_t>& stat ATLAS_THREAD_SAFE =
1064  const_cast<std::atomic<uint32_t>&> (m_compStats[i]);
1065  stat += stats[i];
1066  }
1067 }

◆ convert() [1/2]

StatusCode LVL1BS::PpmByteStreamV1Tool::convert ( const DataVector< LVL1::TriggerTower > *  ttCollection,
RawEventWrite re 
) const

Convert trigger towers to bytestream.

Definition at line 787 of file PpmByteStreamV1Tool.cxx.

790 {
791  const bool debug = msgLvl(MSG::DEBUG);
792  if (debug) msg(MSG::DEBUG);
793 
794  // Clear the event assembler
796  fea.clear();
797  const uint16_t minorVersion = m_srcIdMap.minorVersionPreLS1();
798  fea.setRodMinorVersion(minorVersion);
799 
800  // Pointer to ROD data vector
801 
803 
804  LVL1::TriggerTowerKey towerKey;
805 
806  // Set up trigger tower maps
807 
808  // Trigger tower map for conversion EM to bytestream
809  TriggerTowerMapConst ttEmMap;
810  // Trigger tower map for conversion Had to bytestream
811  TriggerTowerMapConst ttHadMap;
812  setupTTMaps(ttCollection, ttEmMap, ttHadMap, towerKey);
813 
814  // Create the sub-blocks to do the packing
815 
816  PpmSubBlockV1 subBlock;
817  const int chanPerSubBlock = subBlock.channelsPerSubBlock(m_version,
818  m_dataFormat);
819  if (chanPerSubBlock == 0)
820  {
821  msg(MSG::ERROR) << "Unsupported version/data format: "
822  << m_version << "/" << m_dataFormat << endmsg;
823  return StatusCode::FAILURE;
824  }
825  PpmSubBlockV1 errorBlock;
826 
827  int slicesLut = 1;
828  int slicesFadc = 1;
829  int trigLut = 0;
830  int trigFadc = 0;
831  int slicesLutNew = 1;
832  int slicesFadcNew = 1;
833  int trigLutNew = 0;
834  int trigFadcNew = 0;
835  const int modulesPerSlink = s_modules / m_slinks;
836  for (int crate = m_crateMin; crate <= m_crateMax; ++crate)
837  {
838  for (int module = 0; module < s_modules; ++module)
839  {
840 
841  // Pack required number of modules per slink
842 
843  if (module % modulesPerSlink == 0)
844  {
845  const int daqOrRoi = 0;
846  const int slink = module / modulesPerSlink;
847  if (debug)
848  {
849  msg() << "Treating crate " << crate << " slink " << slink << endmsg;
850  }
851  // Get number of slices and triggered slice offsets
852  // for this slink
853  if ( ! slinkSlices(crate, module, modulesPerSlink,
854  slicesLut, slicesFadc, trigLut, trigFadc,
855  ttEmMap, ttHadMap,
856  towerKey))
857  {
858  msg(MSG::ERROR) << "Inconsistent number of slices or "
859  << "triggered slice offsets in data for crate "
860  << crate << " slink " << slink << endmsg;
861  return StatusCode::FAILURE;
862  }
863  slicesLutNew = (m_forceSlicesLut) ? m_forceSlicesLut : slicesLut;
864  slicesFadcNew = (m_forceSlicesFadc) ? m_forceSlicesFadc : slicesFadc;
865  trigLutNew = ModifySlices::peak(trigLut, slicesLut, slicesLutNew);
866  trigFadcNew = ModifySlices::peak(trigFadc, slicesFadc, slicesFadcNew);
867  if (debug)
868  {
869  msg() << "Data Version/Format: " << m_version
870  << " " << m_dataFormat << endmsg
871  << "LUT slices/offset: " << slicesLut << " " << trigLut;
872  if (slicesLut != slicesLutNew)
873  {
874  msg() << " modified to " << slicesLutNew << " " << trigLutNew;
875  }
876  msg() << endmsg
877  << "FADC slices/offset: " << slicesFadc << " " << trigFadc;
878  if (slicesFadc != slicesFadcNew)
879  {
880  msg() << " modified to " << slicesFadcNew << " " << trigFadcNew;
881  }
882  msg() << endmsg;
883  }
884  L1CaloUserHeader userHeader;
885  userHeader.setPpmLut(trigLutNew);
886  userHeader.setPpmFadc(trigFadcNew);
887  userHeader.setLowerBound(m_fadcBaseline);
888  const uint32_t rodIdPpm = m_srcIdMap.getRodID(crate, slink, daqOrRoi,
889  m_subDetector);
890  theROD = fea.getRodData(rodIdPpm);
891  theROD->push_back(userHeader.header());
892  }
893  if (debug) msg() << "Module " << module << endmsg;
894 
895  // Find trigger towers corresponding to each eta/phi pair and fill
896  // sub-blocks
897 
898  bool upstreamError = false;
899  for (int channel = 0; channel < s_channels; ++channel)
900  {
901  const int chan = channel % chanPerSubBlock;
903  {
904  errorBlock.clear();
905  errorBlock.setPpmErrorHeader(m_version, m_dataFormat, crate,
906  module, slicesFadcNew, slicesLutNew);
907  }
908  if (chan == 0)
909  {
910  subBlock.clear();
912  {
913  subBlock.setPpmHeader(m_version, m_dataFormat, m_compVers, crate,
914  module, slicesFadcNew, slicesLutNew);
915  }
916  else
917  {
918  subBlock.setPpmHeader(m_version, m_dataFormat, channel, crate,
919  module, slicesFadcNew, slicesLutNew);
920  }
921  subBlock.setLutOffset(trigLutNew);
922  subBlock.setFadcOffset(trigFadcNew);
923  subBlock.setFadcBaseline(m_fadcBaseline);
924  subBlock.setFadcThreshold(m_fadcThreshold);
925  }
926  const LVL1::TriggerTower *tt = 0;
927  double eta = 0.;
928  double phi = 0.;
929  int layer = 0;
930  if (m_ppmMaps->mapping(crate, module, channel, eta, phi, layer))
931  {
932  tt = findLayerTriggerTower(eta, phi, layer, ttEmMap, ttHadMap, towerKey);
933  }
934  if (tt )
935  {
936  int err = 0;
937  std::vector<int> lut;
938  std::vector<int> fadc;
939  std::vector<int> bcidLut;
940  std::vector<int> bcidFadc;
941  if (layer == 0) // em
942  {
943  ModifySlices::data(tt->emLUT(), lut, slicesLutNew);
944  ModifySlices::data(tt->emADC(), fadc, slicesFadcNew);
945  ModifySlices::data(tt->emBCIDvec(), bcidLut, slicesLutNew);
946  ModifySlices::data(tt->emBCIDext(), bcidFadc, slicesFadcNew);
947  err = tt->emError();
948  }
949  else // had
950  {
951  ModifySlices::data(tt->hadLUT(), lut, slicesLutNew);
952  ModifySlices::data(tt->hadADC(), fadc, slicesFadcNew);
953  ModifySlices::data(tt->hadBCIDvec(), bcidLut, slicesLutNew);
954  ModifySlices::data(tt->hadBCIDext(), bcidFadc, slicesFadcNew);
955  err = tt->hadError();
956  }
957  subBlock.fillPpmData(channel, lut, fadc, bcidLut, bcidFadc);
958  if (err)
959  {
960  const LVL1::DataError errorBits(err);
961  const int errpp = errorBits.get(LVL1::DataError::PPMErrorWord);
963  {
964  errorBlock.fillPpmError(channel, errpp);
965  }
966  else subBlock.fillPpmError(channel, errpp);
967  if (errpp >> 2) upstreamError = true;
968  }
969  }
970  if (chan == chanPerSubBlock - 1)
971  {
972  // output the packed sub-block
973  if ( !subBlock.pack())
974  {
975  msg(MSG::ERROR) << "PPM sub-block packing failed" << endmsg;
976  return StatusCode::FAILURE;
977  }
978  if (m_printCompStats) addCompStats(subBlock.compStats());
979  if (channel != s_channels - 1)
980  {
981  // Only put errors in last sub-block
982  subBlock.setStatus(0, false, false, false, false,
983  false, false, false);
984  if (debug)
985  {
986  msg() << "PPM sub-block data words: "
987  << subBlock.dataWords() << endmsg;
988  }
989  subBlock.write(theROD);
990  }
991  else
992  {
993  // Last sub-block - write error block
994  bool glinkTimeout = false;
995  bool daqOverflow = false;
996  bool bcnMismatch = false;
997  bool glinkParity = false;
999  {
1000  glinkTimeout = errorBlock.mcmAbsent() ||
1001  errorBlock.timeout();
1002  daqOverflow = errorBlock.asicFull() ||
1003  errorBlock.fpgaCorrupt();
1004  bcnMismatch = errorBlock.eventMismatch() ||
1005  errorBlock.bunchMismatch();
1006  glinkParity = errorBlock.glinkPinParity();
1007  }
1008  else
1009  {
1010  glinkTimeout = subBlock.mcmAbsent() ||
1011  subBlock.timeout();
1012  daqOverflow = subBlock.asicFull() ||
1013  subBlock.fpgaCorrupt();
1014  bcnMismatch = subBlock.eventMismatch() ||
1015  subBlock.bunchMismatch();
1016  glinkParity = subBlock.glinkPinParity();
1017  }
1018  subBlock.setStatus(0, glinkTimeout, false, upstreamError,
1019  daqOverflow, bcnMismatch, false, glinkParity);
1020  if (debug)
1021  {
1022  msg() << "PPM sub-block data words: "
1023  << subBlock.dataWords() << endmsg;
1024  }
1025  subBlock.write(theROD);
1026  // Only uncompressed format has a separate error block
1028  {
1029  if ( ! errorBlock.pack())
1030  {
1031  msg(MSG::ERROR) << "PPM error block packing failed" << endmsg;
1032  return StatusCode::FAILURE;
1033  }
1034  errorBlock.setStatus(0, glinkTimeout, false, upstreamError,
1035  daqOverflow, bcnMismatch, false, glinkParity);
1036  errorBlock.write(theROD);
1037  if (debug)
1038  {
1039  msg() << "PPM error block data words: "
1040  << errorBlock.dataWords() << endmsg;
1041  }
1042  }
1043  }
1044  }
1045  }
1046  }
1047  }
1048 
1049  // Fill the raw event
1050 
1051  fea.fill(re, msg());
1052 
1053  return StatusCode::SUCCESS;
1054 }

◆ convert() [2/2]

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

Convert ROB fragments to trigger towers.

Definition at line 139 of file PpmByteStreamV1Tool.cxx.

143 {
144  const bool debug = msgLvl(MSG::DEBUG);
145  const bool verbose = msgLvl(MSG::VERBOSE);
146  if (debug) msg(MSG::DEBUG);
147 
148  const std::string flag("Spare");
149  const std::string::size_type pos = sgKey.find(flag);
150  bool spareChannels =
151  (pos != std::string::npos && pos == (sgKey.length() - flag.length()));
152  const std::string flag2("Muon");
153  const std::string::size_type pos2 = sgKey.find(flag2);
154  bool muonChannels =
155  (pos2 != std::string::npos && pos2 == (sgKey.length() - flag2.length()));
156  bool dataChannels = (!spareChannels && !muonChannels);
157 
158  // Set up TriggerTower pool and mappings
159  // (NB. This assumes mappings won't change during the course of a job)
160  const int maxChannels = s_crates * s_modules * s_channels;
161  const int chanBitVecSize = maxChannels / 32;
162 
163  SlotData& sd = *m_slotData;
164  std::lock_guard guard (sd.m_mutex);
165 
166  if (sd.m_ttData.empty())
167  {
168  const int spareSize = maxChannels - 2 * s_dataSize;
169  const int muonSize = 2 * s_channels;
170  const int modBitVecSize = (s_crates * s_modules) / 32;
171  sd.m_ttData.reserve(s_dataSize);
172  sd.m_ttSpare.reserve(spareSize);
173  sd.m_ttMuon.reserve(muonSize);
174  sd.m_ttPos.resize(maxChannels);
175  sd.m_chanLayer.resize(chanBitVecSize);
176  sd.m_dataChan.resize(chanBitVecSize);
177  sd.m_spareChan.resize(chanBitVecSize);
178  sd.m_muonChan.resize(chanBitVecSize);
179  sd.m_dataMod.resize(modBitVecSize);
180  sd.m_spareMod.resize(modBitVecSize);
181  sd.m_muonMod.resize(modBitVecSize);
182  TriggerTowerMap ttMap;
184  std::vector<int> dummyS;
185  std::vector<int> dummyL(1);
186  std::vector<int> dummyF(5);
187  int dataCount = 0;
188  int spareCount = 0;
189  for (int crate = 0; crate < s_crates; ++crate)
190  {
191  for (int module = 0; module < s_modules; ++module)
192  {
193  const int index2 = (crate << 4) + module;
194  const int word2 = index2 / 32;
195  const int bit2 = index2 % 32;
196  for (int channel = 0; channel < s_channels; ++channel)
197  {
198  const int index = (crate << 10) + (module << 6) + channel;
199  const int word = index / 32;
200  const int bit = index % 32;
201  double eta = 0.;
202  double phi = 0.;
203  int layer = 0;
204  unsigned int key = 0;
205  if (m_ppmMaps->mapping(crate, module, channel, eta, phi, layer))
206  {
207  // Data channels
208  key = sd.m_towerKey.ttKey(phi, eta);
209  itt = ttMap.find(key);
210  if (itt == ttMap.end())
211  {
213  new (m_sms->allocate<LVL1::TriggerTower>(SegMemSvc::JOB))
214  LVL1::TriggerTower(phi, eta, key,
215  dummyF, dummyL, dummyF, dummyL, 0, 0, 0,
216  dummyF, dummyL, dummyF, dummyL, 0, 0, 0);
217  sd.m_ttData.push_back(tt);
218  const int count = dataCount++;
219  sd.m_ttPos[index] = count;
220  ttMap.insert(std::make_pair(key, count));
221  }
222  else
223  {
224  sd.m_ttPos[index] = itt->second;
225  }
226  sd.m_chanLayer[word] |= (layer << bit);
227  sd.m_dataChan[word] |= (1 << bit);
228  sd.m_dataMod[word2] |= (1 << bit2);
229  }
230  else
231  {
232  // Spare channels
233  const int pin = channel % 16;
234  const int asic = channel / 16;
235  eta = 16 * crate + module;
236  phi = 4 * pin + asic;
237  layer = 0;
238  const int type = 1;
239  key = (crate << 24) | (type << 20) | (module << 16) | (pin << 8) | asic; // CoolID
241  new (m_sms->allocate<LVL1::TriggerTower>(SegMemSvc::JOB))
242  LVL1::TriggerTower(phi, eta, key,
243  dummyF, dummyL, dummyF, dummyL, 0, 0, 0,
244  dummyS, dummyS, dummyS, dummyS, 0, 0, 0);
245  sd.m_ttSpare.push_back(tt);
246  sd.m_ttPos[index] = spareCount++;
247  sd.m_chanLayer[word] |= (layer << bit);
248  sd.m_spareChan[word] |= (1 << bit);
249  sd.m_spareMod[word2] |= (1 << bit2);
250  if ((crate == 2 || crate == 3) && (module == 0))
251  {
252  sd.m_ttMuon.push_back(tt);
253  sd.m_muonChan[word] |= (1 << bit);
254  sd.m_muonMod[word2] |= (1 << bit2);
255  }
256  }
257  }
258  }
259  }
260  }
261 
262  // Set up according to the collection we want
263 
264  TriggerTowerVector &ttCol(dataChannels ? sd.m_ttData
265  : spareChannels
266  ? sd.m_ttSpare
267  : sd.m_ttMuon);
268  TriggerTowerVector &ttColRef(dataChannels ? sd.m_ttData
269  : sd.m_ttSpare);
270  const ChannelBitVector &colChan(dataChannels ? sd.m_dataChan
271  : spareChannels
272  ? sd.m_spareChan
273  : sd.m_muonChan);
274  const ChannelBitVector &colMod(dataChannels ? sd.m_dataMod
275  : spareChannels
276  ? sd.m_spareMod
277  : sd.m_muonMod);
278  const int colSize = dataChannels ? 2 * ttCol.size()
279  : ttCol.size();
280  sd.m_foundChan.assign(chanBitVecSize, 0);
281  int ttCount = 0;
282 
283  // Vectors to unpack into
284  std::vector<int> lut;
285  std::vector<int> fadc;
286  std::vector<int> bcidLut;
287  std::vector<int> bcidFadc;
288 
289  // Loop over ROB fragments
290 
291  int fadcBaseline = m_fadcBaseline;
292 
293  int robCount = 0;
294  std::set<uint32_t> dupCheck;
295  ROBIterator rob = robFrags.begin();
296  ROBIterator robEnd = robFrags.end();
297  for (; rob != robEnd; ++rob)
298  {
299 
300  if (debug)
301  {
302  ++robCount;
303  msg() << "Treating ROB fragment " << robCount << endmsg;
304  }
305 
306  // Skip fragments with ROB status errors
307 
308  uint32_t robid = (*rob)->source_id();
309  if ((*rob)->nstatus() > 0)
310  {
311  ROBPointer robData;
312  (*rob)->status(robData);
313  if (*robData != 0)
314  {
315  m_errorTool->robError(robid, *robData);
316  if (debug) msg() << "ROB status error - skipping fragment" << endmsg;
317  continue;
318  }
319  }
320 
321  // Skip duplicate fragments
322 
323  if (!dupCheck.insert(robid).second)
324  {
326  if (debug) msg() << "Skipping duplicate ROB fragment" << endmsg;
327  continue;
328  }
329 
330  // Unpack ROD data (slinks)
331 
332  RODPointer payloadBeg;
334  RODPointer payloadEnd;
335  (*rob)->rod_data(payloadBeg);
336  payloadEnd = payloadBeg + (*rob)->rod_ndata();
337  payload = payloadBeg;
338  if (payload == payloadEnd)
339  {
340  if (debug) msg() << "ROB fragment empty" << endmsg;
341  continue;
342  }
343 
344  // Check identifier
345  const uint32_t sourceID = (*rob)->rod_source_id();
346  if (m_srcIdMap.getRobID(sourceID) != robid ||
347  m_srcIdMap.subDet(sourceID) != m_subDetector ||
348  m_srcIdMap.daqOrRoi(sourceID) != 0 ||
349  m_srcIdMap.slink(sourceID) >= m_slinks ||
350  m_srcIdMap.crate(sourceID) >= s_crates)
351  {
352  m_errorTool->rodError(robid, L1CaloSubBlock::ERROR_ROD_ID);
353  if (debug)
354  {
355  msg() << "Wrong source identifier in data: ROD "
356  << MSG::hex << sourceID << " ROB " << robid
357  << MSG::dec << endmsg;
358  }
359  continue;
360  }
361 
362  // Check minor version
363  const int minorVersion = (*rob)->rod_version() & 0xffff;
364  if (minorVersion > m_srcIdMap.minorVersionPreLS1())
365  {
366  if (debug) msg() << "Skipping post-LS1 data" << endmsg;
367  continue;
368  }
369  const int rodCrate = m_srcIdMap.crate(sourceID);
370  if (debug)
371  {
372  msg() << "Treating crate " << rodCrate
373  << " slink " << m_srcIdMap.slink(sourceID) << endmsg;
374  }
375 
376  // First word should be User Header
378  {
380  if (debug) msg() << "Invalid or missing user header" << endmsg;
381  continue;
382  }
383  L1CaloUserHeader userHeader(*payload);
384  userHeader.setVersion(minorVersion);
385  const int headerWords = userHeader.words();
386  if (headerWords != 1)
387  {
389  if (debug)
390  {
391  msg() << "Unexpected number of user header words: "
392  << headerWords << endmsg;
393  }
394  continue;
395  }
396  for (int i = 0; i < headerWords; ++i) ++payload;
397  // triggered slice offsets
398  const int trigLut = userHeader.ppmLut();
399  const int trigFadc = userHeader.ppmFadc();
400  // FADC baseline lower bound
401  fadcBaseline = userHeader.lowerBound();
402  if (debug)
403  {
404  msg() << "Minor format version number: "
405  << MSG::hex << minorVersion << MSG::dec << endmsg
406  << "LUT triggered slice offset: " << trigLut << endmsg
407  << "FADC triggered slice offset: " << trigFadc << endmsg
408  << "FADC baseline lower bound: " << fadcBaseline << endmsg;
409  }
410  const int runNumber = (*rob)->rod_run_no() & 0xffffff;
411 
412  // Find the number of channels per sub-block
413 
414  int chanPerSubBlock = 0;
415  bool firstBlock = false;
416  uint32_t firstWord = 0;
417  RODPointer payloadFirst;
418  if (payload != payloadEnd)
419  {
422  {
424  if (debug) msg() << "Missing Sub-block header" << endmsg;
425  continue;
426  }
427  firstBlock = true;
428  firstWord = *payload;
429  if (sd.m_ppmBlocks.empty())
430  {
431  sd.m_ppmBlocks.push_back(new PpmSubBlockV1());
432  }
433  PpmSubBlockV1 *const subBlock = sd.m_ppmBlocks[0];
434  subBlock->clear();
435  payloadFirst = subBlock->read(payload, payloadEnd);
436  chanPerSubBlock = subBlock->channelsPerSubBlock();
437  if (chanPerSubBlock == 0)
438  {
439  m_errorTool->rodError(robid, subBlock->unpackErrorCode());
440  if (debug) msg() << "Unsupported version/data format: "
441  << subBlock->version() << "/"
442  << subBlock->format() << endmsg;
443  continue;
444  }
445  if (debug) msg() << "Channels per sub-block: "
446  << chanPerSubBlock << endmsg;
447  }
448  else
449  {
450  if (debug) msg() << "ROB fragment contains user header only" << endmsg;
451  continue;
452  }
453  const int numSubBlocks = s_channels / chanPerSubBlock;
454  const int size = sd.m_ppmBlocks.size();
455  if (numSubBlocks > size)
456  {
457  for (int i = size; i < numSubBlocks; ++i)
458  {
459  sd.m_ppmBlocks.push_back(new PpmSubBlockV1());
460  }
461  }
462 
463  // Loop over PPMs
464 
465  payload = payloadBeg;
466  for (int i = 0; i < headerWords; ++i) ++payload;
467  unsigned int rodErr = L1CaloSubBlock::ERROR_NONE;
468  while (payload != payloadEnd)
469  {
470 
471  // Get all sub-blocks for one PPM (first already read in above)
472 
473  int crate = 0;
474  int module = 0;
475  int nPpmBlocks = 0;
476  for (int block = 0; block < numSubBlocks; ++block)
477  {
478  const uint32_t word = (firstBlock) ? firstWord : *payload;
480  || CmmSubBlock::cmmBlock(word)
481  || PpmSubBlockV1::errorBlock(word))
482  {
483  if (debug) msg() << "Unexpected data sequence" << endmsg;
485  break;
486  }
487  if (chanPerSubBlock != s_channels &&
488  L1CaloSubBlock::seqno(word) != block * chanPerSubBlock)
489  {
490  if (debug)
491  {
492  msg() << "Unexpected channel sequence number: "
493  << L1CaloSubBlock::seqno(word) << " expected "
494  << block *chanPerSubBlock << endmsg;
495  }
497  break;
498  }
499  PpmSubBlockV1 *const subBlock = sd.m_ppmBlocks[block];
500  nPpmBlocks++;
501  if (firstBlock)
502  {
503  payload = payloadFirst;
504  firstBlock = false;
505  }
506  else
507  {
508  subBlock->clear();
509  payload = subBlock->read(payload, payloadEnd);
510  }
511  if (block == 0)
512  {
513  crate = subBlock->crate();
514  module = subBlock->module();
515  if (debug)
516  {
517  msg() << "Crate " << crate << " Module " << module << endmsg;
518  }
519  if (crate != rodCrate)
520  {
521  if (debug)
522  {
523  msg() << "Inconsistent crate number in ROD source ID" << endmsg;
524  }
526  break;
527  }
528  }
529  else
530  {
531  if (subBlock->crate() != crate)
532  {
533  if (debug) msg() << "Inconsistent crate number in sub-blocks"
534  << endmsg;
536  break;
537  }
538  if (subBlock->module() != module)
539  {
540  if (debug) msg() << "Inconsistent module number in sub-blocks"
541  << endmsg;
543  break;
544  }
545  }
546  if (payload == payloadEnd && block != numSubBlocks - 1)
547  {
548  if (debug) msg() << "Premature end of data" << endmsg;
550  break;
551  }
552  }
553  if (rodErr != L1CaloSubBlock::ERROR_NONE) break;
554 
555  // Is there an error block?
556 
557  bool isErrBlock = false;
558  if (payload != payloadEnd)
559  {
563  {
564  if (debug) msg() << "Error block found" << endmsg;
565  sd.m_errorBlock.clear();
566  isErrBlock = true;
567  payload = sd.m_errorBlock.read(payload, payloadEnd);
568  if (sd.m_errorBlock.crate() != crate)
569  {
570  if (debug) msg() << "Inconsistent crate number in error block"
571  << endmsg;
573  break;
574  }
575  if (sd.m_errorBlock.module() != module)
576  {
577  if (debug) msg() << "Inconsistent module number in error block"
578  << endmsg;
580  break;
581  }
582  if (sd.m_errorBlock.dataWords() && !sd.m_errorBlock.unpack())
583  {
584  if (debug)
585  {
586  std::string errMsg(sd.m_errorBlock.unpackErrorMsg());
587  msg() << "Unpacking error block failed: " << errMsg << endmsg;
588  }
589  rodErr = sd.m_errorBlock.unpackErrorCode();
590  break;
591  }
592  }
593  }
594 
595  // Don't bother unpacking modules that aren't used for required collection
596 
597  const int index2 = (crate << 4) + module;
598  const int word2 = index2 / 32;
599  const int bit2 = index2 % 32;
600  if (!((colMod[word2] >> bit2) & 1)) continue;
601 
602  // Loop over sub-blocks and fill trigger towers
603 
604  for (int block = 0; block < nPpmBlocks; ++block)
605  {
606  PpmSubBlockV1 *const subBlock = sd.m_ppmBlocks[block];
607  subBlock->setLutOffset(trigLut);
608  subBlock->setFadcOffset(trigFadc);
609  subBlock->setPedestal(m_pedestal);
610  subBlock->setFadcBaseline(fadcBaseline);
611  subBlock->setRunNumber(runNumber);
612  if (debug)
613  {
614  msg() << "Unpacking sub-block version/format/seqno: "
615  << subBlock->version() << "/" << subBlock->format() << "/"
616  << subBlock->seqno() << endmsg;
617  }
618  if (subBlock->dataWords() && !subBlock->unpack())
619  {
620  if (debug)
621  {
622  std::string errMsg(subBlock->unpackErrorMsg());
623  msg() << "Unpacking PPM sub-block failed: " << errMsg << endmsg;
624  }
625  rodErr = subBlock->unpackErrorCode();
626  break;
627  }
628  if (m_printCompStats) addCompStats(subBlock->compStats());
629  for (int chan = 0; chan < chanPerSubBlock; ++chan)
630  {
631  const int channel = block * chanPerSubBlock + chan;
632  const int index = (crate << 10) + (module << 6) + channel;
633  const int word = index / 32;
634  const int bit = index % 32;
635  if (!((colChan[word] >> bit) & 1)) continue; // skip unwanted channels
636  if (((sd.m_foundChan[word] >> bit) & 1))
637  {
638  if (debug) msg() << "Duplicate data for crate/module/channel: "
639  << crate << "/" << module << "/" << channel
640  << endmsg;
642  break;
643  }
644  lut.clear();
645  fadc.clear();
646  bcidLut.clear();
647  bcidFadc.clear();
648  subBlock->ppmData(channel, lut, fadc, bcidLut, bcidFadc);
649  if (lut.size() < size_t(trigLut + 1))
650  {
651  if (debug)
652  {
653  msg() << "Triggered LUT slice from header "
654  << "inconsistent with number of slices: "
655  << trigLut << ", " << lut.size() << endmsg;
656  }
658  break;
659  }
660  if (fadc.size() < size_t(trigFadc + 1))
661  {
662  if (debug)
663  {
664  msg() << "Triggered FADC slice from header "
665  << "inconsistent with number of slices: "
666  << trigFadc << ", " << fadc.size() << endmsg;
667  }
669  break;
670  }
671  LVL1::DataError errorBits(0);
672  if (isErrBlock)
673  {
674  errorBits.set(LVL1::DataError::PPMErrorWord,
675  sd.m_errorBlock.ppmError(channel));
676  errorBits.set(LVL1::DataError::SubStatusWord,
677  sd.m_errorBlock.subStatus());
678  }
679  else
680  {
681  errorBits.set(LVL1::DataError::PPMErrorWord,
682  subBlock->ppmError(channel));
683  const PpmSubBlockV1 *const lastBlock =
684  sd.m_ppmBlocks[nPpmBlocks - 1];
685  errorBits.set(LVL1::DataError::SubStatusWord,
686  lastBlock->subStatus());
687  }
688  // Wrong bit set for compressed formats 1.01 to 1.03
689  if (subBlock->format() > 1 && subBlock->seqno() < 4)
690  {
691  errorBits.set(LVL1::DataError::ModuleError,
692  (errorBits.error() >> (LVL1::DataError::ModuleError + 1)) & 0x1);
693  }
694  const int error = errorBits.error();
695 
696  // Save to TriggerTower
697 
698  if (verbose)
699  {
700  msg(MSG::VERBOSE) << "channel/LUT/FADC/bcidLUT/bcidFADC/error: "
701  << channel << "/";
702  printVec(lut);
703  printVec(fadc);
704  printVec(bcidLut);
705  printVec(bcidFadc);
706  msg() << MSG::hex << error << MSG::dec << "/";
707  }
708  sd.m_foundChan[word] |= (1 << bit);
709  ++ttCount;
710  LVL1::TriggerTower *tt = ttColRef[sd.m_ttPos[index]];
711  const int layer = ((sd.m_chanLayer[word] >> bit) & 1);
712  if (layer == 0) // EM
713  {
714  tt->addEM(fadc, lut, bcidFadc, bcidLut, error, trigLut, trigFadc);
715  }
716  else // Had
717  {
718  tt->addHad(fadc, lut, bcidFadc, bcidLut, error, trigLut, trigFadc);
719  }
720  }
721  if (rodErr != L1CaloSubBlock::ERROR_NONE) break;
722  }
723  if (rodErr != L1CaloSubBlock::ERROR_NONE) break;
724  }
725  if (rodErr != L1CaloSubBlock::ERROR_NONE)
726  m_errorTool->rodError(robid, rodErr);
727  }
728 
729  // Reset any missing channels (should be rare)
730 
731  if (ttCount != colSize)
732  {
733  if (debug)
734  {
735  msg() << "Found " << ttCount << " channels, expected " << colSize << endmsg;
736  }
737  std::vector<int> dummy(1);
738  for (int word = 0; word < chanBitVecSize; ++word)
739  {
740  if (sd.m_foundChan[word] != colChan[word])
741  {
742  for (int bit = 0; bit < 32; ++bit)
743  {
744  if (((sd.m_foundChan[word] >> bit) & 1) != ((colChan[word] >> bit) & 1))
745  {
746  const int index = word * 32 + bit;
747  LVL1::TriggerTower *tt = ttColRef[sd.m_ttPos[index]];
748  const int layer = ((sd.m_chanLayer[word] >> bit) & 1);
749  if (layer == 0) // EM
750  {
751  tt->addEM(dummy, dummy, dummy, dummy, 0, 0, 0);
752  }
753  else if (dataChannels) // Had
754  {
755  tt->addHad(dummy, dummy, dummy, dummy, 0, 0, 0);
756  }
757  }
758  }
759  }
760  }
761  }
762 
763  // And copy into output collection
764 
765  if (m_zeroSuppress)
766  {
767  TriggerTowerVector::iterator itr = ttCol.begin();
768  TriggerTowerVector::iterator itrE = ttCol.end();
769  for (; itr != itrE; ++itr)
770  {
771  if ((*itr)->emEnergy() || (dataChannels && (*itr)->hadEnergy()))
772  {
773  ttCollection->push_back(*itr);
774  }
775  }
776  }
777  else
778  {
779  ttCollection->assign(ttCol.begin(), ttCol.end());
780  }
781 
782  return StatusCode::SUCCESS;
783 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ finalize()

StatusCode LVL1BS::PpmByteStreamV1Tool::finalize ( )
overridevirtual

Definition at line 126 of file PpmByteStreamV1Tool.cxx.

127 {
128  if (m_printCompStats && msgLvl(MSG::INFO))
129  {
130  msg(MSG::INFO);
131  printCompStats();
132  }
133  return StatusCode::SUCCESS;
134 }

◆ findLayerTriggerTower()

const LVL1::TriggerTower * LVL1BS::PpmByteStreamV1Tool::findLayerTriggerTower ( double  eta,
double  phi,
int  layer,
const TriggerTowerMapConst ttEmMap,
const TriggerTowerMapConst ttHadMap,
LVL1::TriggerTowerKey towerKey 
) const
private

Find a trigger tower using separate layer maps.

Definition at line 1083 of file PpmByteStreamV1Tool.cxx.

1088 {
1089  const LVL1::TriggerTower *tt = 0;
1090  const unsigned int key = towerKey.ttKey(phi, eta);
1091  TriggerTowerMapConst::const_iterator mapIter;
1092  if (layer == 0)
1093  {
1094  mapIter = ttEmMap.find(key);
1095  if (mapIter != ttEmMap.end()) tt = mapIter->second;
1096  }
1097  else
1098  {
1099  mapIter = ttHadMap.find(key);
1100  if (mapIter != ttHadMap.end()) tt = mapIter->second;
1101  }
1102  return tt;
1103 }

◆ initialize()

StatusCode LVL1BS::PpmByteStreamV1Tool::initialize ( )
overridevirtual

Definition at line 113 of file PpmByteStreamV1Tool.cxx.

114 {
115  ATH_MSG_INFO ( "Initializing " << name() );
116 
117  ATH_CHECK( m_ppmMaps.retrieve() );
118  ATH_CHECK( m_errorTool.retrieve() );
119  ATH_CHECK( m_sms.retrieve() );
120 
121  return StatusCode::SUCCESS;
122 }

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

AlgTool InterfaceID.

Definition at line 45 of file PpmByteStreamV1Tool.cxx.

46 {
47  return IID_IPpmByteStreamV1Tool;
48 }

◆ makeSourceIDs()

std::vector< uint32_t > LVL1BS::PpmByteStreamV1Tool::makeSourceIDs ( bool  spareChannels,
bool  muonChannels 
) const
private

Definition at line 1222 of file PpmByteStreamV1Tool.cxx.

1223 {
1224  std::vector<uint32_t> robIds;
1225 
1226  if (!spareChannels && !muonChannels) {
1227  robIds = m_sourceIDsProp;
1228  }
1229 
1230  if (robIds.empty()) {
1231  const int maxlinks = m_srcIdMap.maxSlinks();
1232  for (int crate = 0; crate < s_crates; ++crate)
1233  {
1234  for (int slink = 0; slink < maxlinks; ++slink)
1235  {
1236  const int daqOrRoi = 0;
1237  const uint32_t rodId = m_srcIdMap.getRodID(crate, slink, daqOrRoi,
1238  m_subDetector);
1239  const uint32_t robId = m_srcIdMap.getRobID(rodId);
1240 
1241  if (spareChannels && !(crate > 1 && crate < 6)) {
1242  continue;
1243  }
1244 
1245  if (muonChannels && !(crate > 1 && crate < 4 && slink == 0)) {
1246  continue;
1247  }
1248 
1249  robIds.push_back (robId);
1250  }
1251  }
1252  }
1253  return robIds;
1254 }

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

◆ printCompStats()

void LVL1BS::PpmByteStreamV1Tool::printCompStats ( ) const
private

Print compression stats.

Definition at line 1071 of file PpmByteStreamV1Tool.cxx.

1072 {
1073  msg() << "Compression stats format/count: ";
1074  for (unsigned int i = 0; i < MAXFORMATS; ++i)
1075  {
1076  msg() << " " << i << "/" << m_compStats[i];
1077  }
1078  msg() << endmsg;
1079 }

◆ printVec()

void LVL1BS::PpmByteStreamV1Tool::printVec ( const std::vector< int > &  vec) const
private

Print a vector.

Definition at line 1289 of file PpmByteStreamV1Tool.cxx.

1290 {
1291  std::vector<int>::const_iterator pos;
1292  for (pos = vec.begin(); pos != vec.end(); ++pos)
1293  {
1294  if (pos != vec.begin()) msg() << ",";
1295  msg() << *pos;
1296  }
1297  msg() << "/";
1298 }

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

◆ setupTTMaps()

void LVL1BS::PpmByteStreamV1Tool::setupTTMaps ( const TriggerTowerCollection ttCollection,
TriggerTowerMapConst ttEmMap,
TriggerTowerMapConst ttHadMap,
LVL1::TriggerTowerKey towerKey 
) const
private

Set up separate Em and Had trigger tower maps.

Definition at line 1107 of file PpmByteStreamV1Tool.cxx.

1112 {
1113  using std::accumulate;
1114 
1115  ttEmMap.clear();
1116  ttHadMap.clear();
1118  TriggerTowerCollection::const_iterator pose = ttCollection->end();
1119  for (; pos != pose; ++pos)
1120  {
1121  const LVL1::TriggerTower *tt = *pos;
1122  const unsigned int key = towerKey.ttKey(tt->phi(), tt->eta());
1123  // Ignore any with zero data
1124  // EM
1125  if (accumulate((tt->emLUT()).begin(), (tt->emLUT()).end(), 0) ||
1126  accumulate((tt->emADC()).begin(), (tt->emADC()).end(), 0) ||
1127  accumulate((tt->emBCIDvec()).begin(), (tt->emBCIDvec()).end(), 0) ||
1128  accumulate((tt->emBCIDext()).begin(), (tt->emBCIDext()).end(), 0) ||
1129  tt->emError())
1130  {
1131  ttEmMap.insert(std::make_pair(key, tt));
1132  }
1133  // Had
1134  if (accumulate((tt->hadLUT()).begin(), (tt->hadLUT()).end(), 0) ||
1135  accumulate((tt->hadADC()).begin(), (tt->hadADC()).end(), 0) ||
1136  accumulate((tt->hadBCIDvec()).begin(), (tt->hadBCIDvec()).end(), 0) ||
1137  accumulate((tt->hadBCIDext()).begin(), (tt->hadBCIDext()).end(), 0) ||
1138  tt->hadError())
1139  {
1140  ttHadMap.insert(std::make_pair(key, tt));
1141  }
1142  }
1143 }

◆ slinkSlices()

bool LVL1BS::PpmByteStreamV1Tool::slinkSlices ( int  crate,
int  module,
int  modulesPerSlink,
int &  slicesLut,
int &  slicesFadc,
int &  trigLut,
int &  trigFadc,
const TriggerTowerMapConst ttEmMap,
const TriggerTowerMapConst ttHadMap,
LVL1::TriggerTowerKey towerKey 
) const
private

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

Definition at line 1147 of file PpmByteStreamV1Tool.cxx.

1153 {
1154  int sliceL = -1;
1155  int sliceF = m_dfltSlicesFadc;
1156  int trigL = m_dfltSlicesLut / 2;
1157  int trigF = m_dfltSlicesFadc / 2;
1158  for (int mod = module; mod < module + modulesPerSlink; ++mod)
1159  {
1160  for (int chan = 0; chan < s_channels; ++chan)
1161  {
1162  double eta = 0.;
1163  double phi = 0.;
1164  int layer = 0;
1165  if (!m_ppmMaps->mapping(crate, mod, chan,
1166  eta, phi, layer)) continue;
1168  eta, phi, layer, ttEmMap, ttHadMap,
1169  towerKey);
1170  if ( !tt ) continue;
1171  if (layer == 0)
1172  {
1173  if (sliceL < 0) // initialise
1174  {
1175  sliceL = (tt->emLUT()).size();
1176  sliceF = (tt->emADC()).size();
1177  trigL = tt->emPeak();
1178  trigF = tt->emADCPeak();
1179  }
1180  else // check consistent
1181  {
1182  if ((tt->emLUT()).size() != size_t(sliceL) ||
1183  (tt->emADC()).size() != size_t(sliceF) ||
1184  tt->emPeak() != trigL || tt->emADCPeak() != trigF)
1185  {
1186  return false;
1187  }
1188  }
1189  }
1190  else
1191  {
1192  if (sliceL < 0)
1193  {
1194  sliceL = (tt->hadLUT()).size();
1195  sliceF = (tt->hadADC()).size();
1196  trigL = tt->hadPeak();
1197  trigF = tt->hadADCPeak();
1198  }
1199  else
1200  {
1201  if ((tt->hadLUT()).size() != size_t(sliceL) ||
1202  (tt->hadADC()).size() != size_t(sliceF) ||
1203  tt->hadPeak() != trigL || tt->hadADCPeak() != trigF)
1204  {
1205  return false;
1206  }
1207  }
1208  }
1209  }
1210  }
1211  if (sliceL < 0) sliceL = m_dfltSlicesLut;
1212  slicesLut = sliceL;
1213  slicesFadc = sliceF;
1214  trigLut = trigL;
1215  trigFadc = trigF;
1216  return true;
1217 }

◆ sourceIDs()

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

Return reference to vector with all possible Source Identifiers.

Definition at line 1256 of file PpmByteStreamV1Tool.cxx.

1258 {
1259  // Check if spare channels wanted
1260  const std::string flag("Spare");
1261  const std::string::size_type pos = sgKey.find(flag);
1262  bool spareChannels =
1263  (pos != std::string::npos && pos == (sgKey.length() - flag.length()));
1264  // Check if Tile Muon channels wanted
1265  const std::string flag2("Muon");
1266  const std::string::size_type pos2 = sgKey.find(flag2);
1267  bool muonChannels =
1268  (pos2 != std::string::npos && pos2 == (sgKey.length() - flag2.length()));
1269 
1270  if (spareChannels) {
1271  static const std::vector<uint32_t> sourceIDsSpare =
1272  makeSourceIDs (true, false);
1273  return sourceIDsSpare;
1274  }
1275 
1276  if (muonChannels) {
1277  static const std::vector<uint32_t> sourceIDsMuon =
1278  makeSourceIDs (false, true);
1279  return sourceIDsMuon;
1280  }
1281 
1282  static const std::vector<uint32_t> sourceIDs =
1283  makeSourceIDs (false, false);
1284  return sourceIDs;
1285 }

◆ 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

◆ ATLAS_THREAD_SAFE

SG::SlotSpecificObj<SlotData> m_slotData LVL1BS::PpmByteStreamV1Tool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 147 of file PpmByteStreamV1Tool.h.

◆ m_compStats

std::atomic<uint32_t> LVL1BS::PpmByteStreamV1Tool::m_compStats[MAXFORMATS]
private

Definition at line 195 of file PpmByteStreamV1Tool.h.

◆ m_compVers

const int LVL1BS::PpmByteStreamV1Tool::m_compVers
private

Compression version.

Definition at line 162 of file PpmByteStreamV1Tool.h.

◆ m_crateMax

int LVL1BS::PpmByteStreamV1Tool::m_crateMax
private

Property: Maximum crate number when writing out bytestream.

Definition at line 178 of file PpmByteStreamV1Tool.h.

◆ m_crateMin

int LVL1BS::PpmByteStreamV1Tool::m_crateMin
private

Property: Minimum crate number when writing out bytestream.

Definition at line 176 of file PpmByteStreamV1Tool.h.

◆ m_dataFormat

int LVL1BS::PpmByteStreamV1Tool::m_dataFormat
private

Property: Data compression format.

Definition at line 160 of file PpmByteStreamV1Tool.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_dfltSlicesFadc

int LVL1BS::PpmByteStreamV1Tool::m_dfltSlicesFadc
private

Property: Default number of FADC slices in simulation.

Definition at line 170 of file PpmByteStreamV1Tool.h.

◆ m_dfltSlicesLut

int LVL1BS::PpmByteStreamV1Tool::m_dfltSlicesLut
private

Property: Default number of LUT slices in simulation.

Definition at line 168 of file PpmByteStreamV1Tool.h.

◆ m_errorTool

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

Property: Error collection tool.

Definition at line 153 of file PpmByteStreamV1Tool.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_fadcBaseline

int LVL1BS::PpmByteStreamV1Tool::m_fadcBaseline
private

Property: FADC baseline lower bound.

Definition at line 182 of file PpmByteStreamV1Tool.h.

◆ m_fadcThreshold

int LVL1BS::PpmByteStreamV1Tool::m_fadcThreshold
private

Property: FADC threshold for super-compressed format.

Definition at line 184 of file PpmByteStreamV1Tool.h.

◆ m_forceSlicesFadc

int LVL1BS::PpmByteStreamV1Tool::m_forceSlicesFadc
private

Property: Force number of FADC slices in bytestream.

Definition at line 174 of file PpmByteStreamV1Tool.h.

◆ m_forceSlicesLut

int LVL1BS::PpmByteStreamV1Tool::m_forceSlicesLut
private

Property: Force number of LUT slices in bytestream.

Definition at line 172 of file PpmByteStreamV1Tool.h.

◆ m_pedestal

int LVL1BS::PpmByteStreamV1Tool::m_pedestal
private

Property: Pedestal value.

Definition at line 180 of file PpmByteStreamV1Tool.h.

◆ m_ppmMaps

ToolHandle<LVL1::IL1CaloMappingTool> LVL1BS::PpmByteStreamV1Tool::m_ppmMaps
private

Property: Channel mapping tool.

Definition at line 151 of file PpmByteStreamV1Tool.h.

◆ m_printCompStats

int LVL1BS::PpmByteStreamV1Tool::m_printCompStats
private

Property: Compression statistics print flag.

Definition at line 164 of file PpmByteStreamV1Tool.h.

◆ m_slinks

int LVL1BS::PpmByteStreamV1Tool::m_slinks
private

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

Definition at line 166 of file PpmByteStreamV1Tool.h.

◆ m_sms

ServiceHandle<SegMemSvc> LVL1BS::PpmByteStreamV1Tool::m_sms
private

Memory pool service.

Definition at line 155 of file PpmByteStreamV1Tool.h.

◆ m_sourceIDsProp

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

Property: ROB source IDs.

Definition at line 188 of file PpmByteStreamV1Tool.h.

◆ m_srcIdMap

const L1CaloSrcIdMap LVL1BS::PpmByteStreamV1Tool::m_srcIdMap
private

Source ID converter.

Definition at line 192 of file PpmByteStreamV1Tool.h.

◆ m_subDetector

const eformat::SubDetector LVL1BS::PpmByteStreamV1Tool::m_subDetector
private

Sub-detector type.

Definition at line 190 of file PpmByteStreamV1Tool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_version

const int LVL1BS::PpmByteStreamV1Tool::m_version
private

Sub_block header version.

Definition at line 158 of file PpmByteStreamV1Tool.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_zeroSuppress

int LVL1BS::PpmByteStreamV1Tool::m_zeroSuppress
private

Property: Zero suppression on input.

Definition at line 186 of file PpmByteStreamV1Tool.h.

◆ MAXFORMATS

constexpr unsigned int LVL1BS::PpmByteStreamV1Tool::MAXFORMATS = 10
staticconstexprprivate

Vector for compression statistics.

Definition at line 194 of file PpmByteStreamV1Tool.h.

◆ s_channels

const int LVL1BS::PpmByteStreamV1Tool::s_channels = 64
staticprivate

Definition at line 199 of file PpmByteStreamV1Tool.h.

◆ s_crates

const int LVL1BS::PpmByteStreamV1Tool::s_crates = 8
staticprivate

Definition at line 197 of file PpmByteStreamV1Tool.h.

◆ s_dataSize

const int LVL1BS::PpmByteStreamV1Tool::s_dataSize = 3584
staticprivate

Definition at line 200 of file PpmByteStreamV1Tool.h.

◆ s_modules

const int LVL1BS::PpmByteStreamV1Tool::s_modules = 16
staticprivate

Definition at line 198 of file PpmByteStreamV1Tool.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
LVL1BS::PpmByteStreamV1Tool::m_dfltSlicesLut
int m_dfltSlicesLut
Property: Default number of LUT slices in simulation.
Definition: PpmByteStreamV1Tool.h:168
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
LVL1BS::L1CaloSrcIdMap::minorVersionPreLS1
uint16_t minorVersionPreLS1() const
Return last ROD header minor version for pre-LS1 data.
Definition: L1CaloSrcIdMap.h:64
test_pyathena.eta
eta
Definition: test_pyathena.py:10
LVL1BS::L1CaloSrcIdMap::slink
int slink(uint32_t code) const
Return slink from unpacked moduleID.
Definition: L1CaloSrcIdMap.cxx:73
LVL1BS::PpmByteStreamV1Tool::printCompStats
void printCompStats() const
Print compression stats.
Definition: PpmByteStreamV1Tool.cxx:1071
LVL1BS::PpmByteStreamV1Tool::TriggerTowerMapConst
std::map< unsigned int, const LVL1::TriggerTower * > TriggerTowerMapConst
Definition: PpmByteStreamV1Tool.h:87
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
LVL1BS::L1CaloSubBlock::ERROR_MISSING_HEADER
@ ERROR_MISSING_HEADER
Definition: L1CaloSubBlock.h:33
LVL1BS::PpmByteStreamV1Tool::slinkSlices
bool slinkSlices(int crate, int module, int modulesPerSlink, int &slicesLut, int &slicesFadc, int &trigLut, int &trigFadc, const TriggerTowerMapConst &ttEmMap, const TriggerTowerMapConst &ttHadMap, LVL1::TriggerTowerKey &towerKey) const
Get number of slices and triggered slice offsets for next slink.
Definition: PpmByteStreamV1Tool.cxx:1147
LVL1::DataError
Error data.
Definition: DataError.h:27
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
LVL1BS::PpmByteStreamV1Tool::makeSourceIDs
std::vector< uint32_t > makeSourceIDs(bool spareChannels, bool muonChannels) const
Definition: PpmByteStreamV1Tool.cxx:1222
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LVL1BS::PpmByteStreamV1Tool::m_ppmMaps
ToolHandle< LVL1::IL1CaloMappingTool > m_ppmMaps
Property: Channel mapping tool.
Definition: PpmByteStreamV1Tool.h:151
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition: FullEventAssembler.h:40
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1BS::PpmByteStreamV1Tool::m_sms
ServiceHandle< SegMemSvc > m_sms
Memory pool service.
Definition: PpmByteStreamV1Tool.h:155
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
LVL1BS::PpmByteStreamV1Tool::MAXFORMATS
static constexpr unsigned int MAXFORMATS
Vector for compression statistics.
Definition: PpmByteStreamV1Tool.h:194
LVL1BS::PpmByteStreamV1Tool::m_forceSlicesFadc
int m_forceSlicesFadc
Property: Force number of FADC slices in bytestream.
Definition: PpmByteStreamV1Tool.h:174
LVL1::DataError::ModuleError
@ ModuleError
Definition: DataError.h:41
LVL1BS::PpmByteStreamV1Tool::m_compStats
std::atomic< uint32_t > m_compStats[MAXFORMATS]
Definition: PpmByteStreamV1Tool.h:195
LVL1BS::L1CaloSubBlock::ERROR_DUPLICATE_ROB
@ ERROR_DUPLICATE_ROB
Definition: L1CaloSubBlock.h:31
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
LVL1BS::CmmSubBlock::cmmBlock
static bool cmmBlock(uint32_t word)
Determine if header word corresponds to CMM.
Definition: CmmSubBlock.cxx:84
LVL1BS::PpmByteStreamV1Tool::findLayerTriggerTower
const LVL1::TriggerTower * findLayerTriggerTower(double eta, double phi, int layer, const TriggerTowerMapConst &ttEmMap, const TriggerTowerMapConst &ttHadMap, LVL1::TriggerTowerKey &towerKey) const
Find a trigger tower using separate layer maps.
Definition: PpmByteStreamV1Tool.cxx:1083
LVL1BS::PpmByteStreamV1Tool::sourceIDs
const std::vector< uint32_t > & sourceIDs(const std::string &sgKey) const
Return reference to vector with all possible Source Identifiers.
Definition: PpmByteStreamV1Tool.cxx:1256
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
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:32
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LVL1BS::PpmByteStreamV1Tool::m_dfltSlicesFadc
int m_dfltSlicesFadc
Property: Default number of FADC slices in simulation.
Definition: PpmByteStreamV1Tool.h:170
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
LVL1BS::PpmByteStreamV1Tool::TriggerTowerMap
std::map< unsigned int, int > TriggerTowerMap
Definition: PpmByteStreamV1Tool.h:85
LVL1BS::PpmByteStreamV1Tool::m_pedestal
int m_pedestal
Property: Pedestal value.
Definition: PpmByteStreamV1Tool.h:180
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
ITkPixEncoding::lut
constexpr auto lut(Generator &&f)
Definition: ITkPixQCoreEncodingLUT.h:19
LVL1BS::L1CaloSubBlock::HEADER
@ HEADER
Definition: L1CaloSubBlock.h:27
SegMemSvc::JOB
@ JOB
Definition: SegMemSvc.h:37
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
python.selector.AtlRunQuerySelectorLhcOlc.sd
sd
Definition: AtlRunQuerySelectorLhcOlc.py:612
LVL1::DataError::SubStatusWord
@ SubStatusWord
Definition: DataError.h:44
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
DataVector::assign
void assign(InputIterator first, InputIterator last)
Assign from iterators.
LVL1BS::PpmByteStreamV1Tool::m_sourceIDsProp
std::vector< uint32_t > m_sourceIDsProp
Property: ROB source IDs.
Definition: PpmByteStreamV1Tool.h:188
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
python.PyAthena.module
module
Definition: PyAthena.py:131
LVL1BS::PpmByteStreamV1Tool::m_crateMax
int m_crateMax
Property: Maximum crate number when writing out bytestream.
Definition: PpmByteStreamV1Tool.h:178
LVL1BS::PpmByteStreamV1Tool::s_channels
static const int s_channels
Definition: PpmByteStreamV1Tool.h:199
LVL1BS::PpmByteStreamV1Tool::s_crates
static const int s_crates
Definition: PpmByteStreamV1Tool.h:197
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
LVL1BS::L1CaloSubBlock::ERROR_ROD_ID
@ ERROR_ROD_ID
Definition: L1CaloSubBlock.h:31
LVL1BS::PpmByteStreamV1Tool::m_fadcBaseline
int m_fadcBaseline
Property: FADC baseline lower bound.
Definition: PpmByteStreamV1Tool.h:182
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LVL1BS::ModifySlices::data
static void data(const std::vector< int > &oldVec, std::vector< int > &newVec, int newSlices)
Return modified data vector<int>
Definition: ModifySlices.cxx:20
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
LVL1BS::L1CaloSubBlock::ERROR_CRATE_NUMBER
@ ERROR_CRATE_NUMBER
Definition: L1CaloSubBlock.h:34
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
lumiFormat.i
int i
Definition: lumiFormat.py:85
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
LVL1BS::L1CaloSubBlock::ERROR_DUPLICATE_DATA
@ ERROR_DUPLICATE_DATA
Definition: L1CaloSubBlock.h:35
LVL1BS::PpmByteStreamV1Tool::addCompStats
void addCompStats(const std::vector< uint32_t > &stats) const
Add compression stats to totals.
Definition: PpmByteStreamV1Tool.cxx:1058
beamspotman.n
n
Definition: beamspotman.py:731
LVL1BS::PpmByteStreamV1Tool::m_version
const int m_version
Sub_block header version.
Definition: PpmByteStreamV1Tool.h:158
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LVL1BS::PpmByteStreamV1Tool::m_subDetector
const eformat::SubDetector m_subDetector
Sub-detector type.
Definition: PpmByteStreamV1Tool.h:190
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:57
master.flag
bool flag
Definition: master.py:29
LVL1BS::PpmByteStreamV1Tool::m_zeroSuppress
int m_zeroSuppress
Property: Zero suppression on input.
Definition: PpmByteStreamV1Tool.h:186
LVL1BS::PpmByteStreamV1Tool::ATLAS_THREAD_SAFE
SG::SlotSpecificObj< SlotData > m_slotData ATLAS_THREAD_SAFE
Definition: PpmByteStreamV1Tool.h:147
LVL1BS::PpmByteStreamV1Tool::RODPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
Definition: PpmByteStreamV1Tool.h:91
LVL1BS::PpmByteStreamV1Tool::printVec
void printVec(const std::vector< int > &vec) const
Print a vector.
Definition: PpmByteStreamV1Tool.cxx:1289
test_pyathena.parent
parent
Definition: test_pyathena.py:15
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1BS::PpmByteStreamV1Tool::m_srcIdMap
const L1CaloSrcIdMap m_srcIdMap
Source ID converter.
Definition: PpmByteStreamV1Tool.h:192
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
LVL1BS::PpmByteStreamV1Tool::m_printCompStats
int m_printCompStats
Property: Compression statistics print flag.
Definition: PpmByteStreamV1Tool.h:164
beamspotman.stat
stat
Definition: beamspotman.py:266
LVL1BS::L1CaloSubBlock::wordType
static SubBlockWordType wordType(uint32_t word)
Word identification.
Definition: L1CaloSubBlock.cxx:479
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
LVL1BS::L1CaloSubBlock::COMPRESSED
@ COMPRESSED
Definition: L1CaloSubBlock.h:28
LVL1BS::PpmByteStreamV1Tool::ROBIterator
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Definition: PpmByteStreamV1Tool.h:89
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
FullEventAssembler::clear
void clear()
Clear internal stack.
LVL1::TriggerTower
Trigger towers are the inputs to all other parts of the calorimeter trigger.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/TriggerTower.h:45
Trk::index2
@ index2
Definition: BoundarySurfaceFace.h:49
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
LVL1BS::PpmByteStreamV1Tool::s_dataSize
static const int s_dataSize
Definition: PpmByteStreamV1Tool.h:200
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
LVL1BS::PpmSubBlockV1::errorBlock
static bool errorBlock(uint32_t word)
Check if a header word is for an error block.
Definition: PpmSubBlockV1.cxx:490
LVL1BS::PpmByteStreamV1Tool::TriggerTowerVector
std::vector< LVL1::TriggerTower * > TriggerTowerVector
Definition: PpmByteStreamV1Tool.h:84
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
LVL1BS::L1CaloSrcIdMap::subDet
eformat::SubDetector subDet(uint32_t code) const
Return sub-detector for given ID.
Definition: L1CaloSrcIdMap.cxx:89
LVL1BS::L1CaloSubBlock::ERROR_MISSING_SUBBLOCK
@ ERROR_MISSING_SUBBLOCK
Definition: L1CaloSubBlock.h:33
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
LVL1BS::PpmByteStreamV1Tool::m_slinks
int m_slinks
Property: Number of slinks per crate when writing out bytestream.
Definition: PpmByteStreamV1Tool.h:166
DeMoScan.index
string index
Definition: DeMoScan.py:364
a
TList * a
Definition: liststreamerinfos.cxx:10
h
LVL1::DataError::PPMErrorWord
@ PPMErrorWord
Definition: DataError.h:44
FullEventAssembler::setRodMinorVersion
void setRodMinorVersion(uint16_t m)
change the ROD minor version
LVL1BS::PpmByteStreamV1Tool::ChannelBitVector
std::vector< uint32_t > ChannelBitVector
Definition: PpmByteStreamV1Tool.h:88
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1BS::L1CaloSubBlock::ERROR_SLICES
@ ERROR_SLICES
Definition: L1CaloSubBlock.h:35
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
re
const boost::regex re(r_e)
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
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:623
LVL1BS::L1CaloSrcIdMap::getRodID
uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet) const
Make a ROD Source ID.
Definition: L1CaloSrcIdMap.cxx:18
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
FullEventAssembler::RODDATA
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
Definition: FullEventAssembler.h:54
LVL1BS::PpmByteStreamV1Tool::m_crateMin
int m_crateMin
Property: Minimum crate number when writing out bytestream.
Definition: PpmByteStreamV1Tool.h:176
LVL1BS::PpmByteStreamV1Tool::m_fadcThreshold
int m_fadcThreshold
Property: FADC threshold for super-compressed format.
Definition: PpmByteStreamV1Tool.h:184
LVL1BS::PpmByteStreamV1Tool::m_forceSlicesLut
int m_forceSlicesLut
Property: Force number of LUT slices in bytestream.
Definition: PpmByteStreamV1Tool.h:172
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
LVL1::TriggerTowerKey::ttKey
virtual unsigned int ttKey(const TriggerTower &tower)
returns the key of the passed tower
Definition: TriggerTowerKey.cxx:143
LVL1BS::L1CaloSrcIdMap::maxSlinks
int maxSlinks() const
Return the maximum possible number of slinks.
Definition: L1CaloSrcIdMap.cxx:82
LVL1BS::L1CaloSubBlock::seqno
int seqno() const
Definition: L1CaloSubBlock.h:253
LVL1BS::PpmByteStreamV1Tool::ROBPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
Definition: PpmByteStreamV1Tool.h:90
LVL1BS::PpmByteStreamV1Tool::setupTTMaps
void setupTTMaps(const TriggerTowerCollection *ttCollection, TriggerTowerMapConst &ttEmMap, TriggerTowerMapConst &ttHadMap, LVL1::TriggerTowerKey &towerKey) const
Set up separate Em and Had trigger tower maps.
Definition: PpmByteStreamV1Tool.cxx:1107
error
Definition: IImpactPoint3dEstimator.h:70
LVL1BS::L1CaloUserHeader::isValid
static bool isValid(uint32_t word)
Test for valid header word.
Definition: L1CaloUserHeader.cxx:36
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
LVL1BS::L1CaloSrcIdMap::daqOrRoi
int daqOrRoi(uint32_t code) const
Return daqOrRoi from unpacked moduleID.
Definition: L1CaloSrcIdMap.cxx:65
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::PpmByteStreamV1Tool::m_dataFormat
int m_dataFormat
Property: Data compression format.
Definition: PpmByteStreamV1Tool.h:160
LVL1::TriggerTowerKey
The TriggerTowerKey object provides the key for each trigger tower depending on its eta-phi coords.
Definition: TriggerTowerKey.h:56
LVL1BS::L1CaloSubBlock::ERROR_USER_HEADER
@ ERROR_USER_HEADER
Definition: L1CaloSubBlock.h:32
LVL1BS::PpmByteStreamV1Tool::s_modules
static const int s_modules
Definition: PpmByteStreamV1Tool.h:198
FullEventAssembler::getRodData
RODDATA * getRodData(uint32_t id)
get a block of ROD data
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
FullEventAssembler::fill
void fill(RawEventWrite *re, MsgStream &log)
Fill the FullEventFragment with all the ROD data stored in this.
fitman.k
k
Definition: fitman.py:528
xAOD::TriggerTower
TriggerTower_v2 TriggerTower
Define the latest version of the TriggerTower class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/TriggerTower.h:16
LVL1BS::L1CaloSubBlock::UNCOMPRESSED
@ UNCOMPRESSED
Definition: L1CaloSubBlock.h:28
LVL1BS::PpmByteStreamV1Tool::m_compVers
const int m_compVers
Compression version.
Definition: PpmByteStreamV1Tool.h:162
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
LVL1BS::PpmByteStreamV1Tool::m_errorTool
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_errorTool
Property: Error collection tool.
Definition: PpmByteStreamV1Tool.h:153