Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JDetector
JDetectorToNTuple.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
JDetector/JDetector.hh
"
7
#include "
JDetector/JDetectorToolkit.hh
"
8
#include "
JDetector/JModuleGeometry.hh
"
9
#include "
JFit/JPoint3DEstimator.hh
"
10
#include "
JIO/JFileStreamIO.hh
"
11
12
#include "
Jeep/JParser.hh
"
13
#include "
Jeep/JMessage.hh
"
14
15
16
/**
17
* \file
18
*
19
* Program to convert detector to ntuples.
20
* \author mdejong
21
*/
22
int
main
(
int
argc,
char
**argv)
23
{
24
using namespace
std;
25
26
string
detectorFile;
27
string
outputFile
;
28
int
debug
;
29
30
try
{
31
32
JParser<>
zap(
"Program to convert detector to ntuples."
);
33
34
zap[
'a'
] =
make_field
(detectorFile);
35
zap[
'o'
] =
make_field
(
outputFile
);
36
zap[
'd'
] =
make_field
(
debug
) = 0;
37
38
zap(argc, argv);
39
}
40
catch
(
const
exception &error) {
41
FATAL
(error.what() << endl);
42
}
43
44
45
using namespace
JPP;
46
47
48
JDetector detector;
49
50
try
{
51
load
(detectorFile, detector);
52
}
53
catch
(
const
JException& error) {
54
FATAL
(error);
55
}
56
57
58
JFileStreamWriter out(
outputFile
.c_str());
59
60
for
(JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
61
62
const
JEstimator<JPoint3D> center(module->begin(), module->end());
63
64
JModuleGeometry geometry(JDAQUTCExtended(), module->getID(), center, JEulerAngle3D());
65
66
out.store(geometry);
67
}
68
69
out.close();
70
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1410
JFileStreamIO.hh
JModuleGeometry.hh
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JDetector.hh
Data structure for detector geometry and calibration.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1836
JDETECTOR::load
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Definition:
JDetectorToolkit.hh:444
debug
int debug
debug level
Definition:
JSirene.cc:59
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:65
JPoint3DEstimator.hh
Linear fit of JFIT::JPoint3D.
JParser.hh
Utility class to parse command line options.
JDetectorToolkit.hh
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5