Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JDetachPMTs.cc File Reference

Auxiliary program to detach PMTs from detector. More...

#include <string>
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JSupport/JMeta.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to detach PMTs from detector.

Author
mdejong

Definition in file JDetachPMTs.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 18 of file JDetachPMTs.cc.

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 {
72 }
73 catch(const JException& error) {
74 FATAL(error);
75 }
76}
string outputFile
#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
#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
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
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