28 int main(
int argc,
char **argv)
32 using namespace KM3NETDAQ;
34 JTriggeredFileScanner<> inputFile;
41 JParser<> zap(
"Example program to histogram trigger efficiency.");
50 catch(
const exception &error) {
51 FATAL(error.what() << endl);
62 catch(
const JException& error) {
71 TH1D h0(
"h0", NULL, 100, 0.5, 100.5);
72 TH1D h1(
"h1", NULL, 100, 0.5, 100.5);
73 TH1D h2(
"h2", NULL, 100, 0.5, 100.5);
77 while (inputFile.hasNext()) {
79 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
81 JTriggeredFileScanner<>::multi_pointer_type ps = inputFile.next();
83 const Evt*
event = ps;
93 h1.Fill((Double_t) n, 1.0);
98 for (JMultipleFileScanner<Evt> in(inputFile); in.hasNext(); ) {
100 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
102 const Evt*
event = in.next();
112 h0.Fill((Double_t) n, 1.0);
117 for (Int_t i = 1; i <= h1.GetNbinsX(); ++i) {
119 const Double_t y1 = h1.GetBinContent(i);
120 const Double_t y0 = h0.GetBinContent(i);
124 const Double_t y3 = y1 / y0;
125 const Double_t w3 = sqrt(y1 * (y0 - y1) / (y0*y0*y0));
127 h2.SetBinContent(i, y3);
128 h2.SetBinError (i, w3);
131 ERROR(
"Bin " << h0.GetName() <<
"[" << i <<
"] empty." << endl);
Utility class to parse command line options.
Synchronously read DAQ events and Monte Carlo events (and optionally other events).
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
bool is_noise(const Hit &hit)
Verify hit origin.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Utility class to parse command line options.
ROOT TTree parameter settings.
#define DEBUG(A)
Message macros.
int main(int argc, char *argv[])