ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1Result
src
JetEnergyResult.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
// Local include(s):
7
#include "
TrigT1Result/JetEnergyResult.h
"
8
9
// Local include(s):
10
#include "
TrigT1Interfaces/TrigT1CTPDefs.h
"
11
#include "
TrigT1Interfaces/TrigT1CaloDefs.h
"
12
13
// STL includes
14
#include <sstream>
15
#include <iomanip>
16
17
namespace
ROIB
{
18
19
JetEnergyResult::JetEnergyResult
(
Header
&&
head
,
Trailer
&& trail, std::vector< JetEnergyRoI >&& roIVector )
20
:
m_JetEnergyResultHeader
(
std
::move(
head
) ),
m_JetEnergyResultTrailer
(
std
::move(trail) ),
21
m_JetEnergyResultRoIVec
(
std
::move(roIVector) ) {
22
23
}
24
25
JetEnergyResult::JetEnergyResult
()
26
:
m_JetEnergyResultHeader
(),
m_JetEnergyResultTrailer
(),
27
m_JetEnergyResultRoIVec
() {
28
29
}
30
31
const
Header
&
JetEnergyResult::header
()
const
{
32
return
m_JetEnergyResultHeader
;
33
}
34
35
const
Trailer
&
JetEnergyResult::trailer
()
const
{
36
return
m_JetEnergyResultTrailer
;
37
}
38
39
const
std::vector< JetEnergyRoI >&
JetEnergyResult::roIVec
()
const
{
40
return
m_JetEnergyResultRoIVec
;
41
}
42
43
const
std::string
JetEnergyResult::dump
()
const
44
{
45
std::ostringstream s;
46
47
s <<
" ["
<< this->
header
().
dump
() <<
"] "
;
48
s <<
" ["
;
49
for
(std::vector<JetEnergyRoI>::size_type i(0); i <
roIVec
().size(); ++i) {
50
s <<
LVL1CTP::convertToHex
(
roIVec
()[i].roIWord());
51
}
52
s <<
"] "
;
53
s <<
" ["
<< this->
trailer
().
dump
() <<
"] "
;
54
55
return
s.str();
56
}
57
58
const
std::string
JetEnergyResult::print
(
const
bool
longFormat)
const
59
{
60
std::ostringstream s;
61
62
s <<
"\n header ["
<< this->
header
().
print
(longFormat) <<
"] "
;
63
if
(longFormat) s << std::endl;
64
65
for
(std::vector<JetEnergyRoI>::size_type i(0); i <
roIVec
().size(); ++i) {
66
67
unsigned
int
type
=
roIVec
()[i].roIType();
68
69
if
(i == 0 || longFormat) s <<
"data"
;
70
if
(longFormat) s <<
"["
<< std::setw(2) << i <<
"]"
;
71
72
s <<
" ["
;
73
if
(longFormat) s <<
LVL1CTP::convertToHex
(
roIVec
()[i].roIWord());
74
if
(longFormat) s << std::setw(12) <<
"\n Type: "
;
75
s <<
" "
<<
type
;
76
if
(longFormat) s << std::setw(12) <<
"\n ID: "
;
77
s <<
" "
<<
roIVec
()[i].electronicsID();
78
if
(
type
==
LVL1::TrigT1CaloDefs::JetRoIWordType
) {
79
if
(longFormat) s << std::setw(12) <<
"\n Threshold: "
;
80
using namespace
LVL1CTP
;
// for importing operator<<
81
s <<
" "
<<
roIVec
()[i].thresholds();
82
}
else
if
(
type
==
LVL1::TrigT1CaloDefs::JetEtRoIWordType
) {
83
if
(longFormat) s << std::setw(12) <<
"\n jetEt: "
;
84
s <<
" "
<<
roIVec
()[i].jetEt();
85
}
else
if
(
type
==
LVL1::TrigT1CaloDefs::EnergyRoIWordType0
) {
86
if
(longFormat) s << std::setw(12) <<
"\n energyX: "
;
87
s <<
" "
<<
roIVec
()[i].energyX();
88
}
else
if
(
type
==
LVL1::TrigT1CaloDefs::EnergyRoIWordType1
) {
89
if
(longFormat) s << std::setw(12) <<
"\n energyY: "
;
90
s <<
" "
<<
roIVec
()[i].energyY();
91
if
(longFormat) s << std::setw(12) <<
"\n etSumThresholds: "
;
92
using namespace
LVL1CTP
;
// for importing operator<<
93
s <<
" "
<<
roIVec
()[i].etSumThresholds();
94
}
else
if
(
type
==
LVL1::TrigT1CaloDefs::EnergyRoIWordType2
) {
95
if
(longFormat) s << std::setw(12) <<
"\n energySum: "
;
96
s <<
" "
<<
roIVec
()[i].energySum();
97
if
(longFormat) s << std::setw(12) <<
"\n etMissThresholds: "
;
98
using namespace
LVL1CTP
;
// for importing operator<<
99
s <<
" "
<<
roIVec
()[i].etMissThresholds();
100
}
101
s <<
"] "
;
102
}
103
s <<
"trailer ["
<< this->
trailer
().
print
(longFormat) <<
"] "
;
104
105
return
s.str();
106
}
107
108
}
// namespace ROIB
JetEnergyResult.h
TrigT1CTPDefs.h
TrigT1CaloDefs.h
LVL1::TrigT1CaloDefs::JetRoIWordType
@ JetRoIWordType
Definition
TrigT1CaloDefs.h:168
LVL1::TrigT1CaloDefs::EnergyRoIWordType2
@ EnergyRoIWordType2
Definition
TrigT1CaloDefs.h:172
LVL1::TrigT1CaloDefs::EnergyRoIWordType0
@ EnergyRoIWordType0
Definition
TrigT1CaloDefs.h:170
LVL1::TrigT1CaloDefs::JetEtRoIWordType
@ JetEtRoIWordType
Definition
TrigT1CaloDefs.h:169
LVL1::TrigT1CaloDefs::EnergyRoIWordType1
@ EnergyRoIWordType1
Definition
TrigT1CaloDefs.h:171
ROIB::Header
Header models the LVL1 ROD Header.
Definition
TrigT1Result/TrigT1Result/Header.h:37
ROIB::Header::print
const std::string print(const bool longFormat=false) const
print object content in a human readable format to string
Definition
TrigT1Result/src/Header.cxx:80
ROIB::Header::dump
const std::string dump() const
dump raw object content to string
Definition
TrigT1Result/src/Header.cxx:69
ROIB::JetEnergyResult::print
const std::string print(const bool longFormat=false) const
print object content in a human readable format to string
Definition
JetEnergyResult.cxx:58
ROIB::JetEnergyResult::m_JetEnergyResultRoIVec
std::vector< JetEnergyRoI > m_JetEnergyResultRoIVec
raw data content (RoIs)
Definition
JetEnergyResult.h:49
ROIB::JetEnergyResult::header
const Header & header() const
Definition
JetEnergyResult.cxx:31
ROIB::JetEnergyResult::roIVec
const std::vector< JetEnergyRoI > & roIVec() const
Definition
JetEnergyResult.cxx:39
ROIB::JetEnergyResult::m_JetEnergyResultTrailer
Trailer m_JetEnergyResultTrailer
trailer fragment in LVL1 eformat
Definition
JetEnergyResult.h:48
ROIB::JetEnergyResult::JetEnergyResult
JetEnergyResult()
Definition
JetEnergyResult.cxx:25
ROIB::JetEnergyResult::dump
const std::string dump() const
dump raw object content to string
Definition
JetEnergyResult.cxx:43
ROIB::JetEnergyResult::trailer
const Trailer & trailer() const
Definition
JetEnergyResult.cxx:35
ROIB::JetEnergyResult::m_JetEnergyResultHeader
Header m_JetEnergyResultHeader
header fragment in LVL1 eformat
Definition
JetEnergyResult.h:47
ROIB::Trailer
ROIB::Trailer models the LVL1 ROD Trailer.
Definition
Trailer.h:37
ROIB::Trailer::dump
const std::string dump() const
dump raw object content to string
Definition
Trailer.cxx:45
ROIB::Trailer::print
const std::string print(const bool longFormat=false) const
print object content in a human readable format to string
Definition
Trailer.cxx:56
head
std::string head(std::string s, const std::string &pattern)
head of a string
Definition
computils.cxx:312
LVL1CTP
Definition
Lvl1ResultAccessTool.h:20
LVL1CTP::convertToHex
const std::string convertToHex(const uint32_t word)
helper function to dump a number in hex format
Definition
TrigT1CTPDefs.h:41
ROIB
Namespace of the LVL1 RoIB simulation.
Definition
ILvl1ResultAccessTool.h:19
std
STL namespace.
type
Generated on
for ATLAS Offline Software by
1.17.0