Jpp - 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
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:1500
JLANG::JException
General exception.
Definition:
JException.hh:23
JGEOMETRY3D::JEulerAngle3D
Data structure for Euler angles in three dimensions.
Definition:
JEulerAngle3D.hh:35
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JFileStreamIO.hh
JDETECTOR::JDetector
Detector data structure.
Definition:
JDetector.hh:80
JModuleGeometry.hh
JDETECTOR::JModuleGeometry
Module geometry.
Definition:
JModuleGeometry.hh:30
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
KM3NETDAQ::JDAQUTCExtended
Data structure for UTC time.
Definition:
JDAQUTCExtended.hh:22
JDetector.hh
Data structure for detector geometry and calibration.
JAANET::detector
Detector file.
Definition:
JHead.hh:196
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:63
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JPoint3DEstimator.hh
Linear fit of JFIT::JPoint3D.
JDETECTOR::load
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Definition:
JDetectorToolkit.hh:445
JParser.hh
Utility class to parse command line options.
JDetectorToolkit.hh
detector
do set_variable DETECTOR_TXT $WORKDIR detector
Definition:
detector-XY:fit1d.sh:37
JIO::JFileStreamWriter
Binary buffered file output.
Definition:
JFileStreamIO.hh:72
JFIT::JEstimator< JPoint3D >
Linear fit of crossing point (position) between axes (objects with position and direction).
Definition:
JPoint3DEstimator.hh:55
Generated by
1.8.5