31 static const int WILDCARD = -1;
43 return (((first == second)) ||
62 return (((first == second)) ||
67 ((first.
getID() == WILDCARD || second.
getID() == WILDCARD) &&
68 (first.
getTDC() == WILDCARD || second.
getTDC() == WILDCARD)));
75 struct JEmptyAddress {
76 friend inline std::istream&
operator>>(std::istream& in, JEmptyAddress&
object) {
return in; }
77 friend inline std::ostream&
operator<<(std::ostream& out,
const JEmptyAddress&
object) {
return out; }
84 template<
class JAddress_t = JEmptyAddress>
106 if (this->action ==
"set") {
110 }
else if (this->action ==
"add") {
114 }
else if (this->action ==
"sub") {
118 }
else if (this->action ==
"mul") {
122 }
else if (this->action ==
"div") {
131 catch(
const std::exception& error) {
165 return out <<
modifier.address <<
' '
231 JParser<> zap(
"Auxiliary program to edit PMT parameters map.");
239 zap[
'E'] =
make_field(mu,
"expectation value for npe given two-fold coincidence (" << mu .getOption() <<
" -> " << mu .getCustom() <<
")") = 0.0;
240 zap[
'T'] =
make_field(T_ns,
"time-over-threshold rang (" << T_ns.getOption() <<
" -> " << T_ns.getCustom() <<
")") =
JRange_t();
248 catch(
const exception &error) {
262 DEBUG(
"Modifying default PMT parameters " << i->action <<
' ' << i->key <<
' ' << i->value <<
endl);
265 ERROR(
"No valid action: " << *i <<
endl);
294 for (
unsigned int pmt = 0; pmt !=
module->size(); ++pmt) {
298 if (parameters.find(
id) == parameters.end()) {
300 DEBUG(
"Setting default parameters for PMT " <<
id <<
endl);
316 for (JPMTParametersMap::iterator ps = parameters.begin(); ps != parameters.end(); ++ps) {
322 if (compare(i->address, address)) {
324 DEBUG(
"Modifying parameters for PMT " << ps->first <<
' ' << i->action <<
' ' << i->key <<
' ' << i->value <<
endl);
326 if (!i->apply(ps->second)) {
327 ERROR(
"No valid action: " << *i <<
endl);
336 for (JPMTParametersMap::iterator ps = parameters.begin(); ps != parameters.end(); ++ps) {
340 if (compare(ps->first, i->address)) {
342 DEBUG(
"Modifying parameters for PMT " << ps->first <<
' ' << i->action <<
' ' << i->key <<
' ' << i->value <<
endl);
344 if (!i->apply(ps->second)) {
345 ERROR(
"No valid action: " << *i <<
endl);
355 DEBUG(
"Correct measured QE for two-hit probability " << mu <<
endl);
364 }
else if (mu < 0.0) {
366 FATAL(
"Invalid expection value for two-hit probability " << mu <<
endl);
372 DEBUG(
"Correct measured QE for time-over-threshold range " << T_ns <<
endl);
376 for (JPMTParametersMap::iterator i = parameters.begin(); i != parameters.end(); ++i) {
381 cpu.
getNPE(T_ns.getUpperLimit()),
385 cpu.
getNPE(T_ns.getUpperLimit()),
393 for (JPMTParametersMap::iterator i = parameters.begin(); i != parameters.end(); ++i) {
394 i->second.QE = QE.
constrain(i->second.QE);
405 out << parameters <<
endl;
Data structure for detector geometry and calibration.
int main(int argc, char **argv)
General purpose messaging.
#define DEBUG(A)
Message macros.
PMT analogue signal processor.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class to define a range between two values.
Lookup table for PMT addresses in detector.
Auxiliary class for map of PMT parameters.
void convertHitProbabilityToQE(const double mu)
Convert the hit probabilities to QEs for given expectation value.
const JPMTParameters & getDefaultPMTParameters() const
Get default PMT parameters.
Data structure for PMT parameters.
JProperties getProperties(const JEquationParameters &equation=JPMTParameters::getEquationParameters())
Get properties of this class.
Data structure for PMT physical address.
char ring
ring number ['A','F']
int position
position within ring [1,6]
int getTDC() const
Get TDC.
const T & getValue(const std::string &key) const
Get value.
virtual const char * what() const override
Get error message.
int getID() const
Get identifier.
Template definition of a multi-dimensional oscillation probability interpolation table.
std::ostream & operator<<(std::ostream &out, const morphology_type &object)
Write morphology to output stream.
std::istream & operator>>(std::istream &in, morphology_type &object)
Read morphology from input stream.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
bool hasDetectorAddressMap(const int id)
Check if detector address map is available.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Type definition of range.
PMT analogue signal processor.
virtual double getNPE(const double tot_ns) const override
Get number of photo-electrons.
double getIntegralOfChargeProbability(const double xmin, const double xmax, const int NPE) const
Get integral of probability.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...