Jpp
17.1.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
software
JDetector
getLocation.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/JModuleRouter.hh
"
8
9
#include "
Jeep/JParser.hh
"
10
#include "
Jeep/JMessage.hh
"
11
12
13
/**
14
* \file
15
*
16
* Auxiliary program to print module location for a given module identifier.
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
JModuleIdentifier
id;
26
int
debug
;
27
28
try
{
29
30
JParser<>
zap(
"Auxiliary program to print module location for a given module identifier."
31
"\nInteractive mode in absence of option -M <module>."
);
32
33
zap[
'a'
] =
make_field
(detectorFile,
"Detector file"
);
34
zap[
'M'
] =
make_field
(
id
,
"Module identifier"
) =
JModuleIdentifier
();
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
JModuleRouter
router(
detector
);
54
55
if
(
id
!=
JModuleIdentifier
()) {
56
57
cout << router.
getModule
(
id
).
getLocation
() << endl;
58
59
}
else
{
60
61
while
(cin >>
id
&&
id
!=
JModuleIdentifier
()) {
62
cout << router.
getModule
(
id
).
getLocation
() << endl;
63
}
64
}
65
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
JLANG::JException
General exception.
Definition:
JException.hh:23
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JDETECTOR::JModuleRouter::getModule
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Definition:
JModuleRouter.hh:91
JDETECTOR::JDetector
Detector data structure.
Definition:
JDetector.hh:89
JDETECTOR::JModuleRouter
Router for direct addressing of module data in detector data structure.
Definition:
JModuleRouter.hh:36
JDetector.hh
Data structure for detector geometry and calibration.
JDETECTOR::JModuleIdentifier
JLANG::JObjectID JModuleIdentifier
Definition:
JModuleIdentifier.hh:16
JAANET::detector
Detector file.
Definition:
JHead.hh:226
JDETECTOR::JLocation::getLocation
const JLocation & getLocation() const
Get location.
Definition:
JLocation.hh:69
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
debug
int debug
debug level
Definition:
JSirene.cc:67
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JModuleRouter.hh
Direct access to module in detector data structure.
JDETECTOR::load
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Definition:
JDetectorToolkit.hh:478
JParser.hh
Utility class to parse command line options.
JLANG::JObjectID
Auxiliary class for object identification.
Definition:
JObjectID.hh:22
JDetectorToolkit.hh
detector
do set_variable DETECTOR_TXT $WORKDIR detector
Definition:
detector-XY:fit1d.sh:38
Generated by
1.8.5