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));
53 int main(
int argc,
char **argv)
65 JParser<> zap(
"Example program to test 3D histogram.");
75 catch(
const exception &error) {
76 FATAL(error.what() << endl);
80 if (numberOfEvents <= 0) {
81 FATAL(
"No events." << endl);
100 JMultiHistogram_t histogram;
107 for (
int i = 0; i != numberOfEvents; ++i) {
110 STATUS(
"event: " << setw(10) << i <<
'\r');
DEBUG(endl);
113 const double x = gRandom->Gaus(0.0, 1.0);
114 const double y = gRandom->Gaus(0.0, 1.0);
115 const double z = gRandom->Gaus(0.0, 1.0);
116 const double w = 1.0;
118 histogram.fill(
x,
y, z,
w);
122 histogram.div((
double) numberOfEvents);
127 JMultiPDF_t pdf(histogram);
129 JLANG::store<JIO::JFileStreamWriter>(
outputFile.c_str(), pdf);
137 if (inputFile !=
"") {
141 JLANG::load<JIO::JFileStreamReader>(inputFile.c_str(), pdf);
145 for (
int i = 0; i != numberOfEvents; ++i) {
147 const double x = gRandom->Gaus(0.0, 1.0);
148 const double y = gRandom->Gaus(0.0, 1.0);
149 const double z = gRandom->Gaus(0.0, 1.0);
153 const double u = g3 (
x,
y, z);
154 const double v = pdf(
x,
y, z);
158 catch(
const std::exception& error) {}
165 cout <<
"normalisation " <<
FIXED(5,3) <<
getIntegral(
static_cast<const JMultiFunction_t&
>(pdf)) << endl;
166 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.
T make_set(T __begin, T __end, JResult_t std::iterator_traits< T >::value_type::*value, const JComparator_t &comparator)
Method to exclude outliers from already sorted data.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.