36int main(
int argc,
char **argv)
43 JLimit_t& numberOfEvents = inputFile.getLimit();
52 JParser<> zap(
"Example program to equalize QE of PMTs based on summary data.");
57 zap[
'P'] =
make_field(pmtFile,
"specify PMT file name that can be given to JTriggerEfficiency.") =
"";
58 zap[
'R'] =
make_field(rate_kHz,
"specify expected singles rate [Hz]") = 0.0;
59 zap[
'r'] =
make_field(rings,
"rings, e.g. \"AB\"") =
"ABCDEF";
64 catch(
const exception& error) {
65 FATAL(error.what() << endl);
69 const double factor = 1.0e-3;
77 parameters.
load(pmtFile.c_str());
83 for (JPMTParametersMap::const_iterator i = parameters.begin(); i != parameters.end(); ++i) {
103 for (JDAQSummaryslice::const_iterator frame = summary->begin(); frame != summary->end(); ++frame) {
107 TH1D* h0 = H0[frame->getModuleID()];
108 TProfile* h1 = H1[frame->getModuleID()];
118 double R = frame->getRate (pmt, factor);
119 double W = frame->getWeight(pmt, factor);
131 h1->Fill(pmt, R / P);
132 H1->Fill(pmt, R / P);
141 if (pmtFile !=
"" && rate_kHz > 0.0) {
143 NOTICE(
"Write QEs in PMT file " << pmtFile << endl);
151 parameters[id].
QE *= i->second->GetBinContent(pmt + 1) / rate_kHz;
155 parameters.
store(pmtFile.c_str());
ROOT TTree parameter settings.
int main(int argc, char **argv)
Dynamic ROOT object management.
General purpose messaging.
#define DEBUG(A)
Message macros.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Lookup table for PMT addresses in detector.
const JModuleAddressMap & get(const int id) const
Get module address map.
virtual const JModuleAddressMap & getDefaultModuleAddressMap() const =0
Get default module address map.
Lookup table for PMT addresses in optical module.
const JPMTPhysicalAddress & getPMTPhysicalAddress(const int tdc) const
Get PMT physical address.
Auxiliary class for map of PMT parameters.
char ring
ring number ['A','F']
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
void Write(TDirectory &out, const bool wm=false)
Write objects to file.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
int getDetectorID() const
Get detector identifier.
static int getN()
Get number of bins.
static const double * getData(const double factor=1.0)
Get abscissa values.
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
double getSurvivalProbability(const JPMTParameters ¶meters)
Get model dependent probability that a one photo-electron hit survives the simulation of the PMT assu...
void setAxisLabels(TAxis *axis, const JModuleAddressMap &memo)
Set axis with PMT address labels.
std::string to_upper(const std::string &value)
Convert all character to upper case.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
void store(const char *file_name) const
Store to output file.
void load(const char *file_name)
Load from input file.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.