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;
132 "triplets of data, signal and background histograms, "\
133 "each of which defined by <file name>:<histogram name>");
138 catch(
const exception& error) {
139 FATAL(error.what() << endl);
145 for (
const auto& i : setup) {
147 const TObject* pd = getObject(i.Hd);
148 const TObject* ps = getObject(i.Hs);
149 const TObject* pb = getObject(i.Hb);
151 STATUS(printer(
"Data:", pd) << endl);
152 STATUS(printer(
"Signal:", ps) << endl);
153 STATUS(printer(
"Background:", pb) << endl);
159 const JRealExperiment::fit_type result = rx();
162 cout <<
"signal: " <<
FIXED(9,3) << rx.
getSignal() <<
"/" << setw(6) << rx.size() << endl;
165 if (
debug >= debug_t) {
169 for (
double x : rx) {
171 cout <<
SCIENTIFIC(12,3) << 1.0/x << ((n + 1)%10 == 0 ?
"\n" :
" ");
179 <<
FIXED(12,5) << result.likelihood <<
' '
180 <<
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.