Jpp
JTestNBTrigger.cc
Go to the documentation of this file.
1 #include <iostream>
2 
3 #include <Jeep/JParser.hh>
4 
5 #include <JDAQ/JDAQEvent.hh>
6 
7 #include <JSupport/JSupport.hh>
10 
11 #include <JDetector/JDetector.hh>
14 
15 int main(int argc , char** argv) {
16  using namespace std;
17  using namespace JPP;
18  using namespace KM3NETDAQ;
19 
20  JMultipleFileScanner<JDAQEvent> in;
21 
22  string detectorFile;
23  JDetector detector;
24 
25 
26  JParser<> parser;
27 
28  parser['f'] = make_field(in);
29  parser['a'] = make_field(detectorFile);
30 
31  parser.read(argc , argv);
32 
33  load(detectorFile,detector);
34 
35  const JModuleRouter router (detector);
36 
37  while (in.hasNext()) {
38 
39  JDAQEvent* event = in.next();
40 
41  const JModule& triggeredModule = router.getModule(event->begin<JDAQTriggeredHit>()->getModuleID());
42 
43  for (JDAQEvent::const_iterator<JDAQSnapshotHit> hit = event->begin<JDAQSnapshotHit>() ; hit != event->end<JDAQSnapshotHit>() ; ++hit) {
44 
45  cout << triggeredModule.getDistance(router.getModule(hit->getModuleID())) << " " << triggeredModule.getFloor() << " " << router.getModule(hit->getModuleID()).getFloor() << endl;
46  }
47  }
48 }
KM3NETDAQ::JDAQEvent
DAQ Event.
Definition: JDAQEvent.hh:34
JDETECTOR::load
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Definition: JDetectorToolkit.hh:456
KM3NETDAQ::JDAQModuleIdentifier::getModuleID
int getModuleID() const
Get module identifier.
Definition: JDAQModuleIdentifier.hh:72
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JSupport.hh
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
KM3NETDAQ::JDAQTriggeredHit
DAQ triggered hit.
Definition: JDAQTriggeredHit.hh:25
KM3NETDAQ::JDAQEvent::const_iterator
Template const_iterator.
Definition: JDAQEvent.hh:69
KM3NETDAQ::JDAQTriggerCounter::next
JTriggerCounter_t next()
Increment trigger counter.
Definition: JDAQTriggerCounter.hh:120
JModuleRouter.hh
KM3NETDAQ::JDAQKeyHit
DAQ key hit.
Definition: JDAQKeyHit.hh:24
JMultipleFileScanner.hh
JParser.hh
JDetectorToolkit.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
std
Definition: jaanetDictionary.h:36
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
JDAQEvent.hh
main
int main(int argc, char **argv)
Definition: JTestNBTrigger.cc:15
JDetector.hh
JSupportToolkit.hh
JPARSER::JParser::read
int read(const int argc, const char *const argv[])
Parse the program's command line options.
Definition: JParser.hh:1791