38 inline void print(
const TH1& h1, std::ostream& out)
42 out << setw(
WIDTH) << left << h1.GetName() <<
' '
43 <<
FIXED(8,0) << h1.GetEntries() <<
' '
44 <<
FIXED(8,2) << h1.GetMean() <<
' '
45 <<
FIXED(8,2) << h1.GetRMS() <<
' '
56 int main(
int argc,
char **argv)
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);
85 TH1D h1(
"Event ", NULL, 100, 0.0, 1.0e1);
86 TH1D h2(
"Summary ", NULL, 100, 0.0, 1.0e1);
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(trigger_parameters << endl);
101 STATUS(
"entry: " << setw(10) << input.getCounter() <<
'\r');
DEBUG(endl);
105 h1.Fill((Double_t)
getSizeof(*
object) * 1e-6);
112 hm.Fill((Double_t)
i);
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);
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);
168 const double T = numberOfSummaryslices * 1.0e-9 *
getFrameTime();
170 NOTICE(setw(
WIDTH) << left <<
"Total run duration (based on time slices) [s] " <<
FIXED(7,1) <<
T << endl);
173 for (Int_t
i = 1;
i <= hm.GetNbinsX(); ++
i) {
176 const Double_t
y = (Double_t) hm.GetBinContent(
i);
180 if (name != NULL || y != 0.0) {
183 <<
"[" << setw(2) << x <<
"]" <<
' '
184 << setw(16) << left << (name != NULL ? name :
"?") <<
' '
187 if (numberOfSummaryslices != 0) {
196 << setw(4) <<
" " <<
' '
197 << setw(16) <<
" " <<
' '
198 <<
FIXED(9,0) << h1.GetEntries());
200 if (numberOfSummaryslices != 0) {
211 out << hm << hn << hs << hr;
218 for (Int_t
i = 1;
i <= hm.GetNbinsX(); ++
i) {
221 const Double_t
y = (Double_t) hm.GetBinContent(
i);
Utility class to parse command line options.
Auxiliary data structure for alignment of data.
bool hasTriggerBit(const unsigned int bit) const
Check trigger bit.
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
static const unsigned int NUMBER_OF_TRIGGER_BITS
Number of trigger bits.
then echo Enter input within $TIMEOUT_S seconds echo n User name
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.
I/O formatting auxiliaries.
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
General purpose messaging.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
const char * getTriggerName(JTriggerbit_t bit)
Get trigger name.
#define QAQC(A)
QA/QC output macro.
Auxiliary class to set-up Hit.
const JLimit & getLimit() const
Get limit.
KM3NeT DAQ constants, bit handling, etc.
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.
#define DEBUG(A)
Message macros.
unsigned int JTriggerbit_t
Type definition of trigger bit.