ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1CaloFEX
L1CaloFEXByteStream
src
jFexInputByteStreamTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//***************************************************************************
6
// jFexInputByteStreamTool - This tool decodes Run3 jFEX input data!
7
// -------------------
8
// begin : 01 07 2022
9
// email : Sergi.Rodriguez@cern.ch
10
// ***************************************************************************/
11
12
#ifndef JFEXINPUTBYTESTREAMTOOL_H
13
#define JFEXINPUTBYTESTREAMTOOL_H
14
15
// Trigger includes
16
#include "
TrigT1ResultByteStream/IL1TriggerByteStreamTool.h
"
17
#include "
xAODTrigL1Calo/jFexTowerContainer.h
"
18
#include "
xAODTrigL1Calo/jFexTowerAuxContainer.h
"
19
20
// Athena includes
21
#include "
AthenaBaseComps/AthAlgTool.h
"
22
#include "
PathResolver/PathResolver.h
"
23
24
#include "
AthenaMonitoringKernel/Monitored.h
"
25
26
// Gaudi includes
27
#include "Gaudi/Property.h"
28
33
class
jFexInputByteStreamTool
:
public
extends<AthAlgTool, IL1TriggerByteStreamTool> {
34
public
:
35
jFexInputByteStreamTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent);
36
virtual
~jFexInputByteStreamTool
()
override
=
default
;
37
38
// ------------------------- IAlgTool methods --------------------------------
39
virtual
StatusCode
initialize
()
override
;
40
41
// ------------------------- IL1TriggerByteStreamTool methods ----------------------
43
virtual
StatusCode
convertFromBS
(
const
std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vrobf,
const
EventContext& eventContext)
const override
;
44
46
virtual
StatusCode
convertToBS
(std::vector<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment*>& vrobf,
47
const
xAOD::TrigCompositeContainer
*
tc
,
48
const
EventContext& eventContext)
override
;
49
51
virtual
const
std::vector<uint32_t>&
robIds
()
const override
{
52
return
m_robIds
.value();
53
}
54
55
private
:
56
// ------------------------- Properties --------------------------------------
57
58
ToolHandle<GenericMonitoringTool>
m_monTool
{
this
,
"MonTool"
,
""
,
"Monitoring tool"
};
59
bool
m_UseMonitoring
=
false
;
60
61
Gaudi::Property<bool>
m_doThinning
{
this
,
"DoThinning"
,
true
,
"Remove overlapped towers. Only FPGA Core region is saved"
};
62
63
// ROBIDs property required by the interface
64
Gaudi::Property<std::vector<uint32_t>>
m_robIds
{
this
,
"ROBIDs"
, {},
"List of ROB IDs required for conversion to/from xAOD RoI"
};
65
66
// FiberMapping property required by the interface
67
Gaudi::Property<std::string>
m_FiberMapping
{
this
,
"jFexTowerMapping"
,
"L1CaloFEXByteStream/2023-08-01/jFexTowerMap.txt"
,
"Text file to convert from hardware fiber to eta-phi location"
};
68
69
//Write handle keys for the L1Calo EDMs for BS->xAOD mode of operation
70
SG::WriteHandleKey< xAOD::jFexTowerContainer>
m_jTowersWriteKey
{
this
,
"jTowersWriteKey"
,
"L1_jFexDataTowers"
,
"Write jFexEDM Trigger Tower container"
};
71
72
// Read handle keys for the L1Calo EDMs for xAOD->BS mode of operation
73
SG::ReadHandleKey < xAOD::jFexTowerContainer>
m_jTowersReadKey
{
this
,
"jTowersReadKey"
,
"L1_jFexDataTowers"
,
"Read jFexEDM Trigger Tower container"
};
74
75
std::array<uint32_t,4>
jFEXtoRODTrailer
(uint32_t, uint32_t)
const
;
76
std::array<uint16_t,2>
BulkStreamTrailer
(uint32_t, uint32_t, uint32_t)
const
;
77
std::array<uint16_t,3>
Dataformat1
(uint32_t )
const
;
78
std::array<uint16_t,4>
Dataformat2
(uint32_t )
const
;
79
//bool m_verbose = 1;
80
81
// Read Mapping file to link fibers to Simulation ID and Eta/Phi coordinates
82
StatusCode
ReadfromFile
(
const
std::string&);
83
84
// hash the index into one integer in the format 0xJFCCT (hexadecimal)
85
constexpr
static
unsigned
int
mapIndex
(
unsigned
int
jfex,
unsigned
int
fpga,
unsigned
int
channel,
unsigned
int
tower);
86
std::unordered_map<unsigned int, std::array<float,6> >
m_Firm2Tower_map
;
87
88
void
printError
(
const
std::string& location,
const
std::string& title, MSG::Level
type
,
const
std::string&
detail
)
const
;
89
90
};
91
92
#endif
// JFEXINPUTBYTESTREAMTOOL_H
AthAlgTool.h
printError
void printError()
Definition
CalibrateIBL.cxx:1358
IL1TriggerByteStreamTool.h
tc
static Double_t tc
Definition
LArPhysWaveHECTool.cxx:38
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
PathResolver.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition
StoreGate/StoreGate/WriteHandleKey.h:40
jFexInputByteStreamTool::Dataformat1
std::array< uint16_t, 3 > Dataformat1(uint32_t) const
Definition
jFexInputByteStreamTool.cxx:361
jFexInputByteStreamTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition
jFexInputByteStreamTool.h:58
jFexInputByteStreamTool::Dataformat2
std::array< uint16_t, 4 > Dataformat2(uint32_t) const
Definition
jFexInputByteStreamTool.cxx:372
jFexInputByteStreamTool::mapIndex
static constexpr unsigned int mapIndex(unsigned int jfex, unsigned int fpga, unsigned int channel, unsigned int tower)
Definition
jFexInputByteStreamTool.cxx:465
jFexInputByteStreamTool::robIds
virtual const std::vector< uint32_t > & robIds() const override
Declare ROB IDs for conversion.
Definition
jFexInputByteStreamTool.h:51
jFexInputByteStreamTool::m_robIds
Gaudi::Property< std::vector< uint32_t > > m_robIds
Definition
jFexInputByteStreamTool.h:64
jFexInputByteStreamTool::convertFromBS
virtual StatusCode convertFromBS(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vrobf, const EventContext &eventContext) const override
BS->xAOD conversion.
Definition
jFexInputByteStreamTool.cxx:80
jFexInputByteStreamTool::ReadfromFile
StatusCode ReadfromFile(const std::string &)
Definition
jFexInputByteStreamTool.cxx:417
jFexInputByteStreamTool::jFEXtoRODTrailer
std::array< uint32_t, 4 > jFEXtoRODTrailer(uint32_t, uint32_t) const
Definition
jFexInputByteStreamTool.cxx:320
jFexInputByteStreamTool::m_UseMonitoring
bool m_UseMonitoring
Definition
jFexInputByteStreamTool.h:59
jFexInputByteStreamTool::BulkStreamTrailer
std::array< uint16_t, 2 > BulkStreamTrailer(uint32_t, uint32_t, uint32_t) const
Definition
jFexInputByteStreamTool.cxx:333
jFexInputByteStreamTool::m_doThinning
Gaudi::Property< bool > m_doThinning
Definition
jFexInputByteStreamTool.h:61
jFexInputByteStreamTool::jFexInputByteStreamTool
jFexInputByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
jFexInputByteStreamTool.cxx:41
jFexInputByteStreamTool::m_FiberMapping
Gaudi::Property< std::string > m_FiberMapping
Definition
jFexInputByteStreamTool.h:67
jFexInputByteStreamTool::m_jTowersWriteKey
SG::WriteHandleKey< xAOD::jFexTowerContainer > m_jTowersWriteKey
Definition
jFexInputByteStreamTool.h:70
jFexInputByteStreamTool::m_jTowersReadKey
SG::ReadHandleKey< xAOD::jFexTowerContainer > m_jTowersReadKey
Definition
jFexInputByteStreamTool.h:73
jFexInputByteStreamTool::convertToBS
virtual StatusCode convertToBS(std::vector< OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment * > &vrobf, const xAOD::TrigCompositeContainer *tc, const EventContext &eventContext) override
xAOD->BS conversion
Definition
jFexInputByteStreamTool.cxx:385
jFexInputByteStreamTool::initialize
virtual StatusCode initialize() override
Definition
jFexInputByteStreamTool.cxx:46
jFexInputByteStreamTool::~jFexInputByteStreamTool
virtual ~jFexInputByteStreamTool() override=default
jFexInputByteStreamTool::m_Firm2Tower_map
std::unordered_map< unsigned int, std::array< float, 6 > > m_Firm2Tower_map
Definition
jFexInputByteStreamTool.h:86
jFexTowerAuxContainer.h
jFexTowerContainer.h
detail
Definition
extract_histogram_tag.cxx:14
xAOD::TrigCompositeContainer
TrigCompositeContainer_v1 TrigCompositeContainer
Declare the latest version of the container.
Definition
TrigCompositeContainer.h:17
type
Generated on
for ATLAS Offline Software by
1.17.0