50 Long64_t numberOfEvents;
59 JParser<> zap(
"Example program to test hit coincidence building with random data.");
71 catch(
const exception &error) {
72 FATAL(error.what() << endl);
75 gRandom->SetSeed(seed);
77 using namespace KM3NETDAQ;
82 detector.push_back(getModule<JKM3NeT_t>(1001));
88 simbad.reset(k40Simulator.clone());
93 TProfile hn(
"hn", NULL, 31, 0.5, +31.5);
94 TProfile hc(
"hc", NULL, 21, -1.05, +1.05);
95 TProfile ht(
"ht", NULL, 20, 0.5, +20.5);
107 JSuperFrame2D_t buffer;
110 for (
int event_count = 0; event_count < numberOfEvents; ++event_count) {
112 STATUS(
"event: " << setw(10) << event_count <<
'\r');
DEBUG(endl);
114 const int frame_index = 1;
120 for (JDAQTimeslice::const_iterator super_frame = timeslice.begin(); super_frame != timeslice.end(); ++super_frame) {
122 if (moduleRouter.hasModule(super_frame->getModuleID())) {
126 const JModule& module =
detector.getModule(moduleRouter.getAddress(super_frame->getModuleID()));
128 buffer(*super_frame, module);
132 buildL1(buffer, back_inserter(dataL1));
135 if (!dataL1.empty()) {
139 JFrameL1_t d1(dataL1);
142 for (
int i = 1; i <= hn.GetNbinsX(); ++i) {
144 buildL2.numberOfHits = (int) hn.GetBinCenter(i);
148 buildL2(buffer, d1, back_inserter(d2));
150 hn.Fill((
double) buildL2.numberOfHits, (
double) d2.size() / (double) dataL1.size());
157 if (!dataL1.empty()) {
161 JFrameL1_t d1(dataL1);
164 for (
int i = 1; i <= hc.GetNbinsX(); ++i) {
166 buildL2.ctMin = hc.GetBinCenter(i);
170 buildL2(buffer, d1, back_inserter(d2));
172 hc.Fill(buildL2.ctMin, (
double) d2.size() / (double) dataL1.size());
179 if (!dataL1.empty()) {
183 JFrameL1_t d1(dataL1);
186 for (
int i = ht.GetNbinsX(); i != 0; --i) {
188 buildL2.TMaxLocal_ns = ht.GetBinCenter(i);
192 buildL2(buffer, d1, back_inserter(d2));
194 ht.Fill(buildL2.TMaxLocal_ns, (
double) d2.size() / (double) dataL1.size());
Utility class to parse command line options.
Data structure for a composite optical module.
Router for direct addressing of module data in detector data structure.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class to handle optional I/O.
Data structure for UTC time.
double getTimeOfFrame(const int frame_index)
Get start time of frame in ns since start of run for a given frame index.
T & getInstance(const T &object)
Get static instance from temporary object.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class for map of PMT parameters.
Data structure for L2 parameters.
Auxiliary data structure for L1 build parameters.
2-dimensional frame with time calibrated data from one optical module.
do set_variable DETECTOR_TXT $WORKDIR detector
Timeslice with random data.
#define DEBUG(A)
Message macros.