25 struct experiment_type {
38 friend inline std::istream&
operator>>(std::istream& in, experiment_type& experiment)
40 return in >> experiment.Hd
53 friend inline std::ostream&
operator<<(std::ostream& out,
const experiment_type& experiment)
55 return out << experiment.Hd <<
' '
56 << experiment.Hs <<
' '
72 printer(
const char*
const title,
85 friend inline std::ostream&
operator<<(std::ostream& out,
const printer& printer)
90 out << setw(16) << left << printer.title << right;
92 if (printer.ps != NULL) {
94 out <<
' ' << setw(16) << left << printer.ps->GetName() << right;
96 const TH1* h1 =
dynamic_cast<const TH1*
>(printer.ps);
99 out <<
' ' <<
FIXED(10,3) << h1->GetSumOfWeights();
107 const char*
const title;
133 "triplets of data, signal and background histograms, "\
134 "each of which defined by <file name>:<histogram name>");
135 zap[
'R'] =
make_field(SNR,
"signal-to-noise ratio") = 0.0;
140 catch(
const exception& error) {
141 FATAL(error.what() << endl);
145 JExperiment::setSNR(SNR);
149 for (
const auto& i : setup) {
151 const TObject* pd = getObject(i.Hd);
152 const TObject* ps = getObject(i.Hs);
153 const TObject* pb = getObject(i.Hb);
155 STATUS(printer(
"Data:", pd) << endl);
156 STATUS(printer(
"Signal:", ps) << endl);
157 STATUS(printer(
"Background:", pb) << endl);
163 const JRealExperiment::fit_type result = rx();
166 cout <<
"signal: " <<
FIXED(9,3) << rx.
getSignal() <<
"/" << setw(6) << rx.size() << endl;
169 if (
debug >= debug_t) {
173 for (
double x : rx) {
175 cout <<
SCIENTIFIC(12,3) << 1.0/x << ((n + 1)%10 == 0 ?
"\n" :
" ");
183 <<
FIXED(12,5) << result.likelihood <<
' '
184 <<
FIXED(12,5) << result.signal << endl;
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input.
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 class to handle file name, ROOT directory and object name.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JWriter & operator<<(JWriter &out, const JDAQChronometer &chronometer)
Write DAQ chronometer to output.
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.
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 data structure for floating point format specification.