ATLAS Offline Software
ZdcByteStreamTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*
6  * ZdcByteZtreamTool.h
7  *
8  * Created on: May 27, 2009
9  * Author: leite
10  * based on the L1Calo ByteStream Tool
11  *
12  */
13 
14 #ifndef ZDCBYTESTREAMTOOL_H
15 #define ZDCBYTESTREAMTOOL_H
16 
17 #include <stdint.h>
18 
19 #include <map>
20 #include <string>
21 #include <vector>
22 
27 #include "eformat/SourceIdentifier.h"
28 #include "GaudiKernel/ToolHandle.h"
29 
30 class ZdcID;
31 
32 class IInterface;
33 class InterfaceID;
34 class StatusCode;
35 
36 template<class T> class FullEventAssembler;
37 
38 //Use ZdcDigits onde it's fixed
39 //class ZdcRdo;
40 //class ZdcRdoCollection;
41 class ZdcDigits;
43 
44 class ZdcSrcIdMap;
45 class ZdcPpmSubBlock;
46 
54 {
55 
56 public:
57  ZdcByteStreamTool(const std::string& type,
58  const std::string& name,
59  const IInterface* parent);
60 
62  static const InterfaceID& interfaceID();
63 
64  virtual StatusCode initialize() override;
65  virtual StatusCode finalize() override;
66 
69  ZdcDigitsCollection* ttCollection);
70 
72  static StatusCode convert(const ZdcDigitsCollection* ttCollection,
73  RawEventWrite* re);
74 
76  const std::vector<uint32_t>& sourceIDs();
77 
78 private:
79 // typedef DataVector<ZdcDigits> ZdcDigitsCollection;
80  typedef std::map<unsigned int, ZdcDigits*> ZdcDigitsMap;
81  typedef std::map<unsigned int, const ZdcDigits*> ZdcDigitsMapConst;
82  typedef IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator;
84 
86  void addCompStats(const std::vector<uint32_t>& stats);
88  void printCompStats() const;
90  void printVec(const std::vector<int>& vec) const;
91 
93  //int m_version;
97  //int m_compVers;
103  int m_crates;
105  //int m_modules;
107  int m_slinks;
125  std::vector<uint32_t> m_sourceIDs;
127  eformat::SubDetector m_subDetector;
135  std::vector<uint32_t> m_compStats;
137  std::vector<uint32_t>* m_rodStatus;
139  std::map<uint32_t, std::vector<uint32_t>*> m_rodStatusMap;
140 
141  const ZdcID* m_zdcID{};
142 
143 };
144 
145 #endif /* ZDCBYTESTREAMTOOL_H*/
RawEventWrite
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
Definition: RawEvent.h:39
ZdcByteStreamTool::m_channels
int m_channels
Number of channels per module (may not all be used)
Definition: ZdcByteStreamTool.h:101
ZdcByteStreamTool::m_ppmBlocks
DataVector< ZdcPpmSubBlock > m_ppmBlocks
Vector for current PPM sub-blocks.
Definition: ZdcByteStreamTool.h:133
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition: FullEventAssembler.h:40
ZdcByteStreamTool::m_rodStatusMap
std::map< uint32_t, std::vector< uint32_t > * > m_rodStatusMap
ROD status map.
Definition: ZdcByteStreamTool.h:139
ZdcByteStreamTool::m_dataFormat
int m_dataFormat
Sub_block header version.
Definition: ZdcByteStreamTool.h:95
ZdcDigits
Definition: ZdcDigits.h:28
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
ZdcByteStreamTool::RODPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
Definition: ZdcByteStreamTool.h:83
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
ZdcByteStreamTool::sourceIDs
const std::vector< uint32_t > & sourceIDs()
Return reference to vector with all possible Source Identifiers.
Definition: ZdcByteStreamTool.cxx:602
ZdcByteStreamTool::m_zeroSuppress
int m_zeroSuppress
Zero suppression on input.
Definition: ZdcByteStreamTool.h:123
ZdcByteStreamTool::m_dfltSlicesLut
int m_dfltSlicesLut
Default number of LUT slices in simulation.
Definition: ZdcByteStreamTool.h:109
ZdcByteStreamTool::m_dfltSlicesFadc
int m_dfltSlicesFadc
Default number of FADC slices in simulation.
Definition: ZdcByteStreamTool.h:111
ZdcByteStreamTool::printCompStats
void printCompStats() const
Print compression stats.
Definition: ZdcByteStreamTool.cxx:588
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
ZdcByteStreamTool
Tool to perform ROB fragments to ZdcDigits and from ZdcDigits to raw data conversions.
Definition: ZdcByteStreamTool.h:54
ZdcByteStreamTool::m_rodStatus
std::vector< uint32_t > * m_rodStatus
ROD Status words.
Definition: ZdcByteStreamTool.h:137
ZdcByteStreamTool::m_errorBlock
ZdcPpmSubBlock * m_errorBlock
Trigger tower key provider.
Definition: ZdcByteStreamTool.h:131
ZdcByteStreamTool::m_fadcThreshold
int m_fadcThreshold
FADC threshold for super-compressed format.
Definition: ZdcByteStreamTool.h:121
RawEvent.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ZdcByteStreamTool::m_forceSlicesFadc
int m_forceSlicesFadc
Force number of FADC slices in bytestream.
Definition: ZdcByteStreamTool.h:115
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ZdcByteStreamTool::convert
StatusCode convert(const IROBDataProviderSvc::VROBFRAG &robFrags, ZdcDigitsCollection *ttCollection)
Convert ROB fragments to ZdcCollection.
Definition: ZdcByteStreamTool.cxx:143
ZdcByteStreamTool::addCompStats
void addCompStats(const std::vector< uint32_t > &stats)
Add compression stats to totals.
Definition: ZdcByteStreamTool.cxx:576
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition: IROBDataProviderSvc.h:27
ZdcByteStreamTool::m_pedestal
int m_pedestal
Pedestal value.
Definition: ZdcByteStreamTool.h:117
ZdcByteStreamTool::printVec
void printVec(const std::vector< int > &vec) const
Print a vector.
Definition: ZdcByteStreamTool.cxx:622
ZdcByteStreamTool::ROBIterator
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Definition: ZdcByteStreamTool.h:82
DataVector< ZdcPpmSubBlock >
ZdcByteStreamTool::m_compStats
std::vector< uint32_t > m_compStats
Vector for compression statistics.
Definition: ZdcByteStreamTool.h:135
ZdcByteStreamTool::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition: ZdcByteStreamTool.cxx:40
ZdcByteStreamTool::m_crates
int m_crates
Number of crates.
Definition: ZdcByteStreamTool.h:103
ZdcByteStreamTool::ZdcDigitsMapConst
std::map< unsigned int, const ZdcDigits * > ZdcDigitsMapConst
Definition: ZdcByteStreamTool.h:81
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ZdcByteStreamTool::ZdcDigitsMap
std::map< unsigned int, ZdcDigits * > ZdcDigitsMap
Definition: ZdcByteStreamTool.h:80
ZdcByteStreamTool::m_printCompStats
int m_printCompStats
Compression version.
Definition: ZdcByteStreamTool.h:99
ZdcByteStreamTool::m_slinks
int m_slinks
Number of modules per crate (may not all exist)
Definition: ZdcByteStreamTool.h:107
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
ZdcByteStreamTool::m_fadcBaseline
int m_fadcBaseline
FADC baseline lower bound.
Definition: ZdcByteStreamTool.h:119
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
re
const boost::regex re(r_e)
ZdcByteStreamTool::ZdcByteStreamTool
ZdcByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ZdcByteStreamTool.cxx:46
ZdcByteStreamTool::finalize
virtual StatusCode finalize() override
Definition: ZdcByteStreamTool.cxx:125
ZdcDigitsCollection
Definition: ZdcDigitsCollection.h:20
ZdcByteStreamTool::m_zdcID
const ZdcID * m_zdcID
Definition: ZdcByteStreamTool.h:141
ZdcPpmSubBlock
Sub-Block class for PPM data.
Definition: ZdcPpmSubBlock.h:30
ZdcSrcIdMap
This class provides conversion between Lower level Source ID to higher level source ID for L1Calo Byt...
Definition: ZdcSrcIdMap.h:24
AthAlgTool
Definition: AthAlgTool.h:26
ZdcByteStreamTool::initialize
virtual StatusCode initialize() override
Definition: ZdcByteStreamTool.cxx:93
ZdcID
Definition: ZdcID.h:25
ZdcByteStreamTool::m_sourceIDs
std::vector< uint32_t > m_sourceIDs
ROB source IDs.
Definition: ZdcByteStreamTool.h:125
ZdcByteStreamTool::m_subDetector
eformat::SubDetector m_subDetector
Sub-detector type.
Definition: ZdcByteStreamTool.h:127
ZdcByteStreamTool::m_srcIdMap
ZdcSrcIdMap * m_srcIdMap
Source ID converter.
Definition: ZdcByteStreamTool.h:129
IROBDataProviderSvc.h
ZdcByteStreamTool::m_forceSlicesLut
int m_forceSlicesLut
Force number of LUT slices in bytestream.
Definition: ZdcByteStreamTool.h:113