Example program to test JTOOLS::JQuantiles calculation of a function.
More...
#include <string>
#include <iostream>
#include <iomanip>
#include <cmath>
#include "TMath.h"
#include "JTools/JCollection.hh"
#include "JTools/JGrid.hh"
#include "JTools/JQuantiles.hh"
#include "JTools/JFunction1D_t.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
Double_t | g1 (const Double_t x) |
| Function. More...
|
|
Double_t | G1 (const Double_t x) |
| Integral of method g1. More...
|
|
int | main (int argc, char **argv) |
|
Example program to test JTOOLS::JQuantiles calculation of a function.
- Author
- mdejong
Definition in file JQuantiles.cc.
Double_t g1 |
( |
const Double_t |
x | ) |
|
|
inline |
Function.
- Parameters
-
- Returns
- function value
Definition at line 25 of file JQuantiles.cc.
27 return TMath::Gaus(
x, 0.0, 1.0, kTRUE);
Double_t G1 |
( |
const Double_t |
x | ) |
|
|
inline |
Integral of method g1.
- Parameters
-
- Returns
- integral value
Definition at line 37 of file JQuantiles.cc.
39 return 0.5 * (1.0 + TMath::Erf(sqrt(0.5)*
x));
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 48 of file JQuantiles.cc.
59 JParser<> zap(
"Example program to test quantiles calculation of a function.");
68 catch(
const exception &error) {
69 FATAL(error.what() << endl);
76 if (Q < 0.0 || Q > 1.0) {
77 FATAL(
"Fatal error: quantile " <<
Q << endl);
82 const Double_t
xmin = -5.0;
83 const Double_t
xmax = +5.0;
87 NOTICE(
"quantity " << setw(10) <<
"calculated" <<
" / " << setw(10) <<
"true" << endl);
88 NOTICE(
"X " <<
FIXED(10,6) << quantiles.getX() <<
" / " <<
FIXED(10,6) << 0.0 << endl);
89 NOTICE(
"FWHM " <<
FIXED(10,6) << quantiles.getFWHM() <<
" / " <<
FIXED(10,6) << 2.0*sqrt(2.0*
log(2.0)) << endl);
91 NOTICE(
"quantile " <<
FIXED(10,6) << (
G1(quantiles.getUpperLimit()) -
92 G1(quantiles.getLowerLimit())) <<
" / " <<
FIXED(10,6) <<
Q << endl);
94 ASSERT(fabs(quantiles.getX() - 0.0) < precision);
95 ASSERT(fabs(quantiles.getFWHM() - 2.0*sqrt(2.0*
log(2.0))) < precision);
97 ASSERT(fabs((
G1(quantiles.getUpperLimit()) -
98 G1(quantiles.getLowerLimit())) -
Q) < precision);
Utility class to parse command line options.
Q(UTCMax_s-UTCMin_s)-livetime_s
Auxiliary data structure for floating point format specification.
Double_t G1(const Double_t x)
Integral of method g1.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
then cat $TRIPOD_INITIAL<< EOF1 256877.5 4743716.7-2438.42 256815.5 4743395.0-2435.53 257096.2 4743636.0-2439.5EOFfiif[[!-f $DETECTOR]];then JEditDetector-a $DETECTOR_INITIAL-s"-1 addz -6.9"-o $DETECTOR--!eval`JPrintDetector-a $DETECTOR-O SUMMARY`for STRING in ${STRINGS[*]};do set_variable MODULE`getModule-a $DETECTOR-L"$STRING 0"`JEditDetector-a $DETECTOR-M"$MODULE setz -2.9"-o $DETECTOR--!donefiif[[!-f $TRIPOD]];then cp-p $TRIPOD_INITIAL $TRIPODfiJAcoustics.sh $DETECTOR_IDcat > acoustics_trigger_parameters txt<< EOFQ=0.0;TMax_s=0.020;numberOfHits=90;EOFJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]INPUT_FILES=(`ls KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_0 *${^RUNS}_event.root`) cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$DETECTOR $WORKDIR cp-p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR cp-p $HOMEDIR/${^INPUT_FILES}$WORKDIRfisource $JPP_DIR/examples/JAcoustics/acoustics-fit-toolkit.shtimer_startinitialise stage_b 1 0 100.0e-6 0.002 0.1 0 > &stage log
int numberOfBins
number of bins for average CDF integral of optical module
Double_t g1(const Double_t x)
Function.