ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetValidation
InDetSecVertexValidation
src
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
7
PhysValSecVtx::PhysValSecVtx
(
const
std::string&
type
,
8
const
std::string& name,
9
const
IInterface* parent)
10
:
ManagedMonitorToolBase
(
type
, name, parent)
11
{}
12
13
StatusCode
PhysValSecVtx::initialize
()
14
{
15
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
);
16
ATH_CHECK
(
ManagedMonitorToolBase::initialize
());
17
ATH_CHECK
(
m_eventInfoKey
.initialize());
18
ATH_CHECK
(
m_vertexContainerKey
.initialize());
19
20
std::string folder =
"SquirrelPlots/SecVtx"
;
21
22
m_secVtxValidationPlots
=
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
32
StatusCode
PhysValSecVtx::bookHistograms
()
33
{
34
ATH_MSG_INFO
(
"Booking hists "
<< name() <<
"..."
);
35
ATH_CHECK
(
bookCollection
(
m_secVtxValidationPlots
.get()));
36
return
StatusCode::SUCCESS;
37
}
38
39
StatusCode
PhysValSecVtx::fillHistograms
(
const
EventContext& ctx)
40
{
41
ATH_MSG_DEBUG
(
"Filling hists "
<< name() <<
"..."
);
42
43
SG::ReadHandle< xAOD::VertexContainer >
inputVertexContainer =
SG::makeHandle
(
m_vertexContainerKey
, ctx );
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
58
StatusCode
PhysValSecVtx::procHistograms
()
59
{
60
ATH_MSG_INFO
(
"Finalising hists "
<< name() <<
"..."
);
61
m_secVtxValidationPlots
->finalize();
62
return
StatusCode::SUCCESS;
63
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
PhysValSecVtx.h
ManagedMonitorToolBase::ManagedMonitorToolBase
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition
ManagedMonitorToolBase.cxx:339
ManagedMonitorToolBase::initialize
virtual StatusCode initialize()
Definition
ManagedMonitorToolBase.cxx:617
PhysValSecVtx::PhysValSecVtx
PhysValSecVtx(const std::string &type, const std::string &name, const IInterface *parent)
Definition
PhysValSecVtx.cxx:7
PhysValSecVtx::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition
PhysValSecVtx.h:35
PhysValSecVtx::m_vertexContainerKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
Definition
PhysValSecVtx.h:38
PhysValSecVtx::m_secVtxValidationPlots
std::unique_ptr< SecVtxValidationPlots > m_secVtxValidationPlots
Definition
PhysValSecVtx.h:42
PhysValSecVtx::bookHistograms
virtual StatusCode bookHistograms() override
An inheriting class should either override this function or bookHists().
Definition
PhysValSecVtx.cxx:32
PhysValSecVtx::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) override
An inheriting class should either override this function or fillHists().
Definition
PhysValSecVtx.cxx:39
PhysValSecVtx::bookCollection
StatusCode bookCollection(external_collection_t *)
Definition
PhysValSecVtx.h:50
PhysValSecVtx::initialize
virtual StatusCode initialize() override
Definition
PhysValSecVtx.cxx:13
PhysValSecVtx::procHistograms
virtual StatusCode procHistograms() override
An inheriting class should either override this function or finalHists().
Definition
PhysValSecVtx.cxx:58
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
xAOD::VertexContainer
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Definition
VertexContainer.h:14
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition
Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
type
Generated on
for ATLAS Offline Software by
1.17.0