28 int main(
int argc,
char **argv)
33 typedef JRange<double> JRange_t;
54 catch(
const exception &error) {
55 FATAL(error.what() << endl);
58 using namespace KM3NETDAQ;
63 load(detectorFile, detector);
65 catch(
const JException& error) {
69 if (detector.empty()) {
70 FATAL(
"Empty detector." << endl);
76 const int ny = number_of_strings * number_of_floors;
79 TFile* in = TFile::Open(inputFile.c_str(),
"read");
82 FATAL(
"No data in inputfile " << inputFile << endl);
87 for (map_type::const_iterator i = parameters.begin(); i != parameters.end(); ++i) {
89 const string key = i->first;
90 const JRange_t range = i->second;
94 100, range.first, range.second);
103 for (
size_t dom = 0; dom != detector.size(); ++dom) {
105 const JModule& module = detector.at(dom);
107 TH1D*
p1 = (TH1D*) in->Get(
MAKE_CSTRING(module.getID() <<
".1" << key));
113 const int iy = (module.getString() - 1) * number_of_floors + module.getFloor();
117 const double value = p1->GetBinContent(pmt+1);
121 h2.SetBinContent(pmt+1, iy, value);
127 h1.GetXaxis()->SetTitle(key.c_str());
128 h1.GetYaxis()->SetTitle(
"PMTs");
130 h2.GetXaxis()->SetTitle(
"PMT DAQ index");
132 for (
size_t dom = 0; dom != detector.size(); ++dom) {
134 const JModule& module = detector.at(dom);
137 << setw(3) << setfill(
'0') << module.getString() <<
' '
138 << setw(2) << setfill(
'0') << module.getFloor()));
141 h2.GetZaxis()->SetTitle(key.c_str());
Utility class to parse command line options.
int getNumberOfStrings(const JDetector &detector)
Get number of strings.
#define MAKE_CSTRING(A)
Make C-string.
Data structure for detector geometry and calibration.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int getNumberOfFloors(const JDetector &detector)
Get number of floors.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
General purpose messaging.
Auxiliary class to define a range between two values.
Utility class to parse command line options.
KM3NeT DAQ constants, bit handling, etc.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
int main(int argc, char *argv[])