Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JDetector
getPMTStatus.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/JModuleRouter.hh
"
8
9
#include "
Jeep/JParser.hh
"
10
#include "
Jeep/JMessage.hh
"
11
12
13
/**
14
* \file
15
*
16
* Auxiliary program to print module location for a given module iddentifier.
17
* \author mdejong
18
*/
19
int
main
(
int
argc,
char
**argv)
20
{
21
using namespace
std;
22
using namespace
JPP;
23
24
string
detectorFile;
25
JPMTIdentifier
id;
26
int
debug
;
27
28
try
{
29
30
JParser<>
zap(
"Auxiliary program to print PMT status for a given PMT iddentifier."
31
"\nInteractive mode in absence of option -P <PMT>."
);
32
33
zap[
'a'
] =
make_field
(detectorFile,
"Detector file"
);
34
zap[
'P'
] =
make_field
(
id
,
"PMT identifier"
) =
JPMTIdentifier
();
35
zap[
'd'
] =
make_field
(
debug
) = 1;
36
37
zap(argc, argv);
38
}
39
catch
(
const
exception &error) {
40
FATAL
(error.what() << endl);
41
}
42
43
44
JDetector
detector
;
45
46
try
{
47
load
(detectorFile,
detector
);
48
}
49
catch
(
const
JException
& error) {
50
FATAL
(error);
51
}
52
53
const
JModuleRouter
router(
detector
);
54
55
if
(
id
!=
JPMTIdentifier
()) {
56
57
if
(router.
hasModule
(
id
.getModuleID())) {
58
router.
getModule
(
id
.getModuleID()).
getPMT
(
id
.getPMTAddress()).
getStatus
().
print
(cout);
59
}
60
61
}
else
{
62
63
while
(cin >>
id
&&
id
!=
JPMTIdentifier
()) {
64
65
if
(router.
hasModule
(
id
.getModuleID())) {
66
router.
getModule
(
id
.getModuleID()).
getPMT
(
id
.getPMTAddress()).
getStatus
().
print
(cout);
67
}
68
}
69
}
70
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JLANG::JException
General exception.
Definition:
JException.hh:23
JDETECTOR::JStatus::getStatus
const JStatus & getStatus() const
Get status.
Definition:
JStatus.hh:80
JDETECTOR::JModuleRouter::getModule
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Definition:
JModuleRouter.hh:89
JDETECTOR::JDetector
Detector data structure.
Definition:
JDetector.hh:80
JDETECTOR::JModuleRouter
Router for direct addressing of module data in detector data structure.
Definition:
JModuleRouter.hh:34
JDetector.hh
Data structure for detector geometry and calibration.
JAANET::detector
Detector file.
Definition:
JHead.hh:130
JDETECTOR::JStatus::print
void print(std::ostream &out) const
Print status.
Definition:
JStatus.hh:342
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
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
JDETECTOR::JModule::getPMT
const JPMT & getPMT(const int index) const
Get PMT.
Definition:
JModule.hh:174
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JModuleRouter.hh
Direct access to module in detector data structure.
JParser.hh
Utility class to parse command line options.
JDETECTOR::JPMTIdentifier
PMT identifier.
Definition:
JPMTIdentifier.hh:31
JDetectorToolkit.hh
JDETECTOR::JModuleRouter::hasModule
bool hasModule(const JObjectID &id) const
Has module.
Definition:
JModuleRouter.hh:101
detector
detector
Definition:
examples/JDataFilter/JDataFilter.sh:104
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5