33 int main(
int argc,
char **argv)
37 using namespace KM3NETDAQ;
49 JParser<> zap(
"Auxiliary application to plot PMT parameters.");
51 zap[
'a'] =
make_field(detectorFile,
"detector file.");
52 zap[
'P'] =
make_field(inputFile,
"PMT calibration data file(s)");
54 zap[
'r'] =
make_field(regexp,
"regular expresion to extract bin labels for the x-axis") =
" ";
55 zap[
'A'] =
make_field(showPMTAddress,
"show PMT address on y-axis");
56 zap[
'L'] =
make_field(labelInterval,
"interval between x-axis bins for which labels are shown") = 1;
61 catch(
const exception &error) {
62 FATAL(error.what() << endl);
75 FATAL(
"Empty detector." << endl);
90 NUMBER_OF_FILES, -0.5, NUMBER_OF_FILES - 0.5,
95 const int n = (NUMBER_OF_FILES < labelInterval) ? 1 : labelInterval;
97 const TPRegexp buffer(regexp);
99 for (
int i = 0; i != NUMBER_OF_FILES; ++i){
102 manager->GetXaxis()->SetBinLabel(i+1 ,
parse(buffer , TString(inputFile[i].c_str())));
104 manager->GetXaxis()->SetBinLabel(i+1 ,
" ");
108 for (JDetector::iterator module =
detector.begin(); module !=
detector.end(); ++module) {
110 DEBUG(
"Module " << setw(10) << module->getID() << endl);
114 for (
int i = 0; i != NUMBER_OF_FILES; ++i) {
118 for (JProperties::const_iterator p = properties.begin(); p != properties.end(); ++p) {
121 manager[
MAKE_CSTRING(module->getID() <<
"." << p->first)]->Fill((Double_t) i, (Double_t)
pmt, p->
second.getValue<
const double>());
123 catch(
const exception& error) {}
126 manager[
MAKE_CSTRING(module->getID() <<
"." << p->first)]->Fill((Double_t) i, (Double_t)
pmt, p->
second.getValue<
const bool>() ? 1.0 : 0.0);
128 catch(
const exception& error) {}
139 i->second->Sumw2(kFALSE);
144 TPRegexp buffer(
"(\\d{8}).");
148 TString
id =
parse(buffer, TString(i->second->GetName()));
Utility class to parse command line options.
Utility class to parse parameter values.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
#define MAKE_CSTRING(A)
Make C-string.
Lookup table for PMT addresses in detector.
Dynamic ROOT object management.
Data structure for detector geometry and calibration.
esac $JPP_DIR examples JDetector JTransitTime o $OUTPUT_FILE n N $NPE T $TTS_NS d $DEBUG for HISTOGRAM in tts tt2 pmt
boost::property_tree::ptree parse(std::string str)
Auxiliary class to manage set of compatible ROOT objects (e.g.
Lookup table for PMT addresses in optical module.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void Write(TDirectory &out, const bool wm=false)
Write objects to file.
void setAxisLabels(TAxis *axis, const JModuleAddressMap &memo)
initialize axis with PMT address labels
Auxiliary class for map of PMT parameters.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
General purpose messaging.
Utility class to parse command line options.
double getSurvivalProbability(const JPMTParameters ¶meters)
Get model dependent probability that a one photo-electron hit survives the simulation of the PMT assu...
alias put_queue eval echo n
Data structure for PMT parameters.
KM3NeT DAQ constants, bit handling, etc.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
double QE
relative quantum efficiency
#define DEBUG(A)
Message macros.
int main(int argc, char *argv[])