CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends

RunDCSLVDat Class Reference

#include <RunDCSLVDat.h>

Inheritance diagram for RunDCSLVDat:
IDataItem IDBObject

List of all members.

Public Types

typedef oracle::occi::ResultSet ResultSet

Public Member Functions

std::string getEBAccount ()
std::string getEEAccount ()
float getLV () const
float getLVNominal () const
int getStatus () const
std::string getTable ()
int getTimeStatus ()
 RunDCSLVDat ()
void setLV (float t)
void setLVNominal (float t)
void setStatus (int t)
void setTimeStatus (int t)
 ~RunDCSLVDat ()

Static Public Attributes

static const int LVNOTNOMINAL = 1
static const int LVOFF = 2
static const int maxDifference = 30*60*1000000
static const int maxLVDifferenceEB = 1000
static const int maxLVDifferenceEE = 1000
static const int minLV = 2000

Private Member Functions

void fetchData (std::map< EcalLogicID, RunDCSLVDat > *fillMap, RunIOV *iov) throw (std::runtime_error)
void fetchLastData (std::map< EcalLogicID, RunDCSLVDat > *fillMap) throw (std::runtime_error)
void fillTheMap (ResultSet *, std::map< EcalLogicID, RunDCSLVDat > *)
ResultSetgetBarrelRset ()
ResultSetgetEndcapRset ()
int nowMicroseconds ()
void prepareWrite () throw (std::runtime_error)
void setStatusForBarrel (RunDCSLVDat &, Tm)
void setStatusForEndcaps (RunDCSLVDat &, Tm)
void writeDB (const EcalLogicID *ecid, const RunDCSLVDat *item, RunIOV *iov) throw (std::runtime_error)

Private Attributes

float m_lv
float m_lvnom
int m_status
int m_tstatus

Friends

class EcalCondDBInterface

Detailed Description

Definition at line 14 of file RunDCSLVDat.h.


Member Typedef Documentation

Definition at line 16 of file RunDCSLVDat.h.


Constructor & Destructor Documentation

RunDCSLVDat::RunDCSLVDat ( )

Definition at line 11 of file RunDCSLVDat.cc.

References NULL.

RunDCSLVDat::~RunDCSLVDat ( )

Definition at line 26 of file RunDCSLVDat.cc.

{
}

Member Function Documentation

void RunDCSLVDat::fetchData ( std::map< EcalLogicID, RunDCSLVDat > *  fillMap,
RunIOV iov 
) throw (std::runtime_error) [private]
void RunDCSLVDat::fetchLastData ( std::map< EcalLogicID, RunDCSLVDat > *  fillMap) throw (std::runtime_error) [private]
void RunDCSLVDat::fillTheMap ( ResultSet ,
std::map< EcalLogicID, RunDCSLVDat > *   
) [private]
ResultSet * RunDCSLVDat::getBarrelRset ( ) [private]

Definition at line 55 of file RunDCSLVDat.cc.

References NULL, and o2o::query.

                                      {
  ResultSet* rset = NULL;
  string query = "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
    " d.value_number , '5' NOMINAL_VALUE , d.VALUE_TIMESTAMP "
    "FROM "+ getEBAccount()+".FWWIENERMARATHONCHANNEL_LV d "
    " JOIN "+ getEBAccount()+".LV_MAPPING h on "
    " h.DPID = d.DPID join channelview cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name and dpe_name='MEASUREMENTSENSEVOLTAGE' "; 
  try {
    m_readStmt->setSQL(query);
    rset = m_readStmt->executeQuery();
  }
  catch (SQLException e) {
    throw(std::runtime_error("RunDCSLVDat::getBarrelRset():  " + e.getMessage() + " " + query));
  }
  return rset;
}
std::string RunDCSLVDat::getEBAccount ( ) [inline]

Definition at line 32 of file RunDCSLVDat.h.

{ return "CMS_ECAL_LV_PVSS_COND"; }
std::string RunDCSLVDat::getEEAccount ( ) [inline]

Definition at line 33 of file RunDCSLVDat.h.

{ return "CMS_ECAL_LV_PVSS_COND"; }
ResultSet * RunDCSLVDat::getEndcapRset ( ) [private]

Definition at line 72 of file RunDCSLVDat.cc.

References NULL, and o2o::query.

                                      {
  ResultSet* rset = NULL;
  string query = "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
    " d.VALUE_NUMBER, '5' NOMINAL_VALUE , d.VALUE_TIMESTAMP "
    "FROM "+ getEEAccount()+".FWWIENERMARATHONCHANNEL_LV d "
    " JOIN "+ getEEAccount()+".EE_LV_MAPPING h on "
    " h.DPID = d.DPID join channelview cv on cv.logic_id=h.logic_id WHERE cv.maps_to = cv.name and dpe_name='MEASUREMENTSENSEVOLTAGE' "; 
  try {
    m_readStmt->setSQL(query);
    rset = m_readStmt->executeQuery();
  }
  catch (SQLException e) {
    throw(std::runtime_error("RunDCSLVDat::getEndcapRset():  " + e.getMessage() + " " + query));
  }
  return rset;
}
float RunDCSLVDat::getLV ( ) const [inline]
float RunDCSLVDat::getLVNominal ( ) const [inline]
int RunDCSLVDat::getStatus ( void  ) const [inline]

Definition at line 39 of file RunDCSLVDat.h.

References m_status.

Referenced by popcon::EcalDCSHandler::printLVDataSet(), and popcon::EcalDCSHandler::updateLV().

