Jpp
17.3.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
software/JDetector/JModule.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <set>
4
5
#include "
JDetector/JDetector.hh
"
6
#include "
JDetector/JDetectorToolkit.hh
"
7
#include "
JDetector/JDetectorSupportkit.hh
"
8
#include "
JGeometry3D/JPosition3D.hh
"
9
#include "
JSupport/JMeta.hh
"
10
11
#include "
Jeep/JeepToolkit.hh
"
12
#include "
Jeep/JParser.hh
"
13
#include "
Jeep/JMessage.hh
"
14
15
/**
16
* \file
17
*
18
* Auxiliary program to generate detector file with set of modules.
19
*
20
* \author mdejong
21
*/
22
int
main
(
int
argc,
char
**argv)
23
{
24
using namespace
std;
25
using namespace
JPP;
26
27
string
outputFile
;
28
int
detectorID;
29
string
variant;
30
set<int>
moduleID;
31
JLocation
location;
32
JPosition3D
pos;
33
int
debug
;
34
35
try
{
36
37
JParser<>
zap(
"Auxiliary program to generate detector files."
);
38
39
zap[
'o'
] =
make_field
(
outputFile
,
"detector file"
);
40
zap[
'D'
] =
make_field
(detectorID,
"detector identifier"
) = 1001;
41
zap[
'V'
] =
make_field
(variant,
"detector version"
) = getDetectorVersions<string>();
42
zap[
'M'
] =
make_field
(moduleID,
"list of module identifiers"
) =
JPARSER::initialised
();
43
zap[
'L'
] =
make_field
(location,
"location of module(s)"
) =
JLocation
(1, 1);
44
zap[
'P'
] =
make_field
(pos,
"position of module(s)"
) =
JPosition3D
(0.0, 0.0, 0.0);
45
zap[
'd'
] =
make_field
(
debug
) = 0;
46
47
zap(argc, argv);
48
}
49
catch
(
const
exception &error) {
50
FATAL
(error.what() << endl);
51
}
52
53
54
JDetector
detector
(detectorID, variant,
JDetectorHeader
());
55
56
detector.
comment
.
add
(
JMeta
(argc,argv));
57
58
for
(
const
auto
id
: moduleID) {
59
60
JModule
module = getModule<JKM3NeT_t>(id);
61
62
module.
set
(pos);
63
module.
setLocation
(location);
64
65
detector.push_back(module);
66
}
67
68
try
{
69
store
(
outputFile
, detector);
70
}
71
catch
(
const
JException
& error) {
72
FATAL
(error);
73
}
74
75
return
0;
76
}
JSUPPORT::JMeta
Auxiliary class for ROOT I/O of application specific meta data.
Definition:
JMeta.hh:70
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1517
JLANG::JException
General exception.
Definition:
JException.hh:23
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JDETECTOR::JModule
Data structure for a composite optical module.
Definition:
JModule.hh:68
JDETECTOR::JLocation::setLocation
void setLocation(const JLocation &location)
Set location.
Definition:
JLocation.hh:91
JDETECTOR::JDetector
Detector data structure.
Definition:
JDetector.hh:89
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition:
JParser.hh:83
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JDetector.hh
Data structure for detector geometry and calibration.
JDETECTOR::JDetectorHeader
Data structure for detector header.
Definition:
JDetectorHeader.hh:38
JPosition3D.hh
JDetectorSupportkit.hh
Detector support kit.
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:1993
JeepToolkit.hh
Auxiliary methods for handling file names, type names and environment.
JDETECTOR::store
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
Definition:
JDetectorToolkit.hh:579
JMeta.hh
ROOT I/O of application specific meta data.
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
JDetectorToolkit.hh
std::set< int >
JGEOMETRY3D::JPosition3D
Data structure for position in three dimensions.
Definition:
JPosition3D.hh:36
JEEP::JComment::add
JComment & add(const std::string &comment)
Add comment.
Definition:
JComment.hh:100
detector
do set_variable DETECTOR_TXT $WORKDIR detector
Definition:
detector-XY:fit1d.sh:38
JDETECTOR::JModule::set
JModule & set(const JVector3D &pos)
Set position.
Definition:
JModule.hh:408
JDETECTOR::JDetector::comment
JComment comment
Definition:
JDetector.hh:545
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5