56int main(
int argc,
char **argv)
63 JLimit_t& numberOfEvents = inputFile.getLimit();
70 JParser<> zap(
"Auxiliary program to histogram and print trigger statistics.");
80 catch(
const exception &error) {
81 FATAL(error.what() << endl);
85 TH1D h1(
"Event ", NULL, 100, 0.0, 1.0e1);
86 TH1D h2(
"Summary ", NULL, 100, 0.0, 1.0e1);
88 TH1D hm(
"Trigger mask ", NULL, NUMBER_OF_TRIGGER_BITS, -0.5, NUMBER_OF_TRIGGER_BITS - 0.5);
89 TH1D hn(
"Trigger hits ", NULL, 1000, -0.5, 1000 - 0.5);
90 TH1D hs(
"Snapshot hits ", NULL, 1000, -0.5, 10000 - 0.5);
91 TH1D hr(
"PMT rate [kHz]", NULL, 100, 0.0, 50.0);
96 NOTICE(parameters << endl);
101 STATUS(
"entry: " << setw(10) << input.getCounter() <<
'\r');
DEBUG(endl);
105 h1.Fill((Double_t)
getSizeof(*
object) * 1e-6);
111 if (object->hasTriggerBit(i)) {
112 hm.Fill((Double_t) i);
123 if (object->getTriggerMask(*i) != 0) {
129 ERROR(
"Number of snapshot hits with trigger mask " <<
n <<
" != " << object->size<
JDAQTriggeredHit>() << endl);
135 long long int numberOfSummaryslices = 0;
139 STATUS(
"entry: " << setw(10) << input.getCounter() <<
'\r');
DEBUG(endl);
143 h2.Fill((Double_t)
getSizeof(*
object) * 1e-6);
145 for (JDAQSummaryslice::const_iterator i = object->begin(); i != object->end(); ++i) {
147 hr.Fill(i->getRate(pmt) * 1.0e-3);
161 NOTICE(
"Background rate estimate from snapshot hits " << setprecision(2)
162 << (hs.GetMean() - hn.GetMean()) * numberOfSummaryslices / (hr.GetEntries() * 2e-6 * parameters.TMaxEvent_ns)
163 <<
" [kHz]" << endl);
167 const double T = numberOfSummaryslices * 1.0e-9 *
getFrameTime();
169 NOTICE(setw(
WIDTH) << left <<
"Total run duration (based on time slices) [s] " <<
FIXED(7,1) << T << endl);
172 for (Int_t i = 1; i <= hm.GetNbinsX(); ++i) {
175 const Double_t y = (Double_t) hm.GetBinContent(i);
179 if (name != NULL || y != 0.0) {
182 <<
"[" << setw(2) << x <<
"]" <<
' '
183 << setw(16) << left << (name != NULL ? name :
"?") <<
' '
186 if (numberOfSummaryslices != 0) {
195 << setw(4) <<
" " <<
' '
196 << setw(16) <<
" " <<
' '
197 <<
FIXED(9,0) << h1.GetEntries());
199 if (numberOfSummaryslices != 0) {
200 NOTICE(
FIXED(12,2) << h1.GetEntries() / T <<
" [Hz]");
210 out << hm << hn << hs << hr;
217 for (Int_t i = 1; i <= hm.GetNbinsX(); ++i) {
220 const Double_t y = (Double_t) hm.GetBinContent(i);