ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigEvent
TrigCaloEvent
src
TrigCaloCluster.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
/*******************************************************
7
8
NAME: TrigCaloCluster.cxx
9
PACKAGE: Trigger/TrigEvent/TrigCaloEvent
10
AUTHORS: Denis O. Damazio, Carlos Osuna, Xin Wu
11
12
PURPOSE: Keep the important output variables
13
from the Calorimeter LVL2 Trigger.
14
Optionally seed ID Trigger and EF.
15
Variables here should be RAW variables
16
not corrected.
17
KNOWTOINHERIT: TrigEmCluster, TrigTauCluster,
18
TrigJetCluster
19
DATE: October 17th, 2005
20
21
******************************************************/
22
23
#include "
TrigCaloEvent/TrigCaloCluster.h
"
24
#include <cmath>
25
26
// Constructor
27
TrigCaloCluster::TrigCaloCluster
(
float
energy,
float
eta
,
28
float
phi
,
long
roi_word) :
29
m_rawEnergy
( energy ),
m_rawEt
( 0. ),
30
m_rawEta
(
eta
),
m_rawPhi
(
phi
),
31
m_roiWord
( roi_word ),
m_numberUsedCells
( 0 ),
32
m_quality
( 0 )
33
{
34
for
(
int
i = 0 ; i <
MAXSIZE
; i++ )
35
setRawEnergy
((
CaloSampling::CaloSample
)i,0.0);
36
}
37
38
// Destructor
39
TrigCaloCluster::~TrigCaloCluster
()
40
{}
41
42
// Copy constructor
43
TrigCaloCluster::TrigCaloCluster
(
const
TrigCaloCluster
* tcc ) :
44
m_rawEnergy
( tcc->
rawEnergy
() ),
m_rawEt
( tcc->
rawEt
() ),
45
m_rawEta
( tcc->
rawEta
() ) ,
m_rawPhi
( tcc->
rawPhi
() ),
46
m_roiWord
( tcc->
RoIword
() ),
47
m_numberUsedCells
( tcc->
nCells
() ) ,
48
m_quality
( tcc->
quality
() )
49
{
50
for
(
int
i = 0 ; i <
MAXSIZE
; i++ )
51
setRawEnergy
((
CaloSampling::CaloSample
)i
52
,tcc->
rawEnergy
((
CaloSampling::CaloSample
)i) );
53
}
54
55
// Simple debug method
56
void
57
TrigCaloCluster::print
(
void
)
const
{
58
59
std::cout <<
"m_rawEnergy : "
<<
m_rawEnergy
<<
"; "
;
60
std::cout <<
"m_rawEt : "
<<
m_rawEt
<<
"; "
;
61
std::cout <<
"m_rawEta : "
<<
m_rawEta
<<
"; "
;
62
std::cout <<
"m_rawPhi : "
<<
m_rawPhi
<<
"; "
;
63
std::cout << std::hex;
64
std::cout <<
"m_roiWord : 0x"
<<
m_roiWord
<<
"; "
;
65
std::cout << std::dec;
66
std::cout <<
"m_numberUsedCells : "
<<
m_numberUsedCells
<<
"; "
;
67
std::cout <<
"m_quality : "
<<
m_quality
<<
"; "
;
68
std::cout <<
"m_rawEnergyS : "
;
69
for
(
int
i = 0 ; i <
MAXSIZE
; i++ )
70
std::cout <<
rawEnergy
((
CaloSampling::CaloSample
)i) <<
"; "
;
71
std::cout << std::endl;
72
}
73
74
// Simple debug method using MsgStream
75
void
76
TrigCaloCluster::print
( MsgStream& log )
const
{
77
78
log <<MSG::DEBUG<<
"m_rawEnergy : "
<<
m_rawEnergy
<<
"; "
;
79
log <<MSG::DEBUG<<
"m_rawEt : "
<<
m_rawEt
<<
"; "
;
80
log <<MSG::DEBUG<<
"m_rawEta : "
<<
m_rawEta
<<
"; "
;
81
log <<MSG::DEBUG<<
"m_rawPhi : "
<<
m_rawPhi
<<
"; "
;
82
log << MSG::hex;
83
log <<MSG::DEBUG<<
"m_roiWord : "
<<
m_roiWord
<<
"; "
;
84
log << MSG::dec;
85
log <<MSG::DEBUG<<
"m_numberUsedCells : "
<<
m_numberUsedCells
<<
"; "
;
86
log <<MSG::DEBUG<<
"m_quality : "
<<
m_quality
<<
"; "
;
87
log <<MSG::DEBUG<<
"m_rawEnergyS : "
;
88
for
(
int
i = 0 ; i <
MAXSIZE
; i++ )
89
log <<MSG::DEBUG<<
rawEnergy
((
CaloSampling::CaloSample
)i) <<
"; "
;
90
log <<
endmsg
;
91
}
92
93
// stream output
94
std::string
str
(
const
TrigCaloCluster
& d ) {
95
std::stringstream log;
96
log <<
"m_rawEnergy : "
<< d.rawEnergy() <<
"; "
;
97
log <<
"m_rawEt : "
<< d.rawEt() <<
"; "
;
98
log <<
"m_rawEta : "
<< d.rawEta() <<
"; "
;
99
log <<
"m_rawPhi : "
<< d.rawPhi() <<
"; "
;
100
log << std::hex;
101
log <<
"m_roiWord : "
<< d.RoIword() <<
"; "
;
102
log << std::dec;
103
log <<
"m_numberUsedCells : "
<< d.nCells() <<
"; "
;
104
log <<
"m_quality : "
<< d.quality() <<
"; "
;
105
log <<
"m_rawEnergyS : "
;
106
for
(
int
i = 0 ; i <
MAXSIZE
; i++ )
107
log << d.rawEnergy((
CaloSampling::CaloSample
)i) <<
"; "
;
108
return
log.str();
109
}
110
111
MsgStream&
operator<<
( MsgStream& m,
const
TrigCaloCluster
& d ) {
112
m <<
str
(d);
113
return
m;
114
}
115
116
// comparison
117
bool
operator==
(
const
TrigCaloCluster
&
a
,
const
TrigCaloCluster
& b) {
118
double
ep=0.001;
// arbitrary , but seems to be reasonable
119
if
( std::fabs(
a
.RoIword() - b.RoIword() )>ep )
return
false
;
120
if
( std::fabs(
a
.rawEta() - b.rawEta() )>ep )
return
false
;
121
if
( std::fabs(
a
.rawPhi() - b.rawPhi() )>ep )
return
false
;
122
if
( std::fabs(
a
.rawEt() - b.rawEt() )>ep )
return
false
;
123
if
( std::fabs(
a
.quality() - b.quality() )>ep )
return
false
;
124
return
true
;
125
}
126
127
void
diff
(
const
TrigCaloCluster
&
a
,
const
TrigCaloCluster
& b,
128
std::map< std::string, double >& varChange ) {
129
130
double
ep=0.001;
// arbitrary , but seems to be reasonable
131
if
( std::fabs(
a
.RoIword() - b.RoIword() )>ep ) {
132
varChange[
"RoIword"
] =
a
.RoIword() - b.RoIword();
133
}
134
if
( std::fabs(
a
.rawEta() - b.rawEta() )>ep ) {
135
varChange[
"rawEta"
] =
a
.rawEta() - b.rawEta();
136
}
137
if
( std::fabs(
a
.rawPhi() - b.rawPhi() )>ep ) {
138
varChange[
"rawPhi"
] =
a
.rawPhi() - b.rawPhi();
139
}
140
if
( std::fabs(
a
.rawEt() - b.rawEt() )>ep ) {
141
varChange[
"rawEt"
] =
a
.rawEt() - b.rawEt();
142
}
143
if
( std::fabs(
a
.quality() - b.quality() )>ep ) {
144
varChange[
"quality"
] =
a
.quality() - b.quality();
145
}
146
147
return
;
148
}
149
// End of TrigCaloCluster
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
operator==
bool operator==(const TrigCaloCluster &a, const TrigCaloCluster &b)
Definition
TrigCaloCluster.cxx:117
operator<<
MsgStream & operator<<(MsgStream &m, const TrigCaloCluster &d)
Definition
TrigCaloCluster.cxx:111
diff
void diff(const TrigCaloCluster &a, const TrigCaloCluster &b, std::map< std::string, double > &varChange)
Definition
TrigCaloCluster.cxx:127
TrigCaloCluster.h
MAXSIZE
const int MAXSIZE
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:36
CaloSampling::CaloSample
CaloSample
Definition
Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
TrigCaloCluster
Base Cluster Class.
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:39
TrigCaloCluster::rawEta
float rawEta() const
get Raw Eta (no calibration)
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:109
TrigCaloCluster::TrigCaloCluster
TrigCaloCluster(float energy=0.0, float eta=-10.0, float phi=-10.0, long roi_word=0)
Constructor, please note the default values.
Definition
TrigCaloCluster.cxx:27
TrigCaloCluster::m_quality
unsigned int m_quality
quality of cluster built (to be defined)
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:142
TrigCaloCluster::RoIword
long RoIword() const
get RoI Word
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:115
TrigCaloCluster::m_rawEnergy
float m_rawEnergy
Raw Energy (no calibration).
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:128
TrigCaloCluster::m_roiWord
long m_roiWord
RoI Word.
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:138
TrigCaloCluster::print
void print(void) const
Prints out cluster variables to std::cout.
Definition
TrigCaloCluster.cxx:57
TrigCaloCluster::setRawEnergy
void setRawEnergy(float energy)
set Raw Energy (no calibration)
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:57
TrigCaloCluster::rawPhi
float rawPhi() const
get Raw Phi (no calibration)
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:112
TrigCaloCluster::m_rawEta
float m_rawEta
Raw Eta (no calibration).
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:134
TrigCaloCluster::quality
unsigned int quality() const
get quality of cluster built (to be defined)
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:121
TrigCaloCluster::m_numberUsedCells
int m_numberUsedCells
Number of cells used from RoI.
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:140
TrigCaloCluster::rawEnergy
float rawEnergy() const
get Raw Energy (no calibration)
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:92
TrigCaloCluster::m_rawEt
float m_rawEt
Raw Et (no calibration).
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:130
TrigCaloCluster::~TrigCaloCluster
~TrigCaloCluster()
Destructor.
Definition
TrigCaloCluster.cxx:39
TrigCaloCluster::rawEt
float rawEt() const
get Raw Et (no calibration)
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:103
TrigCaloCluster::m_rawPhi
float m_rawPhi
Raw Phi (no calibration).
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:136
TrigCaloCluster::nCells
int nCells() const
get number of cells used from RoI
Definition
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:118
str
Definition
BTagTrackIpAccessor.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0