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
40{
41 ATH_MSG_DEBUG ("Filling hists " << name() << "...");
42
43 const EventContext& ctx = Gaudi::Hive::currentContext();
44
46 if (not inputVertexContainer.isValid()) {
47 ATH_MSG_FATAL("xAOD::VertexContainer with key " << m_vertexContainerKey.key() << " is not available...");
48 return StatusCode::FAILURE;
49 }
50 const xAOD::VertexContainer *vertexContainer = inputVertexContainer.cptr();
51
52 // Fill histograms
53 for (const xAOD::Vertex* vertex : *vertexContainer) {
54 m_secVtxValidationPlots->fill(vertex);
55 }
56
57 return StatusCode::SUCCESS;
58}
59
61{
62 ATH_MSG_INFO ("Finalising hists " << name() << "...");
63 m_secVtxValidationPlots->finalize();
64 return StatusCode::SUCCESS;
65}
#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().
StatusCode bookCollection(external_collection_t *)
virtual StatusCode initialize() override
virtual StatusCode procHistograms() override
An inheriting class should either override this function or finalHists().
virtual StatusCode fillHistograms() override
An inheriting class should either override this function or fillHists().
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.