ATLAS Offline Software
List of all members
DerivationFramework::HardScatterVertexDecorator Class Reference

#include <HardScatterVertexDecorator.h>

Inheritance diagram for DerivationFramework::HardScatterVertexDecorator:
Collaboration diagram for DerivationFramework::HardScatterVertexDecorator:

Public Member Functions

Constructor
 HardScatterVertexDecorator (const std::string &type, const std::string &name, const IInterface *parent)
 
Function(s) implementing the AthAlgTool and IAugmentationTool interfaces
StatusCode initialize ()
 Function initialising the tool. More...
 
virtual StatusCode addBranches () const
 Function decorating the inputs. More...
 

Private Attributes

The properties that can be defined via the python job options
SG::ReadHandleKey< xAOD::VertexContainerm_vtxContKey
 ReadHandleKey for the input vertices. More...
 
Gaudi::Property< std::string > m_evtDecoName
 Name of the output hardscatter decoration (applied to xAOD::EventInfo) More...
 
ToolHandle< InDet::IInDetHardScatterSelectionToolm_vtxSelectTool
 ToolHandle for the IInDetHardScatterSelectionTool. More...
 
Truly private internal data members
SG::ReadHandleKey< xAOD::EventInfom_evtInfoKey {this, "EventInfo", "EventInfo", "EventInfo key"}
 xAOD::EventInfo ReadHandleKey More...
 
SG::WriteDecorHandleKey< xAOD::EventInfom_evtDecoKey
 WriteDecorHandleKey for the output hardscatter decoration (applied to xAOD::EventInfo) More...
 

Detailed Description

Definition at line 29 of file HardScatterVertexDecorator.h.

Constructor & Destructor Documentation

◆ HardScatterVertexDecorator()

DerivationFramework::HardScatterVertexDecorator::HardScatterVertexDecorator ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 25 of file HardScatterVertexDecorator.cxx.

