Jpp  16.0.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 "JGeometry3D/JPosition3D.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 22 of file software/JDetector/JModule.cc.

23 {
24  using namespace std;
25  using namespace JPP;
26 
27  string outputFile;
28  int detectorID;
29  string variant;
30  set<int> moduleID;
31  JPosition3D pos;
32  int debug;
33 
34  try {
35 
36  JParser<> zap("Auxiliary program to generate detector files.");
37 
38  zap['o'] = make_field(outputFile, "detector file");
39  zap['D'] = make_field(detectorID, "detector identifier") = 1001;
40  zap['V'] = make_field(variant, "detector version") = getDetectorVersions<string>();
41  zap['M'] = make_field(moduleID, "list of module identifiers") = JPARSER::initialised();
42  zap['P'] = make_field(pos, "position of module(s)") = JPosition3D(0.0, 0.0, 0.0);
43  zap['d'] = make_field(debug) = 0;
44 
45  zap(argc, argv);
46  }
47  catch(const exception &error) {
48  FATAL(error.what() << endl);
49  }
50 
51 
52  JDetector detector(detectorID, variant, JDetectorHeader());
53 
54  detector.comment.add(JMeta(argc,argv));
55 
56  for (const auto id : moduleID) {
57 
58  JModule module = getModule<JKM3NeT_t>(id);
59 
60  module.set(pos);
61 
62  detector.push_back(module);
63  }
64 
65  try {
67  }
68  catch(const JException& error) {
69  FATAL(error);
70  }
71 
72  return 0;
73 }
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
Data structure for a composite optical module.
Definition: JModule.hh:68
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
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
do set_variable DETECTOR_TXT $WORKDIR detector
JModule & set(const JVector3D &pos)
Set position.
Definition: JModule.hh:408