ATLAS Offline Software
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 
9 }
10 
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 }
xAOD::TauJet_v3::jet
const Jet * jet() const
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
TauEleOverlapChecker::execute
virtual StatusCode execute(xAOD::TauJet &tau) const override
Execution of this tool.
Definition: TauEleOverlapChecker.cxx:17
TauEleOverlapChecker::m_checkingCone
Gaudi::Property< double > m_checkingCone
Definition: TauEleOverlapChecker.h:39
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TauRecToolBase
The base class for all tau tools.
Definition: TauRecToolBase.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
TauEleOverlapChecker.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TauEleOverlapChecker::initialize
virtual StatusCode initialize() override
Initialization of the tool.
Definition: TauEleOverlapChecker.cxx:11
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TauEleOverlapChecker::m_removedTracksContainer
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_removedTracksContainer
Definition: TauEleOverlapChecker.h:41
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
TauEleOverlapChecker::m_removedClustersContainer
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_removedClustersContainer
Definition: TauEleOverlapChecker.h:40
TauEleOverlapChecker::TauEleOverlapChecker
TauEleOverlapChecker(const std::string &name)
Constructor.
Definition: TauEleOverlapChecker.cxx:7