25int main(
int argc,
char**argv)
34 const double xmin = -10.0;
35 const double xmax = +10.0;
37 unsigned int numberOfEvents;
45 JParser<> zap(
"Example program to test Legendre polynome.");
55 catch(
const exception &error) {
56 FATAL(error.what() << endl);
66 const double x = xmin + i * (xmax - xmin) / (
numberOfBins - 1);
71 for (collection_type::const_iterator i = data.begin(); i != data.end(); ++i) {
72 DEBUG(
"data: " <<
FIXED(7,3) << i->getX() <<
' ' <<
FIXED(7,3) << i->getY() << endl);
78 for (
size_t n = 0; n !=
g1.size(); ++n) {
79 STATUS(
"Legendre: " << setw(2) << n <<
' ' <<
FIXED(7,3) <<
g1[n] << endl);
85 if (numberOfEvents > 0) {
87 for (
unsigned int i = 0; i != numberOfEvents; ++i) {
89 const double x = gRandom->Uniform(xmin, xmax);
90 const double y = f1(x);
91 const double z =
g1(x);
99 ASSERT(numberOfEvents > 0);
103 for (
size_t n = 0; n !=
g1.size(); ++n) {
104 ASSERT(fabs(f1[n] -
g1[n]) <= precision,
"Legendre: " << setw(2) << n <<
' ' <<
FIXED(7,3) <<
g1[n]);
General purpose class for a collection of sorted elements.
The elements in a collection are sorted according to their abscissa values and a given distance opera...
int main(int argc, char **argv)
Linear fit of JMATH::JLegendre.
Auxiliary methods for mathematics.
General purpose messaging.
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Double_t g1(const Double_t x)
Function.
int numberOfBins
number of bins for average CDF integral of optical module
Template definition of linear fit.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Base class for Legendre polynome.
Template definition for function evaluation of Legendre polynome.