Jpp
17.3.1
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
JDetachPMTs.cc
Go to the documentation of this file.
1
#include <string>
2
3
#include "
JDetector/JDetector.hh
"
4
#include "
JDetector/JDetectorToolkit.hh
"
5
#include "
JSupport/JMeta.hh
"
6
7
#include "
Jeep/JParser.hh
"
8
#include "
Jeep/JMessage.hh
"
9
10
11
/**
12
* \file
13
*
14
* Auxiliary program to detach PMTs from detector.
15
*
16
* \author mdejong
17
*/
18
int
main
(
int
argc,
char
**argv)
19
{
20
21
using namespace
std;
22
using namespace
JPP;
23
24
string
detectorFile;
25
string
outputFile
;
26
int
debug
;
27
28
try
{
29
30
JParser<>
zap(
"Auxiliary program to detach PMTs from detector."
);
31
32
zap[
'a'
] =
make_field
(detectorFile,
"detector file"
);
33
zap[
'o'
] =
make_field
(
outputFile
,
"detector file without PMTs"
);
34
zap[
'd'
] =
make_field
(
debug
) = 0;
35
36
zap(argc, argv);
37
}
38
catch
(
const
exception &error) {
39
FATAL
(error.what() << endl);
40
}
41
42
JDetector
detector
;
43
44
try
{
45
load
(detectorFile,
detector
);
46
}
47
catch
(
const
JException
& error) {
48
FATAL
(error);
49
}
50
51
detector
.comment.add(
JMeta
(argc,argv));
52
53
if
(
detector
.setToLatestVersion()) {
54
NOTICE
(
"Set detector version to "
<<
detector
.getVersion() << endl);
55
}
56
57
for
(JDetector::iterator module =
detector
.begin(); module !=
detector
.end(); ++module) {
58
59
DEBUG
(
"Detach PMTs in module "
<< setw(10) << module->getID() << endl);
60
61
module->clear();
62
}
63
64
try
{
65
store
(
outputFile
,
detector
);
66
}
67
catch
(
const
JException
& error) {
68
FATAL
(error);
69
}
70
}
JSUPPORT::JMeta
Auxiliary class for ROOT I/O of application specific meta data.
Definition:
JMeta.hh:70
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1517
JLANG::JException
General exception.
Definition:
JException.hh:23
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JDETECTOR::JDetector
Detector data structure.
Definition:
JDetector.hh:89
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
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
JDETECTOR::store
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
Definition:
JDetectorToolkit.hh:579
JMeta.hh
ROOT I/O of application specific meta data.
NOTICE
#define NOTICE(A)
Definition:
JMessage.hh:64
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:486
JParser.hh
Utility class to parse command line options.
JDetectorToolkit.hh
detector
do set_variable DETECTOR_TXT $WORKDIR detector
Definition:
detector-XY:fit1d.sh:38
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
Generated by
1.8.5