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
37StatusCode PhysValCluster::fillHistograms(const EventContext& ctx){
38
40 if(!evInfoHdl.isValid()){
41 ATH_MSG_ERROR("Do not have EventInfo with key " << m_eventInfoName.key());
42 return StatusCode::FAILURE;
43 }
44
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
#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:31
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.
virtual StatusCode fillHistograms(const EventContext &ctx)
An inheriting class should either override this function or fillHists().
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().
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?