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-2020 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
bool
isSimul= eventInfo->
eventType
(
xAOD::EventInfo::IS_SIMULATION
);
39
40
unsigned
int
runnumber
(0);
41
static
const
SG::AuxElement::ConstAccessor<unsigned int> randomrunnumber(
"RandomRunNumber"
);
42
static
const
SG::AuxElement::ConstAccessor<unsigned int> datarunnumber(
"runNumber"
);
43
44
if
(!isSimul&& datarunnumber.isAvailable(*eventInfo) ){
45
runnumber
= datarunnumber(*eventInfo);
46
}
47
else
if
(isSimul && randomrunnumber.isAvailable(*eventInfo) ){
48
runnumber
= randomrunnumber(*eventInfo);
49
}
50
else
{
51
ATH_MSG_ERROR
(
"Failed, to retrieve the proper run number from event info"
);
52
return
false
;
53
}
54
55
double
eta_calo;
56
double
phi_calo;
57
if
(! cluster->
retrieveMoment
(
xAOD::CaloCluster::ETACALOFRAME
,eta_calo) ||
58
! cluster->
retrieveMoment
(
xAOD::CaloCluster::PHICALOFRAME
,phi_calo)){
59
ATH_MSG_ERROR
(
"Could not get Eta/Phi in calo frame"
);
60
return
false
;
61
}
62
63
if
((
runnumber
>=296939 &&
runnumber
<298967) ||
64
(
runnumber
>=299144 &&
runnumber
<300279)){
65
66
if
( eta_calo > - 1.825
67
&& eta_calo < -1.5
68
&& phi_calo > -1.104921
69
&& phi_calo < -0.956748){
70
return
false
;
71
}
72
}
73
74
if
((
runnumber
>=298967 &&
runnumber
<299144 ) ||
75
(
runnumber
>=300279 &&
runnumber
<305291 )){
76
77
if
( eta_calo > - 1.825
78
&& eta_calo < -1.5
79
&& phi_calo > -1.104921
80
&& phi_calo < -0.956748){
81
return
false
;
82
}
83
84
if
( eta_calo> - 1.825
85
&& eta_calo < -1.5
86
&& phi_calo > 1.054922
87
&& phi_calo < 1.203097){
88
return
false
;
89
}
90
}
91
92
// Remove e/y in region of FEB EMECC1_05R_M1 with dead OTx for part of data24
93
// FEB region + ring of 2 cells around it
94
if
(
runnumber
>=482374 &&
runnumber
<491041){
95
if
( eta_calo > -2.050
96
&& eta_calo < -1.750
97
&& phi_calo > 1.914
98
&& phi_calo < 2.405){
99
return
false
;
100
}
101
}
102
103
104
return
true ;
105
}
106
107
bool
AsgDeadHVCellRemovalTool::accept
(
const
xAOD::Egamma
& part )
const
{
108
return
accept
(&part);
109
}
110
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
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
EventInfo.h
Generated on
for ATLAS Offline Software by
1.17.0