ATLAS Offline Software
Loading...
Searching...
No Matches
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
6#include "xAODEgamma/Egamma.h"
9
10AsgDeadHVCellRemovalTool::AsgDeadHVCellRemovalTool(const std::string& myname) :
11 asg::AsgTool(myname){
12}
13
15
17 return StatusCode::SUCCESS ;
18}
19
21 return StatusCode::SUCCESS;
22}
23
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) ||
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
112 return accept (&part);
113}
114
#define ATH_MSG_ERROR(x,...)
virtual bool accept(const xAOD::Egamma *eg) const final
virtual ASG_TOOL_CLASS2(AsgDeadHVCellRemovalTool, IAsgDeadHVCellRemovalTool, asg::IAsgTool) public ~AsgDeadHVCellRemovalTool()
Standard constructor.
virtual StatusCode finalize()
Gaudi Service Interface method implementations.
virtual StatusCode initialize()
Gaudi Service Interface method implementations.
ServiceHandle< StoreGateSvc > & evtStore()
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
@ ETACALOFRAME
Eta in the calo frame (for egamma).
@ PHICALOFRAME
Phi in the calo frame (for egamma).
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
bool eventType(EventType type) const
Check for one particular bitmask value.
@ IS_SIMULATION
true: simulation, false: data
static std::vector< uint32_t > runnumber
Definition iLumiCalc.h:37
EventInfo_v1 EventInfo
Definition of the latest event info version.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
#define unlikely(x)