16 #include "../../../GaudiKernel/tests/src/LogHistogram.h"
25 template <
typename Arithmetic, Gaudi::Accumulators::atomicity Atomicity>
35 auto randSvc = service<IRndmGenSvc>(
"RndmGenSvc",
true );
37 error() <<
"Unable to create Random generator" <<
endmsg;
42 for (
unsigned int iH = 0; iH <
m_nHistos; ++iH ) {
44 title <<
"Histogram Number " << iH;
52 for (
unsigned int iT = 0; iT <
m_nTracks; ++iT ) {
87 const double gauss( Gauss() );
88 const double gauss2( Gauss() );
89 const double flat( Flat() );
90 const double gauss3( Gauss3() );
94 ++m_gaussAbsName[
gauss];
95 ++m_gaussVflat[{ flat,
gauss }];
96 ++m_gaussVflatVgauss[{ flat,
gauss, gauss2 }];
97 ++m_gauss_noato[
gauss];
98 ++m_gaussVflat_noato[{ flat,
gauss }];
99 ++m_gaussVflatVgauss_noato[{ flat,
gauss, gauss2 }];
100 ++m_gauss_int[(int)
gauss];
101 ++m_gaussVflat_int[{ (int)flat, (
int)
gauss }];
102 ++m_gaussVflatVgauss_int[{ (int)flat, (
int)
gauss, (int)gauss2 }];
105 m_gauss_w[
gauss] += .5;
106 m_gaussVflat_w[{ flat,
gauss }] += .5;
107 m_gaussVflatVgauss_w[{ flat,
gauss, gauss2 }] += .5;
110 auto gauss_buf = m_gauss_buf.buffer();
111 auto gaussVflat_buf = m_gaussVflat_buf.buffer();
112 auto gaussVflatVgauss_buf = m_gaussVflatVgauss_buf.buffer();
113 for (
unsigned int i = 0; i < 10; i++ ) {
115 ++gaussVflat_buf[{ flat,
gauss }];
116 ++gaussVflatVgauss_buf[{ flat,
gauss, gauss2 }];
120 m_prof_gauss[
gauss] += gauss3;
121 m_prof_gaussVflat[{ flat,
gauss }] += gauss3;
122 m_prof_gaussVflatVgauss[{ flat,
gauss, gauss2 }] += gauss3;
123 m_prof_gauss_noato[
gauss] += gauss3;
124 m_prof_gaussVflat_noato[{ flat,
gauss }] += gauss3;
125 m_prof_gaussVflatVgauss_noato[{ flat,
gauss, gauss2 }] += gauss3;
126 m_prof_gauss_int[(int)
gauss] += (
int)gauss3;
127 m_prof_gaussVflat_int[{ (int)flat, (
int)
gauss }] += (int)gauss3;
128 m_prof_gaussVflatVgauss_int[{ (int)flat, (
int)
gauss, (int)gauss2 }] += (int)gauss3;
131 m_prof_gauss_w[
gauss] += { gauss3, .5 };
132 m_prof_gaussVflat_w[{ flat,
gauss }] += { gauss3, .5 };
133 m_prof_gaussVflatVgauss_w[{ flat,
gauss, gauss2 }] += { gauss3, .5 };
136 auto prof_gauss_buf = m_prof_gauss_buf.buffer();
137 auto prof_gaussVflat_buf = m_prof_gaussVflat_buf.buffer();
138 auto prof_gaussVflatVgauss_buf = m_prof_gaussVflatVgauss_buf.buffer();
139 for (
unsigned int i = 0; i < 10; i++ ) {
140 prof_gauss_buf[
gauss] += gauss3;
141 prof_gaussVflat_buf[{ flat,
gauss }] += gauss3;
142 prof_gaussVflatVgauss_buf[{ flat,
gauss, gauss2 }] += gauss3;
146 m_log_gauss[
gauss]++;
147 m_log_gaussVflat[{ flat,
gauss }]++;
149 if ( m_nCalls.nEntries() == 0 ) always() <<
"Filling Histograms...... Please be patient !" <<
endmsg;
161 this,
"Gauss",
"Gaussian mean=0, sigma=1, atomic", { 100, -5, 5,
"X" } };
163 this,
"GaussFlat",
"Gaussian V Flat, atomic", { { 50, -5, 5,
"X" }, { 50, -5, 5,
"Y" } } };
167 "Gaussian V Flat V Gaussian, atomic",
168 { { 10, -5, 5,
"X" }, { 10, -5, 5,
"Y" }, { 10, -5, 5,
"Z" } } };
172 this,
"GaussNA",
"Gaussian mean=0, sigma=1, non atomic", { 100, -5, 5 } };
174 this,
"GaussFlatNA",
"Gaussian V Flat, non atomic", { { 50, -5, 5 }, { 50, -5, 5 } } };
178 "Gaussian V Flat V Gaussian, non atomic",
179 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
183 this,
"GaussInt",
"Gaussian mean=0, sigma=1, integer values", { 10, -5, 5 } };
185 this,
"GaussFlatInt",
"Gaussian V Flat, integer values", { { 10, -5, 5 }, { 10, -5, 5 } } };
189 "Gaussian V Flat V Gaussian, interger values",
190 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
194 this,
"GaussW",
"Gaussian mean=0, sigma=1, weighted", { 100, -5, 5 } };
196 this,
"GaussFlatW",
"Gaussian V Flat, weighted", { { 50, -5, 5 }, { 50, -5, 5 } } };
200 "Gaussian V Flat V Gaussian, weighted",
201 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
205 this,
"GaussBuf",
"Gaussian mean=0, sigma=1, buffered", { 100, -5, 5 } };
207 this,
"GaussFlatBuf",
"Gaussian V Flat, buffered", { { 50, -5, 5 }, { 50, -5, 5 } } };
211 "Gaussian V Flat V Gaussian, buffered",
212 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
218 this,
"ProfGauss",
"Profile, Gaussian mean=0, sigma=1, atomic", { 100, -5, 5 } };
220 this,
"ProfGaussFlat",
"Profile, Gaussian V Flat, atomic", { { 50, -5, 5 }, { 50, -5, 5 } } };
223 "ProfGaussFlatGauss",
224 "Profile, Gaussian V Flat V Gaussian, atomic",
225 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
229 this,
"ProfGaussNA",
"Profile, Gaussian mean=0, sigma=1, non atomic", { 100, -5, 5 } };
231 this,
"ProfGaussFlatNA",
"Profile, Gaussian V Flat, non atomic", { { 50, -5, 5 }, { 50, -5, 5 } } };
233 m_prof_gaussVflatVgauss_noato{
this,
234 "ProfGaussFlatGaussNA",
235 "Profile, Gaussian V Flat V Gaussian, non atomic",
236 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
240 this,
"ProfGaussInt",
"Profile, Gaussian mean=0, sigma=1, integer values", { 10, -5, 5 } };
242 m_prof_gaussVflat_int{
this,
244 "Profile, Gaussian V Flat, integer values",
245 { { 10, -5, 5 }, { 10, -5, 5 } } };
247 m_prof_gaussVflatVgauss_int{
this,
248 "ProfGaussFlatGaussInt",
249 "Profile, Gaussian V Flat V Gaussian, interger values",
250 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
254 this,
"ProfGaussW",
"Profile, Gaussian mean=0, sigma=1, weighted", { 100, -5, 5 } };
256 this,
"ProfGaussFlatW",
"Profile, Gaussian V Flat, weighted", { { 50, -5, 5 }, { 50, -5, 5 } } };
259 "ProfGaussFlatGaussW",
260 "Profile, Gaussian V Flat V Gaussian, weighted",
261 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
265 this,
"ProfGaussBuf",
"Profile, Gaussian mean=0, sigma=1, buffered", { 100, -5, 5 } };
267 this,
"ProfGaussFlatBuf",
"Profile, Gaussian V Flat, buffered", { { 50, -5, 5 }, { 50, -5, 5 } } };
270 "ProfGaussFlatGaussBuf",
271 "Profile, Gaussian V Flat V Gaussian, buffered",
272 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
275 mutable Accumulators::LogHistogram<1> m_log_gauss{
this,
"LogGauss",
"Log, Gaussian", { 5, 0, 2 } };
276 mutable Accumulators::LogHistogram<2, Accumulators::atomicity::full, float> m_log_gaussVflat{
277 this,
"LogGaussFlat",
"LogLog, Gaussian V Flat", { { 5, 0, 2 }, { 5, 0, 2 } } };
281 this,
"/TopDir/SubDir/Gauss",
"Gaussian mean=0, sigma=1, atomic", { 100, -5, 5,
"X" } };
296 const double gauss( Gauss() );
297 const double gauss2( Gauss() );
298 const double flat( Flat() );
302 ++m_gaussVflat[{ flat,
gauss }];
303 ++m_gaussVflatVgauss[{ flat,
gauss, gauss2 }];
306 auto gauss_buf = m_gauss_buf.buffer();
307 auto gaussVflat_buf = m_gaussVflat_buf.buffer();
308 auto gaussVflatVgauss_buf = m_gaussVflatVgauss_buf.buffer();
309 for (
unsigned int i = 0; i < 10; i++ ) {
311 ++gaussVflat_buf[{ flat,
gauss }];
312 ++gaussVflatVgauss_buf[{ flat,
gauss, gauss2 }];
315 if ( m_nCalls.nEntries() == 0 ) always() <<
"Filling Histograms...... Please be patient !" <<
endmsg;
327 this,
"Gauss",
"Gaussian mean=0, sigma=1, atomic", { 100, -5, 5,
"X" } };
329 this,
"GaussFlat",
"Gaussian V Flat, atomic", { { 50, -5, 5,
"X" }, { 50, -5, 5,
"Y" } } };
333 "Gaussian V Flat V Gaussian, atomic",
334 { { 10, -5, 5,
"X" }, { 10, -5, 5,
"Y" }, { 10, -5, 5,
"Z" } } };
338 this,
"GaussBuf",
"Gaussian mean=0, sigma=1, buffered", { 100, -5, 5 } };
340 this,
"GaussFlatBuf",
"Gaussian V Flat, buffered", { { 50, -5, 5 }, { 50, -5, 5 } } };
344 "Gaussian V Flat V Gaussian, buffered",
345 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };