36 inline Double_t g3(
const Double_t x,
40 return (TMath::Gaus(x, 0.0, 1.0, kTRUE) *
41 TMath::Gaus(y, 0.0, 1.0, kTRUE) *
42 TMath::Gaus(z, 0.0, 1.0, kTRUE));
53int main(
int argc,
char **argv)
66 JParser<> zap(
"Example program to test 3D histogram.");
76 catch(
const exception &error) {
77 FATAL(error.what() << endl);
81 if (numberOfEvents <= 0) {
82 FATAL(
"No events." << endl);
98 JMultiHistogram_t histogram;
105 for (
int i = 0; i != numberOfEvents; ++i) {
108 STATUS(
"event: " << setw(10) << i <<
'\r');
DEBUG(endl);
111 const double x = gRandom->Gaus(0.0, 1.0);
112 const double y = gRandom->Gaus(0.0, 1.0);
113 const double z = gRandom->Gaus(0.0, 1.0);
114 const double w = 1.0;
116 histogram.fill(x, y, z, w);
120 histogram.div((
double) numberOfEvents);
125 JMultiPDF_t pdf(histogram);
135 if (inputFile !=
"") {
143 for (
int i = 0; i != numberOfEvents; ++i) {
145 const double x = gRandom->Gaus(0.0, 1.0);
146 const double y = gRandom->Gaus(0.0, 1.0);
147 const double z = gRandom->Gaus(0.0, 1.0);
151 const double u = g3 (x, y, z);
152 const double v = pdf(x, y, z);
156 catch(
const std::exception& error) {}
163 cout <<
"normalisation " <<
FIXED(5,3) << getIntegral(
static_cast<const JMultiFunction_t&
>(pdf)) << endl;
164 cout <<
"efficiency " <<
FIXED(5,3) << (double) Q.
getCount() / (double) numberOfEvents << endl;
General purpose messaging.
#define DEBUG(A)
Message macros.
General methods for loading and storing a single object from and to a file, respectively.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
Auxiliary classes for numerical integration.
int numberOfBins
number of bins for average CDF integral of optical module
virtual const char * what() const override
Get error message.
Utility class to parse command line options.
void store(const std::string &file_name, const T &object)
Store object to output file.
void load(const std::string &file_name, T &object)
Load object from input file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.