Jpp  16.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
software/JDetector/JModule.cc File Reference

Auxiliary program to generate detector file with set of modules. More...

#include <string>
#include <iostream>
#include <set>
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDetector/JDetectorSupportkit.hh"
#include "JSupport/JMeta.hh"
#include "Jeep/JeepToolkit.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 generate detector file with set of modules.

Author
mdejong

Definition in file software/JDetector/JModule.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 21 of file software/JDetector/JModule.cc.

22 {
23  using namespace std;
24  using namespace JPP;
25 
26  string outputFile;
27  int detectorID;
28  string variant;
29  set<int> moduleID;
30  int debug;
31 
32  try {
33 
34  JParser<> zap("Auxiliary program to generate detector files.");
35 
36  zap['o'] = make_field(outputFile, "detector file");
37  zap['D'] = make_field(detectorID, "detector identifier") = 1001;
38  zap['V'] = make_field(variant, "detector version") = getDetectorVersions<string>();
39  zap['M'] = make_field(moduleID, "list of module identifiers") = JPARSER::initialised();
40  zap['d'] = make_field(debug) = 0;
41 
42  zap(argc, argv);
43  }
44  catch(const exception &error) {
45  FATAL(error.what() << endl);
46  }
47 
48 
49  JDetector detector(detectorID, variant, JDetectorHeader());
50 
51  detector.comment.add(JMeta(argc,argv));
52 
53  for (const auto id : moduleID) {
54  detector.push_back(getModule<JKM3NeT_t>(id));
55  }
56 
57  try {
59  }
60  catch(const JException& error) {
61  FATAL(error);
62  }
63 
64  return 0;
65 }
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:70
Utility class to parse command line options.
Definition: JParser.hh:1500
General exception.
Definition: JException.hh:23
Detector data structure.
Definition: JDetector.hh:89
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:66
string outputFile
Data structure for detector header.
Detector file.
Definition: JHead.hh:224
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
do set_variable DETECTOR_TXT $WORKDIR detector