ATLAS Offline Software
Loading...
Searching...
No Matches
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):
7
8
9// System include(s):
10#include <iomanip>
11
12namespace CP {
13
15
16 // Return the internal object.
17 return m_accept;
18 }
19
21 accept( const xAOD::IParticle* part ) const {
22
23 // Reset the decision object.
25
26 // Cast the particle to an e/gamma type.
27 const xAOD::Egamma* eg = nullptr;
28 if( ( part->type() != xAOD::Type::Electron ) &&
29 ( part->type() != xAOD::Type::Photon ) ) {
30 ATH_MSG_WARNING( "Non-e/gamma object received" );
31 return accept;
32 }
33 eg = static_cast< const xAOD::Egamma* >( part );
34
35 // Calculate the decision.
36 accept.setCutResult( m_oqCutIndex, eg->isGoodOQ( m_mask ) );
37
38 // Cut based on the dead HV Tool removal
39 accept.setCutResult(m_deadHVCutIndex, m_deadHVTool->accept(eg));
40
41 // Return the internal object.
42 return accept;
43 }
44
46
47 // Tell the user what is going to happen.
48 ATH_MSG_INFO( "Selecting e/gamma objects with OQ mask: 0x"
49 << std::hex << m_mask );
50
51 // Set up the TAccept object.
52 m_oqCutIndex = m_accept.addCut( "EgammaOQ", "Egamma object quality cut" );
53 m_deadHVCutIndex = m_accept.addCut("notDeadHV", "Egamma dead HV removal cut");
54
55 // Set up the dead HV Removal Tool
56 m_deadHVTool.setTypeAndName("AsgDeadHVCellRemovalTool/deadHVTool");
57 if (m_deadHVTool.retrieve().isFailure()){
58 ANA_MSG_ERROR("Failed to retrieve DeadHVTool, aborting");
59 return StatusCode::FAILURE;
60 }
61
62
63 // Return gracefully.
64 return StatusCode::SUCCESS;
65 }
66
67} // namespace CP
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
asg::AcceptInfo m_accept
Object handling the e/gamma selection decision.
virtual const asg::AcceptInfo & getAcceptInfo() const override
Get the results for the last object processed.
int m_oqCutIndex
Index of the object quality cut.
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...
virtual asg::AcceptData accept(const xAOD::IParticle *part) const override
Get the results for a given particle.
Gaudi::Property< int > m_mask
The mask to require good object quality with.
int m_deadHVCutIndex
Index of this quality cut.
virtual StatusCode initialize() override
Function initialising the tool.
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.
@ Photon
The object is a photon.
Definition ObjectType.h:47
@ Electron
The object is an electron.
Definition ObjectType.h:46
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17