ATLAS Offline Software
Loading...
Searching...
No Matches
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"
8#include "GaudiKernel/EventContext.h"
9
10PhysValCluster::PhysValCluster (const std::string& type, const std::string& name, const IInterface* parent ) : ManagedMonitorToolBase( type, name, parent ) {
11}
12
18
19
21
22 std::string theName = "TopoClusters/TopoClusters_JetETMiss/JetETMiss_"+m_clusterContainerName.key();
23
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
38
39 const EventContext& ctx = Gaudi::Hive::currentContext();
41 if(!evInfoHdl.isValid()){
42 ATH_MSG_ERROR("Do not have EventInfo with key " << m_eventInfoName.key());
43 return StatusCode::FAILURE;
44 }
45
47
48 if(clusHdl.isValid()){
49 for(auto cluster: *clusHdl) {
50 m_clusterValidationPlots->fill(*cluster,*evInfoHdl);
51 }
52 }
53 else ATH_MSG_WARNING(" Cluster container : " << m_clusterContainerName.key() << " not found");
54 return StatusCode::SUCCESS;
55
56}
57
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
std::pair< TH1 *, std::string > HistData
Definition PlotBase.h:30
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 ...
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterContainerName
String that defines with Cluster container to use.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoName
Event info key.
virtual StatusCode initialize()
Standard AlgTool Functions.
PhysValCluster(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
virtual StatusCode bookHistograms()
An inheriting class should either override this function or bookHists().
virtual StatusCode fillHistograms()
An inheriting class should either override this function or fillHists().
std::unique_ptr< ClusterValidationPlots > m_clusterValidationPlots
Pointer to class that defines which histogram blocks to fill.
virtual bool isValid() override final
Can the handle be successfully dereferenced?