Jpp
JModuleAddressMap.cc
Go to the documentation of this file.
1 
2 #include <string>
3 #include <iostream>
4 #include <iomanip>
5 
6 #include "JDAQ/JDAQ.hh"
8 
9 #include "Jeep/JParser.hh"
10 #include "Jeep/JMessage.hh"
11 
12 
13 /**
14  * \file
15  *
16  * Example program to print PMT logical addressing.
17  * \author mdejong
18  */
19 int main(int argc, char **argv)
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 }
JDAQ.hh
JMessage.hh
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
debug
int debug
debug level
Definition: JSirene.cc:59
JDetectorAddressMapToolkit.hh
JParser.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
std
Definition: jaanetDictionary.h:36
JDETECTOR::hasDetectorAddressMap
bool hasDetectorAddressMap(const int id)
Check if detector address map is available.
Definition: JDetectorAddressMapToolkit.hh:499
FATAL
#define FATAL(A)
Definition: JMessage.hh:67
main
int main(int argc, char **argv)
Definition: JModuleAddressMap.cc:19
JDETECTOR::getDetectorAddressMap
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
Definition: JDetectorAddressMapToolkit.hh:363