Go to the documentation of this file.
44 int main(
int argc,
char **argv)
51 JLimit_t& numberOfEvents = inputFile.getLimit();
64 JParser<> zap(
"Monitoring of PMT time-over-threshold distributions.");
66 zap[
'f'] =
make_field(inputFile,
"input file.");
68 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
69 zap[
'a'] =
make_field(detectorFile,
"detector file.");
71 zap[
'c'] =
make_field(ctMax,
"maximal cosine space angle between PMT axes.") = 0.0;
73 zap[
'D'] =
make_field(deadTime_us,
"L0 dead time (us)") = 10;
74 zap[
'C'] =
make_field(selector,
"timeslice selector, e.g. JDAQTimesliceL1.") = getROOTClassSelection<JDAQTimesliceTypes_t>();
75 zap[
'O'] =
make_field(option,
"hit pre-processing option.") = JPreprocessor::getOptions();
80 catch(
const exception &error) {
81 FATAL(error.what() << endl);
91 FATAL(
"Invalid time window [ns] " << T_ns << endl);
94 if (selector == JDAQTimeslice ::Class_Name() ||
95 selector == JDAQTimesliceL1::Class_Name()) {
103 FATAL(
"No trigger parameters from input." << endl);
106 if ((selector == JDAQTimeslice ::Class_Name() && parameters.
writeL1.
prescale > 0) ||
107 (selector == JDAQTimesliceL1::Class_Name())) {
115 if (!multiplicity.
is_valid()) {
FATAL(
"Invalid multiplicity " << multiplicity << endl); }
116 if ( multiplicity.
getLowerLimit() < 1) {
FATAL(
"Invalid multiplicity " << multiplicity << endl); }
132 FATAL(
"Empty detector." << endl);
141 const double zmin = -0.5;
142 const double zmax = 256.5;
143 const int nz = (int) ((zmax-zmin) / 1.0);
153 const double deadTime_ns = deadTime_us * 1e3;
159 for ( ; in.
hasNext() && counter != inputFile.getLimit(); ++counter) {
161 STATUS(
"event: " << setw(10) << counter <<
'\r');
DEBUG(endl);
165 for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
167 if (router.
hasModule(frame->getModuleID())) {
169 TH2D* h2 = manager[frame->getModuleID()];
172 JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame, module);
174 buffer.preprocess(option, match);
176 JSuperFrame1D_t& data = JSuperFrame1D_t::multiplex(buffer);
180 for (JSuperFrame1D_t::const_iterator p = data.begin(), __end = data.end() - 1; p != __end; ) {
182 JSuperFrame1D_t::const_iterator q = p;
184 double ct_max = -1.0;
185 double dt_min = numeric_limits<double>::max();
187 while (++q != __end && q->getT() - p->getT() < T_ns.
getUpperLimit()) {
190 const double dt = q->getT() - p->getT();
203 for (JSuperFrame1D_t::const_iterator __p = p; __p != q; ++__p) {
205 if (__p->getT() > t0[__p->getPMT()] + deadTime_ns) {
206 h2->Fill(__p->getPMT(), __p->getToT());
209 t0[__p->getPMT()] = __p->getT();
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
Auxiliary class for defining the range of iterations of objects.
double TMaxLocal_ns
maximal time difference between L0 hits for L1
Data structure for all trigger parameters.
virtual bool hasNext()
Check availability of next element.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
1-dimensional frame with time calibrated data from one optical module.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
static const char *const _2SToT
Histogram naming.
Utility class to parse command line options.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Auxiliary class to manage set of compatible ROOT objects (e.g.
int main(int argc, char **argv)
bool putObject(TDirectory *dir, const T &object)
Write object to ROOT directory.
virtual const pointer_type & next()
Get next element.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
#define MAKE_CSTRING(A)
Make C-string.
Reduced data structure for L0 hit.
const JPMT & getPMT(const int index) const
Get PMT.
Auxiliary class to select ROOT class based on class name.
Auxiliary class for multiplexing object iterators.
Data structure for a composite optical module.
void Write(TDirectory &out, const bool wm=false)
Write objects to file.
Router for direct addressing of module data in detector data structure.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose class for object reading from a list of file names.
#define DEBUG(A)
Message macros.
bool hasModule(const JObjectID &id) const
Has module.
KM3NeT DAQ data structures and auxiliaries.
double getDot(const JNeutrinoDirection &first, const JNeutrinoDirection &second)
Dot product.
JPrescaler writeL1
write JDAQTimeslice with L1 data
Auxiliary class for specifying the way of pre-processing of hits.
2-dimensional frame with time calibrated data from one optical module.
Long64_t counter_type
Type definition for counter.