Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Classes | Typedefs | Functions | Variables
JDATABASE Namespace Reference

Auxiliary classes and methods for database I/O. More...

Namespaces

 PBS
 Namespace for predefined PBS values.
 

Classes

struct  JAHRS
 
struct  JAHRSCalibration
 
struct  JAHRSCalibration_t
 Auxiliary class to map module identifier to AHRS calibration. More...
 
struct  JAHRSCalibrationValidity
 Auxiliary data structure to check validity of AHRS calibration data. More...
 
struct  JAHRSCalibrationComparator
 Auxiliary data structure for sorting of AHRS calibrations. More...
 
struct  JAHRSDetectorCalibration
 
struct  JAHRSValidity
 Auxiliary data structure to check validity of AHRS data. More...
 
struct  JAllParams
 
struct  JCLBID
 
struct  JCLBMap
 
struct  JNullResultSet
 Auxiliary class for invalid result set. More...
 
class  JDatabaseObjectIterator
 Object iteration from database. More...
 
struct  JDatabaseObjectIterator< JTypeList< JHead_t, JTail_t > >
 Implementation of object iterator for multiple data types. More...
 
struct  JDatabaseObjectIterator< JTypeList< JHead_t, JNullType > >
 Terminator class of recursive JDatabaseObjectIterator class. More...
 
struct  JDatalog
 
struct  JDatalogNumbers
 
struct  JDatim_t
 Auxiliairy data structure for date and time. More...
 
class  JDB
 Auxiliary class for connection to data base. More...
 
struct  JDBReader
 Auxiliary class to read ROOT object from database. More...
 
struct  JDBString
 Wrapper class to read string until end-of-line. More...
 
struct  JRun_t
 Auxiliary class for detector/run comparisons. More...
 
struct  JDetectorsHelper
 Auxiliary class for mapping serial number and object identifier of detectors. More...
 
struct  JCLBIDHelper
 Auxiliary class for mapping UPI of central-logic board to module identifier. More...
 
struct  JUPIHelper
 Auxiliary class for mapping UPI of product to serial number. More...
 
struct  JDBToolkit
 Wrapper data structure for initialisation of fuction objects. More...
 
struct  JDetectorIntegration
 
struct  JProductIntegration_t
 Auxiliary class for product integration data. More...
 
struct  JDetectorIntegration_t
 Detector integration. More...
 
struct  JDetectors
 
struct  JMACAddress
 MAC address. More...
 
struct  JPBS_t
 Product breakdown structure (PBS). More...
 
struct  JPBSSequence
 Auxiliary data structure for a sequence of PBS values. More...
 
struct  JPBSSequences
 Auxiliary data structure for set of PBS sequences. More...
 
struct  JGetPBSSequences
 Auxiliary class to get PBS sequences as a function of PBS. More...
 
struct  JPersons
 
struct  JPMTBestHVSettings
 
struct  JPMTHVRunSettings
 
struct  JPMTHVSettings
 
struct  JProductIntegration
 
struct  JLocation_t
 Auxiliary data structure for location of product in detector. More...
 
struct  JProductRouter
 Auxiliary class to map UPI to location in detector. More...
 
struct  JRunQuality
 Auxiliary data structure for data quality. More...
 
struct  JRuns
 
struct  JRunsetupParams
 
struct  JRunsetups
 Auxiliary class for run setup evaluation. More...
 
struct  JRunSummaryNumbers
 
class  JSelector
 Auxiliary class for specifying selection of database data. More...
 
struct  getSelector
 Template definition for getting table specific selector. More...
 
struct  getSelector< T, JPersons, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JDetectors, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JRuns, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JDatalogNumbers, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JAllParams, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JToAshort, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JCLBMap, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JDetectorIntegration, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JRunSummaryNumbers, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JRunQuality, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JRunsetupParams, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JPMTHVRunSettings, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JVendorHV, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JCLBID, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JUPI, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JAHRS, true >
 Template specialisation for getting table specific selector. More...
 
struct  getSelector< T, JAHRSDetectorCalibration, true >
 Template specialisation for getting table specific selector. More...
 
