Jpp
Functions
JTestNBTrigger.cc File Reference
#include <iostream>
#include <Jeep/JParser.hh>
#include <JDAQ/JDAQEventIO.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 
21 
22  string detectorFile;
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:30
JDETECTOR::load
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Definition: JDetectorToolkit.hh:476
JGEOMETRY3D::JVector3D::getDistance
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition: JVector3D.hh:269
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:20
JSUPPORT::JMultipleFileScanner::next
virtual const pointer_type & next()
Get next element.
Definition: JMultipleFileScanner.hh:398
KM3NETDAQ::JDAQEvent::const_iterator
Template const_iterator.
Definition: JDAQEvent.hh:68
JDETECTOR::JModule
Data structure for a composite optical module.
Definition: JModule.hh:49
KM3NETDAQ::JDAQKeyHit
DAQ key hit.
Definition: JDAQKeyHit.hh:19
JSUPPORT::JMultipleFileScanner::hasNext
virtual bool hasNext()
Check availability of next element.
Definition: JMultipleFileScanner.hh:350
JDETECTOR::JModuleRouter
Router for direct addressing of module data in detector data structure.
Definition: JModuleRouter.hh:34
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
JSUPPORT::JMultipleFileScanner
General purpose class for object reading from a list of file names.
Definition: JMultipleFileScanner.hh:167
JDETECTOR::JDetector
Detector data structure.
Definition: JDetector.hh:80
JAANET::detector
Detector file.
Definition: JHead.hh:130
std
Definition: jaanetDictionary.h:36
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
JDETECTOR::JModuleLocation::getFloor
int getFloor() const
Get floor number.
Definition: JModuleLocation.hh:144
JPARSER::JParser::read
int read(const int argc, const char *const argv[])
Parse the program's command line options.
Definition: JParser.hh:1791