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

#include <MatchingBkgVertexPositioner.h>

Inheritance diagram for Simulation::MatchingBkgVertexPositioner:
Collaboration diagram for Simulation::MatchingBkgVertexPositioner:

Public Member Functions

 MatchingBkgVertexPositioner (const std::string &t, const std::string &n, const IInterface *p)
 
virtual ~MatchingBkgVertexPositioner ()=default
 
StatusCode initialize () override final
 
CLHEP::HepLorentzVector * generate (const EventContext &ctx) const override final
 

Private Attributes

SG::ReadHandleKey< xAOD::VertexContainerm_vertexContainerKey
 

Detailed Description

Returns a VertexShift based on what is given in the background input file.

Definition at line 24 of file MatchingBkgVertexPositioner.h.

Constructor & Destructor Documentation

◆ MatchingBkgVertexPositioner()

Simulation::MatchingBkgVertexPositioner::MatchingBkgVertexPositioner ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 12 of file MatchingBkgVertexPositioner.cxx.

15  : base_class(t, n, p) {}

◆ ~MatchingBkgVertexPositioner()

virtual Simulation::MatchingBkgVertexPositioner::~MatchingBkgVertexPositioner ( )
virtualdefault

Member Function Documentation

◆ generate()

CLHEP::HepLorentzVector * Simulation::MatchingBkgVertexPositioner::generate ( const EventContext &  ctx) const
finaloverride

Definition at line 25 of file MatchingBkgVertexPositioner.cxx.

26  {
27  // we can currently not reliably determine if the timing information is
28  // available
29  bool enableTime{};
30 
32  if (!vertices.isValid()) {
33  ATH_MSG_ERROR("Couldn't retrieve xAOD::VertexContainer with key: "
35  return nullptr;
36  }
37 
38  for (const xAOD::Vertex *vx : *(vertices.cptr())) {
39  if (vx->vertexType() == xAOD::VxType::PriVtx) {
40  ATH_MSG_INFO("Using primary vertex with position and time: "
41  << vx->position().x() << " " << vx->position().y() << " "
42  << vx->position().z() << " "
43  << (enableTime && vx->hasValidTime() ? vx->time() : 0));
44  return new CLHEP::HepLorentzVector(
45  vx->position().x(), vx->position().y(), vx->position().z(),
46  enableTime && vx->hasValidTime() ? vx->time() : 0);
47  }
48  }
49 
50  ATH_MSG_ERROR("No primary vertex found in xAOD::VertexContainer with key: "
52  return nullptr;
53 }

◆ initialize()

StatusCode Simulation::MatchingBkgVertexPositioner::initialize ( )
finaloverride

Definition at line 17 of file MatchingBkgVertexPositioner.cxx.

17  {
18  ATH_MSG_VERBOSE("Initializing ...");
19 
20  ATH_CHECK(m_vertexContainerKey.initialize());
21 
22  return StatusCode::SUCCESS;
23 }

Member Data Documentation

◆ m_vertexContainerKey

SG::ReadHandleKey<xAOD::VertexContainer> Simulation::MatchingBkgVertexPositioner::m_vertexContainerKey
private
Initial value:
{
this, "PrimaryVertexContainerName", "PrimaryVertices"}

Definition at line 38 of file MatchingBkgVertexPositioner.h.


The documentation for this class was generated from the following files:
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Simulation::MatchingBkgVertexPositioner::m_vertexContainerKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
Definition: MatchingBkgVertexPositioner.h:38
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42