57{
61
63 JLimit_t& numberOfEvents = inputFile.getLimit();
67
68 try {
69
70 JParser<> zap(
"Auxiliary program to histogram and print trigger statistics.");
71
77
78 zap(argc, argv);
79 }
80 catch(const exception &error) {
81 FATAL(error.what() << endl);
82 }
83
84
85 TH1D h1("Event ", NULL, 100, 0.0, 1.0e1);
86 TH1D h2("Summary ", NULL, 100, 0.0, 1.0e1);
87
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);
92
93
95
96 NOTICE(trigger_parameters << endl);
97
98
100
101 STATUS(
"entry: " << setw(10) << input.getCounter() <<
'\r');
DEBUG(endl);
102
104
105 h1.Fill((Double_t)
getSizeof(*
object) * 1e-6);
106
109
111 if (object->hasTriggerBit(i)) {
112 hm.Fill((Double_t) i);
113 }
114 }
115
116 {
118
120
122
123 if (object->getTriggerMask(*i) != 0) {
125 }
126 }
127
129 ERROR(
"Number of snapshot hits with trigger mask " <<
n <<
" != " << object->size<
JDAQTriggeredHit>() << endl);
130 }
131 }
132 }
133
134
135 long long int numberOfSummaryslices = 0;
136
138
139 STATUS(
"entry: " << setw(10) << input.getCounter() <<
'\r');
DEBUG(endl);
140
142
143 h2.Fill((Double_t)
getSizeof(*
object) * 1e-6);
144
145 for (JDAQSummaryslice::const_iterator i = object->begin(); i != object->end(); ++i) {
147 hr.Fill(i->getRate(pmt) * 1.0e-3);
148 }
149 }
150 }
151
152
159 }
160
162 NOTICE(
"Background rate estimate from snapshot hits " << setprecision(2)
163 << (hs.GetMean() - hn.GetMean()) * numberOfSummaryslices / (hr.GetEntries() * 2e-6 * trigger_parameters.TMaxEvent_ns)
164 << " [kHz]" << endl);
166
167
168 const double T = numberOfSummaryslices * 1.0e-9 *
getFrameTime();
169
170 NOTICE(setw(
WIDTH) << left <<
"Total run duration (based on time slices) [s] " <<
FIXED(7,1) << T << endl);
171
172
173 for (Int_t i = 1; i <= hm.GetNbinsX(); ++i) {
174
176 const Double_t
y = (Double_t) hm.GetBinContent(i);
177
179
180 if (name != NULL || y != 0.0) {
181
183 << "[" << setw(2) << x << "]" << ' '
184 << setw(16) << left << (name != NULL ? name : "?") << ' '
186
187 if (numberOfSummaryslices != 0) {
189 }
190
192 }
193 }
194
196 << setw(4) << " " << ' '
197 << setw(16) << " " << ' '
198 <<
FIXED(9,0) << h1.GetEntries());
199
200 if (numberOfSummaryslices != 0) {
201 NOTICE(
FIXED(12,2) << h1.GetEntries() / T <<
" [Hz]");
202 }
203
205
207
209
210 out << h1 << h2;
211 out << hm << hn << hs << hr;
212
213 out.Write();
214 out.Close();
215 }
216
217
218 for (Int_t i = 1; i <= hm.GetNbinsX(); ++i) {
219
221 const Double_t
y = (Double_t) hm.GetBinContent(i);
222
224
225 if (name != NULL) {
227 }
228 }
229
231
232 return 0;
233}
#define DEBUG(A)
Message macros.
#define QAQC(A)
QA/QC output macro.
int qaqc
QA/QC file descriptor.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
virtual bool hasNext() override
Check availability of next element.
JTriggerCounter_t next()
Increment trigger counter.
std::ostream & print(std::ostream &out, const JTestSummary &summary, const char delimiter=' ', const bool useColors=true)
Print test summary.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
const char * getTriggerName(JTriggerbit_t bit)
Get trigger name.
unsigned int JTriggerbit_t
Type definition of trigger bit.
KM3NeT DAQ data structures and auxiliaries.
double getFrameTime()
Get frame time duration.
static const unsigned int NUMBER_OF_TRIGGER_BITS
Number of trigger bits.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
size_t getSizeof()
Definition of method to get size of data type.
Auxiliary class to set-up Hit.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.