Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JDetector
JPMTStatusBits.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
JDetector/JPMT.hh
"
7
8
#include "
Jeep/JStreamToolkit.hh
"
9
#include "
Jeep/JParser.hh
"
10
#include "
Jeep/JMessage.hh
"
11
12
13
/**
14
* \file
15
*
16
* Example program to test PMT status bits.
17
* \author mdejong
18
*/
19
int
main
(
int
argc,
char
**argv)
20
{
21
using namespace
std;
22
using namespace
JPP;
23
24
int
debug
;
25
26
try
{
27
28
JParser<>
zap(
"Example program to test PMT status bits."
);
29
30
zap[
'd'
] =
make_field
(
debug
) = 3;
31
32
zap(argc, argv);
33
}
34
catch
(
const
exception &error) {
35
FATAL
(error.what() << endl);
36
}
37
38
39
if
(
debug
>=
debug_t
) {
40
cout <<
"PMT status bits: "
;
41
writeObject
(cout, getPMTStatusBits<string>()) << endl;
42
}
43
44
JPMT
pmt
;
45
46
vector<JPMT::JPMTStatusBits_t>
buffer = getPMTStatusBits<JPMT::JPMTStatusBits_t>();
47
48
for
(
vector<JPMT::JPMTStatusBits_t>::const_iterator
i = buffer.begin(); i != buffer.end(); ++i) {
49
50
ASSERT
(
pmt
.has(*i) ==
false
);
51
52
DEBUG
(
"Set PMT status "
<<
putPMTStatusBit
(*i) << endl);
53
54
pmt
.set(*i);
55
56
ASSERT
(
pmt
.has(*i) ==
true
);
57
}
58
59
return
0;
60
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JEEP::debug_t
debug
Definition:
JMessage.hh:29
std::vector
Definition:
JSTDTypes.hh:12
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
ASSERT
#define ASSERT(A,...)
Assert macro.
Definition:
JMessage.hh:90
JDETECTOR::putPMTStatusBit
static const JPutPMTStatusBit putPMTStatusBit(getPMTStatusBit)
Function object to map PMT status bit to key.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
debug
int debug
debug level
Definition:
JSirene.cc:61
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JStreamToolkit.hh
JPMT.hh
Data structure for PMT geometry and calibration.
JParser.hh
Utility class to parse command line options.
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
JEEP::writeObject
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
Definition:
JStreamToolkit.hh:42
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5