ATLAS Offline Software
Loading...
Searching...
No Matches
TauEleOverlapChecker.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8 TauRecToolBase(name) {
9}
10
13 ATH_CHECK( m_removedTracksContainer.initialize() );
14 return StatusCode::SUCCESS;
15}
16
18 // Checking if the seed jet is valid
19 auto jet_seed = tau.jet();
20 if (jet_seed == nullptr) {
21 ATH_MSG_ERROR("Tau jet link is invalid.");
22 return StatusCode::FAILURE;
23 }
24 // retrieve the input removed tracks and clusters containers
27 if (!removedClustersHandle.isValid() || !removedTracksHandle.isValid()) {
29 "Could not retrieve HiveDataObj with key " <<
30 (!removedClustersHandle.isValid() ? removedClustersHandle.key() : "") <<
31 (!removedTracksHandle.isValid() ? removedTracksHandle.key() : "")
32 );
33 return StatusCode::FAILURE;
34 }
35 const xAOD::CaloClusterContainer *removed_clusters_cont = removedClustersHandle.cptr();
36 const xAOD::TrackParticleContainer *removed_tracks_cont = removedTracksHandle.cptr();
37
38
39 for (auto removal_direction : *removed_tracks_cont) {
40 if (removal_direction->p4().DeltaR(jet_seed->p4()) < m_checkingCone) {
41 return StatusCode::SUCCESS;
42 }
43 }
44 for (auto removal_direction : *removed_clusters_cont) {
45 if (removal_direction->p4().DeltaR(jet_seed->p4()) < m_checkingCone) {
46 return StatusCode::SUCCESS;
47 }
48 }
49 ATH_MSG_DEBUG("TauJet do not overlap with removal direction, skipping...");
50 return StatusCode::FAILURE;
51}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
virtual StatusCode initialize() override
Initialization of the tool.
Gaudi::Property< double > m_checkingCone
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_removedClustersContainer
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_removedTracksContainer
virtual StatusCode execute(xAOD::TauJet &tau) const override
Execution of this tool.
TauEleOverlapChecker(const std::string &name)
Constructor.
TauRecToolBase(const std::string &name)
const Jet * jet() const
TauJet_v3 TauJet
Definition of the current "tau version".
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.