Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JTestNBTrigger.cc
Go to the documentation of this file.
1 #include <iostream>
2 
3 #include <Jeep/JParser.hh>
4 
5 #include <JDAQ/JDAQEventIO.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 
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 }
Utility class to parse command line options.
Definition: JParser.hh:1493
DAQ key hit.
Definition: JDAQKeyHit.hh:19
ROOT TTree parameter settings.
int getModuleID() const
Get module identifier.
int getFloor() const
Get floor number.
Definition: JLocation.hh:145
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Definition: JModule.hh:50
Detector data structure.
Definition: JDetector.hh:80
Template const_iterator.
Definition: JDAQEvent.hh:68
Router for direct addressing of module data in detector data structure.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition: JVector3D.hh:269
Data structure for detector geometry and calibration.
Detector file.
Definition: JHead.hh:130
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
Support methods.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Direct access to module in detector data structure.
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
int main(int argc, char *argv[])
Definition: Main.cpp:15