QApolloDb Class Reference

Inheritance diagram for QApolloDb:

QApolloDbDaq QApolloDbGui QApolloDbServer QApolloDbSlow List of all members.

Detailed Description

read-only interface to cuore data base, intended for daq use

Author:
sergio.didomizio@ge.infn.it
This class only provide an interface to core class QApolloDbBase. Look at that class for member functions documentation.


Public Member Functions

bool Reset ()
 Close connection to data base and reset singleton.
const std::map< unsigned short,
std::string > & 
CrateMap () const
 get map of active crates and corresponding host name
short GetListOfChannels (std::vector< unsigned short > &chList, unsigned short profileId=0)
 get list of active channels corresponding to given profile
unsigned short GetMapping (std::map< unsigned short, QDaqChannel > &cMap)
 fill map with lg channel and corresponding hardware mapping
unsigned short GetActiveChannels (std::map< unsigned short, QDaqChannel > &cMap, QDaqChannel::SettingsType_t what)
 fill map with lg channel and corresponding QDaqChannel
int GetBoards (unsigned short crateId, std::map< unsigned short, std::string > &boards)
 fill boards map with slot and board name
int GetActiveChannels (unsigned short crateId, unsigned short slot, QDaqChannel::SettingsType_t what, std::vector< QDaqChannel > &v)
 Fill map containing given settins for active lg chnannels belonging to the given DAQ slot and DAQ crate.
void GetListOfTriggers (unsigned short lg, std::vector< std::string > &trgList)
 fill list of trigger names for the given channel
const QVdt & GetTrgParameter (unsigned short trgIndex, const std::string &par_name, unsigned short lg=0)
 Get parameter for given trigger index and given channel.
const std::map< std::string,
QVdt > & 
GetTrgParameters (unsigned short trgIndex, unsigned short lg)
 Get map of parameters for given trigger and logical channel.
bool Dump (unsigned short crateId, bool dump)
 dump settings and mapping for the given lg channel
virtual unsigned int GetCurrentRunNumber () const
 return current run number
unsigned short GetCurrentProfile () const
 return profile associated to current run
RunType GetCurrentRunType () const
 return run type id to current run
void GetSettingsBaskets (unsigned short howMany, std::map< std::string, std::vector< QVdt > > &basketsMap)
 get a subset of fields from settings_basket table
unsigned short GetSettingsBasketIds (std::vector< unsigned short > &baskets)
 get vector conaining existing settings basket ids
unsigned short GetSettingsBasket (unsigned short id, std::string &comment)
 get comment associated to given settings basket id
void GetRunTypes (std::map< unsigned short, std::string > &runTypes)
 get a subset of fields from runtypes table
unsigned int GetPulserPeriod ()
 get pulser period
void GetRuns (std::vector< unsigned int > &runs)
 get all run numbers present in runs table
unsigned int GetLastRun ()
 get from db the run number with the most recent start date

Protected Member Functions

 QApolloDb ()
 constructor


Member Function Documentation

short QApolloDb::GetListOfChannels ( std::vector< unsigned short > &  chList,
unsigned short  profileId = 0 
) [inline]

get list of active channels corresponding to given profile

Parameters:
chList vector of active channels
profileId requested profileId. If it is zero, current profile Id is assumed or an error is returned in case DAQ is not running.
Returns:
number of channels in vector or -1 in case of error

unsigned short QApolloDb::GetMapping ( std::map< unsigned short, QDaqChannel > &  cMap  )  [inline]

fill map with lg channel and corresponding hardware mapping

Parameters:
cMap map to be filled
Returns:
number of active channels

unsigned short QApolloDb::GetActiveChannels ( std::map< unsigned short, QDaqChannel > &  cMap,
QDaqChannel::SettingsType_t  what 
) [inline]

fill map with lg channel and corresponding QDaqChannel

Parameters:
what settings to be loaded
cMap map to be filled
Returns:
number of active channels

int QApolloDb::GetBoards ( unsigned short  crateId,
std::map< unsigned short, std::string > &  boards 
) [inline]

fill boards map with slot and board name

Parameters:
crateId identifier of DAQ crate for which board map is filled
boards map to be filled
Returns:
number of active boards in crateId

