ATLAS Offline Software
Loading...
Searching...
No Matches
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
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 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) ||
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
108 return accept (&part);
109}
110
#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()
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
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)
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