34 struct experiment_type {
50 friend inline std::istream&
operator>>(std::istream& in, experiment_type& experiment)
52 return in >> experiment.HS
56 >> experiment.nuisance;
67 friend inline std::ostream&
operator<<(std::ostream& out,
const experiment_type& experiment)
69 return out << experiment.HS <<
' '
70 << experiment.HB <<
' '
71 << experiment.Hs <<
' '
72 << experiment.Hb <<
' '
73 << experiment.nuisance;
88 printer(
const char*
const title,
101 friend inline std::ostream&
operator<<(std::ostream& out,
const printer& printer)
106 out <<
setw(16) << left << printer.title << right;
108 if (printer.ps !=
NULL) {
110 out <<
' ' <<
setw(16) << left << printer.ps->GetName() << right;
112 const TH1* h1 =
dynamic_cast<const TH1*
>(printer.ps);
115 out <<
' ' <<
FIXED(10,3) << h1->GetSumOfWeights();
123 const char*
const title;
164 "douplets of signal and background histograms and doublets of signal and background nuisances, \n"
165 <<
"\teach of which defined by <file name>:<histogram name> and <type> (values), respectively, \n"
166 <<
"\twhere <type> can be:" << get_keys(nuisance_helper));
174 zap[
'x'] =
make_field(X,
"x-axis likelihood histogram") = histogram_type(110, -10.0, +100.0);
182 catch(
const exception& error) {
189 JExperiment::setSNR(
SNR);
194 for (
const auto& i : setup) {
198 const TObject* ps = getObject(i.Hs);
202 pi.nuisance = i.nuisance;
206 STATUS(printer(
"Background for generation:",
pB) <<
endl);
207 STATUS(printer(
"Signal for evaluation: ", ps) <<
endl);
208 STATUS(printer(
"Background for evaluation:",
pb) <<
endl);
227 if (
debug >= debug_t) {
228 for (
size_t i = 0; i != px.size(); ++i) {
229 cout <<
setw(2) << i <<
' ' << px[i].nuisance.signal <<
' ' << px[i].nuisance.background <<
endl;
237 TH1D hl(
"hl",
NULL, X.getNumberOfBins(), X.getLowerLimit(), X.getUpperLimit());
241 if (P > 0.0 && Q > 0.0) {
243 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
247 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
249 STATUS(
"Total time: " <<
setw(8) << (t1 - t0) / chrono::milliseconds(1) <<
" [ms]" <<
endl);
253 }
else if (P > 0.0 || Q > 0.0) {
258 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
261 storage.
put(px().likelihood);
264 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
275 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
287 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
289 STATUS(
"Time to result: " <<
setw(6) << (t1 - t0) / chrono::microseconds(1) <<
" [us]" <<
endl);
292 if (P > 0.0) {
cout <<
"Minimal likelihood ratio: " <<
FIXED(9,5) << x <<
' ' <<
SCIENTIFIC(12,3) << p <<
endl; }
299 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
303 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
305 STATUS(
"Average time: " <<
setw(6) << (t1 - t0) / chrono::nanoseconds(storage.size()) <<
" [ns]" <<
endl);
307 for (
const auto& result : storage) {
310 <<
setw(3) << result.ns <<
' '
311 <<
setw(3) << result.nb <<
' '
312 <<
FIXED(12,5) << result.likelihood <<
' '
313 <<
FIXED(12,5) << result.signal <<
endl);
315 hl.Fill(result.likelihood);
316 hn.Fill(result.signal - result.ns);
int main(int argc, char **argv)
Set of pseudo experments.
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
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.
Auxiliary data structure to fit signal strength using likelihood ratio for multiple pseudo experiment...
double getSignal() const
Get total signal.
void add()
Add remnant signal and background.
virtual void set(const double fS, const double fB=1.0) override
Set scaling factors of signal and background strengths.
void configure(size_t N)
Configure lookup tables.
double getBackground() const
Get total background.
Pseudo experiment using CDF for combined generation and likelihood evaluation.
Data structure for measured coincidence rates of all pairs of PMTs in optical module.
Template definition of random value generator.
Auxiliary data structure for floating point format specification.