1 #ifndef __JROOT__JROOTTESTKIT__
2 #define __JROOT__JROOTTESTKIT__
8 #pragma GCC diagnostic push
9 #pragma GCC diagnostic ignored "-Wall"
14 #pragma GCC diagnostic pop
22 namespace JPP {
using namespace JROOT; }
35 for (Int_t ix = 1; ix <= h1->GetXaxis()->GetNbins(); ++ix){
37 const double x = h1->GetXaxis()->GetBinCenter(ix);
39 h1->SetBinContent(ix, gRandom->Poisson(
f1(
x)));
41 if (h1->GetSumw2N() != 0) {
42 h1->SetBinError(ix, sqrt(h1->GetBinContent(ix)));
57 for (Int_t ix = 1; ix <= h2->GetXaxis()->GetNbins(); ++ix){
58 for (Int_t iy = 1; iy <= h2->GetYaxis()->GetNbins(); ++iy){
60 const double x = h2->GetXaxis()->GetBinCenter(ix);
61 const double y = h2->GetYaxis()->GetBinCenter(iy);
63 h2->SetBinContent(ix, iy, gRandom->Poisson(f2(
x,
y)));
65 if (h2->GetSumw2N() != 0) {
66 h2->SetBinError(ix, iy, sqrt(h2->GetBinContent(ix,iy)));
82 for (Int_t ix = 1; ix <= h3->GetXaxis()->GetNbins(); ++ix){
83 for (Int_t iy = 1; iy <= h3->GetYaxis()->GetNbins(); ++iy){
84 for (Int_t iz = 1; iz <= h3->GetZaxis()->GetNbins(); ++iz){
86 const double x = h3->GetXaxis()->GetBinCenter(ix);
87 const double y = h3->GetYaxis()->GetBinCenter(iy);
88 const double z = h3->GetZaxis()->GetBinCenter(iz);
90 h3->SetBinContent(ix, iy, iz, gRandom->Poisson(
f3(
x,
y,z)));
92 if (h3->GetSumw2N() != 0) {
93 h3->SetBinError(ix, iy, iy, sqrt(h3->GetBinContent(ix,iy,iz)));
118 inline bool operator<(
const double W) {
return this->W < W; }
125 for (Int_t ix = 1; ix <= h1->GetXaxis()->GetNbins(); ++ix){
127 const Double_t
x = h1->GetXaxis()->GetBinCenter(ix);
131 buffer.push_back({
x, W});
134 for (
size_t i = 0; i !=
ns; ++i) {
161 inline bool operator<(
const double W) {
return this->W < W; }
168 for (Int_t ix = 1; ix <= h2->GetXaxis()->GetNbins(); ++ix){
169 for (Int_t iy = 1; iy <= h2->GetYaxis()->GetNbins(); ++iy){
171 const Double_t
x = h2->GetXaxis()->GetBinCenter(ix);
172 const Double_t
y = h2->GetYaxis()->GetBinCenter(iy);
176 buffer.push_back({
x,
y, W});
180 for (
size_t i = 0; i !=
ns; ++i) {
184 h2->Fill(p->x, p->y);
208 inline bool operator<(
const double W) {
return this->W < W; }
215 for (Int_t ix = 1; ix <= h3->GetXaxis()->GetNbins(); ++ix){
216 for (Int_t iy = 1; iy <= h3->GetYaxis()->GetNbins(); ++iy){
217 for (Int_t iz = 1; iz <= h3->GetYaxis()->GetNbins(); ++iz){
219 const Double_t
x = h3->GetXaxis()->GetBinCenter(ix);
220 const Double_t
y = h3->GetYaxis()->GetBinCenter(iy);
221 const Double_t z = h3->GetZaxis()->GetBinCenter(iz);
225 buffer.push_back({
x,
y, z, W});
230 for (
size_t i = 0; i !=
ns; ++i) {
234 h3->Fill(p->x, p->y, p->z);
double f3(const double x, const double y, const double z)
3D function.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
bool operator<(const Head &first, const Head &second)
Less than operator.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for ROOT I/O.
void FillRandom(TH3 *h3, const T &f3, const size_t ns)
Fill 3D histogram according PDF as given 3D function.