Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
getPMT.cc File Reference

Auxiliary program to print module identifier for a given PMT identifier. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDetector/JPMTRouter.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 print module identifier for a given PMT identifier.

Author
mdejong

Definition in file getPMT.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 19 of file getPMT.cc.

20 {
21  using namespace std;
22  using namespace JPP;
23 
24  string detectorFile;
25  int PMT;
26  int debug;
27 
28  try {
29 
30  JParser<> zap("Auxiliary program to print module identifier for a given PMT identifier.");
31 
32  zap['a'] = make_field(detectorFile);
33  zap['P'] = make_field(PMT);
34  zap['d'] = make_field(debug) = 1;
35 
36  zap(argc, argv);
37  }
38  catch(const exception &error) {
39  FATAL(error.what() << endl);
40  }
41 
42 
44 
45  try {
46  load(detectorFile, detector);
47  }
48  catch(const JException& error) {
49  FATAL(error);
50  }
51 
52  const JPMTRouter router(detector);
53 
54  cout << setw(10) << router.getParentModule(PMT).getID() << endl;
55 }
Router for direct addressing of PMT data in detector data structure.
Definition: JPMTRouter.hh:33
Utility class to parse command line options.
Definition: JParser.hh:1500
General exception.
Definition: JException.hh:23
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
Detector data structure.
Definition: JDetector.hh:80
Detector file.
Definition: JHead.hh:196
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
do set_variable DETECTOR_TXT $WORKDIR detector