ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
PFlow
PFlowValidation
PFODQA
src
PhysValCluster.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
PhysValCluster.h
"
6
#include "
xAODCaloEvent/CaloClusterContainer.h
"
7
#include "
xAODEventInfo/EventInfo.h
"
8
#include "GaudiKernel/EventContext.h"
9
10
PhysValCluster::PhysValCluster
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent ) :
ManagedMonitorToolBase
(
type
, name, parent ) {
11
}
12
13
StatusCode
PhysValCluster::initialize
(){
14
ATH_CHECK
(
m_clusterContainerName
.initialize());
15
ATH_CHECK
(
m_eventInfoName
.initialize());
16
return
ManagedMonitorToolBase::initialize
();
17
}
18
19
20
StatusCode
PhysValCluster::bookHistograms
(){
21
22
std::string theName =
"TopoClusters/TopoClusters_JetETMiss/JetETMiss_"
+
m_clusterContainerName
.key();
23
24
m_clusterValidationPlots
.reset(
new
ClusterValidationPlots
(0,theName,
m_clusterContainerName
));
25
m_clusterValidationPlots
->setDetailLevel(100);
26
m_clusterValidationPlots
->initialize();
27
std::vector<HistData> hists =
m_clusterValidationPlots
->retrieveBookedHistograms();
28
29
for
(
const
HistData
& hist : hists) {
30
ATH_CHECK
(
regHist
(hist.first,hist.second,
all
));
31
}
32
33
return
StatusCode::SUCCESS;
34
35
}
36
37
StatusCode
PhysValCluster::fillHistograms
(
const
EventContext& ctx){
38
39
SG::ReadHandle<xAOD::EventInfo>
evInfoHdl{
m_eventInfoName
, ctx};
40
if
(!evInfoHdl.
isValid
()){
41
ATH_MSG_ERROR
(
"Do not have EventInfo with key "
<<
m_eventInfoName
.key());
42
return
StatusCode::FAILURE;
43
}
44
45
SG::ReadHandle<xAOD::CaloClusterContainer>
clusHdl{
m_clusterContainerName
, ctx};
46
47
if
(clusHdl.
isValid
()){
48
for
(
auto
cluster: *clusHdl) {
49
m_clusterValidationPlots
->fill(*cluster,*evInfoHdl);
50
}
51
}
52
else
ATH_MSG_WARNING
(
" Cluster container : "
<<
m_clusterContainerName
.key() <<
" not found"
);
53
return
StatusCode::SUCCESS;
54
55
}
56
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
CaloClusterContainer.h
PhysValCluster.h
HistData
std::pair< TH1 *, std::string > HistData
Definition
PlotBase.h:31
ClusterValidationPlots
Definition
ClusterValidationPlots.h:17
ManagedMonitorToolBase::regHist
virtual StatusCode regHist(TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...
Definition
ManagedMonitorToolBase.cxx:1345
ManagedMonitorToolBase::all
@ all
Definition
ManagedMonitorToolBase.h:116
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
PhysValCluster::m_clusterContainerName
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterContainerName
String that defines with Cluster container to use.
Definition
PhysValCluster.h:30
PhysValCluster::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx)
An inheriting class should either override this function or fillHists().
Definition
PhysValCluster.cxx:37
PhysValCluster::m_eventInfoName
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoName
Event info key.
Definition
PhysValCluster.h:32
PhysValCluster::initialize
virtual StatusCode initialize()
Standard AlgTool Functions.
Definition
PhysValCluster.cxx:13
PhysValCluster::PhysValCluster
PhysValCluster(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition
PhysValCluster.cxx:10
PhysValCluster::bookHistograms
virtual StatusCode bookHistograms()
An inheriting class should either override this function or bookHists().
Definition
PhysValCluster.cxx:20
PhysValCluster::m_clusterValidationPlots
std::unique_ptr< ClusterValidationPlots > m_clusterValidationPlots
Pointer to class that defines which histogram blocks to fill.
Definition
PhysValCluster.h:36
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
type
EventInfo.h
Generated on
for ATLAS Offline Software by
1.17.0