struct  JQueries
 Auxiliary method to get list of table names. More...
 
struct  JToAshort
 
struct  JUPI
 
struct  JUPI_t
 Universal product identifier (UPI). More...
 
struct  JVendorHV
 

Typedefs

typedef JEEP::JDate<'/'> JDate_t
 
typedef JTOOLS::JRange< JDate_tJPeriod_t
 Type definition of period. More...
 
typedef JEEP::JTime<':'> JTime_t
 

Functions

std::istream & operator>> (std::istream &in, JAHRSCalibration &calibration)
 Read AHRS calibration from input stream. More...
 
std::ostream & operator<< (std::ostream &out, const JAHRSCalibration &calibration)
 Write AHRS calibration to output stream. More...
 
int getVersion (const std::string &version)
 Get numerical value of AHRS calibration version. More...
 
const char * getPrivateCookie ()
 Get private cookie. More...
 
const char * getPublicCookie ()
 Get public cookie. More...
 
template<class JTable_t >
const char * getTable ()
 Get table name. More...
 
template<class JTable_t , class JType_t >
const char * getColumn (JType_t JTable_t::*data_member)
 Get column name. More...
 
template<class JTable_t >
std::vector< std::string > getColumns ()
 Get column names. More...
 
ResultSet & getResultSet (const std::string &query)
 Get result set. More...
 
ResultSet & getResultSet (const std::string &query, const std::vector< Selector > &selection)
 Get result set. More...
 
template<class T >
bool operator>> (const std::vector< Selector > &selection, T &object)
 Read ROOT object from selector. More...
 
template<class T >
bool operator>> (ResultSet &rs, T &object)
 Read ROOT object from result set. More...
 
template<class JElement_t , class JAllocator_t >
bool operator>> (ResultSet &rs, std::vector< JElement_t, JAllocator_t > &buffer)
 Read vector of ROOT objects from result set. More...
 
std::ostream & operator<< (std::ostream &out, const JPeriod_t &object)
 Write period to output stream. More...
 
std::vector< std::string > getGITTags (const TRegexp regexp, const JGITTags_t::key_type date)
 Get selection of GIT tags. More...
 
bool is_detector (const JPBS_t &pbs)
 Test if given PBS corresponds to a detector. More...
 
bool is_string (const JPBS_t &pbs)
 Test if given PBS corresponds to a string. More...
 
bool is_optical_module (const JPBS_t &pbs)
 Test if given PBS corresponds to a optical module. More...
 
bool is_base_module (const JPBS_t &pbs)
 Test if given PBS corresponds to a base module. More...
 
bool operator>> (ResultSet &rs, JRunQuality &quality)
 Read data quality from result set. More...
 
bool operator< (const JRunQuality &first, const JRunQuality &second)
 Less-than operator. More...
 
bool operator< (const JRuns &first, const JRuns &second)
 Less-than operator. More...
 
const Selector::RelOp & getOperand (const int index)
 Get operand. More...
 
JTreeParameters getTreeParameters (const JType< JDetectors > &type)
 
JTreeParameters getTreeParameters (const JType< JRuns > &type)
 
JTreeParameters getTreeParameters (const JType< JDatalogNumbers > &type)
 
JTreeParameters getTreeParameters (const JType< JDatalog > &type)
 
JTreeParameters getTreeParameters (const JType< JVendorHV > &type)
 
JTreeParameters getTreeParameters (const JType< JAHRS > &type)
 
JTreeParameters getTreeParameters (const JType< JAHRSCalibration > &type)
 
JTreeParameters getTreeParameters (const JType< JAllParams > &type)
 
JTreeParameters getTreeParameters (const JType< JPMTHVSettings > &type)
 
JTreeParameters getTreeParameters (const JType< JPMTHVRunSettings > &type)
 
JTreeParameters getTreeParameters (const JType< JPMTBestHVSettings > &type)
 
JTreeParameters getTreeParameters (const JType< JProductIntegration > &type)
 
JTreeParameters getTreeParameters (const JType< JCLBMap > &type)
 
JTreeParameters getTreeParameters (const JType< JPersons > &type)
 
