41 int main(
int argc,
char **argv)
49 Long64_t numberOfEvents;
50 JPMTParametersMap pmtParameters;
58 JParser<> zap(
"Example program to test hit coincidence building with random data.");
70 catch(
const exception &error) {
71 FATAL(error.what() << endl);
74 gRandom->SetSeed(seed);
76 using namespace KM3NETDAQ;
85 JDetectorSimulator simbad(detector);
87 simbad.reset(
new JPMTDefaultSimulator(pmtParameters, detector));
88 simbad.reset(
new JCLBDefaultSimulator());
89 simbad.reset(k40Simulator.clone());
94 TProfile hn(
"hn", NULL, 31, 0.5, +31.5);
95 TProfile hc(
"hc", NULL, 21, -1.05, +1.05);
96 TProfile ht(
"ht", NULL, 20, 0.5, +20.5);
99 const JModuleRouter moduleRouter(detector);
111 for (
int event_count = 0; event_count < numberOfEvents; ++event_count) {
113 STATUS(
"event: " << setw(10) << event_count <<
'\r');
DEBUG(endl);
115 const int frame_index = 1;
121 for (JDAQTimeslice::const_iterator super_frame = timeslice.begin(); super_frame != timeslice.end(); ++super_frame) {
123 if (moduleRouter.hasModule(super_frame->getModuleID())) {
127 const JModule& module = detector.getModule(moduleRouter.getAddress(super_frame->getModuleID()));
129 buffer(*super_frame, module);
133 buildL1(buffer, back_inserter(dataL1));
136 if (!dataL1.empty()) {
138 JBuildL2<hit_type> buildL2(1, Tmax_ns, -1.0);
143 for (
int i = 1; i <= hn.GetNbinsX(); ++i) {
145 buildL2.numberOfHits = (int) hn.GetBinCenter(i);
149 buildL2(buffer, d1, back_inserter(d2));
151 hn.Fill((
double) buildL2.numberOfHits, (
double) d2.size() / (double) dataL1.size());
158 if (!dataL1.empty()) {
160 JBuildL2<hit_type> buildL2(2, Tmax_ns, -1.0);
165 for (
int i = 1; i <= hc.GetNbinsX(); ++i) {
167 buildL2.ctMin = hc.GetBinCenter(i);
171 buildL2(buffer, d1, back_inserter(d2));
173 hc.Fill(buildL2.ctMin, (
double) d2.size() / (double) dataL1.size());
180 if (!dataL1.empty()) {
182 JBuildL2<hit_type> buildL2(2, 0.0, -1.0);
187 for (
int i = ht.GetNbinsX(); i != 0; --i) {
189 buildL2.TMaxLocal_ns = ht.GetBinCenter(i);
193 buildL2(buffer, d1, back_inserter(d2));
195 ht.Fill(buildL2.TMaxLocal_ns, (
double) d2.size() / (double) dataL1.size());
Timeslice with random data.
Utility class to parse command line options.
Empty structure for specification of parser element that is initialised (i.e.
Auxiliary class to handle optional I/O.
JSuperFrame2D< hit_type > JSuperFrame2D_t
Data structure for UTC time.
Data structure for detector geometry and calibration.
double getTimeOfFrame(const int frame_index)
Get start time of frame in ns since start of run for a given frame index.
Basic data structure for L0 hit.
JBuildL1< hit_type > JBuildL1_t
Basic data structure for time and time over threshold information of hit.
T & getInstance(const T &object)
Get static instance from temporary object.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Direct access to module in detector data structure.
vector< hit_type > JFrameL1_t
Utility class to parse command line options.
2-dimensional frame with time calibrated data from one optical module.
Basic data structure for L1 hit.
#define DEBUG(A)
Message macros.
int main(int argc, char *argv[])