Jpp
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
8
#include "
Jeep/JParser.hh
"
9
#include "
Jeep/JMessage.hh
"
10
11
12
/**
13
* \file
14
*
15
* Auxiliary program to print module identifier for a given module location.
16
* \author mdejong
17
*/
18
int
main
(
int
argc,
char
**argv)
19
{
20
using namespace
std;
21
using namespace
JPP;
22
23
string
detectorFile;
24
JLocation
location;
25
int
debug
;
26
27
try
{
28
29
JParser<>
zap(
"Auxiliary program to print module identifier for a given module location."
30
"\nInteractive mode in absence of option -L <location>."
);
31
32
zap[
'a'
] =
make_field
(detectorFile,
"Detector file"
);
33
zap[
'L'
] =
make_field
(location,
"Module location"
) =
JLocation
();
34
zap[
'd'
] =
make_field
(
debug
) = 1;
35
36
zap(argc, argv);
37
}
38
catch
(
const
exception &error) {
39
FATAL
(error.what() << endl);
40
}
41
42
43
JDetector
detector
;
44
45
try
{
46
load
(detectorFile,
detector
);
47
}
48
catch
(
const
JException
& error) {
49
FATAL
(error);
50
}
51
52
if
(location !=
JLocation
()) {
53
54
cout <<
detector
.getModule(location).getID() << endl;
55
56
}
else
{
57
58
while
(cin >> location && location !=
JLocation
()) {
59
cout <<
detector
.getModule(location).getID() << endl;
60
}
61
}
62
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JLANG::JException
General exception.
Definition:
JException.hh:23
JDETECTOR::JDetector
Detector data structure.
Definition:
JDetector.hh:80
JDetector.hh
Data structure for detector geometry and calibration.
JAANET::detector
Detector file.
Definition:
JHead.hh:130
JDETECTOR::JLocation
Logical location of module.
Definition:
JLocation.hh:37
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
JDETECTOR::load
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Definition:
JDetectorToolkit.hh:462
debug
int debug
debug level
Definition:
JSirene.cc:61
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
JDetectorToolkit.hh
detector
detector
Definition:
examples/JDataFilter/JDataFilter.sh:104
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5