ATLAS Offline Software
JepRoiByteStreamV2Tool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGT1CALOBYTESTREAM_JEPROIBYTESTREAMV2TOOL_H
6 #define TRIGT1CALOBYTESTREAM_JEPROIBYTESTREAMV2TOOL_H
7 
8 #include <stdint.h>
9 
10 #include <map>
11 #include <string>
12 #include <vector>
13 
19 #include "eformat/SourceIdentifier.h"
20 #include "GaudiKernel/ToolHandle.h"
21 #include "CmxEnergySubBlock.h"
22 
23 class IInterface;
24 class InterfaceID;
25 class StatusCode;
26 
27 template <class T> class FullEventAssembler;
28 
29 namespace LVL1 {
30  class CMXEtSums;
31  class CMXRoI;
32  class JEMTobRoI;
33  class JEPRoIBSCollectionV2;
34 }
35 
36 namespace LVL1BS {
37 
38 class JemRoiSubBlockV2;
39 class L1CaloErrorByteStreamTool;
40 class L1CaloSrcIdMap;
41 
51 
52  public:
53  JepRoiByteStreamV2Tool(const std::string& type, const std::string& name,
54  const IInterface* parent);
55  virtual ~JepRoiByteStreamV2Tool();
56 
58  static const InterfaceID& interfaceID();
59 
60  virtual StatusCode initialize() override;
61  virtual StatusCode finalize() override;
62 
64  StatusCode convert(const std::string& name,
65  DataVector<LVL1::JEMTobRoI>* jeCollection) const;
67  DataVector<LVL1::JEMTobRoI>* jeCollection) const;
69  StatusCode convert(const std::string& name,
70  LVL1::CMXRoI* cmCollection) const;
71 
73  LVL1::CMXRoI* cmCollection) const;
74 
77 
79  const std::vector<uint32_t>& sourceIDs(const std::string& sgKey) const;
80 
81  private:
83  { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
84 
87  typedef std::map<uint32_t, const LVL1::JEMTobRoI*> JemRoiMap;
88  typedef std::map<int, const LVL1::CMXEtSums*> CmxSumsMap;
89  typedef IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator;
92 
95  DataVector<LVL1::JEMTobRoI>* jeCollection,
96  LVL1::CMXRoI* cmCollection) const;
97 
100  ToolHandle<LVL1BS::L1CaloErrorByteStreamTool> m_errorTool;
101 
103  const LVL1::CMXEtSums* findCmxSums(int crate, int source,
104  const CmxSumsMap& cmxEtMap) const;
105 
106  std::vector<uint32_t> makeSourceIDs (bool roiDaq) const;
107 
109  void setupJemRoiMap(const JemRoiCollection* jeCollection,
110  JemRoiMap& roiMap) const;
112  void setupCmxEtMap(const CmxSumsCollection* enCollection,
113  CmxSumsMap& cmxEtMap) const;
114 
116  void energySubBlockTypes(int source,
119  CmxEnergySubBlock::HitsType& hitType) const;
120 
130  const int m_crates;
132  const int m_modules;
134  const int m_frames;
136  const int m_maxRoiWords;
138  int m_slinks;
144  std::vector<uint32_t> m_sourceIDsProp;
146  std::vector<uint32_t> m_sourceIDsRoIBProp;
148  const eformat::SubDetector m_subDetector;
151 };
152 
153 } // end namespace
154 
155 #endif
LVL1BS::JepRoiByteStreamV2Tool::JemRoiCollection
DataVector< LVL1::JEMTobRoI > JemRoiCollection
Definition: JepRoiByteStreamV2Tool.h:85
LVL1BS::JepRoiByteStreamV2Tool::setupJemRoiMap
void setupJemRoiMap(const JemRoiCollection *jeCollection, JemRoiMap &roiMap) const
Set up JEM RoIs map.
Definition: JepRoiByteStreamV2Tool.cxx:643
LVL1BS::JepRoiByteStreamV2Tool::m_dataFormat
int m_dataFormat
Property: Data compression format.
Definition: JepRoiByteStreamV2Tool.h:128
LVL1BS::JepRoiByteStreamV2Tool::m_sourceIDsProp
std::vector< uint32_t > m_sourceIDsProp
Property: ROB source IDs.
Definition: JepRoiByteStreamV2Tool.h:144
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition: FullEventAssembler.h:40
LVL1BS::JepRoiByteStreamV2Tool::m_sourceIDsRoIBProp
std::vector< uint32_t > m_sourceIDsRoIBProp
Property: ROB source IDs for RoIB.
Definition: JepRoiByteStreamV2Tool.h:146
LVL1BS::JepRoiByteStreamV2Tool::RODPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
Definition: JepRoiByteStreamV2Tool.h:91
xAOD::JEMTobRoI
JEMTobRoI_v1 JEMTobRoI
Define the latest version of the JEMTobRoI class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/JEMTobRoI.h:17
LVL1BS::L1CaloSrcIdMap
This class provides conversion between Lower level Source ID to higher level source ID for L1Calo Byt...
Definition: L1CaloSrcIdMap.h:24
LVL1BS::CmxEnergySubBlock::SourceType
SourceType
Definition: CmxEnergySubBlock.h:29
LVL1::CMXRoI
CMX RoI data.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXRoI.h:22
LVL1BS::JepRoiByteStreamV2Tool::m_crateMax
int m_crateMax
Property: Maximum crate number when writing out bytestream.
Definition: JepRoiByteStreamV2Tool.h:142
LVL1BS::JepRoiByteStreamV2Tool::~JepRoiByteStreamV2Tool
virtual ~JepRoiByteStreamV2Tool()
Definition: JepRoiByteStreamV2Tool.cxx:84
LVL1BS::JepRoiByteStreamV2Tool::m_errorTool
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_errorTool
Property: Error collection tool.
Definition: JepRoiByteStreamV2Tool.h:100
LVL1BS::JepRoiByteStreamV2Tool::finalize
virtual StatusCode finalize() override
Definition: JepRoiByteStreamV2Tool.cxx:103
LVL1::JEPRoIBSCollectionV2
Jet/Energy Processor RoI container for writing bytestream post-LS1.
Definition: JEPRoIBSCollectionV2.h:24
LVL1BS::JepRoiByteStreamV2Tool::JepRoiByteStreamV2Tool
JepRoiByteStreamV2Tool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: JepRoiByteStreamV2Tool.cxx:44
LVL1BS::JepRoiByteStreamV2Tool::setupCmxEtMap
void setupCmxEtMap(const CmxSumsCollection *enCollection, CmxSumsMap &cmxEtMap) const
Set up CMX energy sums map.
Definition: JepRoiByteStreamV2Tool.cxx:661
LVL1BS::JepRoiByteStreamV2Tool::m_subDetector
const eformat::SubDetector m_subDetector
Sub-detector type.
Definition: JepRoiByteStreamV2Tool.h:148
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1BS::JepRoiByteStreamV2Tool::m_frames
const int m_frames
Number of RoI frames.
Definition: JepRoiByteStreamV2Tool.h:134
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
LVL1BS::CmxEnergySubBlock::HitsType
HitsType
Definition: CmxEnergySubBlock.h:28
xAOD::CMXRoI
CMXRoI_v1 CMXRoI
Define the latest version of the CMXRoI class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/CMXRoI.h:14
RawEvent.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1BS::JepRoiByteStreamV2Tool::m_crateMin
int m_crateMin
Property: Minimum crate number when writing out bytestream.
Definition: JepRoiByteStreamV2Tool.h:140
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1BS::JepRoiByteStreamV2Tool::m_maxRoiWords
const int m_maxRoiWords
Number of CMX energy RoI words.
Definition: JepRoiByteStreamV2Tool.h:136
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition: IROBDataProviderSvc.h:27
DataVector< LVL1::JEMTobRoI >
LVL1BS::JepRoiByteStreamV2Tool::m_modules
const int m_modules
Number of JEM modules per crate.
Definition: JepRoiByteStreamV2Tool.h:132
xAOD::CMXEtSums
CMXEtSums_v1 CMXEtSums
Define the latest version of the CMXEtSums class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/CMXEtSums.h:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LVL1BS::JepRoiByteStreamV2Tool::m_crates
const int m_crates
Number of crates.
Definition: JepRoiByteStreamV2Tool.h:130
LVL1BS::JepRoiByteStreamV2Tool
Tool to perform ROB fragments to JEM RoI and CMX RoI, and JEP RoI container to raw data conversions.
Definition: JepRoiByteStreamV2Tool.h:50
LVL1BS::JepRoiByteStreamV2Tool::energySubBlockTypes
void energySubBlockTypes(int source, CmxEnergySubBlock::SourceType &srcType, CmxEnergySubBlock::SumType &sumType, CmxEnergySubBlock::HitsType &hitType) const
Get energy subBlock types from CMXEtSums source type.
Definition: JepRoiByteStreamV2Tool.cxx:680
LVL1BS::JepRoiByteStreamV2Tool::m_crateOffsetHw
int m_crateOffsetHw
Property: Hardware crate number offset.
Definition: JepRoiByteStreamV2Tool.h:122
LVL1BS::JepRoiByteStreamV2Tool::ROBPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
Definition: JepRoiByteStreamV2Tool.h:90
LVL1::CMXEtSums
CMXEtSums object stores Et sums from the Energy CMXs.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXEtSums.h:27
LVL1BS::JepRoiByteStreamV2Tool::m_crateOffsetSw
int m_crateOffsetSw
Property: Software crate number offset.
Definition: JepRoiByteStreamV2Tool.h:124
LVL1BS::JepRoiByteStreamV2Tool::m_byteStreamCnvSvc
ServiceHandle< IByteStreamCnvSvc > m_byteStreamCnvSvc
Definition: JepRoiByteStreamV2Tool.h:83
LVL1BS::JepRoiByteStreamV2Tool::initialize
virtual StatusCode initialize() override
Definition: JepRoiByteStreamV2Tool.cxx:91
LVL1BS::JepRoiByteStreamV2Tool::sourceIDs
const std::vector< uint32_t > & sourceIDs(const std::string &sgKey) const
Return reference to vector with all possible Source Identifiers.
Definition: JepRoiByteStreamV2Tool.cxx:361
LVL1BS::JepRoiByteStreamV2Tool::convert
StatusCode convert(const std::string &name, DataVector< LVL1::JEMTobRoI > *jeCollection) const
Convert ROB fragments to JEM RoIs.
Definition: JepRoiByteStreamV2Tool.cxx:110
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
LVL1BS::CmxEnergySubBlock::SumType
SumType
Definition: CmxEnergySubBlock.h:30
LVL1BS::JepRoiByteStreamV2Tool::JemRoiMap
std::map< uint32_t, const LVL1::JEMTobRoI * > JemRoiMap
Definition: JepRoiByteStreamV2Tool.h:87
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1BS::JepRoiByteStreamV2Tool::findCmxSums
const LVL1::CMXEtSums * findCmxSums(int crate, int source, const CmxSumsMap &cmxEtMap) const
Find CMX energy sums for given crate, source.
Definition: JepRoiByteStreamV2Tool.cxx:630
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47
LVL1BS::JepRoiByteStreamV2Tool::m_slinks
int m_slinks
Property: Number of slinks per crate when writing out bytestream.
Definition: JepRoiByteStreamV2Tool.h:138
LVL1BS::JepRoiByteStreamV2Tool::ROBIterator
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Definition: JepRoiByteStreamV2Tool.h:89
LVL1BS::JepRoiByteStreamV2Tool::m_version
int m_version
Property: Sub_block header version.
Definition: JepRoiByteStreamV2Tool.h:126
copySelective.source
string source
Definition: copySelective.py:32
LVL1BS::JepRoiByteStreamV2Tool::makeSourceIDs
std::vector< uint32_t > makeSourceIDs(bool roiDaq) const
Definition: JepRoiByteStreamV2Tool.cxx:327
AthAlgTool
Definition: AthAlgTool.h:26
IByteStreamCnvSvc.h
LVL1BS::JepRoiByteStreamV2Tool::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Definition: JepRoiByteStreamV2Tool.h:98
LVL1BS::JepRoiByteStreamV2Tool::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition: JepRoiByteStreamV2Tool.cxx:37
LVL1BS::JepRoiByteStreamV2Tool::CmxSumsMap
std::map< int, const LVL1::CMXEtSums * > CmxSumsMap
Definition: JepRoiByteStreamV2Tool.h:88
LVL1BS::JepRoiByteStreamV2Tool::m_srcIdMap
const L1CaloSrcIdMap m_srcIdMap
Source ID converter.
Definition: JepRoiByteStreamV2Tool.h:150
IROBDataProviderSvc.h
LVL1BS::JepRoiByteStreamV2Tool::convertBs
StatusCode convertBs(const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::JEMTobRoI > *jeCollection, LVL1::CMXRoI *cmCollection) const
Convert bytestream to given container type.
Definition: JepRoiByteStreamV2Tool.cxx:381
LVL1BS::JepRoiByteStreamV2Tool::CmxSumsCollection
DataVector< LVL1::CMXEtSums > CmxSumsCollection
Definition: JepRoiByteStreamV2Tool.h:86
CmxEnergySubBlock.h
ServiceHandle< IByteStreamCnvSvc >