Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JSelectPMTParameters.cc File Reference

Auxiliary program to select PMT parameters. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JDetector/JPMTParametersMap.hh"
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDetector/JModuleRouter.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 select PMT parameters.

Author
mdejong

Definition in file JSelectPMTParameters.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 22 of file JSelectPMTParameters.cc.

23{
24 using namespace std;
25 using namespace JPP;
26
27 string detectorFile;
28 string pmtParameters;
29 string outputFile;
30 int debug;
31
32 try {
33
34 JParser<> zap("Auxiliary program to selec PMT parameters.");
35
36 zap['a'] = make_field(detectorFile);
37 zap['P'] = make_field(pmtParameters, "PMT simulation data (or corresponding file name)");
38 zap['o'] = make_field(outputFile);
39 zap['d'] = make_field(debug) = 1;
40
41 zap(argc, argv);
42 }
43 catch(const exception &error) {
44 FATAL(error.what() << endl);
45 }
46
47
49
50 try {
51 load(detectorFile, detector);
52 }
53 catch(const JException& error) {
54 FATAL(error);
55 }
56
57 const JModuleRouter router(detector);
58
59 JPMTParametersMap parameters;
60
61 parameters.load(pmtParameters.c_str());
62
63 for (JPMTParametersMap::iterator i = parameters.begin(); i != parameters.end(); ) {
64 if (router.hasModule(i->first.getModuleID()))
65 ++i;
66 else
67 i = parameters.erase(i);
68 }
69
70 parameters.comment.add(JMeta(argc, argv));
71
72 parameters.store(outputFile.c_str());
73}
string outputFile
#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
Router for direct addressing of module data in detector data structure.
Auxiliary class for map of PMT parameters.
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.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Detector file.
Definition JHead.hh:227
JComment & add(const std::string &comment)
Add comment.
Definition JComment.hh:100
void store(const char *file_name) const
Store to output file.
void load(const char *file_name)
Load from input file.
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72