ATLAS Offline Software
CpmRoiByteStreamV2Tool.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_CPMROIBYTESTREAMV2TOOL_H
6 #define TRIGT1CALOBYTESTREAM_CPMROIBYTESTREAMV2TOOL_H
7 
8 #include <stdint.h>
9 
10 #include <map>
11 #include <string>
12 #include <vector>
13 
14 #include "L1CaloSrcIdMap.h"
20 #include "eformat/SourceIdentifier.h"
21 #include "GaudiKernel/ToolHandle.h"
22 
23 class IInterface;
24 class InterfaceID;
25 class StatusCode;
26 
27 template <typename> class FullEventAssembler;
28 
29 namespace LVL1 {
30  class CPMTobRoI;
31 }
32 
33 namespace LVL1BS {
34 
35 class CpmRoiSubBlockV2;
36 class L1CaloErrorByteStreamTool;
37 class L1CaloSrcIdMap;
38 
48 
49  public:
50  CpmRoiByteStreamV2Tool(const std::string& type, const std::string& name,
51  const IInterface* parent);
52  virtual ~CpmRoiByteStreamV2Tool();
53 
55  static const InterfaceID& interfaceID();
56 
57  virtual StatusCode initialize() override;
58 
60  StatusCode convert(const std::string& robFrags,
61  DataVector<LVL1::CPMTobRoI>* roiCollection) const;
63  DataVector<LVL1::CPMTobRoI>* roiCollection) const;
64 
66  StatusCode convert(const DataVector<LVL1::CPMTobRoI>* roiCollection) const;
67 
69  const std::vector<uint32_t>& sourceIDs(const std::string& sgKey) const;
70 
71  private:
73  { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
74 
76  typedef std::map<uint32_t, const LVL1::CPMTobRoI*> CpmRoiMap;
77  typedef IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator;
80 
81  std::vector<uint32_t> makeSourceIDs (bool roiDaq) const;
82 
84  void setupCpmRoiMap(const CpmRoiCollection* roiCollection,
85  CpmRoiMap& roiMap) const;
86 
89  ToolHandle<LVL1BS::L1CaloErrorByteStreamTool> m_errorTool;
90 
96  int m_version;
100  const int m_crates;
102  const int m_modules;
104  int m_slinks;
110  std::vector<uint32_t> m_sourceIDsProp;
112  std::vector<uint32_t> m_sourceIDsRoIBProp;
114  const eformat::SubDetector m_subDetector;
117 
118  // Property: M7 format follows old specification, so we have two zeros
119  // as most significant bits instead of 0xa
121 };
122 
123 } // end namespace
124 
125 #endif
LVL1BS::CpmRoiByteStreamV2Tool::m_slinks
int m_slinks
Property: Number of slinks per crate when writing out bytestream.
Definition: CpmRoiByteStreamV2Tool.h:104
LVL1BS::CpmRoiByteStreamV2Tool::ROBPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
Definition: CpmRoiByteStreamV2Tool.h:78
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition: FullEventAssembler.h:40
LVL1BS::CpmRoiByteStreamV2Tool::CpmRoiMap
std::map< uint32_t, const LVL1::CPMTobRoI * > CpmRoiMap
Definition: CpmRoiByteStreamV2Tool.h:76
LVL1BS::L1CaloSrcIdMap
This class provides conversion between Lower level Source ID to higher level source ID for L1Calo Byt...
Definition: L1CaloSrcIdMap.h:24
LVL1BS::CpmRoiByteStreamV2Tool
Tool to perform ROB fragments to CPM TOB RoI and CPM TOB RoI to raw data conversions.
Definition: CpmRoiByteStreamV2Tool.h:47
LVL1BS::CpmRoiByteStreamV2Tool::m_crateOffsetHw
int m_crateOffsetHw
Property: Hardware crate number offset.
Definition: CpmRoiByteStreamV2Tool.h:92
LVL1BS::CpmRoiByteStreamV2Tool::m_crates
const int m_crates
Number of crates.
Definition: CpmRoiByteStreamV2Tool.h:100
LVL1BS::CpmRoiByteStreamV2Tool::m_dataFormat
int m_dataFormat
Property: Data compression format.
Definition: CpmRoiByteStreamV2Tool.h:98
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1BS::CpmRoiByteStreamV2Tool::m_errorTool
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_errorTool
Property: Error collection tool.
Definition: CpmRoiByteStreamV2Tool.h:89
LVL1BS::CpmRoiByteStreamV2Tool::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition: CpmRoiByteStreamV2Tool.cxx:33
LVL1BS::CpmRoiByteStreamV2Tool::m_crateMin
int m_crateMin
Property: Minimum crate number when writing out bytestream.
Definition: CpmRoiByteStreamV2Tool.h:106
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
LVL1BS::CpmRoiByteStreamV2Tool::m_srcIdMap
const L1CaloSrcIdMap m_srcIdMap
Source ID converter.
Definition: CpmRoiByteStreamV2Tool.h:116
RawEvent.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1BS::CpmRoiByteStreamV2Tool::m_crateOffsetSw
int m_crateOffsetSw
Property: Software crate number offset.
Definition: CpmRoiByteStreamV2Tool.h:94
LVL1BS::CpmRoiByteStreamV2Tool::initialize
virtual StatusCode initialize() override
Definition: CpmRoiByteStreamV2Tool.cxx:90
AthAlgTool.h
LVL1BS::CpmRoiByteStreamV2Tool::m_version
int m_version
Property: Sub_block header version.
Definition: CpmRoiByteStreamV2Tool.h:96
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1BS::CpmRoiByteStreamV2Tool::m_byteStreamCnvSvc
ServiceHandle< IByteStreamCnvSvc > m_byteStreamCnvSvc
Definition: CpmRoiByteStreamV2Tool.h:73
LVL1BS::CpmRoiByteStreamV2Tool::m_subDetector
const eformat::SubDetector m_subDetector
Sub-detector type.
Definition: CpmRoiByteStreamV2Tool.h:114
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition: IROBDataProviderSvc.h:27
LVL1BS::CpmRoiByteStreamV2Tool::m_modules
const int m_modules
Number of CPM modules per crate.
Definition: CpmRoiByteStreamV2Tool.h:102
DataVector< LVL1::CPMTobRoI >
LVL1BS::CpmRoiByteStreamV2Tool::CpmRoiCollection
DataVector< LVL1::CPMTobRoI > CpmRoiCollection
Definition: CpmRoiByteStreamV2Tool.h:75
LVL1BS::CpmRoiByteStreamV2Tool::~CpmRoiByteStreamV2Tool
virtual ~CpmRoiByteStreamV2Tool()
Definition: CpmRoiByteStreamV2Tool.cxx:83
LVL1BS::CpmRoiByteStreamV2Tool::sourceIDs
const std::vector< uint32_t > & sourceIDs(const std::string &sgKey) const
Return reference to vector with all possible Source Identifiers.
Definition: CpmRoiByteStreamV2Tool.cxx:496
LVL1BS::CpmRoiByteStreamV2Tool::m_isM7Format
bool m_isM7Format
Definition: CpmRoiByteStreamV2Tool.h:120
LVL1BS::CpmRoiByteStreamV2Tool::RODPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
Definition: CpmRoiByteStreamV2Tool.h:79
LVL1BS::CpmRoiByteStreamV2Tool::convert
StatusCode convert(const std::string &robFrags, DataVector< LVL1::CPMTobRoI > *roiCollection) const
Convert ROB fragments to CPM RoIs.
Definition: CpmRoiByteStreamV2Tool.cxx:102
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LVL1BS::CpmRoiByteStreamV2Tool::CpmRoiByteStreamV2Tool
CpmRoiByteStreamV2Tool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CpmRoiByteStreamV2Tool.cxx:40
LVL1BS::CpmRoiByteStreamV2Tool::m_crateMax
int m_crateMax
Property: Maximum crate number when writing out bytestream.
Definition: CpmRoiByteStreamV2Tool.h:108
LVL1BS::CpmRoiByteStreamV2Tool::m_sourceIDsRoIBProp
std::vector< uint32_t > m_sourceIDsRoIBProp
Property: ROB source IDs for RoIB.
Definition: CpmRoiByteStreamV2Tool.h:112
LVL1BS::CpmRoiByteStreamV2Tool::setupCpmRoiMap
void setupCpmRoiMap(const CpmRoiCollection *roiCollection, CpmRoiMap &roiMap) const
Set up CPM RoI map.
Definition: CpmRoiByteStreamV2Tool.cxx:516
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1BS::CpmRoiByteStreamV2Tool::ROBIterator
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Definition: CpmRoiByteStreamV2Tool.h:77
LVL1BS
Definition: ZdcModifySlices.h:10
L1CaloSrcIdMap.h
LVL1BS::CpmRoiByteStreamV2Tool::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Definition: CpmRoiByteStreamV2Tool.h:87
LVL1BS::CpmRoiByteStreamV2Tool::makeSourceIDs
std::vector< uint32_t > makeSourceIDs(bool roiDaq) const
Definition: CpmRoiByteStreamV2Tool.cxx:462
AthAlgTool
Definition: AthAlgTool.h:26
IByteStreamCnvSvc.h
LVL1BS::CpmRoiByteStreamV2Tool::m_sourceIDsProp
std::vector< uint32_t > m_sourceIDsProp
Property: ROB source IDs.
Definition: CpmRoiByteStreamV2Tool.h:110
IROBDataProviderSvc.h
xAOD::CPMTobRoI
CPMTobRoI_v1 CPMTobRoI
Define the latest version of the CPMTobRoI class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/CPMTobRoI.h:17
ServiceHandle< IByteStreamCnvSvc >