36 struct experiment_type {
48 friend inline std::istream&
operator>>(std::istream& in, experiment_type& experiment)
50 return in >> experiment.Hs
62 friend inline std::ostream&
operator<<(std::ostream& out,
const experiment_type& experiment)
64 return out << experiment.Hs <<
' '
80 printer(
const char*
const title,
93 friend inline std::ostream&
operator<<(std::ostream& out,
const printer& printer)
98 out <<
setw(16) << left << printer.title << right;
100 if (printer.ps !=
NULL) {
102 out <<
' ' <<
setw(16) << left << printer.ps->GetName() << right;
104 const TH1* h1 =
dynamic_cast<const TH1*
>(printer.ps);
107 out <<
' ' <<
FIXED(10,3) << h1->GetSumOfWeights();
115 const char*
const title;
157 "douplets of signal and background histograms, "
158 <<
"each of which defined by <file name>:<histogram name>");
163 zap[
'B'] =
make_field(boost,
"boost livetime of experiment") = 1.0;
168 "signal and background nuisances, "
169 <<
"each of which defined by <type> (values), \n"
171 zap[
'x'] =
make_field(X,
"x-axis likelihood histogram") = histogram_type(110, -10.0, +100.0);
179 catch(
const exception& error) {
186 JExperiment::setSNR(
SNR);
188 for (
const auto& i : setup) {
193 dynamic_cast<TH1*
>(ps)->
Scale(boost);
221 TH1D hl(
"hl",
NULL, X.getNumberOfBins(), X.getLowerLimit(), X.getUpperLimit());
234 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
253 for (
size_t i = 0; i != n; ++i) {
254 storage.
put(px(nb).likelihood);
260 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
262 STATUS(
"Total time: " <<
setw(8) << (t1 - t0) / chrono::milliseconds(1) <<
" [ms]" <<
endl);
274 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
279 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
281 STATUS(
"Time to result: " <<
setw(6) << (t1 - t0) / chrono::nanoseconds(1) <<
" [ns]" <<
endl);
286 }
else if (P.size() > 0 && Q > 0.0) {
288 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
292 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
294 STATUS(
"Total time: " <<
setw(8) << (t1 - t0) / chrono::milliseconds(1) <<
" [ms]" <<
endl);
298 }
else if (P.size() > 0 || Q > 0.0) {
303 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
306 storage.
put(px().likelihood);
309 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
311 STATUS(
"Total time: " <<
setw(8) << (t1 - t0) / chrono::milliseconds(1) <<
" [ms]" <<
endl);
321 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
333 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
335 STATUS(
"Time to result: " <<
setw(6) << (t1 - t0) / chrono::microseconds(1) <<
" [us]" <<
endl);
338 if (P.size() == 1) {
cout <<
"Minimal likelihood ratio: " <<
FIXED(9,5) << x <<
' ' <<
SCIENTIFIC(12,3) << p <<
endl; }
345 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
349 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
351 STATUS(
"Average time: " <<
setw(6) << (t1 - t0) / chrono::nanoseconds(storage.size()) <<
" [ns]" <<
endl);
353 for (
const auto& result : storage) {
356 <<
setw(3) << result.ns <<
' '
357 <<
setw(3) << result.nb <<
' '
358 <<
FIXED(12,5) << result.likelihood <<
' '
359 <<
FIXED(12,5) << result.signal <<
endl);
361 hl.Fill(result.likelihood);
362 hn.Fill(result.signal - result.ns);
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input.
Auxiliary methods for mathematics.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
Auxiliary methods to convert data members or return values of member methods of a set of objects to a...
Auxiliary class to handle file name, ROOT directory and object name.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
std::ostream & operator<<(std::ostream &out, const morphology_type &object)
Write morphology to output stream.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
double getProbability(const T value) const
Get maximal probability corresponding given minimal value.
T getValue(const double P) const
Get minimal value corresponding given maximal probability.
void put(const T value)
Add value to container.
Pseudo experiment using CDF for combined generation and likelihood evaluation.
void add(const TObject *ps, const TObject *pb)
Add objects with PDFs of signal and background.
struct JASTRONOMY::JPseudoExperiment::parameters_type nuisance
double getSignal() const
Get total signal.
virtual void set(const double fS, const double fB=1.0) override
Set scaling factors of signal and background strengths.
double getBackground() const
Get total background.
void configure(size_t N)
Configure lookup tables.
Data structure for measured coincidence rates of all pairs of PMTs in optical module.
Template definition of random value generator.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure for floating point format specification.