ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
EgammaAnalysisAlgorithms
Root
EgammaIsGoodOQSelectionTool.cxx
Go to the documentation of this file.
1
//
2
// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
//
4
5
// Local include(s):
6
#include "
EgammaAnalysisAlgorithms/EgammaIsGoodOQSelectionTool.h
"
7
8
#include <
xAODEventInfo/EventInfo.h
>
9
#include <
AsgDataHandles/ReadDecorHandleKey.h
>
10
11
// System include(s):
12
#include <iomanip>
13
14
namespace
CP
{
15
16
const
asg::AcceptInfo
&
EgammaIsGoodOQSelectionTool::getAcceptInfo
()
const
{
17
18
// Return the internal object.
19
return
m_accept
;
20
}
21
22
asg::AcceptData
EgammaIsGoodOQSelectionTool::
23
accept
(
const
xAOD::IParticle
* part )
const
{
24
25
// Reset the decision object.
26
asg::AcceptData
accept
{&
m_accept
};
27
28
// Cast the particle to an e/gamma type.
29
const
xAOD::Egamma
* eg =
nullptr
;
30
if
( ( part->type() !=
xAOD::Type::Electron
) &&
31
( part->type() !=
xAOD::Type::Photon
) ) {
32
ATH_MSG_WARNING
(
"Non-e/gamma object received"
);
33
return
accept
;
34
}
35
eg =
static_cast<
const
xAOD::Egamma
*
>
( part );
36
37
// Calculate the decision.
38
accept
.setCutResult(
m_oqCutIndex
, eg->
isGoodOQ
(
m_mask
) );
39
40
// Cut based on the dead HV Tool removal
41
accept
.setCutResult(
m_deadHVCutIndex
,
m_deadHVTool
->accept(eg));
42
43
// Return the internal object.
44
return
accept
;
45
}
46
47
StatusCode
EgammaIsGoodOQSelectionTool::initialize
() {
48
49
// Tell the user what is going to happen.
50
ATH_MSG_INFO
(
"Selecting e/gamma objects with OQ mask: 0x"
51
<< std::hex <<
m_mask
);
52
53
// Set up the TAccept object.
54
m_oqCutIndex
=
m_accept
.addCut(
"EgammaOQ"
,
"Egamma object quality cut"
);
55
m_deadHVCutIndex
=
m_accept
.addCut(
"notDeadHV"
,
"Egamma dead HV removal cut"
);
56
57
// Set up the dead HV Removal Tool
58
m_deadHVTool
.setTypeAndName(
"AsgDeadHVCellRemovalTool/deadHVTool"
);
59
if
(
m_deadHVTool
.retrieve().isFailure()){
60
ANA_MSG_ERROR
(
"Failed to retrieve DeadHVTool, aborting"
);
61
return
StatusCode::FAILURE;
62
}
63
64
#ifndef XAOD_STANDALONE
65
// Declare dependency on RandomRunNumber for MC (used by deadHVTool)
66
// Not doing this in the tool itself, since it is a public tool and
67
// for public tools the dependencies don't get properly propagated
68
SG::ReadDecorHandleKey<xAOD::EventInfo>
randomRunNumberKey{
"EventInfo.RandomRunNumber"
};
69
addDependency(randomRunNumberKey.fullKey(), Gaudi::DataHandle::Reader);
70
#endif
71
72
// Return gracefully.
73
return
StatusCode::SUCCESS;
74
}
75
76
}
// namespace CP
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
EgammaIsGoodOQSelectionTool.h
CP::EgammaIsGoodOQSelectionTool::m_accept
asg::AcceptInfo m_accept
Object handling the e/gamma selection decision.
Definition
EgammaIsGoodOQSelectionTool.h:70
CP::EgammaIsGoodOQSelectionTool::getAcceptInfo
virtual const asg::AcceptInfo & getAcceptInfo() const override
Get the results for the last object processed.
Definition
EgammaIsGoodOQSelectionTool.cxx:16
CP::EgammaIsGoodOQSelectionTool::m_oqCutIndex
int m_oqCutIndex
Index of the object quality cut.
Definition
EgammaIsGoodOQSelectionTool.h:72
CP::EgammaIsGoodOQSelectionTool::m_deadHVTool
asg::AnaToolHandle< IAsgDeadHVCellRemovalTool > m_deadHVTool
The tool that selects on dead HV from the 2016 run, acc. to https://twiki.cern.ch/twiki/bin/view/Atla...
Definition
EgammaIsGoodOQSelectionTool.h:76
CP::EgammaIsGoodOQSelectionTool::accept
virtual asg::AcceptData accept(const xAOD::IParticle *part) const override
Get the results for a given particle.
Definition
EgammaIsGoodOQSelectionTool.cxx:23
CP::EgammaIsGoodOQSelectionTool::m_mask
Gaudi::Property< int > m_mask
The mask to require good object quality with.
Definition
EgammaIsGoodOQSelectionTool.h:65
CP::EgammaIsGoodOQSelectionTool::m_deadHVCutIndex
int m_deadHVCutIndex
Index of this quality cut.
Definition
EgammaIsGoodOQSelectionTool.h:80
CP::EgammaIsGoodOQSelectionTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition
EgammaIsGoodOQSelectionTool.cxx:47
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition
StoreGate/StoreGate/ReadDecorHandleKey.h:86
asg::AcceptData
Definition
AcceptData.h:31
asg::AcceptInfo
Definition
AcceptInfo.h:28
xAOD::Egamma_v1::isGoodOQ
bool isGoodOQ(uint32_t mask) const
Check object quality. Return True is it is Good Object Quality.
Definition
Egamma_v1.cxx:225
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
xAODType::Photon
@ Photon
The object is a photon.
Definition
ObjectType.h:47
xAODType::Electron
@ Electron
The object is an electron.
Definition
ObjectType.h:46
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