Jpp
17.2.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
getPMT.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/JPMTChannel.hh
"
8
#include "
JDetector/JPMTIdentifier.hh
"
9
10
#include "
Jeep/JParser.hh
"
11
#include "
Jeep/JMessage.hh
"
12
13
14
/**
15
* \file
16
*
17
* Auxiliary program to print PMT data for a given PMT channel or identifier.
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
JPMTChannel
channel;
27
JObjectID
id;
28
int
debug
;
29
30
try
{
31
32
JParser<>
zap(
"Auxiliary program to print PMT data for a given PMT channel."
);
33
34
zap[
'a'
] =
make_field
(detectorFile);
35
zap[
'P'
] =
make_field
(channel,
"PMT channel: <string> <floor> <TDC>"
) =
JPMTChannel
();
36
zap[
'p'
] =
make_field
(
id
,
"PMT identifier"
) =
JObjectID
();
37
zap[
'd'
] =
make_field
(
debug
) = 1;
38
39
zap(argc, argv);
40
}
41
catch
(
const
exception &error) {
42
FATAL
(error.what() << endl);
43
}
44
45
46
JDetector
detector
;
47
48
try
{
49
load
(detectorFile,
detector
);
50
}
51
catch
(
const
JException
& error) {
52
FATAL
(error);
53
}
54
55
if
(channel !=
JPMTChannel
()) {
56
57
for
(JDetector::const_iterator module =
detector
.begin(); module !=
detector
.end(); ++module) {
58
59
if
(module->getLocation() == channel.getLocation()) {
60
61
cout << module->getPMT(channel.getTDC()) << endl;
62
63
break
;
64
}
65
}
66
67
}
else
if
(
id
!=
JObjectID
()) {
68
69
for
(JDetector::const_iterator module =
detector
.begin(); module !=
detector
.end(); ++module) {
70
for
(JModule::const_iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
71
if
(pmt->getID() ==
id
.getID()) {
72
73
cout << *pmt << endl;
74
75
break
;
76
}
77
}
78
}
79
80
}
else
{
81
82
while
(cin >> channel && channel !=
JPMTChannel
()) {
83
84
for
(JDetector::const_iterator module =
detector
.begin(); module !=
detector
.end(); ++module) {
85
86
if
(module->getLocation() == channel.getLocation()) {
87
88
cout << module->getPMT(channel.getTDC()) << endl;
89
90
break
;
91
}
92
}
93
}
94
}
95
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1517
JLANG::JException
General exception.
Definition:
JException.hh:23
JDETECTOR::JPMTChannel
Auxiliary class to uniquely identify PMT readout channel.
Definition:
JPMTChannel.hh:30
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JPMTChannel.hh
Data structure to uniquely identify PMT readout channel.
JDETECTOR::JDetector
Detector data structure.
Definition:
JDetector.hh:89
JDetector.hh
Data structure for detector geometry and calibration.
JAANET::detector
Detector file.
Definition:
JHead.hh:226
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1993
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
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
JPMTIdentifier.hh
detector
do set_variable DETECTOR_TXT $WORKDIR detector
Definition:
detector-XY:fit1d.sh:38
debug
int debug
debug level
Definition:
archive-put-Detectors.sh:95
Generated by
1.8.5