Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JDetector
JPMTParametersMap.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/JPMTParametersMap.hh
"
9
10
#include "
Jeep/JParser.hh
"
11
#include "
Jeep/JMessage.hh
"
12
13
14
/**
15
* \file
16
*
17
* Example program to create PMT parameters map.
18
* \author mdejong
19
*/
20
int
main
(
int
argc,
char
**argv)
21
{
22
using namespace
std;
23
using namespace
JPP;
24
25
string
detectorFile;
26
int
debug
;
27
JPMTParametersMap
parameters
;
28
29
try
{
30
31
JParser<>
zap(
"Example program to create PMT parameters map."
);
32
33
zap[
'a'
] =
make_field
(detectorFile) =
""
;
34
zap[
'P'
] =
make_field
(
parameters
) =
JPARSER::initialised
();
35
zap[
'd'
] =
make_field
(
debug
) = 0;
36
37
zap(argc, argv);
38
}
39
catch
(
const
exception &error) {
40
FATAL
(error.what() << endl);
41
}
42
43
44
if
(detectorFile !=
""
) {
45
46
JDetector
detector
;
47
48
try
{
49
load
(detectorFile, detector);
50
}
51
catch
(
const
JException
& error) {
52
FATAL
(error);
53
}
54
55
for
(JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
56
57
for
(
unsigned
int
pmt
= 0;
pmt
!= module->size(); ++
pmt
) {
58
59
const
JPMTIdentifier
id(module->getID(),
pmt
);
60
61
parameters
[id] = parameters.getDefaultPMTParameters();
62
}
63
}
64
}
65
66
cout <<
parameters
;
67
}
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
parameters
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition:
diff-Tuna.sh:38
JPMTParametersMap.hh
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition:
JParser.hh:63
JDetector.hh
Data structure for detector geometry and calibration.
pmt
esac $JPP_DIR examples JDetector JTransitTime o $OUTPUT_FILE n N $NPE T $TTS_NS d $DEBUG for HISTOGRAM in tts tt2 pmt
Definition:
JTransitTime.sh:36
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
JDETECTOR::JPMTParametersMap
Auxiliary class for map of PMT parameters.
Definition:
JPMTParametersMap.hh:89
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.
JDETECTOR::JPMTIdentifier
PMT identifier.
Definition:
JPMTIdentifier.hh:31
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