ATLAS Offline Software
Loading...
Searching...
No Matches
PhysValSecVtx.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "src/PhysValSecVtx.h"
6
8 const std::string& name,
9 const IInterface* parent)
10 : ManagedMonitorToolBase(type, name, parent)
11{}
12
14{
15 ATH_MSG_INFO ("Initializing " << name() << "...");
17 ATH_CHECK(m_eventInfoKey.initialize());
18 ATH_CHECK(m_vertexContainerKey.initialize());
19
20 std::string folder = "SquirrelPlots/SecVtx";
21
23 std::make_unique< SecVtxValidationPlots >(nullptr,
24 Form("%s/%s/",
25 folder.c_str(),
26 m_vertexContainerKey.key().c_str())
27 );
28
29 return StatusCode::SUCCESS;
30}
31
33{
34 ATH_MSG_INFO ("Booking hists " << name() << "...");
36 return StatusCode::SUCCESS;
37}
38
39StatusCode PhysValSecVtx::fillHistograms(const EventContext& ctx)
40{
41 ATH_MSG_DEBUG ("Filling hists " << name() << "...");
42
44 if (not inputVertexContainer.isValid()) {
45 ATH_MSG_FATAL("xAOD::VertexContainer with key " << m_vertexContainerKey.key() << " is not available...");
46 return StatusCode::FAILURE;
47 }
48 const xAOD::VertexContainer *vertexContainer = inputVertexContainer.cptr();
49
50 // Fill histograms
51 for (const xAOD::Vertex* vertex : *vertexContainer) {
52 m_secVtxValidationPlots->fill(vertex);
53 }
54
55 return StatusCode::SUCCESS;
56}
57
59{
60 ATH_MSG_INFO ("Finalising hists " << name() << "...");
61 m_secVtxValidationPlots->finalize();
62 return StatusCode::SUCCESS;
63}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
PhysValSecVtx(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
std::unique_ptr< SecVtxValidationPlots > m_secVtxValidationPlots
virtual StatusCode bookHistograms() override
An inheriting class should either override this function or bookHists().
virtual StatusCode fillHistograms(const EventContext &ctx) override
An inheriting class should either override this function or fillHists().
StatusCode bookCollection(external_collection_t *)
virtual StatusCode initialize() override
virtual StatusCode procHistograms() override
An inheriting class should either override this function or finalHists().
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.