Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JDetachPMTs.cc
Go to the documentation of this file.
1#include <string>
2
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 */
18int main(int argc, char **argv)
19{
20
21 using namespace std;
22 using namespace JPP;
23
24 string detectorFile;
25 string outputFile;
26 bool squash;
27 int debug;
28
29 try {
30
31 JParser<> zap("Auxiliary program to detach PMTs from detector.");
32
33 zap['a'] = make_field(detectorFile, "detector file");
34 zap['o'] = make_field(outputFile, "detector file without PMTs");
35 zap['q'] = make_field(squash, "squash meta data");
36 zap['d'] = make_field(debug) = 0;
37
38 zap(argc, argv);
39 }
40 catch(const exception &error) {
41 FATAL(error.what() << endl);
42 }
43
45
46 try {
47 load(detectorFile, detector);
48 }
49 catch(const JException& error) {
50 FATAL(error);
51 }
52
53 if (squash) {
54 detector.comment.clear();
55 }
56
57 detector.comment.add(JMeta(argc,argv));
58
59 if (detector.setToLatestVersion()) {
60 NOTICE("Set detector version to " << detector.getVersion() << endl);
61 }
62
63 for (JDetector::iterator module = detector.begin(); module != detector.end(); ++module) {
64
65 DEBUG("Detach PMTs in module " << setw(10) << module->getID() << endl);
66
67 module->clear();
68 }
69
70 try {
71 store(outputFile, detector);
72 }
73 catch(const JException& error) {
74 FATAL(error);
75 }
76}
string outputFile
int main(int argc, char **argv)
Data structure for detector geometry and calibration.
General purpose messaging.
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define NOTICE(A)
Definition JMessage.hh:64
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
ROOT I/O of application specific meta data.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Detector data structure.
Definition JDetector.hh:96
General exception.
Definition JException.hh:24
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Detector file.
Definition JHead.hh:227
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72