20 int main(
int argc,
char **argv)
32 JParser<> zap(
"Auxiliary program to print PMT data for a given PMT channel.");
35 zap[
'P'] =
make_field(channel,
"PMT channel: <string> <floor> <TDC>") = JPMTChannel();
36 zap[
'p'] =
make_field(
id,
"PMT identifier") = JObjectID();
41 catch(
const exception &error) {
42 FATAL(error.what() << endl);
51 catch(
const JException& error) {
55 if (channel != JPMTChannel()) {
57 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
59 if (module->getLocation() == channel.getLocation()) {
61 cout << module->getPMT(channel.getTDC()) << endl;
67 }
else if (
id != JObjectID()) {
69 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
70 for (JModule::const_iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
71 if (pmt->getID() ==
id.getID()) {
82 while (cin >> channel && channel != JPMTChannel()) {
84 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
86 if (module->getLocation() == channel.getLocation()) {
88 cout << module->getPMT(channel.getTDC()) << endl;
Utility class to parse command line options.
int main(int argc, char *argv[])
Data structure to uniquely identify PMT readout channel.
Data structure for detector geometry and calibration.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Utility class to parse command line options.
do set_variable DETECTOR_TXT $WORKDIR detector