29   static const char WILDCARD_RING       = 
'*';   
 
   30   static const int  WILDCARD_POSITION   = -1;    
 
   31   static const int  WILDCARD            = -1;    
 
   43     return (((first          == second))                                                                                          ||
 
   48             ((first.
ring     == WILDCARD_RING     || second.
ring     == WILDCARD_RING)  && 
 
   49              (first.
position == WILDCARD_POSITION || second.
position == WILDCARD_POSITION)));
 
   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) {
 
  132         cerr << error.what() << endl;
 
  147     friend inline std::istream& 
operator>>(std::istream& 
in, JModifier& modifier)
 
  149       return in >> modifier.address
 
  163     friend inline std::ostream& 
operator<<(std::ostream& out, 
const JModifier& modifier)
 
  165       return out << modifier.address << 
' ' 
  166                  << modifier.action  << 
' ' 
  167                  << modifier.key     << 
' ' 
  202 int main(
int argc, 
char **argv)
 
  224     JParser<> zap(
"Auxiliary program to edit PMT parameters map.");
 
  226     zap[
'a'] = 
make_field(detectorFile,     
"detector file.")                                                   = 
"";
 
  227     zap[
'D'] = 
make_field(detectorID,       
"detector identifier (in absence of detector file).")               = 0;
 
  232     zap[
'E'] = 
make_field(mu,               
"expectation value for npe given two-fold coincidence")             = 0.0;
 
  236     zap[
'q'] = 
make_field(squash,           
"squash meta data");
 
  241   catch(
const exception &error) {
 
  242     FATAL(error.what() << endl);
 
  247     parameters.comment.clear();
 
  250   parameters.comment.add(
JMeta(argc,argv));
 
  253   for (
vector< JModifier<> >::const_iterator i = hdr.begin(); i != hdr.end(); ++i) {
 
  255     DEBUG(
"Modifying default PMT parameters " << i->action << 
' ' << i->key << 
' ' << i->value << endl);
 
  257     if (!i->apply(parameters.getDefaultPMTParameters())) {
 
  258       ERROR(
"No valid action: " << *i << endl);
 
  262   if (detectorFile != 
"") {
 
  269       load(detectorFile, detector);
 
  275     if        (detectorID == 0) {
 
  277       detectorID = detector.
getID();
 
  279     } 
else if (detectorID != detector.
getID()) {
 
  281       FATAL(
"Inconsistent detector identifier " << detectorID << 
" != " << detector.
getID() << endl);
 
  285     for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
 
  287       for (
unsigned int pmt = 0; pmt != module->size(); ++pmt) {
 
  291         if (parameters.find(
id) == parameters.end()) {
 
  293           DEBUG(
"Setting default parameters for PMT " << 
id << endl);
 
  295           parameters[id] = parameters.getDefaultPMTParameters();
 
  304       FATAL(
"Invalid detector identifier " << detectorID << endl);
 
  309     for (JPMTParametersMap::iterator ps = parameters.begin(); ps != parameters.end(); ++ps) {
 
  313       for (
vector< JModifier<JPMTPhysicalAddress> >::const_iterator i = mod.begin(); i != mod.end(); ++i) {
 
  315         if (compare(i->address, address)) {
 
  317           DEBUG(
"Modifying parameters for PMT " << ps->first << 
' ' << i->action << 
' ' << i->key << 
' ' << i->value << endl);
 
  319           if (!i->apply(ps->second)) {
 
  320             ERROR(
"No valid action: " << *i << endl);
 
  329     for (JPMTParametersMap::iterator ps = parameters.begin(); ps != parameters.end(); ++ps) {
 
  331       for (
vector< JModifier<JPMTIdentifier> >::const_iterator i = daq.begin(); i != daq.end(); ++i) {
 
  333         if (compare(ps->first, i->address)) {
 
  335           DEBUG(
"Modifying parameters for PMT " << ps->first << 
' ' << i->action << 
' ' << i->key << 
' ' << i->value << endl);
 
  337           if (!i->apply(ps->second)) {
 
  338             ERROR(
"No valid action: " << *i << endl);
 
  348     DEBUG(
"Correct measured QE for two-hit probability " << mu << endl);
 
  351       parameters.convertHitProbabilityToQE(mu);
 
  357   } 
else if (mu < 0.0) {
 
  359     FATAL(
"Invalid expection value for two-hit probability " << mu << endl);
 
  365     DEBUG(
"Correct measured QE for time-over-threshold range " << T_ns << endl);
 
  369     for (JPMTParametersMap::iterator i = parameters.begin(); i != parameters.end(); ++i) {
 
  374                                                           cpu.
getNPE(T_ns.getUpperLimit()),
 
  378                                                           cpu.
getNPE(T_ns.getUpperLimit()),
 
  386     for (JPMTParametersMap::iterator i = parameters.begin(); i != parameters.end(); ++i) {
 
  387       i->second.QE = QE.constrain(i->second.QE);
 
  394     parameters.comment.add(
JMeta(argc, argv));
 
  398     out << parameters << endl;
 
Utility class to parse command line options. 
 
int main(int argc, char *argv[])
 
double getIntegralOfChargeProbability(const double xmin, const double xmax, const int NPE) const 
Get integral of probability. 
 
bool hasDetectorAddressMap(const int id)
Check if detector address map is available. 
 
*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
 
Lookup table for PMT addresses in detector. 
 
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
 
JProperties getProperties(const JEquationParameters &equation=JPMTParameters::getEquationParameters())
Get properties of this class. 
 
Data structure for detector geometry and calibration. 
 
const JModuleAddressMap & get(const int id) const 
Get module address map. 
 
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
 
int getTDC() const 
Get TDC. 
 
const T & getValue(const std::string &key) const 
Get value. 
 
Type definition of range. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
int getID() const 
Get identifier. 
 
virtual double getNPE(const double tot_ns) const override
Get number of photo-electrons. 
 
Auxiliary class for map of PMT parameters. 
 
char ring
ring number ['A','F'] 
 
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map. 
 
General purpose messaging. 
 
PMT analogue signal processor. 
 
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input. 
 
virtual const char * what() const override
Get error message. 
 
void load(const std::string &file_name, JDetector &detector)
Load detector from input file. 
 
Auxiliary class to define a range between two values. 
 
Utility class to parse command line options. 
 
int position
position within ring [1,6] 
 
PMT analogue signal processor. 
 
Data structure for PMT physical address. 
 
Data structure for PMT parameters. 
 
do set_variable DETECTOR_TXT $WORKDIR detector
 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
 
#define DEBUG(A)
Message macros.