JTreeParameters getTreeParameters (const JType< JToAshort > &type)
 
JTreeParameters getTreeParameters (const JType< JRunSummaryNumbers > &type)
 
JTreeParameters getTreeParameters (const JType< JRunQuality > &type)
 
JTreeParameters getTreeParameters (const JType< JRunsetupParams > &type)
 
JTreeParameters getTreeParameters (const JType< JCLBID > &type)
 
JTreeParameters getTreeParameters (const JType< JUPI > &type)
 
template<class JTypelist_t >
const std::vector< std::string > & getQueries ()
 Get list of possible queries. More...
 

Variables

static const char PREFIX_COOKIE = '_'
 Cookie prefix. More...
 
static const std::string PREFIX_DATAFILTER = "DAQ_triggerParameters"
 This string is prepended to every parameter in the database output for the corresponding process. More...
 
static const std::string PREFIX_ADF = "DAQ_ADF"
 
static const std::string SPECIAL_CHARACTERS = "!@#$%^&*()-+=[]{};:'\"\\|,.<>/?"
 Special characters. More...
 
JDetectorsHelper getDetector
 Function object for mapping serial number to object identifier of detector and vice versa. More...
 
JCLBIDHelper getCLBID
 Function object for mapping UPI of central-logic board to module identifier. More...
 
JUPIHelper getUPI
 Function object for mapping PBS and serial number to UPI. More...
 
static JCLBIDHelpergetCLBUPI = getCLBID
 Function object for mapping module identifier to UPI of central-logic board. More...
 
static JGetPBSSequences getPBSSequences
 Function object to get PBS sequences as a function of PBS. More...
 
static const Selector::RelOp *const OPERAND []
 Available operands. More...
 
static const int NUMBER_OF_OPERANDS = sizeof(OPERAND) / sizeof(OPERAND[0])
 Number of available operands. More...
 

Detailed Description

Auxiliary classes and methods for database I/O.

Author
mdejong

Typedef Documentation

Definition at line 15 of file JDate_t.hh.

Type definition of period.

Definition at line 36 of file JDetectorIntegration_t.hh.

Definition at line 15 of file JTime_t.hh.

Function Documentation

std::istream& JDATABASE::operator>> ( std::istream &  in,
JAHRSCalibration calibration 
)
inline

Read AHRS calibration from input stream.

Parameters
ininput stream
calibrationAHRS calibration
Returns
input stream

Definition at line 26 of file JAHRSCalibrationToolkit.hh.

27  {
28  using namespace std;
29  using namespace JPP;
30 
31  in >> calibration.ACC_OFFSET_X
32  >> calibration.ACC_OFFSET_Y
33  >> calibration.ACC_OFFSET_Z;
34 
35  in >> calibration.ACC_ROT_XX >> calibration.ACC_ROT_XY >> calibration.ACC_ROT_XZ;
36  in >> calibration.ACC_ROT_YX >> calibration.ACC_ROT_YY >> calibration.ACC_ROT_YZ;
37  in >> calibration.ACC_ROT_ZX >> calibration.ACC_ROT_ZY >> calibration.ACC_ROT_ZZ;
38 
39  in >> calibration.MAG_XMIN
40  >> calibration.MAG_YMIN
41  >> calibration.MAG_ZMIN;
42 
43  in >> calibration.MAG_XMAX
44  >> calibration.MAG_YMAX
45  >> calibration.MAG_ZMAX;
46 
47  in >> calibration.MAG_ROT_XX >> calibration.MAG_ROT_XY >> calibration.MAG_ROT_XZ;
48  in >> calibration.MAG_ROT_YX >> calibration.MAG_ROT_YY >> calibration.MAG_ROT_YZ;
49  in >> calibration.MAG_ROT_ZX >> calibration.MAG_ROT_ZY >> calibration.MAG_ROT_ZZ;
50 
51  return in;
52  }
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 source JAcoustics sh $DETECTOR_ID typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:36
std::ostream& JDATABASE::operator<< ( std::ostream &  out,
const JAHRSCalibration calibration 
)
inline

Write AHRS calibration to output stream.

