ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
ElectronPhotonID
ElectronPhotonSelectorTools
Root
AsgDeadHVCellRemovalTool.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 "
ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h
"
6
#include "
xAODEgamma/Egamma.h
"
7
#include "
xAODCaloEvent/CaloCluster.h
"
8
#include "
xAODEventInfo/EventInfo.h
"
9
10
AsgDeadHVCellRemovalTool::AsgDeadHVCellRemovalTool(
const
std::string& myname) :
11
asg
::AsgTool(myname){
12
}
13
14
AsgDeadHVCellRemovalTool::~AsgDeadHVCellRemovalTool
()=
default
;
15
16
StatusCode
AsgDeadHVCellRemovalTool::initialize
(){
17
return
StatusCode::SUCCESS ;
18
}
19
20
StatusCode
AsgDeadHVCellRemovalTool::finalize
(){
21
return
StatusCode::SUCCESS;
22
}
23
24
bool
AsgDeadHVCellRemovalTool::accept
(
const
xAOD::Egamma
* eg )
const
{
25
26
if
( !eg ){
27
ATH_MSG_ERROR
(
"Failed, no egamma object."
);
28
return
false
;
29
}
30
31
const
xAOD::CaloCluster
* cluster = eg->
caloCluster
();
32
if
( !cluster ){
33
ATH_MSG_ERROR
(
"Failed, cluster."
);
34
return
false
;
35
}
36
37
const
xAOD::EventInfo
*eventInfo =
evtStore
()->retrieve<
const
xAOD::EventInfo
> (
"EventInfo"
);
38
if
(!eventInfo)[[
unlikely
]]{
39
ATH_MSG_ERROR
(
"Failed, eventInfo is null."
);
40
return
false
;
41
}
42
bool
isSimul= eventInfo->
eventType
(
xAOD::EventInfo::IS_SIMULATION
);
43
44
unsigned
int
runnumber
(0);
45
static
const
SG::ConstAccessor<unsigned int>
randomrunnumber(
"RandomRunNumber"
);
46
static
const
SG::ConstAccessor<unsigned int>
datarunnumber(
"runNumber"
);
47
48
if
(!isSimul&& datarunnumber.
isAvailable
(*eventInfo) ){
49
runnumber
= datarunnumber(*eventInfo);
50
}
51
else
if
(isSimul && randomrunnumber.
isAvailable
(*eventInfo) ){
52
runnumber
= randomrunnumber(*eventInfo);
53
}
54
else
{
55
ATH_MSG_ERROR
(
"Failed, to retrieve the proper run number from event info"
);
56
return
false
;
57
}
58
59
double
eta_calo;
60
double
phi_calo;
61
if
(! cluster->
retrieveMoment
(
xAOD::CaloCluster::ETACALOFRAME
,eta_calo) ||
62
! cluster->
retrieveMoment
(
xAOD::CaloCluster::PHICALOFRAME
,phi_calo)){
63
ATH_MSG_ERROR
(
"Could not get Eta/Phi in calo frame"
);
64
return
false
;
65
}
66
67
if
((
runnumber
>=296939 &&
runnumber
<298967) ||
68
(
runnumber
>=299144 &&
runnumber
<300279)){
69
70
if
( eta_calo > - 1.825
71
&& eta_calo < -1.5
72
&& phi_calo > -1.104921
73
&& phi_calo < -0.956748){
74
return
false
;
75
}
76
}
77
78
if
((
runnumber
>=298967 &&
runnumber
<299144 ) ||
79
(
runnumber
>=300279 &&
runnumber
<305291 )){
80
81
if
( eta_calo > - 1.825
82
&& eta_calo < -1.5
83
&& phi_calo > -1.104921
84
&& phi_calo < -0.956748){
85
return
false
;
86
}
87
88
if
( eta_calo> - 1.825
89
&& eta_calo < -1.5
90
&& phi_calo > 1.054922
91
&& phi_calo < 1.203097){
92
return
false
;
93
}
94
}
95
96
// Remove e/y in region of FEB EMECC1_05R_M1 with dead OTx for part of data24
97
// FEB region + ring of 2 cells around it
98
if
(
runnumber
>=482374 &&
runnumber
<491041){
99
if
( eta_calo > -2.050
100
&& eta_calo < -1.750
101
&& phi_calo > 1.914
102
&& phi_calo < 2.405){
103
return
false
;
104
}
105
}
106
107
108
return
true ;
109
}
110
111
bool
AsgDeadHVCellRemovalTool::accept
(
const
xAOD::Egamma
& part )
const
{
112
return
accept
(&part);
113
}
114
AsgDeadHVCellRemovalTool.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
Egamma.h
CaloCluster.h
AsgDeadHVCellRemovalTool::accept
virtual bool accept(const xAOD::Egamma *eg) const final
Definition
AsgDeadHVCellRemovalTool.cxx:24
AsgDeadHVCellRemovalTool::~AsgDeadHVCellRemovalTool
virtual ASG_TOOL_CLASS2(AsgDeadHVCellRemovalTool, IAsgDeadHVCellRemovalTool, asg::IAsgTool) public ~AsgDeadHVCellRemovalTool()
Standard constructor.
AsgDeadHVCellRemovalTool::finalize
virtual StatusCode finalize()
Gaudi Service Interface method implementations.
Definition
AsgDeadHVCellRemovalTool.cxx:20
AsgDeadHVCellRemovalTool::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations.
Definition
AsgDeadHVCellRemovalTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
xAOD::CaloCluster_v1::retrieveMoment
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
Definition
CaloCluster_v1.cxx:662
xAOD::CaloCluster_v1::ETACALOFRAME
@ ETACALOFRAME
Eta in the calo frame (for egamma).
Definition
CaloCluster_v1.h:190
xAOD::CaloCluster_v1::PHICALOFRAME
@ PHICALOFRAME
Phi in the calo frame (for egamma).
Definition
CaloCluster_v1.h:191
xAOD::Egamma_v1::caloCluster
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
Definition
Egamma_v1.cxx:377
xAOD::EventInfo_v1::eventType
bool eventType(EventType type) const
Check for one particular bitmask value.
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition
EventInfo_v1.h:151
runnumber
static std::vector< uint32_t > runnumber
Definition
iLumiCalc.h:37
asg
Definition
DataHandleTestTool.h:28
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::Egamma
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition
Egamma.h:17
unlikely
#define unlikely(x)
Definition
pythonic_coracool.cxx:9
EventInfo.h
Generated on
for ATLAS Offline Software by
1.17.0