int QApolloDb::GetActiveChannels ( unsigned short  crateId,
unsigned short  slot,
QDaqChannel::SettingsType_t  what,
std::vector< QDaqChannel > &  v 
) [inline]

Fill map containing given settins for active lg chnannels belonging to the given DAQ slot and DAQ crate.

Parameters:
crateId identifier of DAQ crate for which channel map is filled
slot identifier of the DAQ slot for which channel map is filled (all slots belonging to crateId are filled if slot = 0)
what type of settings to be loaded. Multiple types can be loaded using the format Type1|Type2
v map to be filled
Returns:
number of channels loaded

void QApolloDb::GetListOfTriggers ( unsigned short  lg,
std::vector< std::string > &  trgList 
) [inline]

fill list of trigger names for the given channel

If no entry corresponding to the given lg channel is found in the db then the default trigger names (i.e. lg=0) are returned.

Parameters:
lg lg channel for which trigger names are returned. Default trigger names can be obtained asking for lg=0.
trgList vector containing trigger names. trigger name "NULL" means that no trigger is associated with that trigger tag for that lg

const QVdt& QApolloDb::GetTrgParameter ( unsigned short  trgIndex,
const std::string &  par_name,
unsigned short  lg = 0 
) [inline]

Get parameter for given trigger index and given channel.

Parameters:
par_name name of parameter to be returned
trgIndex trigger tag for which parameter is returned. Can be 1,2,3 or 4.
lg logical channel for which parameter is returned
Returns:
const reference to a QVdt containing requested trigger parameter

const std::map<std::string,QVdt>& QApolloDb::GetTrgParameters ( unsigned short  trgIndex,
unsigned short  lg 
) [inline]

Get map of parameters for given trigger and logical channel.

Parameters:
trgIndex trigger tag for which parameter is returned.
lg logical channel for which parameter is returned
Returns:
const reference to a map containing requested trigger parameters

bool QApolloDb::Dump ( unsigned short  crateId,
bool  dump 
) [inline]

dump settings and mapping for the given lg channel

Returns:
true if channel is not present in cache, true otherwise

void QApolloDb::GetSettingsBaskets ( unsigned short  howMany,
std::map< std::string, std::vector< QVdt > > &  basketsMap 
) [inline]

get a subset of fields from settings_basket table

Filled fields:

Parameters:
howMany max number of returned rows
basketMap map to be filled. Inside basketMap, keys identify fields in settings_basket table and values are arrays of QVdt containing content of each field.

unsigned short QApolloDb::GetSettingsBasketIds ( std::vector< unsigned short > &  baskets  )  [inline]

get vector conaining existing settings basket ids

Parameters:
baskets reference to the vector that will be filled with existing settings basket ids
Returns:
number of entries found in database

unsigned short QApolloDb::GetSettingsBasket ( unsigned short  id,
std::string &  comment 
) [inline]

get comment associated to given settings basket id

Parameters:
id settings basket id for which the comment is requested. If id is zero default settings basket is assumed
comment reference to a string that will be filled with the comment associated to the default settings basket
Returns:
requested settings basket id. In case default id was requested, real id is returned (not zero...)

void QApolloDb::GetRunTypes ( std::map< unsigned short, std::string > &  runTypes  )  [inline]

get a subset of fields from runtypes table

Filled fields:

Parameters:
runTypes reference to map to be filled. Inside runTypes, keys are run_type_id and values are run_type.

unsigned int QApolloDb::GetPulserPeriod (  )  [inline]

get pulser period

Returns:
pulser period in ms or 0 in case of error

void QApolloDb::GetRuns ( std::vector< unsigned int > &  runs  )  [inline]

get all run numbers present in runs table

Parameters:
runs reference to vector to be filled. Runs are sorted.

unsigned int QApolloDb::GetLastRun (  )  [inline]

get from db the run number with the most recent start date

Returns:
run number with the most recent start date, or zero if there are no runs at all in the database


The documentation for this class was generated from the following files:
Generated on Fri Mar 6 13:40:42 2009 for CUORE Software by  doxygen 1.5.1