Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JDetector
JModuleAddressMap.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
km3net-dataformat/online/JDAQ.hh
"
7
#include "
JDetector/JDetectorAddressMapToolkit.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
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JDETECTOR::hasDetectorAddressMap
bool hasDetectorAddressMap(const int id)
Check if detector address map is available.
Definition:
JDetectorAddressMapToolkit.hh:499
JDetectorAddressMapToolkit.hh
Detector specific mapping between logical positions and readout channels of PMTs in optical modules...
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
debug
int debug
debug level
Definition:
JSirene.cc:61
JDETECTOR::getDetectorAddressMap
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
Definition:
JDetectorAddressMapToolkit.hh:363
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
JDAQ.hh
KM3NeT DAQ constants, bit handling, etc.
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5