| The Gaudi Framework v32r1 (f65d50dc)

HistoTool.h
Go to the documentation of this file.
1 #ifndef GAUDIALG_HISTOTOOL_H
2 #define GAUDIALG_HISTOTOOL_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // Gaudi
7 // ============================================================================
8 #include "GaudiAlg/GaudiHistoTool.h"
9 #include "GaudiAlg/IHistoTool.h"
10 // ============================================================================
11
28 class HistoTool : virtual public GaudiHistoTool, virtual public IHistoTool {
29 public:
30 typedef IHistoTool::HistoID HistoID;
31
40 HistoTool( const std::string& type, const std::string& name, const IInterface* parent );
41
42 public:
43 // ================================= 1D Histograms ========================================
44
45 // fill the histogram (book on demand)
46 AIDA::IHistogram1D* plot1D( const double value, const std::string& title, const double low, const double high,
47 const unsigned long bins = 100, const double weight = 1.0 ) const override
48
49 {
50 return GaudiHistoTool::plot1D( value, title, low, high, bins, weight );
51 };
52
53 // fill the histogram with forced ID assignement (book on demand)
54 AIDA::IHistogram1D* plot1D( const double value, const HistoID& ID, const std::string& title, const double low,
55 const double high, const unsigned long bins = 100,
56 const double weight = 1.0 ) const override {
57 return GaudiHistoTool::plot1D( value, ID, title, low, high, bins, weight );
58 };
59
60 // ================================= 2D Histograms ========================================
61
62 // fill the histogram (book on demand)
63 AIDA::IHistogram2D* plot2D( const double valueX, const double valueY, const std::string& title, const double lowX,
64 const double highX, const double lowY, const double highY, const unsigned long binsX = 50,
65 const unsigned long binsY = 50, const double weight = 1.0 ) const override {
66 return GaudiHistoTool::plot2D( valueX, valueY, title, lowX, highX, lowY, highY, binsX, binsY, weight );
67 };
68
69 // fill the histogram (book on demand)
70 AIDA::IHistogram2D* plot2D( const double valueX, const double valueY, const HistoID& ID, const std::string& title,
71 const double lowX, const double highX, const double lowY, const double highY,
72 const unsigned long binsX = 50, const unsigned long binsY = 50,
73 const double weight = 1.0 ) const override {
74 return GaudiHistoTool::plot2D( valueX, valueY, ID, title, lowX, highX, lowY, highY, binsX, binsY, weight );
75 };
76
77 // ================================= 3D Histograms ========================================
78
79 // fill the histogram (book on demand)
80 AIDA::IHistogram3D* plot3D( const double valueX, const double valueY, const double valueZ, const std::string& title,
81 const double lowX, const double highX, const double lowY, const double highY,
82 const double lowZ, const double highZ, const unsigned long binsX = 10,
83 const unsigned long binsY = 10, const unsigned long binsZ = 10,
84 const double weight = 1.0 ) const override {
85 return GaudiHistoTool::plot3D( valueX, valueY, valueZ, title, lowX, highX, lowY, highY, lowZ, highZ, binsX, binsY,
86 binsZ, weight );
87 };
88
89 // fill the histogram (book on demand)
90 AIDA::IHistogram3D* plot3D( const double valueX, const double valueY, const double valueZ, const HistoID& ID,
91 const std::string& title, const double lowX, const double highX, const double lowY,
92 const double highY, const double lowZ, const double highZ, const unsigned long binsX = 10,
93 const unsigned long binsY = 10, const unsigned long binsZ = 10,
94 const double weight = 1.0 ) const override {
95 return GaudiHistoTool::plot3D( valueX, valueY, valueZ, ID, title, lowX, highX, lowY, highY, lowZ, highZ, binsX,
96 binsY, binsZ, weight );
97 };
98
99 public:
100 // book the 1D histogram
101 AIDA::IHistogram1D* book1D( const std::string& title, const double low = 0, const double high = 100,
102 const unsigned long bins = 100 ) const override {
103 return GaudiHistoTool::book1D( title, low, high, bins );
104 };
105
106 // book the 2D histogram
107 AIDA::IHistogram2D* book2D( const std::string& title, const double lowX = 0, const double highX = 100,
108 const unsigned long binsX = 50, const double lowY = 0, const double highY = 100,
109 const unsigned long binsY = 50 ) const override {
110 return GaudiHistoTool::book2D( title, lowX, highX, binsX, lowY, highY, binsY );
111 }
112
113 // book the 3D histogram
114 AIDA::IHistogram3D* book3D( const std::string& title, const double lowX = 0, const double highX = 100,
115 const unsigned long binsX = 10, const double lowY = 0, const double highY = 100,
116 const unsigned long binsY = 10, const double lowZ = 0, const double highZ = 100,
117 const unsigned long binsZ = 10 ) const override {
118 return GaudiHistoTool::book3D( title, lowX, highX, binsX, lowY, highY, binsY, lowZ, highZ, binsZ );
119 }
120
121 // book the 1D histogram with forced ID
122 AIDA::IHistogram1D* book1D( const HistoID& ID, const std::string& title = "", const double low = 0,
123 const double high = 100, const unsigned long bins = 100 ) const override {
124 return GaudiHistoTool::book1D( ID, title, low, high, bins );
125 };
126
127 // book the 2D histogram with forced ID
128 AIDA::IHistogram2D* book2D( const HistoID& ID, const std::string& title, const double lowX = 0,
129 const double highX = 100, const unsigned long binsX = 50, const double lowY = 0,
130 const double highY = 100, const unsigned long binsY = 50 ) const override {
131 return GaudiHistoTool::book2D( ID, title, lowX, highX, binsX, lowY, highY, binsY );
132 }
133
134 // book the 3D histogram with forced ID
135 AIDA::IHistogram3D* book3D( const HistoID& ID, const std::string& title, const double lowX = 0,
136 const double highX = 100, const unsigned long binsX = 10, const double lowY = 0,
137 const double highY = 100, const unsigned long binsY = 10, const double lowZ = 0,
138 const double highZ = 100, const unsigned long binsZ = 10 ) const override {
139 return GaudiHistoTool::book3D( ID, title, lowX, highX, binsX, lowY, highY, binsY, lowZ, highZ, binsZ );
140 }
141
142 // fill the histo with the value and weight
143 AIDA::IHistogram1D* fill( AIDA::IHistogram1D* histo, const double value, const double weight,
144 const std::string& title = "" ) const override {
145 return GaudiHistoTool::fill( histo, value, weight, title );
146 };
147
148 // fill the 2D histo with the value and weight
149 AIDA::IHistogram2D* fill( AIDA::IHistogram2D* histo, const double valueX, const double valueY, const double weight,
150 const std::string& title = "" ) const override {
151 return GaudiHistoTool::fill( histo, valueX, valueY, weight, title );
152 };
153
154 // fill the 3D histo with the value and weight
155 AIDA::IHistogram3D* fill( AIDA::IHistogram3D* histo, const double valueX, const double valueY, const double valueZ,
156 const double weight, const std::string& title = "" ) const override {
157 return GaudiHistoTool::fill( histo, valueX, valueY, valueZ, weight, title );
158 };
159
160 // access the EXISTING 1D histogram by title
161 AIDA::IHistogram1D* histo1D( const std::string& title ) const override { return GaudiHistoTool::histo1D( title ); }
162
163 // access the EXISTING 1D histogram by ID
164 AIDA::IHistogram1D* histo1D( const HistoID& ID ) const override { return GaudiHistoTool::histo1D( ID ); }
165
166 // access the EXISTING 2D histogram by title
167 AIDA::IHistogram2D* histo2D( const std::string& title ) const override { return GaudiHistoTool::histo2D( title ); }
168
169 // access the EXISTING 2D histogram by ID
170 AIDA::IHistogram2D* histo2D( const HistoID& ID ) const override { return GaudiHistoTool::histo2D( ID ); }
171
172 // access the EXISTING 3D histogram by title
173 AIDA::IHistogram3D* histo3D( const std::string& title ) const override { return GaudiHistoTool::histo3D( title ); }
174
175 // access the EXISTING 3D histogram by ID
176 AIDA::IHistogram3D* histo3D( const HistoID& ID ) const override { return GaudiHistoTool::histo3D( ID ); }
177
178 // check the existence AND validity of the histogram with given title
179 bool histoExists( const std::string& title ) const override { return GaudiHistoTool::histoExists( title ); }
180
181 // check the existence AND validity of the histogram with given title
182 bool histoExists( const HistoID& ID ) const override { return GaudiHistoTool::histoExists( ID ); }
183
184 HistoTool() = delete;
185 HistoTool( const HistoTool& ) = delete;
186 HistoTool& operator=( const HistoTool& ) = delete;
187 };
188
189 #endif // GAUDIALG_HISTOTOOL_H
HistoTool::histo3D
AIDA::IHistogram3D * histo3D(const HistoID &ID) const override
access the EXISTING 3D histogram by ID return the pointer to existing 3D histogram or NULL
Definition: HistoTool.h:176
GaudiHistos< GaudiTool >::plot1D
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
Definition: GaudiHistos_1DFixedBinning.icpp:103
HistoTool::book3D
AIDA::IHistogram3D * book3D(const HistoID &ID, const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const override
book the 3D histogram with forced ID
Definition: HistoTool.h:135
HistoTool::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const override
book the 1D histogram
Definition: HistoTool.h:101
HistoTool::plot2D
AIDA::IHistogram2D * plot2D(const double valueX, const double valueY, const HistoID &ID, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const override
fill the 2D histogram with forced ID assignment (book on demand)
Definition: HistoTool.h:70
HistoTool
Simple tool for histogramming (component)
Definition: HistoTool.h:28
GaudiHistoTool.h
Header file for class : GaudiHistoTool.
HistoTool::plot2D
AIDA::IHistogram2D * plot2D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const override
fill the 2D histogram (book on demand)
Definition: HistoTool.h:63
HistoTool::histo2D
AIDA::IHistogram2D * histo2D(const HistoID &ID) const override
access the EXISTING 2D histogram by ID return the pointer to existing 2D histogram or NULL
Definition: HistoTool.h:170
HistoTool::fill
AIDA::IHistogram2D * fill(AIDA::IHistogram2D *histo, const double valueX, const double valueY, const double weight, const std::string &title="") const override
fill the 2D histo with the value and weight
Definition: HistoTool.h:149
HistoTool::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const override
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: HistoTool.h:173
HistoTool::book2D
AIDA::IHistogram2D * book2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const override
book the 2D histogram
Definition: HistoTool.h:107
HistoTool::histoExists
bool histoExists(const HistoID &ID) const override
check the existence AND validity of the histogram with given title
Definition: HistoTool.h:182
HistoTool::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const override
fill the 1D histo with the value and weight
Definition: HistoTool.h:143
GaudiHistoTool
Simple class to extend the functionality of class GaudiTool.
Definition: GaudiHistoTool.h:39
HistoTool::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const override
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: HistoTool.h:161
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
std::string
STL class.
GaudiHistos< GaudiTool >::histoExists
bool histoExists(const std::string &title) const
check the existence AND validity of the histogram with given title
Definition: GaudiHistos.h:2355
HistoTool::plot3D
AIDA::IHistogram3D * plot3D(const double valueX, const double valueY, const double valueZ, const HistoID &ID, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const double lowZ, const double highZ, const unsigned long binsX=10, const unsigned long binsY=10, const unsigned long binsZ=10, const double weight=1.0) const override
fill the 3D histogram with forced ID assignment (book on demand)
Definition: HistoTool.h:90
GaudiHistos< GaudiTool >::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos< GaudiTool >::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
HistoTool::book1D
AIDA::IHistogram1D * book1D(const HistoID &ID, const std::string &title="", const double low=0, const double high=100, const unsigned long bins=100) const override
book the 1D histogram with forced ID
Definition: HistoTool.h:122
HistoTool::book2D
AIDA::IHistogram2D * book2D(const HistoID &ID, const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const override
book the 2D histogram with forced ID
Definition: HistoTool.h:128
IInterface
Definition of the basic interface.
Definition: IInterface.h:244
HistoTool::plot1D
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const override
fill the 1D histogram (book on demand)
Definition: HistoTool.h:46
HistoTool::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const override
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: HistoTool.h:167
GaudiHistos< GaudiTool >::book2D
AIDA::IHistogram2D * book2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D histogram
Definition: GaudiHistos_2DFixedBinning.icpp:7
GaudiHistos< GaudiTool >::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
HistoTool::operator=
HistoTool & operator=(const HistoTool &)=delete
IAlgTool::type
virtual const std::string & type() const =0
The type of an AlgTool, meaning the concrete AlgTool class.
HistoTool::HistoTool
HistoTool()=delete
IHistoTool::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: IHistoTool.h:534
GaudiHistos< GaudiTool >::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
HistoTool::book3D
AIDA::IHistogram3D * book3D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const override
book the 3D histogram
Definition: HistoTool.h:114
IAlgTool::parent
virtual const IInterface * parent() const =0
The parent of the concrete AlgTool.
GaudiHistos< GaudiTool >::plot3D
AIDA::IHistogram3D * plot3D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const double lowZ, const double highZ, const unsigned long binsX=10, const unsigned long binsY=10, const unsigned long binsZ=10, const double weight=1.0) const
fill the 3D histogram (book on demand)
Definition: GaudiHistos_3DFixedBinning.icpp:111
GaudiHistos< GaudiTool >::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295
HistoTool::histoExists
bool histoExists(const std::string &title) const override
check the existence AND validity of the histogram with given title
Definition: HistoTool.h:179
HistoTool::HistoID
IHistoTool::HistoID HistoID
Definition: HistoTool.h:30
IHistoTool.h
GaudiHistos< GaudiTool >::book3D
AIDA::IHistogram3D * book3D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const
book the 3D histogram
Definition: GaudiHistos_3DFixedBinning.icpp:7
HistoTool::plot3D
AIDA::IHistogram3D * plot3D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const double lowZ, const double highZ, const unsigned long binsX=10, const unsigned long binsY=10, const unsigned long binsZ=10, const double weight=1.0) const override
fill the 3D histogram (book on demand)
Definition: HistoTool.h:80
GaudiAlg::ID
ID class for Histogram and Ntuples.
Definition: GaudiHistoID.h:43
HistoTool::fill
AIDA::IHistogram3D * fill(AIDA::IHistogram3D *histo, const double valueX, const double valueY, const double valueZ, const double weight, const std::string &title="") const override
fill the 3D histo with the value and weight
Definition: HistoTool.h:155
IHistoTool
An abstract interface for "histogramming tool".
Definition: IHistoTool.h:30
HistoTool::histo1D
AIDA::IHistogram1D * histo1D(const HistoID &ID) const override
access the EXISTING 1D histogram by ID return the pointer to existing 1D histogram or NULL
Definition: HistoTool.h:164
HistoTool::plot1D
AIDA::IHistogram1D * plot1D(const double value, const HistoID &ID, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const override
fill the 1D histogram with forced ID assignement (book on demand)
Definition: HistoTool.h:54
GaudiHistos< GaudiTool >::plot2D
AIDA::IHistogram2D * plot2D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D histogram (book on demand)
Definition: GaudiHistos_2DFixedBinning.icpp:106