Jpp
19.0.0
the software that should make you happy
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
#include <algorithm>
6
7
#include "
km3net-dataformat/online/JDAQ.hh
"
8
#include "
JDetector/JDetectorAddressMap.hh
"
9
#include "
JDetector/JDetectorSupportkit.hh
"
10
11
#include "
Jeep/JParser.hh
"
12
#include "
Jeep/JMessage.hh
"
13
14
namespace
{
15
16
const
char
*
const
readout_t =
"readout"
;
17
const
char
*
const
physical_t =
"physical"
;
18
}
19
20
/**
21
* \file
22
*
23
* Example program to print PMT logical addressing.
24
* \author mdejong
25
*/
26
int
main
(
int
argc,
char
**argv)
27
{
28
using namespace
std;
29
using namespace
JPP;
30
31
int
detectorID;
32
int
moduleID;
33
string
option;
34
int
debug
;
35
36
try
{
37
38
JParser<>
zap(
"Example program to print PMT logical addressing."
);
39
40
zap[
'D'
] =
make_field
(detectorID);
41
zap[
'M'
] =
make_field
(moduleID) = -1;
42
zap[
'M'
] =
make_field
(moduleID) = -1;
43
zap[
'O'
] =
make_field
(option,
"sort"
) = readout_t, physical_t;
44
zap[
'd'
] =
make_field
(
debug
) = 0;
45
46
zap(argc, argv);
47
}
48
catch
(
const
exception &error) {
49
FATAL
(error.what() << endl);
50
}
51
52
53
54
if
(!
hasDetectorAddressMap
(detectorID)) {
55
FATAL
(
"No detector address map for detector identifier "
<< detectorID << endl);
56
}
57
58
const
JDetectorAddressMap& demo =
getDetectorAddressMap
(detectorID);
59
60
JModuleAddressMap memo = demo.get(moduleID);
61
62
if
(option == readout_t)
63
sort(memo.begin(), memo.end(), less<JPMTReadoutAddress>());
64
else
if
(option == physical_t)
65
sort(memo.begin(), memo.end(), less<JPMTPhysicalAddress>());
66
else
67
;
68
69
for
(JModuleAddressMap::const_iterator
i
= memo.begin();
i
!= memo.end(); ++
i
) {
70
cout << setw(2) <<
i
->tdc <<
' '
<<
i
->ring <<
i
->position << endl;
71
}
72
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1711
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JDETECTOR::hasDetectorAddressMap
bool hasDetectorAddressMap(const int id)
Check if detector address map is available.
Definition:
JDetectorSupportkit.hh:700
JDetectorAddressMap.hh
i
then rm i
Definition:
JEvtReweightMupageParameterScan.sh:309
JDetectorSupportkit.hh
Detector support kit.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:2158
JDETECTOR::getDetectorAddressMap
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
Definition:
JDetectorSupportkit.hh:542
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.
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5