Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Auxiliary program to compose detector from separate calibrations.
- Author
- mdejong
Definition in file JConstructDetector.cc.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 26 of file JConstructDetector.cc.
38 JParser<> zap(
"Auxiliary program to compose detector from separate calibrations.");
40 zap[
'a'] =
make_field(detectorFile,
"detector file (module identifiers, module locations and PMT identifiers are used)");
41 zap[
'f'] =
make_field(inputFile,
"detector calibrations file (json format)");
47 catch(
const exception &error) {
48 FATAL(error.what() << endl);
62 FATAL(
"No detector address map for detector identier " <<
detector.getID() << endl);
73 istream* in = open<istream>(inputFile.c_str());
79 DEBUG(setw(4) << js << endl);
87 json::const_iterator data = js.find(
Data_t);
89 if (data != js.end()) {
91 for (
size_t i = 0; i != data->size(); ++i) {
93 if (data->at(i).contains(
PMTT0s_t)) {
109 for (JModuleRotation::const_iterator i = rotation.begin(); i != rotation.end(); ++i) {
111 if (moduleRouter.hasModule(i->getID())) {
113 JModule& module =
detector.getModule(moduleRouter.getAddress(i->getID()));
121 for (JModulePosition::const_iterator i = position.begin(); i != position.end(); ++i) {
123 if (moduleRouter.hasModule(i->getID())) {
125 JModule& module =
detector.getModule(moduleRouter.getAddress(i->getID()));
131 for (JPMTCalibration::const_iterator i = calibration.begin(); i != calibration.end(); ++i) {
133 if (pmtRouter.hasPMT(i->getID())) {
135 JPMT& pmt =
detector.getPMT(pmtRouter.getAddress(i->getID()));
void close(std::istream *pf)
Close file.
bool is_valid(const T &value)
Check validity of given value.
const JModule & getModule(const JDetector &detector, const JModuleLocation &location)
find module with a given string and floor number
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Utility class to parse command line options.
Router for direct addressing of PMT data in detector data structure.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const std::string PMTT0s_t
int getID() const
Get identifier.
static const std::string Data_t
Data structure for a composite optical module.
void rotate(const JRotation3D &R)
Rotate module.
Data structure for PMT geometry and calibration.
const JModuleLocation & getLocation() const
Get location.
Router for direct addressing of module data in detector data structure.
void store(const JString &file_name, const JDetector &detector)
Store detector to output file.
void setCalibration(const JCalibration &cal)
Set calibration.
static const std::string DOMRotations_t
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define DEBUG(A)
Message macros.
static const std::string DOMPositions_t
JModule & add(const JVector3D &pos)
Add position.
Lookup table for PMT addresses in detector.
bool hasDetectorAddressMap(const int id)
Check if detector address map is available.
const JModuleAddressMap & get(const int id) const
Get module address map.
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.