#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include "TROOT.h"
#include "TFile.h"
#include "TH2D.h"
#include "JDAQ/JDAQ.hh"
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDetector/JPMTParametersMap.hh"
#include "JDetector/JPMTParametersToolkit.hh"
#include "JGizmo/JManager.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Auxiliary application to plot PMT parameters.
- Author
- mdejong
Definition in file JPlotPMTParameters2D.cc.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 28 of file JPlotPMTParameters2D.cc.
41 JParser<> zap(
"Auxiliary application to plot PMT parameters.");
43 zap[
'a'] =
make_field(detectorFile,
"detector file.");
45 zap[
'P'] =
make_field(inputFile,
"PMT calibration data file");
50 catch(
const exception &error) {
51 FATAL(error.what() << endl);
57 load(detectorFile, detector);
59 catch(
const JException& error) {
63 if (detector.empty()) {
64 FATAL(
"Empty detector." << endl);
70 parameters.push_back(JPMTParametersMap(i->c_str()));
74 const int NUMBER_OF_FILES = parameters.size();
77 NUMBER_OF_FILES, -0.5, NUMBER_OF_FILES - 0.5,
80 for (JDetector::iterator module = detector.begin(); module != detector.end(); ++module) {
82 DEBUG(
"Module " << setw(10) << module->getID() << endl);
86 for (
int i = 0; i != NUMBER_OF_FILES; ++i) {
88 const JProperties properties = parameters[i].getPMTParameters(JPMTIdentifier(module->getID(), pmt)).getProperties();
90 for (JProperties::const_iterator p = properties.begin(); p != properties.end(); ++p) {
93 manager[
MAKE_CSTRING(module->getID() <<
"." << p->first)]->Fill((Double_t) i, (Double_t) pmt, p->second.getValue<
const double>());
95 catch(
const exception& error) {}
98 manager[
MAKE_CSTRING(module->getID() <<
"." << p->first)]->Fill((Double_t) i, (Double_t) pmt, p->second.getValue<
const bool>() ? 1.0 : 0.0);
100 catch(
const exception& error) {}
103 const JPMTParameters buffer = parameters[i].getPMTParameters(JPMTIdentifier(module->getID(), pmt));