Jpp
Functions
JTestNBTrigger.cc File Reference
#include <iostream>
#include <Jeep/JParser.hh>
#include <JDAQ/JDAQEvent.hh>
#include <JSupport/JSupport.hh>
#include <JSupport/JSupportToolkit.hh>
#include <JSupport/JMultipleFileScanner.hh>
#include <JDetector/JDetector.hh>
#include <JDetector/JDetectorToolkit.hh>
#include <JDetector/JModuleRouter.hh>

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 15 of file JTestNBTrigger.cc.

15  {
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
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
KM3NETDAQ::JDAQKeyHit
DAQ key hit.
Definition: JDAQKeyHit.hh:24
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
JPARSER::JParser::read
int read(const int argc, const char *const argv[])
Parse the program's command line options.
Definition: JParser.hh:1791