Jpp
18.2.1-ARCA-DF-PATCH
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
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
#include "
JDetector/JPMTStatus.hh
"
8
9
#include "
Jeep/JStreamToolkit.hh
"
10
#include "
Jeep/JParser.hh
"
11
#include "
Jeep/JMessage.hh
"
12
13
14
/**
15
* \file
16
*
17
* Example program to test PMT status bits.
18
* \author mdejong
19
*/
20
int
main
(
int
argc,
char
**argv)
21
{
22
using namespace
std;
23
using namespace
JPP;
24
25
int
debug
;
26
27
try
{
28
29
JParser<>
zap(
"Example program to test PMT status bits."
);
30
31
zap[
'd'
] =
make_field
(
debug
) = 3;
32
33
zap(argc, argv);
34
}
35
catch
(
const
exception &error) {
36
FATAL
(error.what() << endl);
37
}
38
39
40
if
(
debug
>=
debug_t
) {
41
cout <<
"PMT status bits: "
;
42
writeObject
(cout, getPMTStatusBits<string>()) << endl;
43
}
44
45
JPMT pmt;
46
47
vector<int>
buffer = getPMTStatusBits<int>();
48
49
for
(
vector<int>::const_iterator
i
= buffer.begin();
i
!= buffer.end(); ++
i
) {
50
51
ASSERT
(pmt.has(*
i
) ==
false
);
52
53
DEBUG
(
"Set PMT status "
<<
putPMTStatusBit
(*
i
) << endl);
54
55
pmt.set(*
i
);
56
57
ASSERT
(pmt.has(*
i
) ==
true
);
58
}
59
60
return
0;
61
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
JEEP::debug_t
debug
Definition:
JMessage.hh:29
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
std::vector< int >
i
then rm i
Definition:
JEvtReweightMupageParameterScan.sh:309
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:1989
JPMTStatus.hh
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
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
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
Generated by
1.8.5