25 int main(
int argc,
char**argv)
32 typedef JLegendre<double, N> JLegendre_t;
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);
60 typedef JCollection< JElement2D<double, double> > collection_type;
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);
76 JEstimator<JLegendre_t>
g1(data.begin(), data.end());
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]);
107 ASSERT(fabs(
Q.getMean()) <= precision);
109 ASSERT(
Q.getSTDev() <= precision);
Utility class to parse command line options.
Linear fit of JMATH::JLegendre.
Q(UTCMax_s-UTCMin_s)-livetime_s
int main(int argc, char *argv[])
Auxiliary methods for mathematics.
The elements in a collection are sorted according to their abscissa values and a given distance opera...
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
Auxiliary data structure for floating point format specification.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose class for a collection of sorted elements.
General purpose messaging.
Utility class to parse command line options.
int numberOfBins
number of bins for average CDF integral of optical module
#define DEBUG(A)
Message macros.
Double_t g1(const Double_t x)
Function.