ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigEgammaEmulationTool
Root
TrigEgammaEmulationPrecisionCaloHypoTool.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigEgammaEmulationTool/TrigEgammaEmulationPrecisionCaloHypoTool.h
"
6
#include "GaudiKernel/SystemOfUnits.h"
7
8
9
using namespace
Trig
;
10
11
//**********************************************************************
12
13
TrigEgammaEmulationPrecisionCaloHypoTool::TrigEgammaEmulationPrecisionCaloHypoTool
(
const
std::string& myname )
14
:
TrigEgammaEmulationBaseHypoTool
(myname)
15
{}
16
17
18
20
21
22
bool
TrigEgammaEmulationPrecisionCaloHypoTool::emulate
(
const
Trig::TrigData
&input,
23
bool
&pass)
const
24
{
25
pass=
false
;
26
27
if
( !input.roi )
return
false
;
28
29
if
( input.clusters.empty() )
return
false
;
30
31
for
(
const
auto
&cl : input.clusters )
32
{
33
if
(
decide
( input, cl ) ){
34
pass=
true
;
35
return
true
;
36
}
37
}
38
39
return
false
;
40
}
41
42
43
44
45
bool
TrigEgammaEmulationPrecisionCaloHypoTool::decide
(
const
Trig::TrigData
&input,
46
const
xAOD::CaloCluster
*pClus )
const
47
{
48
unsigned
PassedCuts=0;
49
50
if
(!input.roi){
51
ATH_MSG_DEBUG
(
"L1 not found"
);
52
return
false
;
53
}
54
55
// when leaving scope it will ship data to monTool
56
PassedCuts = PassedCuts + 1;
//got called (data in place)
57
58
auto
roiDescriptor = input.roi;
59
60
61
if
( std::abs( roiDescriptor->eta() ) > 2.6 ) {
62
ATH_MSG_DEBUG
(
"REJECT The cluster had eta coordinates beyond the EM fiducial volume : "
<< roiDescriptor->eta() <<
"; stop the chain now"
);
63
return
false
;
64
}
65
66
ATH_MSG_DEBUG
(
"; RoI ID = "
<< roiDescriptor->roiId()
67
<<
": Eta = "
<< roiDescriptor->eta()
68
<<
", Phi = "
<< roiDescriptor->phi() );
69
70
// fill local variables for RoI reference position
71
double
etaRef = roiDescriptor->eta();
72
double
phiRef = roiDescriptor->phi();
73
// correct phi the to right range ( probably not needed anymore )
74
if
( std::abs( phiRef ) >
M_PI
) phiRef -= 2*
M_PI
;
// correct phi if outside range
75
76
float
absEta = std::abs( pClus->
eta
() );
77
78
const
int
cutIndex =
findCutIndex
( absEta );
79
80
float
dEta = pClus->
eta
() - etaRef;
81
// Deal with angle diferences greater than Pi
82
float
dPhi = std::abs( pClus->
phi
() - phiRef );
83
dPhi = ( dPhi <
M_PI
? dPhi : 2*
M_PI
- dPhi );
// TB why only <
84
float
eT_Cluster = pClus->
et
();
85
// apply cuts: DeltaEta( clus-ROI )
86
ATH_MSG_DEBUG
(
"CaloCluster: eta="
<< pClus->
eta
()
87
<<
" roi eta="
<< etaRef <<
" DeltaEta="
<< dEta
88
<<
" cut: <"
<<
m_detacluster
);
89
90
if
( std::abs( pClus->
eta
() - etaRef ) >
m_detacluster
) {
91
ATH_MSG_DEBUG
(
"REJECT Cluster dEta cut failed"
);
92
return
false
;
93
}
94
PassedCuts = PassedCuts + 1;
//Deta
95
96
// DeltaPhi( clus-ROI )
97
ATH_MSG_DEBUG
(
": phi="
<< pClus->
phi
()
98
<<
" roi phi="
<< phiRef <<
" DeltaPhi="
<< dPhi
99
<<
" cut: <"
<<
m_dphicluster
);
100
101
if
( dPhi >
m_dphicluster
) {
102
ATH_MSG_DEBUG
(
"REJECT Clsuter dPhi cut failed"
);
103
return
false
;
104
}
105
PassedCuts = PassedCuts + 1;
//DPhi
106
107
108
109
// eta range
110
if
( cutIndex == -1 ) {
// VD
111
ATH_MSG_DEBUG
(
"Cluster eta: "
<< absEta <<
" outside eta range "
<<
m_etabin
[
m_etabin
.size()-1] );
112
return
false
;
113
}
else
{
114
ATH_MSG_DEBUG
(
"eta bin used for cuts "
<< cutIndex );
115
}
116
PassedCuts = PassedCuts + 1;
// passed eta cut
117
118
// ET_em
119
ATH_MSG_DEBUG
(
"CaloCluster: ET_em="
<< eT_Cluster <<
" cut: >"
<<
m_eTthr
[cutIndex] );
120
if
( eT_Cluster <
m_eTthr
[cutIndex] ) {
121
ATH_MSG_DEBUG
(
"REJECT et cut failed"
);
122
return
false
;
123
}
124
PassedCuts = PassedCuts + 1;
// ET_em
125
126
127
// got this far => passed!
128
// Reach this point successfully
129
ATH_MSG_DEBUG
(
"pass!"
);
130
131
return
true
;
132
133
}
134
136
137
int
TrigEgammaEmulationPrecisionCaloHypoTool::findCutIndex
(
float
eta
)
const
{
138
const
float
absEta = std::abs(
eta
);
139
140
auto
binIterator = std::adjacent_find(
m_etabin
.begin(),
m_etabin
.end(), [=](
float
left,
float
right){ return left < absEta and absEta < right; } );
141
if
( binIterator ==
m_etabin
.end() ) {
142
return
-1;
143
}
144
return
binIterator -
m_etabin
.begin();
145
}
146
147
148
149
150
151
M_PI
#define M_PI
Definition
ActiveFraction.h:14
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
TrigEgammaEmulationPrecisionCaloHypoTool.h
Trig::TrigData
Definition
TrigEgammaEmulationToolMT.h:40
Trig::TrigEgammaEmulationBaseHypoTool::TrigEgammaEmulationBaseHypoTool
TrigEgammaEmulationBaseHypoTool(const std::string &myname)
Definition
TrigEgammaEmulationBaseHypoTool.cxx:12
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::m_dphicluster
Gaudi::Property< float > m_dphicluster
Definition
TrigEgammaEmulationPrecisionCaloHypoTool.h:35
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::TrigEgammaEmulationPrecisionCaloHypoTool
TrigEgammaEmulationPrecisionCaloHypoTool(const std::string &myname)
Definition
TrigEgammaEmulationPrecisionCaloHypoTool.cxx:13
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::m_eTthr
Gaudi::Property< std::vector< float > > m_eTthr
Definition
TrigEgammaEmulationPrecisionCaloHypoTool.h:38
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::findCutIndex
int findCutIndex(float eta) const
==========================================================================
Definition
TrigEgammaEmulationPrecisionCaloHypoTool.cxx:137
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::m_detacluster
Gaudi::Property< float > m_detacluster
Definition
TrigEgammaEmulationPrecisionCaloHypoTool.h:34
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::decide
bool decide(const TrigData &input, const xAOD::CaloCluster *) const
Definition
TrigEgammaEmulationPrecisionCaloHypoTool.cxx:45
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::m_etabin
Gaudi::Property< std::vector< float > > m_etabin
Definition
TrigEgammaEmulationPrecisionCaloHypoTool.h:37
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::emulate
virtual bool emulate(const TrigData &input, bool &pass) const override
==========================================================================
Definition
TrigEgammaEmulationPrecisionCaloHypoTool.cxx:22
xAOD::CaloCluster_v1::et
double et() const
Definition
CaloCluster_v1.h:863
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition
CaloCluster_v1.cxx:251
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition
CaloCluster_v1.cxx:256
Trig
The common trigger namespace for trigger analysis tools.
Definition
LArCellMonAlg.h:33
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
Generated on
for ATLAS Offline Software by
1.17.0