125{
128
130 size_t numberOfTests;
131 double SNR;
133
134 try {
135
137
139 "triplets of data, signal and background histograms, "\
140 "each of which defined by <file name>:<histogram name>");
141 zap[
'n'] =
make_field(numberOfTests,
"number of tests for upper limit calculation") = 0;
142 zap[
'R'] =
make_field(SNR,
"signal-to-noise ratio") = 0.0;
144
145 zap(argc, argv);
146 }
147 catch(const exception& error) {
148 FATAL(error.what() << endl);
149 }
150
151
152 JExperiment::setSNR(SNR);
153
156
157 for (const auto& i : setup) {
158
162
163 STATUS(printer(
"Data:", pd) << endl);
164 STATUS(printer(
"Signal:", ps) << endl);
165 STATUS(printer(
"Background:", pb) << endl);
166
169 }
170
171
172 const JRealExperiment::fit_type
result = rx();
173
174
175 cout <<
"signal: " <<
FIXED(9,3) << rx.
getSignal() <<
"/" << setw(6) << rx.size() << endl;
177
178 if (
debug >= debug_t) {
179
181
182 for (double x : rx) {
183
184 cout <<
SCIENTIFIC(12,3) << 1.0/
x << ((
n + 1)%10 == 0 ?
"\n" :
" ");
185
187 }
188 cout << endl;
189 }
190
191 cout << "result: "
194
195 if (numberOfTests != 0) {
196
197 const double Q = 0.9;
198
200
201 cout <<
"upper limit: " <<
FIXED(12,5) << mu << endl;
202 }
203}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
TObject * getObject(const JRootObjectID &id)
Get first TObject with given identifier.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
double getSignal() const
Get total signal strength.
double getDerivative(const double p) const
Get derivative of likelihood for given signal strength.
double getSignalStrengthForUpperLimit(const JAspera &aspera, const double Q, const size_t numberOfTests, const double precision=1.0e-4)
Get signal strength given result of experiment and probability of upper limit.
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.
Real experiment using PDF of signal and background.
void add(const TObject *pd, const TObject *ps, const TObject *pb)
Add objects with data and PDFs of signal and background.
Auxiliary wrapper for I/O of container with optional comment (see JComment).
Auxiliary data structure for floating point format specification.