{ return m_status; }
std::string RunDCSLVDat::getTable ( ) [inline, virtual]

Implements IDataItem.

Definition at line 31 of file RunDCSLVDat.h.

{ return ""; }
int RunDCSLVDat::getTimeStatus ( ) [inline]

Definition at line 40 of file RunDCSLVDat.h.

References m_tstatus.

{return m_tstatus;}
int RunDCSLVDat::nowMicroseconds ( ) [private]

Definition at line 123 of file RunDCSLVDat.cc.

References Tm::microsTime(), and Tm::setToCurrentGMTime().

                                  {
  Tm t_now_gmt;
  
  t_now_gmt.setToCurrentGMTime();
  int t_now_gmt_micros = t_now_gmt.microsTime();
  return t_now_gmt_micros;
}
void RunDCSLVDat::prepareWrite ( ) throw (std::runtime_error) [private, virtual]

Implements IDataItem.

Definition at line 32 of file RunDCSLVDat.cc.

{


}
void RunDCSLVDat::setLV ( float  t) [inline]

Definition at line 34 of file RunDCSLVDat.h.

References m_lv, and matplotRender::t.

{ m_lv = t; }
void RunDCSLVDat::setLVNominal ( float  t) [inline]

Definition at line 36 of file RunDCSLVDat.h.

References m_lvnom, and matplotRender::t.

{ m_lvnom = t; }
void RunDCSLVDat::setStatus ( int  t) [inline]

Definition at line 35 of file RunDCSLVDat.h.

References m_status, and matplotRender::t.

Referenced by setStatusForBarrel(), and setStatusForEndcaps().

{ m_status = t; }
void RunDCSLVDat::setStatusForBarrel ( RunDCSLVDat dat,
Tm  sinceTm 
) [private]

Definition at line 132 of file RunDCSLVDat.cc.

References getLV(), getLVNominal(), Tm::microsTime(), query::result, setStatus(), and setTimeStatus().

                                                                 {
  int t_now_gmt_micros = nowMicroseconds();

  if (fabs(dat.getLV() - dat.getLVNominal())*1000 > maxLVDifferenceEB) {
    dat.setStatus(LVNOTNOMINAL);
  }
  if (dat.getLV()*1000 < minLV) {
    dat.setStatus(LVOFF);
  }

  int result=0;
  int d= ((int)t_now_gmt_micros - (int)sinceTm.microsTime()) ;
  if (d> maxDifference) {
    result= -d/1000000 ;
  }
  dat.setTimeStatus(result);


}
void RunDCSLVDat::setStatusForEndcaps ( RunDCSLVDat dat,
Tm  sinceTm 
) [private]

Definition at line 152 of file RunDCSLVDat.cc.

References getLV(), getLVNominal(), Tm::microsTime(), query::result, setStatus(), and setTimeStatus().

                                                                   {
  int t_now_gmt_micros = nowMicroseconds();

  if (fabs(dat.getLV() - dat.getLVNominal())*1000 > maxLVDifferenceEE) {
    dat.setStatus(LVNOTNOMINAL);
  }
  if (dat.getLV()*1000 < minLV) {
    dat.setStatus(LVOFF);
  }

  int result=0;
  int d= ((int)t_now_gmt_micros - (int)sinceTm.microsTime()) ;
  if (d> maxDifference) {
    result= -d/1000000 ;
  }
  dat.setTimeStatus(result);


}
void RunDCSLVDat::setTimeStatus ( int  t) [inline]

Definition at line 41 of file RunDCSLVDat.h.

References m_tstatus, and matplotRender::t.

Referenced by setStatusForBarrel(), and setStatusForEndcaps().

void RunDCSLVDat::writeDB ( const EcalLogicID ecid,
const RunDCSLVDat item,
RunIOV iov 
) throw (std::runtime_error) [private]

Definition at line 41 of file RunDCSLVDat.cc.

{
}

Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 26 of file RunDCSLVDat.h.


Member Data Documentation

const int RunDCSLVDat::LVNOTNOMINAL = 1 [static]

Definition at line 23 of file RunDCSLVDat.h.

Referenced by popcon::EcalDCSHandler::updateLV().

const int RunDCSLVDat::LVOFF = 2 [static]

Definition at line 24 of file RunDCSLVDat.h.

Referenced by popcon::EcalDCSHandler::updateLV().

float RunDCSLVDat::m_lv [private]

Definition at line 63 of file RunDCSLVDat.h.

Referenced by getLV(), and setLV().

float RunDCSLVDat::m_lvnom [private]

Definition at line 64 of file RunDCSLVDat.h.

Referenced by getLVNominal(), and setLVNominal().

int RunDCSLVDat::m_status [private]

Definition at line 65 of file RunDCSLVDat.h.

Referenced by getStatus(), and setStatus().

int RunDCSLVDat::m_tstatus [private]

Definition at line 66 of file RunDCSLVDat.h.

Referenced by getTimeStatus(), and setTimeStatus().

const int RunDCSLVDat::maxDifference = 30*60*1000000 [static]

Definition at line 18 of file RunDCSLVDat.h.

const int RunDCSLVDat::maxLVDifferenceEB = 1000 [static]

Definition at line 19 of file RunDCSLVDat.h.

const int RunDCSLVDat::maxLVDifferenceEE = 1000 [static]

Definition at line 20 of file RunDCSLVDat.h.

const int RunDCSLVDat::minLV = 2000 [static]

Definition at line 21 of file RunDCSLVDat.h.