ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
DerivationFramework::MuonJetDrTool Class Reference

#include <MuonJetDrTool.h>

Inheritance diagram for DerivationFramework::MuonJetDrTool:
Collaboration diagram for DerivationFramework::MuonJetDrTool:

Public Member Functions

 MuonJetDrTool (const std::string &t, const std::string &n, const IInterface *p)
 Constructor with parameters. More...
 
 ~MuonJetDrTool ()=default
 Destructor. More...
 
virtual StatusCode addBranches () const override
 
virtual StatusCode initialize () override
 

Private Attributes

SG::ReadHandleKey< xAOD::MuonContainerm_muonSGKey {this, "ContainerKey", "Muons"}
 
SG::ReadHandleKey< xAOD::JetContainerm_jetSGKey {this, "JetContainerKey", "AntiKt4EMTopoJets"}
 
SG::WriteDecorHandleKey< xAOD::MuonContainerm_jetDR_SGKey {this, "dRDecoration", "DFCommonJetDr"}
 
Gaudi::Property< float > m_jetMinPt {this, "JetMinPt", 20.e3, "Minimal pt cut of the jets to be considered"}
 

Detailed Description

Definition at line 21 of file MuonJetDrTool.h.

Constructor & Destructor Documentation

◆ MuonJetDrTool()

DerivationFramework::MuonJetDrTool::MuonJetDrTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Constructor with parameters.

Definition at line 11 of file MuonJetDrTool.cxx.

11  : base_class(t, n, p) {
12 }

◆ ~MuonJetDrTool()

DerivationFramework::MuonJetDrTool::~MuonJetDrTool ( )
default

Destructor.

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::MuonJetDrTool::addBranches ( ) const
overridevirtual

Definition at line 20 of file MuonJetDrTool.cxx.

20  {
21  const EventContext& ctx = Gaudi::Hive::currentContext();
22 
23  // Retrieve main muonicle collection
25  if (!muons.isValid()) {
26  ATH_MSG_FATAL("Failed to retrive container " << m_muonSGKey.fullKey());
27  return StatusCode::FAILURE;
28  }
30  if (!jets.isValid()) {
31  ATH_MSG_FATAL("Failed to retrieve " << m_jetSGKey.fullKey());
32  return StatusCode::FAILURE;
33  }
35 
36  for (auto muon : *muons) {
37  double new_jetdR = FLT_MAX;
38  bool found{false};
39  for (auto jet : *jets) {
40  if (jet->pt() <= m_jetMinPt) continue;
41  new_jetdR = std::min(xAOD::P4Helpers::deltaR(jet, muon), new_jetdR);
42  found = true;
43  }
44  decorator_jetdR(*muon) = found ? new_jetdR : -1;
45  }
46  return StatusCode::SUCCESS;
47 }

◆ initialize()

StatusCode DerivationFramework::MuonJetDrTool::initialize ( )
overridevirtual

Definition at line 13 of file MuonJetDrTool.cxx.

13  {
16  m_jetDR_SGKey = m_muonSGKey.key() + "." + m_jetDR_SGKey.key();
17  ATH_CHECK(m_jetDR_SGKey.initialize());
18  return StatusCode::SUCCESS;
19 }

Member Data Documentation

◆ m_jetDR_SGKey

SG::WriteDecorHandleKey<xAOD::MuonContainer> DerivationFramework::MuonJetDrTool::m_jetDR_SGKey {this, "dRDecoration", "DFCommonJetDr"}
private

Definition at line 35 of file MuonJetDrTool.h.

◆ m_jetMinPt

Gaudi::Property<float> DerivationFramework::MuonJetDrTool::m_jetMinPt {this, "JetMinPt", 20.e3, "Minimal pt cut of the jets to be considered"}
private

Definition at line 37 of file MuonJetDrTool.h.

◆ m_jetSGKey

SG::ReadHandleKey<xAOD::JetContainer> DerivationFramework::MuonJetDrTool::m_jetSGKey {this, "JetContainerKey", "AntiKt4EMTopoJets"}
private

Definition at line 34 of file MuonJetDrTool.h.

◆ m_muonSGKey

SG::ReadHandleKey<xAOD::MuonContainer> DerivationFramework::MuonJetDrTool::m_muonSGKey {this, "ContainerKey", "Muons"}
private

Definition at line 33 of file MuonJetDrTool.h.


The documentation for this class was generated from the following files:
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:196
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
DerivationFramework::MuonJetDrTool::m_jetDR_SGKey
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_jetDR_SGKey
Definition: MuonJetDrTool.h:35
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
DerivationFramework::MuonJetDrTool::m_jetSGKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetSGKey
Definition: MuonJetDrTool.h:34
DerivationFramework::MuonJetDrTool::m_jetMinPt
Gaudi::Property< float > m_jetMinPt
Definition: MuonJetDrTool.h:37
DerivationFramework::MuonJetDrTool::m_muonSGKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonSGKey
Definition: MuonJetDrTool.h:33
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
xAOD::P4Helpers::deltaR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Definition: xAODP4Helpers.h:150
beamspotman.n
n
Definition: beamspotman.py:731
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
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
checkTriggerxAOD.found
found
Definition: checkTriggerxAOD.py:328