ATLAS Offline Software
InDetPlotBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETPHYSVALMONITORING_INDETPLOTBASE
6 #define INDETPHYSVALMONITORING_INDETPLOTBASE
7 
14 #include "GaudiKernel/ServiceHandle.h"
15 #include "InDetPhysValMonitoring/SingleHistogramDefinition.h" // to make available to children
17 
18 #include <string>
19 
20 #define IDPVM_BOOK(name) mBook(name, #name)
21 
23 class TEfficiency;
24 
25 
33 class InDetPlotBase: public PlotBase, public AthMessaging {
34 public:
36  InDetPlotBase(InDetPlotBase* pParent, const std::string& dirName);
37 
39  SingleHistogramDefinition retrieveDefinition(const std::string& histoIdentifier,
40  const std::string& folder = "default",
41  const std::string& nameOverride="");
42 
48  template <class Htype> void book (Htype* & pHisto,
49  const std::string& histoIdentifier,
50  const std::string & nameOverride="",
51  const std::string& folder = "default");
52 
54  void book(TH1*& pHisto, const SingleHistogramDefinition& hd);
56  void book(TProfile*& pHisto, const SingleHistogramDefinition& hd);
58  void book(TProfile2D*& pHisto, const SingleHistogramDefinition& hd);
60  void book(TH2*& pHisto, const SingleHistogramDefinition& hd);
62  void book(TEfficiency*& pHisto, const SingleHistogramDefinition& hd);
63 
64  // weight2 allows us to weight averaging in the profile
65  static void fillHisto(TProfile* pTprofile, const float bin, const float weight, const float weight2=1.0);
66  static void fillHisto(TProfile2D* pTprofile, const float xval, const float yval, const float weight, const float weight2=1.0);
67  //
68  static void fillHisto(TH1* pTh1, const float value);
69  static void fillHisto(TH1* pTh1, const float value, const float weight);
70  //
71  static void fillHisto(TH2* pTh2, const float xval, const float yval);
72  static void fillHisto(TH2* pTh2, const float xval, const float yval, const float weight);
73  //
74  static void fillHisto(TH3* pTh3, const float xval, const float yval, const float zval);
75  //
76  static void fillHisto(TEfficiency* pTeff, const float value, const bool accepted, float weight);
77  static void fillHisto(TEfficiency* eff2d, const float xvalue, const float yvalue, const bool accepted, const float weight);
78  //
79 protected:
81  template <class T>
82  void
83  mBook(T& pHisto, const std::string& histoIdentifier) {
84  return book(pHisto, histoIdentifier.substr(2));
85  }
86 
87 private:
89 };
90 
91 
92 #include "InDetPlotBase.ixx"
93 
94 
95 #endif
SingleHistogramDefinition.h
PlotBase
Definition: PlotBase.h:34
InDetPlotBase::book
void book(Htype *&pHisto, const std::string &histoIdentifier, const std::string &nameOverride="", const std::string &folder="default")
Helper method to book histograms using an identifier string.
bin
Definition: BinsDiffFromStripMedian.h:43
athena.value
value
Definition: athena.py:124
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
InDetPlotBase
Mixin class to give extra capabilities to plots such as ATH_MSG and an easier booking interface,...
Definition: InDetPlotBase.h:33
plotting.yearwise_efficiency_vs_mu.xval
float xval
Definition: yearwise_efficiency_vs_mu.py:35
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
SingleHistogramDefinition
Almost-a-struct for holding the single histogram definition.
Definition: SingleHistogramDefinition.h:17
InDetPlotBase::m_histoDefSvc
ServiceHandle< IHistogramDefinitionSvc > m_histoDefSvc
Definition: InDetPlotBase.h:88
InDetPlotBase::InDetPlotBase
InDetPlotBase(InDetPlotBase *pParent, const std::string &dirName)
Constructor taking parent node and directory name for plots.
Definition: InDetPlotBase.cxx:35
plotting.yearwise_efficiency_vs_mu.yval
float yval
Definition: yearwise_efficiency_vs_mu.py:36
IHistogramDefinitionSvc.h
InDetPlotBase::mBook
void mBook(T &pHisto, const std::string &histoIdentifier)
book, for use by macro
Definition: InDetPlotBase.h:83
AthMessaging.h
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
InDetPlotBase::fillHisto
static void fillHisto(TProfile *pTprofile, const float bin, const float weight, const float weight2=1.0)
Definition: InDetPlotBase.cxx:82
PlotBase.h
InDetPlotBase::retrieveDefinition
SingleHistogramDefinition retrieveDefinition(const std::string &histoIdentifier, const std::string &folder="default", const std::string &nameOverride="")
Retrieve a single histogram definition, given the unique string identifier.
Definition: InDetPlotBase.cxx:151
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
IHistogramDefinitionSvc
Interface class to get the histogram definition for a named histogram in a given directory.
Definition: IHistogramDefinitionSvc.h:20
ServiceHandle< IHistogramDefinitionSvc >