Jpp
18.3.0-rc.1
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
software
JDetector
getModule.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
JDetector/JDetector.hh
"
6
#include "
JDetector/JDetectorToolkit.hh
"
7
#include "
JDetector/JLocationRouter.hh
"
8
9
#include "
Jeep/JParser.hh
"
10
#include "
Jeep/JMessage.hh
"
11
12
13
/**
14
* \file
15
*
16
* Auxiliary program to print module identifier for a given module location.
17
* \author mdejong
18
*/
19
int
main
(
int
argc,
char
**argv)
20
{
21
using namespace
std;
22
using namespace
JPP;
23
24
string
detectorFile;
25
JLocation location;
26
int
debug
;
27
28
try
{
29
30
JParser<>
zap(
"Auxiliary program to print module identifier for a given module location."
31
"\nInteractive mode in absence of option -L <location>."
);
32
33
zap[
'a'
] =
make_field
(detectorFile,
"Detector file"
);
34
zap[
'L'
] =
make_field
(location,
"Module location"
) = JLocation();
35
zap[
'd'
] =
make_field
(
debug
) = 1;
36
37
zap(argc, argv);
38
}
39
catch
(
const
exception &error) {
40
FATAL
(error.what() << endl);
41
}
42
43
44
JDetector
detector
;
45
46
try
{
47
load
(detectorFile,
detector
);
48
}
49
catch
(
const
JException& error) {
50
FATAL
(error);
51
}
52
53
const
JLocationRouter router(
detector
);
54
55
if
(location != JLocation()) {
56
57
if
(router.hasLocation(location))
58
cout << router.getModule(location).getID() << endl;
59
else
60
FATAL
(
"Missing location "
<< location << endl);
61
62
}
else
{
63
64
while
(cin >> location && location != JLocation()) {
65
cout << router.getModule(location).getID() << endl;
66
}
67
}
68
69
return
0;
70
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JDetector.hh
Data structure for detector geometry and calibration.
JLocationRouter.hh
Direct access to location in detector data structure.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JDETECTOR::load
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Definition:
JDetectorToolkit.hh:483
JParser.hh
Utility class to parse command line options.
JDetectorToolkit.hh
detector
do set_variable DETECTOR_TXT $WORKDIR detector
Definition:
detector-XY:fit1d.sh:38
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5