ATLAS Offline Software
JepRoiByteStreamTool.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_JEPROIBYTESTREAMTOOL_H
6 #define TRIGT1CALOBYTESTREAM_JEPROIBYTESTREAMTOOL_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 <class T> class FullEventAssembler;
28 
29 namespace LVL1 {
30  class CMMJetHits;
31  class CMMEtSums;
32  class CMMRoI;
33  class JEMRoI;
34  class JEPRoIBSCollection;
35 }
36 
37 namespace LVL1BS {
38 
39 class CmmEnergySubBlock;
40 class CmmJetSubBlock;
41 class JemRoiSubBlock;
42 class L1CaloErrorByteStreamTool;
43 class L1CaloSrcIdMap;
44 
54 
55  public:
56  JepRoiByteStreamTool(const std::string& type, const std::string& name,
57  const IInterface* parent);
58  virtual ~JepRoiByteStreamTool();
59 
61  static const InterfaceID& interfaceID();
62 
63  virtual StatusCode initialize() override;
64  virtual StatusCode finalize() override;
65 
68  DataVector<LVL1::JEMRoI>* jeCollection) const;
71  LVL1::CMMRoI* cmCollection) const;
72 
75 
77  const std::vector<uint32_t>& sourceIDs(const std::string& sgKey) const;
78 
79  private:
81  { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };
82 
86  typedef std::map<uint32_t, const LVL1::JEMRoI*> JemRoiMap;
87  typedef std::map<int, const LVL1::CMMJetHits*> CmmHitsMap;
88  typedef std::map<int, const LVL1::CMMEtSums*> CmmSumsMap;
89  typedef IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator;
92 
95  DataVector<LVL1::JEMRoI>* jeCollection,
96  LVL1::CMMRoI* cmCollection) const;
97 
99  ToolHandle<LVL1BS::L1CaloErrorByteStreamTool> m_errorTool;
100 
102  const LVL1::CMMJetHits* findCmmHits(int crate, int dataID,
103  const CmmHitsMap& cmmHitsMap) const;
105  const LVL1::CMMEtSums* findCmmSums(int crate, int dataID,
106  const CmmSumsMap& cmmEtMap) const;
107 
108  std::vector<uint32_t> makeSourceIDs (bool roiDaq) const;
109 
111  void setupJemRoiMap(const JemRoiCollection* jeCollection,
112  JemRoiMap& roiMap) const;
114  void setupCmmHitsMap(const CmmHitsCollection* hitCollection,
115  CmmHitsMap& cmmHitsMap) const;
117  void setupCmmEtMap(const CmmSumsCollection* enCollection,
118  CmmSumsMap& cmmEtMap) const;
119 
129  const int m_crates;
131  const int m_modules;
133  int m_slinks;
135  std::vector<uint32_t> m_sourceIDsProp;
137  std::vector<uint32_t> m_sourceIDsRoIBProp;
139  const eformat::SubDetector m_subDetector;
142 };
143 
144 } // end namespace
145 
146 #endif
LVL1BS::JepRoiByteStreamTool::JemRoiMap
std::map< uint32_t, const LVL1::JEMRoI * > JemRoiMap
Definition: JepRoiByteStreamTool.h:86
xAOD::CMMRoI
CMMRoI_v1 CMMRoI
Define the latest version of the CMMRoI class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/CMMRoI.h:14
LVL1BS::JepRoiByteStreamTool::m_modules
const int m_modules
Number of JEM modules per crate.
Definition: JepRoiByteStreamTool.h:131
LVL1BS::JepRoiByteStreamTool::m_slinks
int m_slinks
Property: Number of slinks per crate when writing out bytestream.
Definition: JepRoiByteStreamTool.h:133
LVL1BS::JepRoiByteStreamTool::findCmmSums
const LVL1::CMMEtSums * findCmmSums(int crate, int dataID, const CmmSumsMap &cmmEtMap) const
Find CMM energy sums for given crate, data ID.
Definition: JepRoiByteStreamTool.cxx:687
LVL1BS::JepRoiByteStreamTool::m_sourceIDsRoIBProp
std::vector< uint32_t > m_sourceIDsRoIBProp
Property: ROB source IDs for RoIB.
Definition: JepRoiByteStreamTool.h:137
LVL1BS::JepRoiByteStreamTool::JepRoiByteStreamTool
JepRoiByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: JepRoiByteStreamTool.cxx:47
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition: FullEventAssembler.h:40
LVL1BS::JepRoiByteStreamTool::m_subDetector
const eformat::SubDetector m_subDetector
Sub-detector type.
Definition: JepRoiByteStreamTool.h:139
LVL1BS::L1CaloSrcIdMap
This class provides conversion between Lower level Source ID to higher level source ID for L1Calo Byt...
Definition: L1CaloSrcIdMap.h:24
LVL1::CMMEtSums
CMMEtSums object stores Et sums from the Energy CMMs.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMEtSums.h:33
LVL1BS::JepRoiByteStreamTool::m_srcIdMap
const L1CaloSrcIdMap m_srcIdMap
Source ID converter.
Definition: JepRoiByteStreamTool.h:141
LVL1BS::JepRoiByteStreamTool::m_dataFormat
int m_dataFormat
Property: Data compression format.
Definition: JepRoiByteStreamTool.h:127
LVL1BS::JepRoiByteStreamTool::JemRoiCollection
DataVector< LVL1::JEMRoI > JemRoiCollection
Definition: JepRoiByteStreamTool.h:83
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1BS::JepRoiByteStreamTool::ROBPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
Definition: JepRoiByteStreamTool.h:90
LVL1BS::JepRoiByteStreamTool::CmmHitsCollection
DataVector< LVL1::CMMJetHits > CmmHitsCollection
Definition: JepRoiByteStreamTool.h:84
LVL1BS::JepRoiByteStreamTool::initialize
virtual StatusCode initialize() override
Definition: JepRoiByteStreamTool.cxx:87
LVL1BS::JepRoiByteStreamTool::m_crates
const int m_crates
Number of crates.
Definition: JepRoiByteStreamTool.h:129
LVL1BS::JepRoiByteStreamTool::m_version
int m_version
Property: Sub_block header version.
Definition: JepRoiByteStreamTool.h:125
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
LVL1BS::JepRoiByteStreamTool::sourceIDs
const std::vector< uint32_t > & sourceIDs(const std::string &sgKey) const
Return reference to vector with all possible Source Identifiers.
Definition: JepRoiByteStreamTool.cxx:429
LVL1BS::JepRoiByteStreamTool::finalize
virtual StatusCode finalize() override
Definition: JepRoiByteStreamTool.cxx:99
LVL1BS::JepRoiByteStreamTool::m_crateOffsetSw
int m_crateOffsetSw
Property: Software crate number offset.
Definition: JepRoiByteStreamTool.h:123
LVL1BS::JepRoiByteStreamTool::setupCmmHitsMap
void setupCmmHitsMap(const CmmHitsCollection *hitCollection, CmmHitsMap &cmmHitsMap) const
Set up CMM hits map.
Definition: JepRoiByteStreamTool.cxx:718
RawEvent.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1BS::JepRoiByteStreamTool::CmmSumsCollection
DataVector< LVL1::CMMEtSums > CmmSumsCollection
Definition: JepRoiByteStreamTool.h:85
LVL1::JEPRoIBSCollection
Jet/Energy Processor RoI container for writing bytestream.
Definition: JEPRoIBSCollection.h:25
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition: IROBDataProviderSvc.h:27
DataVector< LVL1::JEMRoI >
LVL1BS::JepRoiByteStreamTool::setupJemRoiMap
void setupJemRoiMap(const JemRoiCollection *jeCollection, JemRoiMap &roiMap) const
Set up JEM RoIs map.
Definition: JepRoiByteStreamTool.cxx:700
LVL1BS::JepRoiByteStreamTool::RODPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
Definition: JepRoiByteStreamTool.h:91
LVL1BS::JepRoiByteStreamTool::convert
StatusCode convert(const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::JEMRoI > *jeCollection) const
Convert ROB fragments to JEM RoIs.
Definition: JepRoiByteStreamTool.cxx:106
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LVL1BS::JepRoiByteStreamTool::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition: JepRoiByteStreamTool.cxx:40
xAOD::CMMEtSums
CMMEtSums_v1 CMMEtSums
Define the latest version of the CMMEtSums class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/CMMEtSums.h:14
LVL1BS::JepRoiByteStreamTool::makeSourceIDs
std::vector< uint32_t > makeSourceIDs(bool roiDaq) const
Definition: JepRoiByteStreamTool.cxx:395
LVL1BS::JepRoiByteStreamTool::m_byteStreamCnvSvc
ServiceHandle< IByteStreamCnvSvc > m_byteStreamCnvSvc
Definition: JepRoiByteStreamTool.h:81
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
LVL1BS::JepRoiByteStreamTool::ROBIterator
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Definition: JepRoiByteStreamTool.h:89
LVL1BS::JepRoiByteStreamTool::m_errorTool
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_errorTool
Error collection tool.
Definition: JepRoiByteStreamTool.h:99
LVL1BS::JepRoiByteStreamTool::findCmmHits
const LVL1::CMMJetHits * findCmmHits(int crate, int dataID, const CmmHitsMap &cmmHitsMap) const
Find CMM hits for given crate, data ID.
Definition: JepRoiByteStreamTool.cxx:674
LVL1BS::JepRoiByteStreamTool::m_sourceIDsProp
std::vector< uint32_t > m_sourceIDsProp
Property: ROB source IDs.
Definition: JepRoiByteStreamTool.h:135
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1BS::JepRoiByteStreamTool::m_crateOffsetHw
int m_crateOffsetHw
Property: Hardware crate number offset.
Definition: JepRoiByteStreamTool.h:121
LVL1BS::JepRoiByteStreamTool
Tool to perform ROB fragments to JEM RoI and CMM RoI, and JEP RoI container to raw data conversions.
Definition: JepRoiByteStreamTool.h:53
LVL1BS
Definition: ZdcModifySlices.h:10
xAOD::CMMJetHits
CMMJetHits_v1 CMMJetHits
Define the latest version of the CMMJetHits class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/CMMJetHits.h:14
LVL1::CMMJetHits
CMMJetHits class stores Jet hit multiplicities received by and read out from the Jet CMMs.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMJetHits.h:32
L1CaloSrcIdMap.h
LVL1BS::JepRoiByteStreamTool::setupCmmEtMap
void setupCmmEtMap(const CmmSumsCollection *enCollection, CmmSumsMap &cmmEtMap) const
Set up CMM energy sums map.
Definition: JepRoiByteStreamTool.cxx:737
LVL1BS::JepRoiByteStreamTool::convertBs
StatusCode convertBs(const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::JEMRoI > *jeCollection, LVL1::CMMRoI *cmCollection) const
Convert bytestream to given container type.
Definition: JepRoiByteStreamTool.cxx:449
AthAlgTool
Definition: AthAlgTool.h:26
IByteStreamCnvSvc.h
LVL1BS::JepRoiByteStreamTool::CmmSumsMap
std::map< int, const LVL1::CMMEtSums * > CmmSumsMap
Definition: JepRoiByteStreamTool.h:88
LVL1BS::JepRoiByteStreamTool::CmmHitsMap
std::map< int, const LVL1::CMMJetHits * > CmmHitsMap
Definition: JepRoiByteStreamTool.h:87
LVL1BS::JepRoiByteStreamTool::~JepRoiByteStreamTool
virtual ~JepRoiByteStreamTool()
Definition: JepRoiByteStreamTool.cxx:80
IROBDataProviderSvc.h
LVL1::CMMRoI
CMM RoI data.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMRoI.h:21
xAOD::JEMRoI
JEMRoI_v1 JEMRoI
Define the latest version of the JEMRoI class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/JEMRoI.h:14
ServiceHandle< IByteStreamCnvSvc >