Parameters
outoutput stream
calibrationAHRS calibration
Returns
output stream

Definition at line 62 of file JAHRSCalibrationToolkit.hh.

63  {
64  using namespace std;
65  using namespace JPP;
66 
67  out << FIXED(9,6) << calibration.ACC_OFFSET_X << ' '
68  << FIXED(9,6) << calibration.ACC_OFFSET_Y << ' '
69  << FIXED(9,6) << calibration.ACC_OFFSET_Z << ' ';
70 
71  out << FIXED(9,6) << calibration.ACC_ROT_XX << ' ' << FIXED(9,6) << calibration.ACC_ROT_XY << ' ' << FIXED(9,6) << calibration.ACC_ROT_XZ << ' ';
72  out << FIXED(9,6) << calibration.ACC_ROT_YX << ' ' << FIXED(9,6) << calibration.ACC_ROT_YY << ' ' << FIXED(9,6) << calibration.ACC_ROT_YZ << ' ';
73  out << FIXED(9,6) << calibration.ACC_ROT_ZX << ' ' << FIXED(9,6) << calibration.ACC_ROT_ZY << ' ' << FIXED(9,6) << calibration.ACC_ROT_ZZ << ' ';
74 
75  out << FIXED(9,6) << calibration.MAG_XMIN << ' '
76  << FIXED(9,6) << calibration.MAG_YMIN << ' '
77  << FIXED(9,6) << calibration.MAG_ZMIN << ' ';
78 
79  out << FIXED(9,6) << calibration.MAG_XMAX << ' '
80  << FIXED(9,6) << calibration.MAG_YMAX << ' '
81  << FIXED(9,6) << calibration.MAG_ZMAX << ' ';
82 
83  out << FIXED(9,6) << calibration.MAG_ROT_XX << ' ' << FIXED(9,6) << calibration.MAG_ROT_XY << ' ' << FIXED(9,6) << calibration.MAG_ROT_XZ << ' ';
84  out << FIXED(9,6) << calibration.MAG_ROT_YX << ' ' << FIXED(9,6) << calibration.MAG_ROT_YY << ' ' << FIXED(9,6) << calibration.MAG_ROT_YZ << ' ';
85  out << FIXED(9,6) << calibration.MAG_ROT_ZX << ' ' << FIXED(9,6) << calibration.MAG_ROT_ZY << ' ' << FIXED(9,6) << calibration.MAG_ROT_ZZ << ' ';
86 
87  return out;
88  }
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:445
int JDATABASE::getVersion ( const std::string &  version)
inline

Get numerical value of AHRS calibration version.

Parameters
versionversion
Returns
version

Definition at line 97 of file JAHRSCalibrationToolkit.hh.

98  {
99  using namespace std;
100  using namespace JPP;
101 
102  size_t pos = version.find_last_of("vV");
103 
104  if (pos != string::npos)
105  return to_value<int>(version.substr(pos+1));
106  else
107  return -1;
108  }
version
Definition: JCalibratePMT.sh:7
const char* JDATABASE::getPrivateCookie ( )
inline

Get private cookie.

Returns
cookie

Definition at line 37 of file JDB.hh.

38  {
39  const char* home = getenv("HOME");
40 
41  return MAKE_CSTRING((home != NULL ? home : ".") << "/" << ".km3netdb_cookie");
42  }
#define MAKE_CSTRING(A)
Make C-string.
Definition: JPrint.hh:151
const char* JDATABASE::getPublicCookie ( )
inline

Get public cookie.

Returns
cookie

Definition at line 50 of file JDB.hh.

51  {
52  return getenv("DBCOOKIE");
53  }
template<class JTable_t >
const char* JDATABASE::getTable ( )
inline

Get table name.

Returns
table name

Definition at line 200 of file JDB.hh.

201  {
202  return JTable_t::getName();
203  }
const char * getName()
Get ROOT name of given data type.
Definition: JRootToolkit.hh:54
template<class JTable_t , class JType_t >
const char* JDATABASE::getColumn ( JType_t JTable_t::*  data_member)
inline

Get column name.

Parameters
data_memberdata member
Returns
column name

