ATLAS Offline Software
Loading...
Searching...
No Matches
EventAnalysis.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "GaudiKernel/ITHistSvc.h"
7#include "GaudiKernel/ServiceHandle.h"
8#include "TH1.h"
9#include "TH2.h"
10#include "TProfile.h"
11#include "TProfile2D.h"
12
13namespace{
14 template <class HistoArrayType>
15 void registerHistogramType
16 (ITHistSvc& histSvc,
17 const HistoArrayType & h, const std::string &sampleName, const std::string & suffix){
18 unsigned int u = 1;
19 const std::string titleRoot{"/ESD/" + sampleName + suffix};
20 for ( auto & thisHisto:h ){
21 histSvc.regHist( titleRoot + std::to_string(u), thisHisto.second ).ignore();
22 ++u;
23 }
24 }
25}
26
27//=============================================================================
28// Constructors & Destructors
29//=============================================================================
30
35
39
40//=============================================================================
41// Public Accessors
42//=============================================================================
44{
45 // This must be called by an inheriting class in order to book
46 // & register histograms.
48 Register();
49}
50
51//=============================================================================
52// Protected Accessors
53//=============================================================================
55{
56 // This must be overriden by an inheriting class.
57}
58
59//=============================================================================
60// Private Accessors
61//=============================================================================
63{
64 ServiceHandle<ITHistSvc> histSvc ("THistSvc", "EventAnalysis");
65
66 // Register histograms in monitoring tool
67 registerHistogramType(*histSvc, m_x1DHistograms, m_xSampleName, "/1dhisto_");
68 registerHistogramType(*histSvc, m_x2DHistograms, m_xSampleName, "/2dhisto_");
69
70 registerHistogramType(*histSvc, m_x1DProfHistograms, m_xSampleName, "/1dprof_");
71 registerHistogramType(*histSvc, m_x2DProfHistograms, m_xSampleName, "/2dprof_");
72}
73
74
75//=============================================================================
Header file for AthHistogramAlgorithm.
std::map< unsigned int, TProfile2D * > m_x2DProfHistograms
std::map< unsigned int, TH2F * > m_x2DHistograms
virtual ~EventAnalysis()
std::map< unsigned int, TH1F * > m_x1DHistograms
virtual void BookHistograms()
virtual void Init()
std::map< unsigned int, TProfile * > m_x1DProfHistograms
unsigned int m_uPassedEvents
std::string m_xSampleName
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77