1 #ifndef __JDB_JPMTRUNSETUPPARAMS__
2 #define __JDB_JPMTRUNSETUPPARAMS__
22 namespace JDATABASE {}
23 namespace JPP {
using namespace JDATABASE; }
37 template<
class JValue_t>
39 public std::map<std::string, JValue_t>
59 std::ostringstream os;
85 void configure(
const int id,
const int run,
const std::string& parameter)
100 if (rs >> parameters) {
110 if (parameters.NAME == parameter) {
121 if (parameters.PAR_OID == upars.OID && parameters.ISINPUT ==
'Y') {
122 if (parameters.VALUE !=
"") {
123 istringstream(parameters.VALUE) >> (*this)[parameters.UPIFILTER];
141 typename JPMTRunsetupParams::const_iterator p = this->find(upi.
toString());
143 const bool is_default = (p == this->end());
146 p = this->find(
getUPI(upi));
149 if (p != this->end())
150 return { is_default, p->second };
167 for (
typename JPMTRunsetupParams::const_iterator i =
object.begin(); i !=
object.end(); ++i) {
168 out << left << setw(32) << i->first <<
' ' << right << setw(6) << i->second << endl;
Auxiliary class for PMT run setup parameters.
void configure(const int id, const int run, const std::string ¶meter)
Configure PMT run setup parameters for given detector and run.
const std::string & getVariant() const
Get variant.
friend std::ostream & operator<<(std::ostream &out, const JPMTRunsetupParams &object)
Write PMT run setup parameters to output stream.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Type definition of PMT parameter value.
*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
Universal product identifier (UPI).
static const char SEPARATOR
Separator between PBS, variant and version.
const char *const PMT_THRESHOLD_t
parameter name of PMT threshold
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
const JPBS_t & getPBS() const
Get PBS.
result_type operator()(const JUPI_t &upi) const
Get PMT parameter value for given UPI of PMT.
const char *const PMT_HV_t
parameter name of PMT high voltage
const char *const OPTICS_t
sub-system of PMT
JPMTRunsetupParams()
Default constructor.
static std::string getUPI(const JUPI_t &upi)
Get fallback UPI.
std::string toString() const
Convert UPI.
bool is_default
true if fallback; else false
ResultSet & getResultSet(const std::string &query)
Get result set.
static const char DOT
Separator between PBS values.
Template definition for getting table specific selector.