Definition at line 213 of file JDB.hh.

214  {
215  JTable_t* pc = NULL;
216  TClass* rc = dynamic_cast<TClass*>(TDictionary::GetDictionary(typeid(JTable_t)));
217 
218  if (rc != NULL) {
219 
220  TIterator* i = rc->GetListOfDataMembers()->MakeIterator();
221 
222  for (const TDataMember* p; (p = (const TDataMember*) i->Next()) != NULL; ) {
223 
224  if (p->GetOffset() == (char*) &(pc->*data_member) - (char*) pc) {
225  return p->GetName();
226  }
227  }
228  }
229 
230  return NULL;
231  }
template<class JTable_t >
std::vector<std::string> JDATABASE::getColumns ( )
inline

Get column names.

Returns
column names

Definition at line 240 of file JDB.hh.

241  {
242  using namespace JPP;
243 
245 
246  TClass* rc = dynamic_cast<TClass*>(TDictionary::GetDictionary(typeid(JTable_t)));
247 
248  if (rc != NULL) {
249 
250  TIterator* i = rc->GetListOfDataMembers()->MakeIterator();
251 
252  for (const TDataMember* p; (p = (const TDataMember*) i->Next()) != NULL; ) {
253  if (JRootClass::is_class(*p)) {
254  buffer.push_back(p->GetName());
255  }
256  }
257  }
258 
259  return buffer;
260  }
static bool is_class(const char *const class_name)
Check class name against ROOT class names.
Definition: JRootClass.hh:48
ResultSet& JDATABASE::getResultSet ( const std::string &  query)
inline

Get result set.

Parameters
queryquery / table name
Returns
result set

Definition at line 269 of file JDB.hh.

270  {
271  return JDB::get()->StreamDS(query.c_str(), std::vector<Selector>());
272  }
T get(const JHead &header)
Get object from header.
ResultSet& JDATABASE::getResultSet ( const std::string &  query,
const std::vector< Selector > &  selection 
)
inline

Get result set.

Parameters
queryquery / table name
selectionselection
Returns
result set

Definition at line 282 of file JDB.hh.

283  {
284  return JDB::get()->StreamDS(query.c_str(), selection);
285  }
T get(const JHead &header)
Get object from header.
template<class T >
bool JDATABASE::operator>> ( const std::vector< Selector > &  selection,
T object 
)
inline

Read ROOT object from selector.

Parameters
selectionselection
objectobject
Returns
true if read; else false

Definition at line 47 of file JDBReader.hh.

48  {
49  using namespace std;
50  using namespace JPP;
51 
52  JRootReader reader(null, JEquationParameters(), JDBDictionary::getInstance());
53 
54  JRootReadableClass cls(object);
55 
56  for (vector<Selector>::const_iterator i = selection.begin(); i != selection.end(); ++i) {
57 
58  string parameter = to_upper(i->Name);
59 
60  for (string::const_iterator i = SPECIAL_CHARACTERS.begin(); i != SPECIAL_CHARACTERS.end(); ++i) {
61  for (string::size_type pos; (pos = parameter.find(*i)) != string::npos; ) {
62  parameter.erase(pos);
63  }
64  }
65 
66  JRootReadableClass abc = cls.find(parameter.c_str());
67 
68  if (abc.is_valid()) {
69 
70  JRedirectString redirect(reader, i->Value);
71 
72  reader.getObject(abc);
73  }
74  }
75 
76  return true;
77  }
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
std::string to_upper(const std::string &value)
Convert all character to upper case.
static const std::string SPECIAL_CHARACTERS
Special characters.
Definition: JDBReader.hh:36
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
template<class T >
bool JDATABASE::operator>> ( ResultSet &  rs,
T object 
)
inline

Read ROOT object from result set.

Parameters
rsresult set
objectobject
Returns
true if read; else false

Definition at line 186 of file JDBReader.hh.

187  {
189 
190  if (rs.Next()) {
191 
192  object = reader(rs);
193 
194  return true;
195  }
196 
197  return false;
198  }
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
Auxiliary class to read ROOT object from database.
Definition: JDBReader.hh:91
template<class JElement_t , class JAllocator_t >
bool JDATABASE::operator>> ( ResultSet &  rs,
std::vector< JElement_t, JAllocator_t > &  buffer 
)
inline

