15 #include "../../../GaudiKernel/tests/src/LogHistogram.h"
24 template <
typename Arithmetic, Gaudi::Accumulators::atomicity Atomicity>
34 auto randSvc = service<IRndmGenSvc>(
"RndmGenSvc",
true );
36 error() <<
"Unable to create Random generator" <<
endmsg;
41 for (
unsigned int iH = 0; iH <
m_nHistos; ++iH ) {
43 title <<
"Histogram Number " << iH;
51 for (
unsigned int iT = 0; iT <
m_nTracks; ++iT ) {
86 const double gauss( Gauss() );
87 const double gauss2( Gauss() );
88 const double flat( Flat() );
89 const double gauss3( Gauss3() );
93 ++m_gaussAbsName[
gauss];
94 ++m_gaussVflat[{ flat,
gauss }];
95 ++m_gaussVflatVgauss[{ flat,
gauss, gauss2 }];
96 ++m_gauss_noato[
gauss];
97 ++m_gaussVflat_noato[{ flat,
gauss }];
98 ++m_gaussVflatVgauss_noato[{ flat,
gauss, gauss2 }];
99 ++m_gauss_int[(int)
gauss];
100 ++m_gaussVflat_int[{ (int)flat, (
int)
gauss }];
101 ++m_gaussVflatVgauss_int[{ (int)flat, (
int)
gauss, (int)gauss2 }];
104 m_gauss_w[
gauss] += .5;
105 m_gaussVflat_w[{ flat,
gauss }] += .5;
106 m_gaussVflatVgauss_w[{ flat,
gauss, gauss2 }] += .5;
109 auto gauss_buf = m_gauss_buf.buffer();
110 auto gaussVflat_buf = m_gaussVflat_buf.buffer();
111 auto gaussVflatVgauss_buf = m_gaussVflatVgauss_buf.buffer();
112 for (
unsigned int i = 0; i < 10; i++ ) {
114 ++gaussVflat_buf[{ flat,
gauss }];
115 ++gaussVflatVgauss_buf[{ flat,
gauss, gauss2 }];
119 m_prof_gauss[
gauss] += gauss3;
120 m_prof_gaussVflat[{ flat,
gauss }] += gauss3;
121 m_prof_gaussVflatVgauss[{ flat,
gauss, gauss2 }] += gauss3;
122 m_prof_gauss_noato[
gauss] += gauss3;
123 m_prof_gaussVflat_noato[{ flat,
gauss }] += gauss3;
124 m_prof_gaussVflatVgauss_noato[{ flat,
gauss, gauss2 }] += gauss3;
125 m_prof_gauss_int[(int)
gauss] += (
int)gauss3;
126 m_prof_gaussVflat_int[{ (int)flat, (
int)
gauss }] += (int)gauss3;
127 m_prof_gaussVflatVgauss_int[{ (int)flat, (
int)
gauss, (int)gauss2 }] += (int)gauss3;
130 m_prof_gauss_w[
gauss] += { gauss3, .5 };
131 m_prof_gaussVflat_w[{ flat,
gauss }] += { gauss3, .5 };
132 m_prof_gaussVflatVgauss_w[{ flat,
gauss, gauss2 }] += { gauss3, .5 };
135 auto prof_gauss_buf = m_prof_gauss_buf.buffer();
136 auto prof_gaussVflat_buf = m_prof_gaussVflat_buf.buffer();
137 auto prof_gaussVflatVgauss_buf = m_prof_gaussVflatVgauss_buf.buffer();
138 for (
unsigned int i = 0; i < 10; i++ ) {
139 prof_gauss_buf[
gauss] += gauss3;
140 prof_gaussVflat_buf[{ flat,
gauss }] += gauss3;
141 prof_gaussVflatVgauss_buf[{ flat,
gauss, gauss2 }] += gauss3;
145 m_log_gauss[
gauss]++;
146 m_log_gaussVflat[{ flat,
gauss }]++;
148 if ( m_nCalls.nEntries() == 0 ) always() <<
"Filling Histograms...... Please be patient !" <<
endmsg;
160 this,
"Gauss",
"Gaussian mean=0, sigma=1, atomic", { 100, -5, 5,
"X" } };
162 this,
"GaussFlat",
"Gaussian V Flat, atomic", { { 50, -5, 5,
"X" }, { 50, -5, 5,
"Y" } } };
166 "Gaussian V Flat V Gaussian, atomic",
167 { { 10, -5, 5,
"X" }, { 10, -5, 5,
"Y" }, { 10, -5, 5,
"Z" } } };
171 this,
"GaussNA",
"Gaussian mean=0, sigma=1, non atomic", { 100, -5, 5 } };
173 this,
"GaussFlatNA",
"Gaussian V Flat, non atomic", { { 50, -5, 5 }, { 50, -5, 5 } } };
177 "Gaussian V Flat V Gaussian, non atomic",
178 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
182 this,
"GaussInt",
"Gaussian mean=0, sigma=1, integer values", { 10, -5, 5 } };
184 this,
"GaussFlatInt",
"Gaussian V Flat, integer values", { { 10, -5, 5 }, { 10, -5, 5 } } };
188 "Gaussian V Flat V Gaussian, interger values",
189 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
193 this,
"GaussW",
"Gaussian mean=0, sigma=1, weighted", { 100, -5, 5 } };
195 this,
"GaussFlatW",
"Gaussian V Flat, weighted", { { 50, -5, 5 }, { 50, -5, 5 } } };
199 "Gaussian V Flat V Gaussian, weighted",
200 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
204 this,
"GaussBuf",
"Gaussian mean=0, sigma=1, buffered", { 100, -5, 5 } };
206 this,
"GaussFlatBuf",
"Gaussian V Flat, buffered", { { 50, -5, 5 }, { 50, -5, 5 } } };
210 "Gaussian V Flat V Gaussian, buffered",
211 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
217 this,
"ProfGauss",
"Profile, Gaussian mean=0, sigma=1, atomic", { 100, -5, 5 } };
219 this,
"ProfGaussFlat",
"Profile, Gaussian V Flat, atomic", { { 50, -5, 5 }, { 50, -5, 5 } } };
222 "ProfGaussFlatGauss",
223 "Profile, Gaussian V Flat V Gaussian, atomic",
224 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
228 this,
"ProfGaussNA",
"Profile, Gaussian mean=0, sigma=1, non atomic", { 100, -5, 5 } };
230 this,
"ProfGaussFlatNA",
"Profile, Gaussian V Flat, non atomic", { { 50, -5, 5 }, { 50, -5, 5 } } };
232 m_prof_gaussVflatVgauss_noato{
this,
233 "ProfGaussFlatGaussNA",
234 "Profile, Gaussian V Flat V Gaussian, non atomic",
235 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
239 this,
"ProfGaussInt",
"Profile, Gaussian mean=0, sigma=1, integer values", { 10, -5, 5 } };
241 m_prof_gaussVflat_int{
this,
243 "Profile, Gaussian V Flat, integer values",
244 { { 10, -5, 5 }, { 10, -5, 5 } } };
246 m_prof_gaussVflatVgauss_int{
this,
247 "ProfGaussFlatGaussInt",
248 "Profile, Gaussian V Flat V Gaussian, interger values",
249 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
253 this,
"ProfGaussW",
"Profile, Gaussian mean=0, sigma=1, weighted", { 100, -5, 5 } };
255 this,
"ProfGaussFlatW",
"Profile, Gaussian V Flat, weighted", { { 50, -5, 5 }, { 50, -5, 5 } } };
258 "ProfGaussFlatGaussW",
259 "Profile, Gaussian V Flat V Gaussian, weighted",
260 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
264 this,
"ProfGaussBuf",
"Profile, Gaussian mean=0, sigma=1, buffered", { 100, -5, 5 } };
266 this,
"ProfGaussFlatBuf",
"Profile, Gaussian V Flat, buffered", { { 50, -5, 5 }, { 50, -5, 5 } } };
269 "ProfGaussFlatGaussBuf",
270 "Profile, Gaussian V Flat V Gaussian, buffered",
271 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };
274 mutable Accumulators::LogHistogram<1> m_log_gauss{
this,
"LogGauss",
"Log, Gaussian", { 5, 0, 2 } };
275 mutable Accumulators::LogHistogram<2, Accumulators::atomicity::full, float> m_log_gaussVflat{
276 this,
"LogGaussFlat",
"LogLog, Gaussian V Flat", { { 5, 0, 2 }, { 5, 0, 2 } } };
280 this,
"/TopDir/SubDir/Gauss",
"Gaussian mean=0, sigma=1, atomic", { 100, -5, 5,
"X" } };