Example program to test transformable function.
More...
#include <string>
#include <iostream>
#include <iomanip>
#include "TMath.h"
#include "TRandom.h"
#include "JTools/JFunction1D_t.hh"
#include "JTools/JTransformableMultiFunction.hh"
#include "JTools/JFunctionalMap_t.hh"
#include "JTools/JQuantile.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Example program to test transformable function.
- Author
- mdejong
Definition in file JTransformableFunction.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 163 of file JTransformableFunction.cc.
175 JParser<> zap(
"Example program to test transformable function.");
184 catch(
const exception &error) {
185 FATAL(error.what() << endl);
188 if (numberOfEvents <= 0) {
189 FATAL(
"No events." << endl);
193 const double xmin = 0.1;
194 const double xmax = 1.0;
195 const double dx = (xmax - xmin) / 3;
199 for (
double x = xmin; x < xmax + 0.5*dx; x += dx) {
201 const double ymin = -5.0 * xmax;
202 const double ymax = +5.0 * xmax;
205 for (
double y = ymin; y < ymax + 0.5*dy; y += dy) {
210 h2.setExceptionHandler(
new typename function_type::JDefaultResult(
JMATH::zero));
213 h2.transform(JTransformer_t());
225 const double ymin = -5.0 * xmax;
226 const double ymax = +5.0 * xmax;
228 for (
int i = 0; i != numberOfEvents; ++i) {
230 const double x = gRandom->Uniform(xmin, xmax);
231 const double y = gRandom->Uniform(ymin, ymax);
235 const result_type value = h2(x,y);
237 const double f = f2(x,y);
238 const double fp = g2(x,y);
239 const double v = G2(x,y);
241 Q[0].put(value.f - f);
242 Q[1].put(value.fp - fp);
243 Q[2].put(value.v - v);
245 catch(
const std::exception& error) {}
252 for (
int i = 0; i !=
sizeof(Q)/
sizeof(Q[0]); ++i) {
253 cout <<
" " << setw(10) << Q[i].getTitle();
258 for (
int i = 0; i !=
sizeof(Q)/
sizeof(Q[0]); ++i) {
259 cout <<
" " <<
SCIENTIFIC(10,2) << Q[i].getMean();
264 for (
int i = 0; i !=
sizeof(Q)/
sizeof(Q[0]); ++i) {
265 cout <<
" " <<
SCIENTIFIC(10,2) << Q[i].getSTDev();
Utility class to parse command line options.
do set_array DAQHEADER JPrintDAQHeader f
static const JZero zero
Function object to assign zero value.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary data structure for floating point format specification.
int numberOfBins
number of bins for average CDF integral of optical module