60 using namespace KM3NETDAQ;
70 JParser<> zap(
"Auxiliary program to histogram and print trigger statistics.");
74 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
80 catch(
const exception &error) {
81 FATAL(error.what() << endl);
88 TH1D
h1(
"Event ", NULL, 100, 0.0, 1.0e1);
89 TH1D h2(
"Summary ", NULL, 100, 0.0, 1.0e1);
92 TH1D hn(
"Trigger hits ", NULL, 1000, -0.5, 1000 - 0.5);
93 TH1D hs(
"Snapshot hits ", NULL, 1000, -0.5, 10000 - 0.5);
94 TH1D hr(
"PMT rate [kHz]", NULL, 100, 0.0, 50.0);
99 NOTICE(trigger_parameters << endl);
104 STATUS(
"entry: " << setw(10) << input.getCounter() <<
'\r');
DEBUG(endl);
115 hm.Fill((Double_t) i);
138 long long int numberOfSummaryslices = 0;
142 STATUS(
"entry: " << setw(10) << input.getCounter() <<
'\r');
DEBUG(endl);
146 h2.Fill((Double_t)
getSizeof(*
object) * 1e-6);
148 for (JDAQSummaryslice::const_iterator i = object->begin(); i !=
object->end(); ++i) {
150 hr.Fill(i->getRate(pmt) * 1.0e-3);
165 NOTICE(
"Background rate estimate from snapshot hits " << setprecision(2)
166 << (hs.GetMean() - hn.GetMean()) * numberOfSummaryslices / (hr.GetEntries() * 2e-6 * trigger_parameters.TMaxEvent_ns)
167 <<
" [kHz]" << endl);
171 const double T = numberOfSummaryslices * 1.0e-9 *
getFrameTime();
173 NOTICE(setw(
WIDTH) << left <<
"Total run duration (based on time slices) [s] " <<
FIXED(7,1) <<
T << endl);
176 for (Int_t i = 1; i <= hm.GetNbinsX(); ++i) {
179 const Double_t y = (Double_t) hm.GetBinContent(i);
183 if (name != NULL || y != 0.0) {
186 <<
"[" << setw(2) << x <<
"]" <<
' '
187 << setw(16) << left << (name != NULL ? name :
"?") <<
' '
190 if (numberOfSummaryslices != 0) {
199 << setw(4) <<
" " <<
' '
200 << setw(16) <<
" " <<
' '
201 <<
FIXED(7,0) <<
h1.GetEntries());
203 if (numberOfSummaryslices != 0) {
214 out << hm << hn << hs << hr;
221 for (Int_t i = 1; i <= hm.GetNbinsX(); ++i) {
224 const Double_t y = (Double_t) hm.GetBinContent(i);
Auxiliary class to set-up Hit.
Auxiliary data structure for alignment of data.
Utility class to parse command line options.
bool hasTriggerBit(const unsigned int bit) const
Check trigger bit.
static const unsigned int NUMBER_OF_TRIGGER_BITS
Number of trigger bits.
then echo Enter input within $TIMEOUT_S seconds echo n User name
then for HISTOGRAM in h0 h1
Auxiliary data structure for floating point format specification.
unsigned int size() const
Get number of hits.
static JTriggerMask_t getTriggerMask(const JDAQTriggeredHit &hit)
Get trigger mask of given hit.
Auxiliary class for defining the range of iterations of objects.
const_iterator< T > end() const
Get end of data.
virtual bool hasNext() override
Check availability of next element.
const_iterator< T > begin() const
Get begin of data.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
double getFrameTime()
Get frame time duration.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
const char * getTriggerName(JTriggerbit_t bit)
Get trigger name.
#define QAQC(A)
QA/QC output macro.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
const JLimit & getLimit() const
Get limit.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
size_t getSizeof(const JDAQEvent &object)
Get size of object.
int qaqc
QA/QC file descriptor.
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
JTriggerCounter_t next()
Increment trigger counter.
unsigned int JTriggerbit_t
Type definition of trigger bit.