Read vector of ROOT objects from result set.

Parameters
rsresult set
buffer
Returns
true if read; else false

Definition at line 209 of file JDBReader.hh.

210  {
211  for (JElement_t object; rs >> object; ) {
212  buffer.push_back(object);
213  }
214 
215  return true;
216  }
std::ostream& JDATABASE::operator<< ( std::ostream &  out,
const JPeriod_t object 
)
inline

Write period to output stream.

Parameters
outoutput stream
objectperiod
Returns
output stream

Definition at line 46 of file JDetectorIntegration_t.hh.

47  {
48  return out << "(" << object.getLowerLimit() << "," << object.getUpperLimit() << ")";
49  }
std::vector<std::string> JDATABASE::getGITTags ( const TRegexp  regexp,
const JGITTags_t::key_type  date 
)
inline

Get selection of GIT tags.

Parameters
regexpregular expression
datedate corresponding to oldest version
Returns
GIT tags

Definition at line 34 of file JDB/JGITTags.hh.

35  {
36  using namespace JPP;
37 
39 
40  const JGITTags_t tags = JEEP::getGITTags();
41 
42  for (JGITTags_t::const_reverse_iterator i = tags.rbegin(); i.base() != tags.lower_bound(date); ++i) {
43  if (TString(i->second.c_str()).Contains(regexp)) {
44  buffer.push_back(getGITVersion(i->second));
45  }
46  }
47 
48  return buffer;
49  }
std::map< JDate<'-'>, std::string > JGITTags_t
Type definition of dated GIT tags.
std::string getGITVersion(const std::string &tag)
Get GIT version for given GIT tag.
const JGITTags_t & getGITTags()
Get GIT dated tags.
bool JDATABASE::is_detector ( const JPBS_t pbs)
inline

Test if given PBS corresponds to a detector.

Parameters
pbsPBS
Returns
true if detector; else false

Definition at line 253 of file JPBS_t.hh.

254  {
255  return (pbs == PBS::DETECTOR);
256  }
set_variable DETECTOR
bool JDATABASE::is_string ( const JPBS_t pbs)
inline

Test if given PBS corresponds to a string.

Parameters
pbsPBS
Returns
true if string; else false

Definition at line 265 of file JPBS_t.hh.

266  {
267  return (pbs == PBS::DETECTION_UNIT);
268  }
static const JPBS_t DETECTION_UNIT(3)
PBS of detection unit
bool JDATABASE::is_optical_module ( const JPBS_t pbs)
inline

Test if given PBS corresponds to a optical module.

Parameters
pbsPBS
Returns
true if optical module; else false

Definition at line 277 of file JPBS_t.hh.

278  {
279  return (pbs == PBS::DOM);
280  }
static const JPBS_t DOM(3, 4)
PBS of optical module
bool JDATABASE::is_base_module ( const JPBS_t pbs)
inline

Test if given PBS corresponds to a base module.

Parameters
pbsPBS
Returns
true if base module; else false

Definition at line 289 of file JPBS_t.hh.

290  {
291  return (pbs == PBS::BASE ||
292  pbs == PBS::BASE_CONTAINER);
293  }
static const JPBS_t BASE(3, 2)
PBS of detection unit base
static const JPBS_t BASE_CONTAINER(3, 2, 2)
PBS of detection unit base container
bool JDATABASE::operator>> ( ResultSet &  rs,
JRunQuality &  quality 
)

Read data quality from result set.

Parameters
rsresult set
qualityquality
Returns
true if read; else false

Definition at line 59 of file JRunQuality.cc.

