ATLAS Offline Software
Loading...
Searching...
No Matches
PpmByteStreamV1Tool.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_PPMBYTESTREAMV1TOOL_H
6#define TRIGT1CALOBYTESTREAM_PPMBYTESTREAMV1TOOL_H
7
8#include <stdint.h>
9
10#include <map>
11#include <string>
12#include <vector>
13#include <atomic>
14#include <mutex>
15
16#include "L1CaloSrcIdMap.h"
17#include "PpmSubBlockV1.h"
24#include "eformat/SourceIdentifier.h"
25#include "GaudiKernel/ServiceHandle.h"
26#include "GaudiKernel/ToolHandle.h"
28
29class IInterface;
30class InterfaceID;
31class StatusCode;
32class SegMemSvc;
33
34template <class T> class FullEventAssembler;
35
36namespace LVL1 {
38 class TriggerTower;
39 class TriggerTowerKey;
40}
41
42namespace LVL1BS {
43
45class L1CaloSrcIdMap;
46class PpmSubBlockV1;
47
55
57
58 public:
59 PpmByteStreamV1Tool(const std::string& type, const std::string& name,
60 const IInterface* parent);
61 virtual ~PpmByteStreamV1Tool();
62
64 static const InterfaceID& interfaceID();
65
66 virtual StatusCode initialize() override;
67 virtual StatusCode finalize() override;
68
70 StatusCode convert(const std::string& sgKey,
71 const IROBDataProviderSvc::VROBFRAG& robFrags,
72 DataVector<LVL1::TriggerTower>* ttCollection) const;
73
75 StatusCode convert(const DataVector<LVL1::TriggerTower>* ttCollection,
76 RawEventWrite* re) const;
77
79 const std::vector<uint32_t>& sourceIDs(const std::string& sgKey) const;
80
81 private:
82
84 typedef std::vector<LVL1::TriggerTower*> TriggerTowerVector;
85 typedef std::map<unsigned int, int> TriggerTowerMap;
86 typedef std::map<unsigned int, const LVL1::TriggerTower*>
88 typedef std::vector<uint32_t> ChannelBitVector;
89 typedef IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator;
92
94 void addCompStats(const std::vector<uint32_t>& stats) const;
96 void printCompStats() const;
97
99 const LVL1::TriggerTower* findLayerTriggerTower(double eta, double phi,
100 int layer,
101 const TriggerTowerMapConst& ttEmMap,
102 const TriggerTowerMapConst& ttHadMap,
103 LVL1::TriggerTowerKey& towerKey) const;
105 void setupTTMaps(const TriggerTowerCollection* ttCollection,
106 TriggerTowerMapConst& ttEmMap,
107 TriggerTowerMapConst& ttHadMap,
108 LVL1::TriggerTowerKey& towerKey) const;
109
111 bool slinkSlices(int crate, int module, int modulesPerSlink,
112 int& slicesLut, int& slicesFadc, int& trigLut, int& trigFadc,
113 const TriggerTowerMapConst& ttEmMap,
114 const TriggerTowerMapConst& ttHadMap,
115 LVL1::TriggerTowerKey& towerKey) const;
116
117 std::vector<uint32_t>
118 makeSourceIDs (bool spareChannels, bool muonChannels) const;
119
121 void printVec(const std::vector<int>& vec) const;
122
148
149
151 ToolHandle<LVL1::IL1CaloMappingTool> m_ppmMaps;
153 ToolHandle<LVL1BS::L1CaloErrorByteStreamTool> m_errorTool;
156
158 const int m_version;
162 const int m_compVers;
188 std::vector<uint32_t> m_sourceIDsProp;
190 const eformat::SubDetector m_subDetector;
194 static constexpr unsigned int MAXFORMATS = 10;
195 std::atomic<uint32_t> m_compStats[MAXFORMATS];
196
197 static const int s_crates = 8;
198 static const int s_modules = 16;
199 static const int s_channels = 64;
200 static const int s_dataSize = 3584;
201
202};
203
204} // end namespace
205
206#endif
const boost::regex re(r_e)
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Maintain a set of objects, one per slot.
std::vector< size_t > vec
An STL vector of pointers that by default owns its pointed-to elements.
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
Definition RawEvent.h:39
Define macros for attributes used to control the static checker.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Derived DataVector<T>.
Definition DataVector.h:795
Template class for assembling a full atlas raw event from subfragments.
std::vector< const ROBF * > VROBFRAG
Tool to accumulate ROB/ROD unpacking errors.
This class provides conversion between Lower level Source ID to higher level source ID for L1Calo Byt...
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
int m_crateMax
Property: Maximum crate number when writing out bytestream.
const eformat::SubDetector m_subDetector
Sub-detector type.
static constexpr unsigned int MAXFORMATS
Vector for compression statistics.
std::vector< uint32_t > ChannelBitVector
int m_dataFormat
Property: Data compression format.
int m_crateMin
Property: Minimum crate number when writing out bytestream.
virtual StatusCode initialize() override
const std::vector< uint32_t > & sourceIDs(const std::string &sgKey) const
Return reference to vector with all possible Source Identifiers.
int m_pedestal
Property: Pedestal value.
int m_fadcBaseline
Property: FADC baseline lower bound.
int m_dfltSlicesFadc
Property: Default number of FADC slices in simulation.
std::vector< LVL1::TriggerTower * > TriggerTowerVector
void setupTTMaps(const TriggerTowerCollection *ttCollection, TriggerTowerMapConst &ttEmMap, TriggerTowerMapConst &ttHadMap, LVL1::TriggerTowerKey &towerKey) const
Set up separate Em and Had trigger tower maps.
void printCompStats() const
Print compression stats.
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.
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
int m_fadcThreshold
Property: FADC threshold for super-compressed format.
std::map< unsigned int, int > TriggerTowerMap
int m_slinks
Property: Number of slinks per crate when writing out bytestream.
const int m_version
Sub_block header version.
std::vector< uint32_t > makeSourceIDs(bool spareChannels, bool muonChannels) const
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_errorTool
Property: Error collection tool.
int m_forceSlicesLut
Property: Force number of LUT slices in bytestream.
int m_dfltSlicesLut
Property: Default number of LUT slices in simulation.
void printVec(const std::vector< int > &vec) const
Print a vector.
int m_forceSlicesFadc
Property: Force number of FADC slices in bytestream.
ServiceHandle< SegMemSvc > m_sms
Memory pool service.
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
int m_zeroSuppress
Property: Zero suppression on input.
SG::SlotSpecificObj< SlotData > m_slotData ATLAS_THREAD_SAFE
std::vector< uint32_t > m_sourceIDsProp
Property: ROB source IDs.
const L1CaloSrcIdMap m_srcIdMap
Source ID converter.
int m_printCompStats
Property: Compression statistics print flag.
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.
PpmByteStreamV1Tool(const std::string &type, const std::string &name, const IInterface *parent)
std::map< unsigned int, const LVL1::TriggerTower * > TriggerTowerMapConst
StatusCode convert(const std::string &sgKey, const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::TriggerTower > *ttCollection) const
Convert ROB fragments to trigger towers.
void addCompStats(const std::vector< uint32_t > &stats) const
Add compression stats to totals.
ToolHandle< LVL1::IL1CaloMappingTool > m_ppmMaps
Property: Channel mapping tool.
const int m_compVers
Compression version.
DataVector< LVL1::TriggerTower > TriggerTowerCollection
std::atomic< uint32_t > m_compStats[MAXFORMATS]
virtual StatusCode finalize() override
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Sub-Block class for PPM data.
The TriggerTowerKey object provides the key for each trigger tower depending on its eta-phi coords.
Trigger towers are the inputs to all other parts of the calorimeter trigger.
Maintain a set of objects, one per slot.
Service to access an arena caching allocator.
Definition SegMemSvc.h:28
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
const DataType * PointerType
Definition RawEvent.h:25
PpmSubBlockV1 m_errorBlock
Current error block.
ChannelBitVector m_chanLayer
Mapping vectors.
DataVector< PpmSubBlockV1 > m_ppmBlocks
Vector for current PPM sub-blocks.
LVL1::TriggerTowerKey m_towerKey
Trigger tower key provider.
TriggerTowerVector m_ttData
TriggerTower pool vectors.