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
13
14namespace{
15 template <class HistoArrayType>
16 void registerHistogramType
17 (ITHistSvc& histSvc,
18 const HistoArrayType & h, const std::string &sampleName, const std::string & suffix){
19 unsigned int u = 1;
20 const std::string titleRoot{"/ESD/" + sampleName + suffix};
21 for ( auto & thisHisto:h ){
22 histSvc.regHist( titleRoot + std::to_string(u), thisHisto.second ).ignore();
23 ++u;
24 }
25 }
26}
27
28//=============================================================================
29// Constructors & Destructors
30//=============================================================================
31
36
40
41//=============================================================================
42// Public Accessors
43//=============================================================================
45{
46 // This must be called by an inheriting class in order to book
47 // & register histograms.
49 Register();
50}
51
52//=============================================================================
53// Protected Accessors
54//=============================================================================
56{
57 // This must be overriden by an inheriting class.
58}
59
60//=============================================================================
61// Private Accessors
62//=============================================================================
64{
65 ServiceHandle<ITHistSvc> histSvc ("THistSvc", "EventAnalysis");
66
67 // Register histograms in monitoring tool
68 registerHistogramType(*histSvc, m_x1DHistograms, m_xSampleName, "/1dhisto_");
69 registerHistogramType(*histSvc, m_x2DHistograms, m_xSampleName, "/2dhisto_");
70
71 registerHistogramType(*histSvc, m_x1DProfHistograms, m_xSampleName, "/1dprof_");
72 registerHistogramType(*histSvc, m_x2DProfHistograms, m_xSampleName, "/2dprof_");
73}
74
75
76//=============================================================================
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