CMS 3D CMS Logo

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

RunDCSMagnetDat Class Reference

#include <RunDCSMagnetDat.h>

Inheritance diagram for RunDCSMagnetDat:
IDataItem IDBObject

List of all members.

Public Types

typedef oracle::occi::ResultSet ResultSet

Public Member Functions

std::string getMagnetAccount ()
float getMagnetCurrent () const
std::string getTable ()
Tm getTime () const
 RunDCSMagnetDat ()
void setMagnetCurrent (float t)
void setTime (Tm start)
 ~RunDCSMagnetDat ()

Private Member Functions

void fetchData (std::map< EcalLogicID, RunDCSMagnetDat > *fillMap, RunIOV *iov) throw (std::runtime_error)
void fetchLastData (std::map< EcalLogicID, RunDCSMagnetDat > *fillMap) throw (std::runtime_error)
void fillTheMap (ResultSet *, std::map< EcalLogicID, RunDCSMagnetDat > *)
ResultSetgetMagnetRset ()
int nowMicroseconds ()
void prepareWrite () throw (std::runtime_error)
void writeDB (const EcalLogicID *ecid, const RunDCSMagnetDat *item, RunIOV *iov) throw (std::runtime_error)

Private Attributes

float m_current
Tm m_time

Friends

class EcalCondDBInterface

Detailed Description

Definition at line 15 of file RunDCSMagnetDat.h.


Member Typedef Documentation

Definition at line 17 of file RunDCSMagnetDat.h.


Constructor & Destructor Documentation

RunDCSMagnetDat::RunDCSMagnetDat ( )

Definition at line 15 of file RunDCSMagnetDat.cc.

References NULL.

RunDCSMagnetDat::~RunDCSMagnetDat ( )

Definition at line 28 of file RunDCSMagnetDat.cc.

{
}

Member Function Documentation

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

Definition at line 355 of file RunDCSHVDat.cc.

References alignCSCRings::e, edm::pset::fillMap(), and AlCaHLTBitMon_ParallelJobs::p.

{
  this->checkConnection();

  fillMap->clear();

  try {
    std::pair< EcalLogicID, RunDCSHVDat > p;
    RunDCSHVDat dat;

    ResultSet* rset = getBarrelRset();
    
    fillTheMap(rset, fillMap);
    rset = getEndcapAnodeRset();
    
    fillTheMap(rset, fillMap);
    rset = getEndcapDynodeRset();
    
    fillTheMap(rset, fillMap);
  } 
  catch (SQLException &e) {
    throw(std::runtime_error("RunDCSHVDat::fetchData():  "+e.getMessage()));
  }
}
void RunDCSMagnetDat::fillTheMap ( ResultSet ,
std::map< EcalLogicID, RunDCSMagnetDat > *   
) [private]

Definition at line 204 of file RunDCSHVDat.cc.

References DateHandler::dateToTm(), alignCSCRings::e, AlCaHLTBitMon_ParallelJobs::p, RunDCSHVDat::setHV(), RunDCSHVDat::setHVNominal(), and RunDCSHVDat::setStatus().

                                                                         {

  // method for last value queries 

  std::pair< EcalLogicID, RunDCSHVDat > p;
  RunDCSHVDat dat;
  DateHandler dh(m_env, m_conn);

  try {
    while(rset->next()) {
      p.first = EcalLogicID( rset->getString(1),     // name
                             rset->getInt(2),        // logic_id
                             rset->getInt(3),        // id1
                             rset->getInt(4),        // id2
                             rset->getInt(5),        // id3
                             rset->getString(6));    // maps_to
      
      dat.setHV(        rset->getFloat(7) );
      dat.setHVNominal( rset->getFloat(8) );
      Date sinceDate = rset->getDate(9);
      Tm  sinceTm = dh.dateToTm( sinceDate );
      dat.setStatus(0);
      if (p.first.getName() == "EB_HV_channel") {
        setStatusForBarrel(dat, sinceTm);      
      } else {
        setStatusForEndcaps(dat, sinceTm);      
      }
      p.second = dat;
      fillMap->insert(p);
    } 
  }
  catch (SQLException &e) {
    throw(std::runtime_error("RunDCSHVDat::fetchData():  "+e.getMessage()));
  }
}
std::string RunDCSMagnetDat::getMagnetAccount ( ) [inline]

Definition at line 25 of file RunDCSMagnetDat.h.

{ return "CMS_DCS_ENV_PVSS_COND"; }
float RunDCSMagnetDat::getMagnetCurrent ( ) const [inline]
ResultSet * RunDCSMagnetDat::getMagnetRset ( ) [private]

Definition at line 73 of file RunDCSMagnetDat.cc.

References gather_cfg::cout, alignCSCRings::e, NULL, and o2o::query.

                                          {

  DateHandler dh(m_env, m_conn);

  ResultSet* rset = NULL;
  string query="SELECT c.name, c.logic_id, c.id1, c.id2, c.id3, c.maps_to , v.value_number, v.change_date from "+ getMagnetAccount()+
    ".CMSFWMAGNET_LV v, channelview c where v.dpe_name= 'CURRENT' and  c.name=maps_to and c.name='EB' " ;
  try {

    std::cout<<"query:"<<query<<std::endl;

    m_readStmt->setSQL(query);
    rset = m_readStmt->executeQuery();
  }
  catch (SQLException e) {
    throw(std::runtime_error("RunDCSMagnetDat::getBarrelRset():  " + e.getMessage() + " " + query));
  }
  return rset;
}
std::string RunDCSMagnetDat::getTable ( ) [inline, virtual]

Implements IDataItem.

Definition at line 24 of file RunDCSMagnetDat.h.

{ return "CMSFWMAGNET_LV"; }
Tm RunDCSMagnetDat::getTime ( void  ) const

Definition at line 37 of file RunDCSMagnetDat.cc.

{
  return m_time;
}
int RunDCSMagnetDat::nowMicroseconds ( ) [private]

Definition at line 135 of file RunDCSMagnetDat.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 RunDCSMagnetDat::prepareWrite ( ) throw (std::runtime_error) [private, virtual]

Implements IDataItem.

Definition at line 46 of file RunDCSMagnetDat.cc.

{


}
void RunDCSMagnetDat::setMagnetCurrent ( float  t) [inline]

Definition at line 26 of file RunDCSMagnetDat.h.

References m_current, and lumiQTWidget::t.

{ m_current = t; }
void RunDCSMagnetDat::setTime ( Tm  start)

Definition at line 32 of file RunDCSMagnetDat.cc.

{
    m_time = start;
}
void RunDCSMagnetDat::writeDB ( const EcalLogicID ecid,
const RunDCSMagnetDat item,
RunIOV iov 
) throw (std::runtime_error) [private]

Definition at line 55 of file RunDCSMagnetDat.cc.

{
}

Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 19 of file RunDCSMagnetDat.h.


Member Data Documentation

float RunDCSMagnetDat::m_current [private]

Definition at line 53 of file RunDCSMagnetDat.h.

Referenced by getMagnetCurrent(), and setMagnetCurrent().

Definition at line 54 of file RunDCSMagnetDat.h.