60  {
61  using namespace std;
62  using namespace JPP;
63 
64  quality.run = -1;
65 
66  for (JRunSummaryNumbers parameters; ; ) {
67 
68  bool has_next = false;
69 
70  try {
71  has_next = (rs >> parameters);
72  }
73  catch(const exception& error) {
74  has_next = false;
75  }
76 
77  if (parameters.RUN != quality.run || !has_next) {
78 
79  if (quality.run != -1) {
80 
81  return true;
82 
83  } else if (!has_next) {
84 
85  rs.Close();
86 
87  return false;
88  }
89 
90  quality = JRunQuality();
91  quality.GIT = parameters.SOURCE_NAME;
92  quality.detector = getDetector(parameters.DETID);
93  quality.run = parameters.RUN;
94  }
95 
96  quality.put(parameters.PARAMETER_NAME, parameters.DATA_VALUE);
97  }
98  }
*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
Definition: diff-Tuna.sh:38
JDetectorsHelper getDetector
Function object for mapping serial number to object identifier of detector and vice versa...
Definition: JDBToolkit.cc:5
bool JDATABASE::operator< ( const JRunQuality first,
const JRunQuality second 
)
inline

Less-than operator.

Parameters
firstfirst run quaility
secondsecond run quaility
Returns
true if first run quality less than second; else false

Definition at line 149 of file JRunQuality.hh.

151  {
152  if (first.detector == second.detector)
153  return first.run < second.run;
154  else
155  return first.detector < second.detector;
156  }
bool JDATABASE::operator< ( const JRuns first,
const JRuns second 
)
inline

Less-than operator.

Parameters
firstfirst run
secondsecond run
Returns
true if first run less than second; else false

Definition at line 56 of file JRuns.hh.

58  {
59  if (first.DETID == second.DETID)
60  return first.RUN < second.RUN;
61  else
62  return first.DETID < second.DETID;
63  }
int DETID
constraint
Definition: JRuns.hh:22
const Selector::RelOp& JDATABASE::getOperand ( const int  index)
inline

Get operand.

Parameters
indexindex
Returns
operand

Definition at line 56 of file JDB/JSelector.hh.