25  :
26  base_class(type, name, parent) {
27  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::HardScatterVertexDecorator::addBranches ( ) const
virtual

Function decorating the inputs.

Definition at line 64 of file HardScatterVertexDecorator.cxx.

65  {
66  ATH_MSG_DEBUG("In addBranches(...) for " << name() << "...");
67 
68  const EventContext& ctx = Gaudi::Hive::currentContext();
69 
70  // Open our vertex container
72  if (!vtxCont.isValid()) {
73  ATH_MSG_ERROR("Unable to retrieve xAOD::VertexContainer!");
74  return StatusCode::FAILURE;
75  }
76 
77  // Open our event info
79  if (!evtInfo.isValid()) {
80  ATH_MSG_ERROR("Unable to retrieve xAOD::EventInfo!");
81  return StatusCode::FAILURE;
82  }
83 
84  // Instantiate our WriteDecorHandle
86 
87  // Decorate our event info
88  evtDeco(*evtInfo) = m_vtxSelectTool->getHardScatterLink(vtxCont.get());
89 
90  return StatusCode::SUCCESS;
91  }

◆ initialize()

StatusCode DerivationFramework::HardScatterVertexDecorator::initialize ( )

Function initialising the tool.

Definition at line 29 of file HardScatterVertexDecorator.cxx.

30  {
31  // Print configuration
32  ATH_MSG_DEBUG("Initializing " << name() << "...");
33  ATH_MSG_DEBUG("Using VertexContainerName: " << m_vtxContKey);
34  ATH_MSG_DEBUG("Using HardScatterDecoName: " << m_evtDecoName);
35  ATH_MSG_DEBUG("Using HardScatterSelectionTool: " << m_vtxSelectTool);
36 
37  if (m_vtxContKey.empty()) {
38  ATH_MSG_ERROR("No xAOD::VertexContainer provided!");
39  return StatusCode::FAILURE;
40  }
41 
42  if (m_evtDecoName.empty()) {
43  ATH_MSG_ERROR("Hardscatter decoration name cannot be empty!");
44  return StatusCode::FAILURE;
45  }
46 
47  if (m_vtxSelectTool.empty()) {
48  ATH_MSG_ERROR("No InDet::IInDetHardScatterSelectionTool provided!");
49  return StatusCode::FAILURE;
50  }
51 
52  // Initialize our vertex and event info container reads
53  ATH_CHECK(m_vtxContKey.initialize());
55 
56  // Instantiate and initialize our event info decorator write
59  // Fetch our InDet::IInDetHardScatterSelectionTool
60  ATH_CHECK(m_vtxSelectTool.retrieve());
61  return StatusCode::SUCCESS;
62  }

Member Data Documentation

◆ m_evtDecoKey

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::HardScatterVertexDecorator::m_evtDecoKey
private
Initial value:
{this, "VertexDecorationKey", "",
"Declaration of the HardScatterVertexLink key. Will be overwrriten during initialize"}

WriteDecorHandleKey for the output hardscatter decoration (applied to xAOD::EventInfo)

Definition at line 84 of file HardScatterVertexDecorator.h.

◆ m_evtDecoName

Gaudi::Property<std::string> DerivationFramework::HardScatterVertexDecorator::m_evtDecoName
private
Initial value:
{this, "HardScatterDecoName", "hardScatterVertexLink",
"Name of the hardscatter vertex decoration (applied to xAOD::EventInfo)"}

Name of the output hardscatter decoration (applied to xAOD::EventInfo)

Definition at line 67 of file HardScatterVertexDecorator.h.

◆ m_evtInfoKey

SG::ReadHandleKey<xAOD::EventInfo> DerivationFramework::HardScatterVertexDecorator::m_evtInfoKey {this, "EventInfo", "EventInfo", "EventInfo key"}
private

xAOD::EventInfo ReadHandleKey

Definition at line 81 of file HardScatterVertexDecorator.h.

◆ m_vtxContKey

SG::ReadHandleKey<xAOD::VertexContainer> DerivationFramework::HardScatterVertexDecorator::m_vtxContKey
private
Initial value:
{this, "VertexContainerName", "PrimaryVertices",
"Name of the input vertex container"}

ReadHandleKey for the input vertices.

Definition at line 63 of file HardScatterVertexDecorator.h.

◆ m_vtxSelectTool

ToolHandle<InDet::IInDetHardScatterSelectionTool> DerivationFramework::HardScatterVertexDecorator::m_vtxSelectTool
private
Initial value:
{this, "HardScatterSelectionTool", "",
"IInDetHardScatterSelectionTool for selecting the hardscatter vertex" }

ToolHandle for the IInDetHardScatterSelectionTool.

Definition at line 71 of file HardScatterVertexDecorator.h.


The documentation for this class was generated from the following files:
DerivationFramework::HardScatterVertexDecorator::m_vtxSelectTool
ToolHandle< InDet::IInDetHardScatterSelectionTool > m_vtxSelectTool
ToolHandle for the IInDetHardScatterSelectionTool.
Definition: HardScatterVertexDecorator.h:71
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
DerivationFramework::HardScatterVertexDecorator::m_evtDecoName
Gaudi::Property< std::string > m_evtDecoName
Name of the output hardscatter decoration (applied to xAOD::EventInfo)
Definition: HardScatterVertexDecorator.h:67
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
test_pyathena.parent
parent
Definition: test_pyathena.py:15
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DerivationFramework::HardScatterVertexDecorator::m_evtInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
xAOD::EventInfo ReadHandleKey
Definition: HardScatterVertexDecorator.h:81
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
DerivationFramework::HardScatterVertexDecorator::m_vtxContKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vtxContKey
ReadHandleKey for the input vertices.
Definition: HardScatterVertexDecorator.h:63
DerivationFramework::HardScatterVertexDecorator::m_evtDecoKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_evtDecoKey
WriteDecorHandleKey for the output hardscatter decoration (applied to xAOD::EventInfo)
Definition: HardScatterVertexDecorator.h:84