1 #ifndef __JDB_JDBTOOLKIT__
2 #define __JDB_JDBTOOLKIT__
23 namespace JDATABASE {};
24 namespace JPP {
using namespace JDATABASE; }
48 det2id[parameters.OID] = parameters.SERIALNUMBER;
49 id2det[parameters.SERIALNUMBER] = parameters.OID;
118 return to_value<int>(detid);
120 return (*
this)(detid);
136 return (*
this)(to_value<int>(detid));
165 upi2id[parameters.CLBUPI] = parameters.CLBID;
166 id2upi[parameters.CLBID] = parameters.CLBUPI;
183 if (p == upi2id.end()) {
187 p = upi2id.find(upi);
189 if (p == upi2id.end()) {
208 if (p == id2upi.end()) {
214 if (p == id2upi.end()) {
249 const JUPI_t upi(parameters.PBS,
252 parameters.SERIALNUMBER);
254 number2upi[pbs][parameters.SERIALNUMBER] = upi;
275 if (p == number2upi.end()) {
278 p = number2upi.find(pbs);
281 if (p != number2upi.end()) {
285 if (q != p->second.end()) {
326 template<
class JHelper_t,
class ...Args>
329 helper.initialise(args...);
339 template<
class ...Args>
352 template<
class JHelper_t,
class ...Args>
353 static void initialise(JHelper_t& (*pF)(),
const Args& ...args)
355 JHelper_t::helper.initialise(args...);
static JCLBIDHelper helper
Helper object.
JCLBIDHelper & getCLBUPI()
Auxiliary function for helper object initialisation.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
*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
JUPIHelper & getUPI()
Auxiliary function for helper object initialisation.
Universal product identifier (UPI).
Auxiliary class for a type holder.
Auxiliary class for specifying selection of database data.
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
Auxiliary class for mapping UPI of central-logic board to module identifier.
static JUPIHelper helper
Helper object.
std::map< std::string, int > det2id
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JCLBIDHelper & getCLBID()
Auxiliary function for helper object initialisation.
std::map< JUPI_t, int > upi2id
bool is_integer(const std::string &buffer)
Check if string is an integer.
int operator()(const std::string &detid, const JType< int > &type)
Get serial number according given data type.
int operator()(const JUPI_t &upi)
Get module identifier.
void initialise(const JPBS_t &pbs)
Initialise.
std::string operator()(const std::string &detid, const JType< std::string > &type)
Get detector identifier according given data type.
Auxiliary class for mapping UPI of product to serial number.
std::map< int, JUPI_t > id2upi
JUPI_t operator()(const int id)
Get UPI.
std::map< JPBS_t, std::map< int, JUPI_t > > number2upi
static JDetectorsHelper helper
Helper object.
Auxiliary class for mapping serial number and object identifier of detectors.
void initialise()
Initialise.
void initialise()
Initialise.
Product breakdown structure (PBS).
std::string operator()(const int id)
Get detector identifier.
JUPI_t operator()(const JPBS_t &pbs, const int number)
Get UPI.
Exception for accessing a value in a collection that is outside of its range.
int operator()(const std::string &detid)
Get detector serial number.
std::map< int, std::string > id2det
Template definition for getting table specific selector.
static JDB & get()
Get connection to database.