57  {
58  if (index >= 0 && index <= NUMBER_OF_OPERANDS)
59  return *OPERAND[index];
60  else
61  THROW(JIndexOutOfRange, "Invalid index " << index);
62  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
static const int NUMBER_OF_OPERANDS
Number of available operands.
static const Selector::RelOp *const OPERAND[]
Available operands.
JTreeParameters JDATABASE::getTreeParameters ( const JType< JDetectors > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 30 of file JDB/JSupport.hh.

31  {
32  return JTreeParameters("DB_DETECTORS", "db_detectors", "", 2);
33  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JRuns > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 39 of file JDB/JSupport.hh.

40  {
41  return JTreeParameters("DB_RUNS", "db_runs", "", 2);
42  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JDatalogNumbers > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 48 of file JDB/JSupport.hh.

49  {
50  return JTreeParameters("DATALOGNUMBERS", "", "datalognumbers", 2);
51  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JDatalog > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 57 of file JDB/JSupport.hh.

58  {
59  return JTreeParameters("DATALOG", "", "datalog", 2);
60  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JVendorHV > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 66 of file JDB/JSupport.hh.

67  {
68  return JTreeParameters("VENDOR_HV", "vendor_hv", "", 2);
69  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JAHRS > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 75 of file JDB/JSupport.hh.

76  {
77  return JTreeParameters("AHRS", "ahrs", "", 2);
78  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JAHRSCalibration > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 84 of file JDB/JSupport.hh.

85  {
86  return JTreeParameters("AHRSCALIB", "ahrscalib", "", 2);
87  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JAllParams > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 93 of file JDB/JSupport.hh.

94  {
95  return JTreeParameters("DB_ALLPARAMS", "db_allparams", "", 2);
96  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JPMTHVSettings > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 102 of file JDB/JSupport.hh.

103  {
104  return JTreeParameters("HV_SETTINGS", "hv_settings", "", 2);
105  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JPMTHVRunSettings > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 111 of file JDB/JSupport.hh.

112  {
113  return JTreeParameters("HV_RUN_SETTINGS", "hv_run_settings", "", 2);
114  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JPMTBestHVSettings > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 120 of file JDB/JSupport.hh.

121  {
122  return JTreeParameters("BEST_HV_SETTINGS", "best_hv_settings", "", 2);
123  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JProductIntegration > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 129 of file JDB/JSupport.hh.

130  {
131  return JTreeParameters("INTEGRATION", "integration", "", 2);
132  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JCLBMap > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 138 of file JDB/JSupport.hh.

139  {
140  return JTreeParameters("CLBMAP", "clbmap", "", 2);
141  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JPersons > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 147 of file JDB/JSupport.hh.

148  {
149  return JTreeParameters("PERSONS", "persons", "", 2);
150  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JToAshort > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 156 of file JDB/JSupport.hh.

157  {
158  return JTreeParameters("DB_TOASHORT", "db_toashort", "", 2);
159  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JRunSummaryNumbers > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 165 of file JDB/JSupport.hh.

166  {
167  return JTreeParameters("DB_RUNSUMMARYNUMBERS", "db_runsummarynumbers", "", 2);
168  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JRunQuality > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 174 of file JDB/JSupport.hh.

175  {
176  return JTreeParameters("DB_RUNQUALITY", "db_runquality", "", 2);
177  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JRunsetupParams > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 183 of file JDB/JSupport.hh.

184  {
185  return JTreeParameters("DB_RUNSETUPPARAMS", "db_runsetupparams", "", 2);
186  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JCLBID > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 192 of file JDB/JSupport.hh.

193  {
194  return JTreeParameters("DB_CLBID", "db_clbid", "", 2);
195  }
JTreeParameters JDATABASE::getTreeParameters ( const JType< JUPI > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 201 of file JDB/JSupport.hh.

202  {
203  return JTreeParameters("DB_UPI", "db_upi", "", 2);
204  }
template<class JTypelist_t >
const std::vector<std::string>& JDATABASE::getQueries ( )
inline

Get list of possible queries.

Returns
list of possible queries

Definition at line 244 of file JDB/JSupport.hh.

245  {
246  static const JQueries<JTypelist_t> buffer;
247 
248  return buffer;
249  }

Variable Documentation

const char JDATABASE::PREFIX_COOKIE = '_'
static

Cookie prefix.

Definition at line 59 of file JDB.hh.

const std::string JDATABASE::PREFIX_DATAFILTER = "DAQ_triggerParameters"
static

This string is prepended to every parameter in the database output for the corresponding process.

Definition at line 65 of file JDB.hh.

const std::string JDATABASE::PREFIX_ADF = "DAQ_ADF"
static

Definition at line 66 of file JDB.hh.

const std::string JDATABASE::SPECIAL_CHARACTERS = "!@#$%^&*()-+=[]{};:'\"\\|,.<>/?"
static

Special characters.

Definition at line 36 of file JDBReader.hh.

JDetectorsHelper JDATABASE::getDetector

Function object for mapping serial number to object identifier of detector and vice versa.

Definition at line 5 of file JDBToolkit.cc.

JCLBIDHelper JDATABASE::getCLBID

Function object for mapping UPI of central-logic board to module identifier.

Definition at line 6 of file JDBToolkit.cc.

JUPIHelper JDATABASE::getUPI

Function object for mapping PBS and serial number to UPI.

Definition at line 7 of file JDBToolkit.cc.

JCLBIDHelper& JDATABASE::getCLBUPI = getCLBID
static

Function object for mapping module identifier to UPI of central-logic board.

Definition at line 264 of file JDBToolkit.hh.

JGetPBSSequences JDATABASE::getPBSSequences
static

Function object to get PBS sequences as a function of PBS.

Definition at line 270 of file JPBSSequence.hh.

const Selector::RelOp* const JDATABASE::OPERAND[]
static
Initial value:
=
{
&Selector::RelOp::Equal,
&Selector::RelOp::Different,
&Selector::RelOp::Less,
&Selector::RelOp::LessEqual,
&Selector::RelOp::Greater,
&Selector::RelOp::GreaterEqual
}

Available operands.

Definition at line 33 of file JDB/JSelector.hh.

const int JDATABASE::NUMBER_OF_OPERANDS = sizeof(OPERAND) / sizeof(OPERAND[0])
static

Number of available operands.

Definition at line 47 of file JDB/JSelector.hh.