Jpp  18.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JModuleAddressMap.cc File Reference

Example program to print PMT logical addressing. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "km3net-dataformat/online/JDAQ.hh"
#include "JDetector/JDetectorAddressMapToolkit.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to print PMT logical addressing.

Author
mdejong

Definition in file JModuleAddressMap.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 19 of file JModuleAddressMap.cc.

20 {
21  using namespace std;
22 
23  int detectorID;
24  int moduleID;
25  int debug;
26 
27  try {
28 
29  JParser<> zap("Example program to print PMT logical addressing.");
30 
31  zap['D'] = make_field(detectorID);
32  zap['M'] = make_field(moduleID) = -1;
33  zap['d'] = make_field(debug) = 0;
34 
35  zap(argc, argv);
36  }
37  catch(const exception &error) {
38  FATAL(error.what() << endl);
39  }
40 
41 
42  using namespace JPP;
43 
44  if (!hasDetectorAddressMap(detectorID)) {
45  FATAL("No detector address map for detector identifier " << detectorID << endl);
46  }
47 
48  const JDetectorAddressMap& demo = getDetectorAddressMap(detectorID);
49  const JModuleAddressMap& memo = demo.get(moduleID);
50 
51  for (JModuleAddressMap::const_iterator i = memo.begin(); i != memo.end(); ++i) {
52  cout << i->toString("TDC[%] = %%") << endl;
53  }
54 }
Utility class to parse command line options.
Definition: JParser.hh:1514
bool hasDetectorAddressMap(const int id)
Check if detector address map is available.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level