136{
139
142
150 bool add;
151 histogram_type X;
153 double P;
156
157 try {
158
160
162
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);
179
181 }
182 catch(const exception& error) {
184 }
185
186
188
189 JExperiment::setSNR(
SNR);
190
191
193
194 for (const auto& i : setup) {
195
200
202 pi.nuisance = i.nuisance;
204
206 STATUS(printer(
"Background for generation:",
pB) <<
endl);
207 STATUS(printer(
"Signal for evaluation: ", ps) <<
endl);
208 STATUS(printer(
"Background for evaluation:",
pb) <<
endl);
210
211 }
212
214
217 }
218
219 if (add) {
221 }
222
226
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;
230 }
231 }
232
234
236
237 TH1D hl(
"hl",
NULL, X.getNumberOfBins(), X.getLowerLimit(), X.getUpperLimit());
239
240
241 if (P > 0.0 && Q > 0.0) {
242
243 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
244
246
247 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
248
249 STATUS(
"Total time: " <<
setw(8) << (t1 - t0) / chrono::milliseconds(1) <<
" [ms]" <<
endl);
250
252
253 } else if (P > 0.0 || Q > 0.0) {
254
256
257 {
258 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
259
261 storage.
put(px().likelihood);
262 }
263
264 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
265
267 }
268
270
272 double p = 0.0;
273
274 {
275 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
276
277 if (P > 0.0) {
280 }
281
282 if (Q > 0.0) {
285 }
286
287 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
288
289 STATUS(
"Time to result: " <<
setw(6) << (t1 - t0) / chrono::microseconds(1) <<
" [us]" <<
endl);
290 }
291
294
296
298
299 const chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now();
300
301 px(storage);
302
303 const chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();
304
305 STATUS(
"Average time: " <<
setw(6) << (t1 - t0) / chrono::nanoseconds(storage.size()) <<
" [ns]" <<
endl);
306
307 for (const auto& result : storage) {
308
314
317 }
318 }
319
320 out.Write();
321 out.Close();
322}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
TObject * getObject(const JRootObjectID &id)
Get first TObject with given identifier.
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
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.