CMS 3D CMS Logo

ODLaserConfig Class Reference

#include <OnlineDB/EcalCondDB/interface/ODLaserConfig.h>

Inheritance diagram for ODLaserConfig:

IODConfig IDBObject

List of all members.

Public Member Functions

int fetchNextId () throw (std::runtime_error)
int getChannelMask () const
int getDebug () const
int getDummy () const
int getEMTCNone () const
int getEMTCSlotId () const
int getEMTCTTCIn () const
int getFilter () const
int getFPMode () const
std::string getHalAddressTableFile () const
std::string getHalModuleFile () const
std::string getHalStaticTableFile () const
int getId () const
std::string getLaserControlHost () const
int getLaserControlOn () const
int getLaserControlPort () const
int getLaserPhase () const
std::string getLaserTag () const
std::string getLocalOutputFile () const
std::string getMatacqAcquisitionMode () const
int getMatacqBaseAddress () const
int getMatacqFedId () const
std::string getMatacqMode () const
int getMatacqNone () const
std::string getMatacqSerialNumber () const
std::string getMaxSamplesForDaq () const
int getOpticalSwitch () const
std::string getPedestalFile () const
int getPedestalRunEventCount () const
int getPostTrig () const
int getPower () const
int getRawDataMode () const
std::string getTable ()
int getUseBuffer () const
int getWaveLength () const
int getWTE2LaserDelay () const
 ODLaserConfig ()
void setChannelMask (int x)
void setDebug (int x)
void setDummy (int x)
void setEMTCNone (int x)
void setEMTCSlotId (int x)
void setEMTCTTCIn (int x)
void setFilter (int x)
void setFPMode (int x)
void setHalAddressTableFile (std::string x)
void setHalModuleFile (std::string x)
void setHalStaticTableFile (std::string x)
void setId (int id)
void setLaserControlHost (std::string x)
void setLaserControlOn (int x)
void setLaserControlPort (int x)
void setLaserPhase (int x)
void setLaserTag (std::string x)
void setLocalOutputFile (std::string x)
void setMatacqAcquisitionMode (std::string x)
void setMatacqBaseAddress (int x)
void setMatacqFedId (int x)
void setMatacqMode (std::string x)
void setMatacqNone (int x)
void setMatacqSerialNumber (std::string x)
void setMaxSamplesForDaq (std::string x)
void setOpticalSwitch (int x)
void setParameters (std::map< string, string > my_keys_map)
void setPedestalFile (std::string x)
void setPedestalRunEventCount (int x)
void setPostTrig (int x)
void setPower (int x)
void setRawDataMode (int x)
void setUseBuffer (int x)
void setWaveLength (int x)
void setWTE2LaserDelay (int x)
 ~ODLaserConfig ()

Private Member Functions

void clear ()
void fetchData (ODLaserConfig *result) throw (std::runtime_error)
int fetchID () throw (std::runtime_error)
void prepareWrite () throw (std::runtime_error)
void writeDB () throw (std::runtime_error)

Private Attributes

std::string m_aqmode
int m_chan_mask
int m_debug
int m_dummy
int m_emtc_1
int m_emtc_2
int m_emtc_3
int m_emtc_4
int m_emtc_5
int m_filter
int m_fp_mode
std::string m_hal_add_file
std::string m_hal_mod_file
std::string m_hal_tab_file
int m_ID
std::string m_laser_tag
std::string m_laserhost
int m_laserport
std::string m_mode
int m_mq_base
int m_mq_fed
std::string m_mq_file
int m_mq_none
int m_on
int m_ped_count
std::string m_ped_file
int m_post_trig
int m_power
int m_raw_mode
std::string m_samples
std::string m_serial
int m_switch
int m_use_buffer
int m_wave

Friends

class EcalCondDBInterface


Detailed Description

Definition at line 9 of file ODLaserConfig.h.


Constructor & Destructor Documentation

ODLaserConfig::ODLaserConfig (  ) 

Definition at line 10 of file ODLaserConfig.cc.

References clear(), IODConfig::m_config_tag, IDBObject::m_conn, IDBObject::m_env, m_ID, IODConfig::m_readStmt, IODConfig::m_writeStmt, and NULL.

00011 {
00012   m_env = NULL;
00013   m_conn = NULL;
00014   m_writeStmt = NULL;
00015   m_readStmt = NULL;
00016   m_config_tag="";
00017 
00018    m_ID=0;
00019    clear();
00020 }

ODLaserConfig::~ODLaserConfig (  ) 

Definition at line 66 of file ODLaserConfig.cc.

00067 {
00068 }


Member Function Documentation

void ODLaserConfig::clear ( void   )  [private]

Definition at line 22 of file ODLaserConfig.cc.

References m_aqmode, m_chan_mask, m_debug, m_dummy, m_emtc_1, m_emtc_2, m_emtc_3, m_emtc_4, m_emtc_5, m_filter, m_fp_mode, m_hal_add_file, m_hal_mod_file, m_hal_tab_file, m_laser_tag, m_laserhost, m_laserport, m_mode, m_mq_base, m_mq_file, m_mq_none, m_on, m_ped_count, m_ped_file, m_post_trig, m_power, m_raw_mode, m_samples, m_serial, m_switch, m_use_buffer, and m_wave.

Referenced by ODLaserConfig().

00022                          {
00023 
00024 
00025   m_debug=0;
00026   m_dummy=0;
00027 
00028   // emtc 
00029    m_emtc_1=0;
00030    m_emtc_2=0;
00031    m_emtc_3=0;
00032    m_emtc_4=0;
00033    m_emtc_5=0;
00034 
00035   // laser
00036   m_wave=0;
00037   m_power=0;
00038   m_switch=0;
00039   m_filter=0;
00040   m_on=0;
00041   m_laserhost="";
00042   m_laserport=0;
00043 
00044   // mataq
00045    m_mq_base=0;
00046    m_mq_none=0;
00047    m_mode="" ;
00048    m_chan_mask=0;
00049    m_samples="";
00050    m_ped_file="";
00051    m_use_buffer=0;
00052    m_post_trig=0;
00053    m_fp_mode=0;
00054    m_hal_mod_file="";
00055    m_hal_add_file="";
00056    m_hal_tab_file="";
00057    m_serial="";
00058    m_ped_count=0;
00059    m_raw_mode=0;
00060    m_aqmode="";
00061    m_mq_file="";
00062    m_laser_tag="";
00063 
00064 }

void ODLaserConfig::fetchData ( ODLaserConfig result  )  throw (std::runtime_error) [private]

Definition at line 258 of file ODLaserConfig.cc.

References IDBObject::checkConnection(), e, IODConfig::m_readStmt, and HLT_VtxMuL3::result.

Referenced by fetchID().

00260 {
00261   this->checkConnection();
00262   result->clear();
00263   if(result->getId()==0 && (result->getConfigTag()=="") ){
00264     throw(runtime_error("ODLaserConfig::fetchData(): no Id defined for this ODLaserConfig "));
00265   }
00266 
00267   try {
00268 
00269     m_readStmt->setSQL("SELECT * "
00270                        "FROM ECAL_Laser_CONFIGURATION d "
00271                        " where ( laser_configuration_id = :1  or laser_tag=:2 )" );
00272     m_readStmt->setInt(1, result->getId());
00273     m_readStmt->setString(2, result->getConfigTag());
00274    ResultSet* rset = m_readStmt->executeQuery();
00275 
00276     rset->next();
00277 
00278     
00279     // start from 3 because of select * 
00280 
00281     result->setId(rset->getInt(1));
00282     result->setConfigTag(rset->getString(2));
00283 
00284     result->setDebug(rset->getInt(  3  ));
00285     result->setDummy(rset->getInt(  4  ));
00286     result->setMatacqBaseAddress(rset->getInt( 5   ));
00287     result->setMatacqNone(rset->getInt(  6  ));
00288     result->setMatacqMode(rset->getString(7    ));
00289     result->setChannelMask(rset->getInt(  8  ));
00290     result->setMaxSamplesForDaq(rset->getString( 9   ));
00291     result->setMatacqFedId(rset->getInt( 10   ));
00292     result->setPedestalFile(rset->getString( 11   ));
00293     result->setUseBuffer(rset->getInt(   12 ));
00294     result->setPostTrig(rset->getInt(   13 ));
00295     result->setFPMode(rset->getInt(   14 ));
00296     result->setHalModuleFile(rset->getString( 15   ));
00297     result->setHalAddressTableFile(rset->getString( 16   ));
00298     result->setHalStaticTableFile(rset->getString(  17  ));
00299     result->setMatacqSerialNumber(rset->getString(  18  ));
00300     result->setPedestalRunEventCount(rset->getInt(  19  ));
00301     result->setRawDataMode(rset->getInt( 20   ));
00302     result->setMatacqAcquisitionMode(rset->getString( 21   ));
00303     result->setLocalOutputFile(rset->getString(  22  ));
00304     result->setEMTCNone(rset->getInt(  23  ));
00305     result->setWTE2LaserDelay(rset->getInt( 24   ));
00306     result->setLaserPhase(rset->getInt(  25  ));
00307     result->setEMTCTTCIn(rset->getInt(  26  ));
00308     result->setEMTCSlotId(rset->getInt( 27   ));
00309     // laser
00310     result->setWaveLength(rset->getInt( 28   ));
00311     result->setPower(rset->getInt(  29  ));
00312     result->setOpticalSwitch(rset->getInt( 30   ));
00313     result->setFilter(rset->getInt(  31  ));
00314     result->setLaserControlOn(rset->getInt( 32   ));
00315     result->setLaserControlHost(rset->getString( 33   ));
00316     result->setLaserControlPort(rset->getInt( 34   ));
00317     result->setLaserTag(rset->getString( 35   ));
00318   
00319   } catch (SQLException &e) {
00320     throw(runtime_error("ODLaserConfig::fetchData():  "+e.getMessage()));
00321   }
00322 }

int ODLaserConfig::fetchID (  )  throw (std::runtime_error) [private]

Definition at line 324 of file ODLaserConfig.cc.

References IDBObject::checkConnection(), e, fetchData(), getLaserTag(), IDBObject::m_conn, and m_ID.

00325 {
00326   // Return from memory if available
00327   if (m_ID!=0) {
00328     return m_ID;
00329   }
00330 
00331   this->checkConnection();
00332 
00333   try {
00334     Statement* stmt = m_conn->createStatement();
00335     stmt->setSQL("SELECT laser_configuration_id FROM ecal_laser_configuration "
00336                  "WHERE laser_tag=:laser_tag ");
00337     stmt->setString(1, getLaserTag());
00338 
00339     ResultSet* rset = stmt->executeQuery();
00340 
00341     if (rset->next()) {
00342       m_ID = rset->getInt(1);
00343     } else {
00344       m_ID = 0;
00345     }
00346     m_conn->terminateStatement(stmt);
00347   } catch (SQLException &e) {
00348     throw(runtime_error("ODLaserConfig::fetchID:  "+e.getMessage()));
00349   }
00350 
00351   fetchData(this);
00352 
00353   return m_ID;
00354 }

int ODLaserConfig::fetchNextId (  )  throw (std::runtime_error)

Definition at line 118 of file ODLaserConfig.cc.

References IDBObject::checkConnection(), e, IDBObject::m_conn, IODConfig::m_readStmt, and HLT_VtxMuL3::result.

Referenced by prepareWrite().

00118                                                         {
00119 
00120   int result=0;
00121   try {
00122     this->checkConnection();
00123 
00124     m_readStmt = m_conn->createStatement(); 
00125     m_readStmt->setSQL("select ecal_laser_config_sq.NextVal from dual");
00126     ResultSet* rset = m_readStmt->executeQuery();
00127     while (rset->next ()){
00128       result= rset->getInt(1);
00129     }
00130     m_conn->terminateStatement(m_readStmt);
00131     return result; 
00132 
00133   } catch (SQLException &e) {
00134     throw(runtime_error("ODLaserConfig::fetchNextId():  "+e.getMessage()));
00135   }
00136 
00137 }

int ODLaserConfig::getChannelMask (  )  const [inline]

Definition at line 33 of file ODLaserConfig.h.

References m_chan_mask.

00033 { return m_chan_mask; }

int ODLaserConfig::getDebug (  )  const [inline]

Definition at line 22 of file ODLaserConfig.h.

References m_debug.

00022 { return m_debug; }

int ODLaserConfig::getDummy (  )  const [inline]

Definition at line 24 of file ODLaserConfig.h.

References m_dummy.

00024 { return m_dummy; }

int ODLaserConfig::getEMTCNone (  )  const [inline]

Definition at line 72 of file ODLaserConfig.h.

References m_emtc_1.

00072 { return m_emtc_1; }

int ODLaserConfig::getEMTCSlotId (  )  const [inline]

Definition at line 80 of file ODLaserConfig.h.

References m_emtc_5.

00080 { return m_emtc_5; }

int ODLaserConfig::getEMTCTTCIn (  )  const [inline]

Definition at line 78 of file ODLaserConfig.h.

References m_emtc_4.

00078 { return m_emtc_4; }

int ODLaserConfig::getFilter (  )  const [inline]

Definition at line 96 of file ODLaserConfig.h.

References m_filter.

00096 { return m_filter; }

int ODLaserConfig::getFPMode (  )  const [inline]

Definition at line 45 of file ODLaserConfig.h.

References m_fp_mode.

00045 { return m_fp_mode; }

std::string ODLaserConfig::getHalAddressTableFile (  )  const [inline]

Definition at line 50 of file ODLaserConfig.h.

References m_hal_add_file.

00050 { return m_hal_add_file; }

std::string ODLaserConfig::getHalModuleFile (  )  const [inline]

Definition at line 47 of file ODLaserConfig.h.

References m_hal_mod_file.

00047 { return m_hal_mod_file; }

std::string ODLaserConfig::getHalStaticTableFile (  )  const [inline]

Definition at line 53 of file ODLaserConfig.h.

References m_hal_tab_file.

00053 { return m_hal_tab_file; }

int ODLaserConfig::getId (  )  const [inline]

Definition at line 19 of file ODLaserConfig.h.

References m_ID.

00019 { return m_ID; }

std::string ODLaserConfig::getLaserControlHost (  )  const [inline]

Definition at line 102 of file ODLaserConfig.h.

References m_laserhost.

00102 { return m_laserhost; }

int ODLaserConfig::getLaserControlOn (  )  const [inline]

Definition at line 99 of file ODLaserConfig.h.

References m_on.

00099 { return m_on; }

int ODLaserConfig::getLaserControlPort (  )  const [inline]

Definition at line 105 of file ODLaserConfig.h.

References m_laserport.

00105 { return m_laserport; }

int ODLaserConfig::getLaserPhase (  )  const [inline]

Definition at line 76 of file ODLaserConfig.h.

References m_emtc_3.

00076 { return m_emtc_3; }

std::string ODLaserConfig::getLaserTag (  )  const [inline]

Definition at line 110 of file ODLaserConfig.h.

References m_laser_tag.

Referenced by fetchID().

00110 { return m_laser_tag ; }

std::string ODLaserConfig::getLocalOutputFile (  )  const [inline]

Definition at line 68 of file ODLaserConfig.h.

References m_mq_file.

00068 { return m_mq_file; }

std::string ODLaserConfig::getMatacqAcquisitionMode (  )  const [inline]

Definition at line 65 of file ODLaserConfig.h.

References m_aqmode.

00065 { return m_aqmode; }

int ODLaserConfig::getMatacqBaseAddress (  )  const [inline]

Definition at line 27 of file ODLaserConfig.h.

References m_mq_base.

00027 { return m_mq_base; }

int ODLaserConfig::getMatacqFedId (  )  const [inline]

Definition at line 37 of file ODLaserConfig.h.

References m_mq_fed.

00037 { return m_mq_fed; }

std::string ODLaserConfig::getMatacqMode (  )  const [inline]

Definition at line 31 of file ODLaserConfig.h.

References m_mode.

00031 { return m_mode; }

int ODLaserConfig::getMatacqNone (  )  const [inline]

Definition at line 29 of file ODLaserConfig.h.

References m_mq_none.

00029 { return m_mq_none; }

std::string ODLaserConfig::getMatacqSerialNumber (  )  const [inline]

Definition at line 56 of file ODLaserConfig.h.

References m_serial.

00056 { return m_serial; }

std::string ODLaserConfig::getMaxSamplesForDaq (  )  const [inline]

Definition at line 35 of file ODLaserConfig.h.

References m_samples.

00035 { return m_samples; }

int ODLaserConfig::getOpticalSwitch (  )  const [inline]

Definition at line 93 of file ODLaserConfig.h.

References m_switch.

00093 { return m_switch; }

std::string ODLaserConfig::getPedestalFile (  )  const [inline]

Definition at line 39 of file ODLaserConfig.h.

References m_ped_file.

00039 { return m_ped_file; }

int ODLaserConfig::getPedestalRunEventCount (  )  const [inline]

Definition at line 59 of file ODLaserConfig.h.

References m_ped_count.

00059 { return m_ped_count; }

int ODLaserConfig::getPostTrig (  )  const [inline]

Definition at line 43 of file ODLaserConfig.h.

References m_post_trig.

00043 { return m_post_trig; }

int ODLaserConfig::getPower (  )  const [inline]

Definition at line 90 of file ODLaserConfig.h.

References m_power.

00090 { return m_power; }

int ODLaserConfig::getRawDataMode (  )  const [inline]

Definition at line 62 of file ODLaserConfig.h.

References m_raw_mode.

00062 { return m_raw_mode; }

std::string ODLaserConfig::getTable (  )  [inline, virtual]

Implements IODConfig.

Definition at line 16 of file ODLaserConfig.h.

00016 { return "ECAL_Laser_CONFIGURATION"; }

int ODLaserConfig::getUseBuffer (  )  const [inline]

Definition at line 41 of file ODLaserConfig.h.

References m_use_buffer.

00041 { return m_use_buffer; }

int ODLaserConfig::getWaveLength (  )  const [inline]

Definition at line 87 of file ODLaserConfig.h.

References m_wave.

00087 { return m_wave; }

int ODLaserConfig::getWTE2LaserDelay (  )  const [inline]

Definition at line 74 of file ODLaserConfig.h.

References m_emtc_2.

00074 { return m_emtc_2; }

void ODLaserConfig::prepareWrite (  )  throw (std::runtime_error) [private, virtual]

Implements IODConfig.

Definition at line 140 of file ODLaserConfig.cc.

References IDBObject::checkConnection(), e, fetchNextId(), IDBObject::m_conn, m_ID, and IODConfig::m_writeStmt.

00142 {
00143   this->checkConnection();
00144   int next_id=fetchNextId();
00145 
00146 
00147   try {
00148     m_writeStmt = m_conn->createStatement();
00149     m_writeStmt->setSQL("INSERT INTO ECAL_Laser_CONFIGURATION ( laser_configuration_id, laser_tag "
00150                         ", laser_DEBUG "
00151                         ", DUMMY "
00152                         ", MATACQ_BASE_ADDRESS " 
00153                         ", MATACQ_NONE "
00154                         ", matacq_mode "
00155                         ", channel_Mask "
00156                         ", max_Samples_For_Daq "
00157                         ", maTACQ_FED_ID "
00158                         ", pedestal_File "
00159                         ", use_Buffer "
00160                         ", postTrig "
00161                         ", fp_Mode "
00162                         ", hal_Module_File " 
00163                         ", hal_Address_Table_File "
00164                         ", hal_Static_Table_File "
00165                         ", matacq_Serial_Number "
00166                         ", pedestal_Run_Event_Count " 
00167                         ", raw_Data_Mode "
00168                         ", ACQUISITION_MODE " 
00169                         ", LOCAL_OUTPUT_FILE " 
00170                         ", emtc_none "
00171                         ", wte2_laser_delay " 
00172                         ", laser_phase "
00173                         ", emtc_ttc_in "
00174                         ", emtc_slot_id " 
00175                         ", WAVELENGTH "
00176                         ", POWER_SETTING "
00177                         ", OPTICAL_SWITCH "
00178                         ", FILTER "
00179                         ", LASER_CONTROL_ON " 
00180                         ", LASER_CONTROL_HOST " 
00181                         ", LASER_CONTROL_PORT "
00182                         ", LASER_TAG2 ) "
00183                         "VALUES (  :1, :2, :3, :4, :5, :6, :7, :8, :9, :10, "
00184                         ":11, :12, :13, :14, :15, :16, :17, :18, :19, :20,  "
00185                         ":21, :22, :23, :24, :25, :26, :27, :28, :29, :30,  "
00186                         ":31, :32, :33, :34, :35 )");
00187     m_writeStmt->setInt(1, next_id);
00188     m_ID=next_id;
00189   } catch (SQLException &e) {
00190     throw(runtime_error("ODLaserConfig::prepareWrite():  "+e.getMessage()));
00191   }
00192 }

void ODLaserConfig::setChannelMask ( int  x  )  [inline]

Definition at line 32 of file ODLaserConfig.h.

References m_chan_mask.

Referenced by setParameters().

00032 { m_chan_mask = x; }

void ODLaserConfig::setDebug ( int  x  )  [inline]

Definition at line 21 of file ODLaserConfig.h.

References m_debug.

Referenced by setParameters().

00021 { m_debug = x; }

void ODLaserConfig::setDummy ( int  x  )  [inline]

Definition at line 23 of file ODLaserConfig.h.

References m_dummy.

Referenced by setParameters().

00023 { m_dummy = x; }

void ODLaserConfig::setEMTCNone ( int  x  )  [inline]

Definition at line 71 of file ODLaserConfig.h.

References m_emtc_1.

Referenced by setParameters().

00071 { m_emtc_1 = x; }

void ODLaserConfig::setEMTCSlotId ( int  x  )  [inline]

Definition at line 79 of file ODLaserConfig.h.

References m_emtc_5.

Referenced by setParameters().

00079 { m_emtc_5 = x; }

void ODLaserConfig::setEMTCTTCIn ( int  x  )  [inline]

Definition at line 77 of file ODLaserConfig.h.

References m_emtc_4.

Referenced by setParameters().

00077 { m_emtc_4 = x; }

void ODLaserConfig::setFilter ( int  x  )  [inline]

Definition at line 95 of file ODLaserConfig.h.

References m_filter.

Referenced by setParameters().

00095 { m_filter = x; }

void ODLaserConfig::setFPMode ( int  x  )  [inline]

Definition at line 44 of file ODLaserConfig.h.

References m_fp_mode.

Referenced by setParameters().

00044 { m_fp_mode = x; }

void ODLaserConfig::setHalAddressTableFile ( std::string  x  )  [inline]

Definition at line 49 of file ODLaserConfig.h.

References m_hal_add_file.

Referenced by setParameters().

00049 { m_hal_add_file = x; }

void ODLaserConfig::setHalModuleFile ( std::string  x  )  [inline]

Definition at line 46 of file ODLaserConfig.h.

References m_hal_mod_file.

Referenced by setParameters().

00046 { m_hal_mod_file = x; }

void ODLaserConfig::setHalStaticTableFile ( std::string  x  )  [inline]

Definition at line 52 of file ODLaserConfig.h.

References m_hal_tab_file.

Referenced by setParameters().

00052 { m_hal_tab_file = x; }

void ODLaserConfig::setId ( int  id  )  [inline]

Definition at line 18 of file ODLaserConfig.h.

References m_ID.

00018 { m_ID = id; }

void ODLaserConfig::setLaserControlHost ( std::string  x  )  [inline]

Definition at line 101 of file ODLaserConfig.h.

References m_laserhost.

Referenced by setParameters().

00101 { m_laserhost = x; }

void ODLaserConfig::setLaserControlOn ( int  x  )  [inline]

Definition at line 98 of file ODLaserConfig.h.

References m_on.

Referenced by setParameters().

00098 { m_on = x; }

void ODLaserConfig::setLaserControlPort ( int  x  )  [inline]

Definition at line 104 of file ODLaserConfig.h.

References m_laserport.

Referenced by setParameters().

00104 { m_laserport = x; }

void ODLaserConfig::setLaserPhase ( int  x  )  [inline]

Definition at line 75 of file ODLaserConfig.h.

References m_emtc_3.

Referenced by setParameters().

00075 { m_emtc_3 = x; }

void ODLaserConfig::setLaserTag ( std::string  x  )  [inline]

Definition at line 109 of file ODLaserConfig.h.

References m_laser_tag.

00109 { m_laser_tag = x; }

void ODLaserConfig::setLocalOutputFile ( std::string  x  )  [inline]

Definition at line 67 of file ODLaserConfig.h.

References m_mq_file.

Referenced by setParameters().

00067 { m_mq_file = x; }

void ODLaserConfig::setMatacqAcquisitionMode ( std::string  x  )  [inline]

Definition at line 64 of file ODLaserConfig.h.

References m_aqmode.

Referenced by setParameters().

00064 { m_aqmode = x; }

void ODLaserConfig::setMatacqBaseAddress ( int  x  )  [inline]

Definition at line 26 of file ODLaserConfig.h.

References m_mq_base.

Referenced by setParameters().

00026 { m_mq_base = x; }

void ODLaserConfig::setMatacqFedId ( int  x  )  [inline]

Definition at line 36 of file ODLaserConfig.h.

References m_mq_fed.

Referenced by setParameters().

00036 { m_mq_fed = x; }

void ODLaserConfig::setMatacqMode ( std::string  x  )  [inline]

Definition at line 30 of file ODLaserConfig.h.

References m_mode.

Referenced by setParameters().

00030 { m_mode = x; }

void ODLaserConfig::setMatacqNone ( int  x  )  [inline]

Definition at line 28 of file ODLaserConfig.h.

References m_mq_none.

Referenced by setParameters().

00028 { m_mq_none = x; }

void ODLaserConfig::setMatacqSerialNumber ( std::string  x  )  [inline]

Definition at line 55 of file ODLaserConfig.h.

References m_serial.

Referenced by setParameters().

00055 { m_serial = x; }

void ODLaserConfig::setMaxSamplesForDaq ( std::string  x  )  [inline]

Definition at line 34 of file ODLaserConfig.h.

References m_samples.

Referenced by setParameters().

00034 { m_samples = x; }

void ODLaserConfig::setOpticalSwitch ( int  x  )  [inline]

Definition at line 92 of file ODLaserConfig.h.

References m_switch.

Referenced by setParameters().

00092 { m_switch = x; }

void ODLaserConfig::setParameters ( std::map< string, string >  my_keys_map  ) 

Definition at line 72 of file ODLaserConfig.cc.

References setChannelMask(), IODConfig::setConfigTag(), setDebug(), setDummy(), setEMTCNone(), setEMTCSlotId(), setEMTCTTCIn(), setFilter(), setFPMode(), setHalAddressTableFile(), setHalModuleFile(), setHalStaticTableFile(), setLaserControlHost(), setLaserControlOn(), setLaserControlPort(), setLaserPhase(), setLocalOutputFile(), setMatacqAcquisitionMode(), setMatacqBaseAddress(), setMatacqFedId(), setMatacqMode(), setMatacqNone(), setMatacqSerialNumber(), setMaxSamplesForDaq(), setOpticalSwitch(), setPedestalFile(), setPedestalRunEventCount(), setPostTrig(), setPower(), setRawDataMode(), setUseBuffer(), setWaveLength(), and setWTE2LaserDelay().

00072                                                                   {
00073   
00074   // parses the result of the XML parser that is a map of 
00075   // string string with variable name variable value 
00076   
00077   for( std::map<std::string, std::string >::iterator ci=
00078          my_keys_map.begin(); ci!=my_keys_map.end(); ci++ ) {
00079     
00080     if(ci->first==  "LASER_CONFIGURATION_ID") setConfigTag(ci->second);
00081     if(ci->first==  "DEBUG") setDebug(atoi(ci->second.c_str()) );
00082     if(ci->first==  "DUMMY") setDummy(atoi(ci->second.c_str() ));
00083     if(ci->first==  "MATACQ_BASE_ADDRESS") setMatacqBaseAddress(atoi(ci->second.c_str() ));
00084     if(ci->first==  "MATACQ_NONE") setMatacqNone(atoi(ci->second.c_str() ));
00085     if(ci->first==  "MATACQ_MODE") setMatacqMode(ci->second);
00086     if(ci->first==  "CHANNEL_MASK") setChannelMask(atoi(ci->second.c_str() ));
00087     if(ci->first==  "MAX_SAMPLES_FOR_DAQ") setMaxSamplesForDaq(ci->second );
00088     if(ci->first==  "MATACQ_FED_ID") setMatacqFedId(atoi(ci->second.c_str()) );
00089     if(ci->first==  "PEDESTAL_FILE") setPedestalFile(ci->second );
00090     if(ci->first==  "USE_BUFFER") setUseBuffer(atoi(ci->second.c_str())) ;
00091     if(ci->first==  "POSTTRIG") setPostTrig(atoi(ci->second.c_str()) );
00092     if(ci->first==  "FP_MODE") setFPMode(atoi(ci->second.c_str() ));
00093     if(ci->first==  "HAL_MODULE_FILE") setHalModuleFile(ci->second );
00094     if(ci->first==  "HAL_ADDRESS_TABLE_FILE" || ci->first==  "HAL_ADDRESST_ABLE_FILE") setHalAddressTableFile(ci->second);
00095     if(ci->first==  "HAL_STATIC_TABLE_FILE") setHalStaticTableFile(ci->second );
00096     if(ci->first==  "MATACQ_SERIAL_NUMBER") setMatacqSerialNumber(ci->second );
00097     if(ci->first==  "PEDESTAL_RUN_EVENT_COUNT") setPedestalRunEventCount(atoi(ci->second.c_str()) );
00098     if(ci->first==  "RAW_DATA_MODE") setRawDataMode(atoi(ci->second.c_str()) );
00099     if(ci->first==  "ACQUISITION_MODE") setMatacqAcquisitionMode(ci->second );
00100     if(ci->first==  "LOCAL_OUTPUT_FILE") setLocalOutputFile(ci->second );
00101     if(ci->first==  "EMTC_NONE") setEMTCNone(atoi(ci->second.c_str()) );
00102     if(ci->first==  "WTE2_LASER_DELAY") setWTE2LaserDelay(atoi(ci->second.c_str()) );
00103     if(ci->first==  "LASER_PHASE") setLaserPhase(atoi(ci->second.c_str()) );
00104     if(ci->first==  "EMTC_TTC_IN") setEMTCTTCIn(atoi(ci->second.c_str()) );
00105     if(ci->first==  "EMTC_SLOT_ID") setEMTCSlotId(atoi(ci->second.c_str()) );
00106     if(ci->first==  "WAVELENGTH") setWaveLength(atoi(ci->second.c_str()) );
00107     if(ci->first==  "OPTICAL_SWITCH") setOpticalSwitch(atoi(ci->second.c_str()) );
00108     if(ci->first==  "POWER_SETTING") setPower(atoi(ci->second.c_str()) );
00109     if(ci->first==  "FILTER") setFilter(atoi(ci->second.c_str()) );
00110     if(ci->first==  "LASER_CONTROL_ON") setLaserControlOn(atoi(ci->second.c_str()) );
00111     if(ci->first==  "LASER_CONTROL_HOST") setLaserControlHost(ci->second );
00112     if(ci->first==  "LASER_CONTROL_PORT") setLaserControlPort(atoi(ci->second.c_str()) );
00113 
00114   }
00115   
00116 }

void ODLaserConfig::setPedestalFile ( std::string  x  )  [inline]

Definition at line 38 of file ODLaserConfig.h.

References m_ped_file.

Referenced by setParameters().

00038 { m_ped_file = x; }

void ODLaserConfig::setPedestalRunEventCount ( int  x  )  [inline]

Definition at line 58 of file ODLaserConfig.h.

References m_ped_count.

Referenced by setParameters().

00058 { m_ped_count = x; }

void ODLaserConfig::setPostTrig ( int  x  )  [inline]

Definition at line 42 of file ODLaserConfig.h.

References m_post_trig.

Referenced by setParameters().

00042 { m_post_trig = x; }

void ODLaserConfig::setPower ( int  x  )  [inline]

Definition at line 89 of file ODLaserConfig.h.

References m_power.

Referenced by setParameters().

00089 { m_power = x; }

void ODLaserConfig::setRawDataMode ( int  x  )  [inline]

Definition at line 61 of file ODLaserConfig.h.

References m_raw_mode.

Referenced by setParameters().

00061 { m_raw_mode = x; }

void ODLaserConfig::setUseBuffer ( int  x  )  [inline]

Definition at line 40 of file ODLaserConfig.h.

References m_use_buffer.

Referenced by setParameters().

00040 { m_use_buffer = x; }

void ODLaserConfig::setWaveLength ( int  x  )  [inline]

Definition at line 86 of file ODLaserConfig.h.

References m_wave.

Referenced by setParameters().

00086 { m_wave = x; }

void ODLaserConfig::setWTE2LaserDelay ( int  x  )  [inline]

Definition at line 73 of file ODLaserConfig.h.

References m_emtc_2.

Referenced by setParameters().

00073 { m_emtc_2 = x; }

void ODLaserConfig::writeDB (  )  throw (std::runtime_error) [private]

Definition at line 196 of file ODLaserConfig.cc.

References IDBObject::checkConnection(), IODConfig::checkPrepare(), e, and IODConfig::m_writeStmt.

00198 {
00199   this->checkConnection();
00200   this->checkPrepare();
00201 
00202   try {
00203     
00204     // 1 is the id 2 is the tag
00205     m_writeStmt->setString(2, this->getConfigTag());
00206 
00207     m_writeStmt->setInt(   3, this->getDebug());
00208     m_writeStmt->setInt(   4, this->getDummy());
00209     m_writeStmt->setInt(   5, this->getMatacqBaseAddress());
00210     m_writeStmt->setInt(   6, this->getMatacqNone());
00211     m_writeStmt->setString(7, this->getMatacqMode());
00212     m_writeStmt->setInt(   8, this->getChannelMask());
00213     m_writeStmt->setString(9, this->getMaxSamplesForDaq());
00214     m_writeStmt->setInt(  10, this->getMatacqFedId());
00215     m_writeStmt->setString(11, this->getPedestalFile());
00216     m_writeStmt->setInt(  12, this->getUseBuffer());
00217     m_writeStmt->setInt(  13, this->getPostTrig());
00218     m_writeStmt->setInt(  14, this->getFPMode());
00219     m_writeStmt->setString(15,  this->getHalModuleFile() );
00220     m_writeStmt->setString(16, this->getHalAddressTableFile() );
00221     m_writeStmt->setString(17, this->getHalStaticTableFile() );
00222     m_writeStmt->setString(18, this->getMatacqSerialNumber() );
00223     m_writeStmt->setInt(   19, this->getPedestalRunEventCount() );
00224     m_writeStmt->setInt(   20, this->getRawDataMode());
00225     m_writeStmt->setString(21, this->getMatacqAcquisitionMode());
00226     m_writeStmt->setString(22, this->getLocalOutputFile());
00227     m_writeStmt->setInt(   23, this->getEMTCNone());
00228     m_writeStmt->setInt(   24, this->getWTE2LaserDelay());
00229     m_writeStmt->setInt(   25, this->getLaserPhase());
00230     m_writeStmt->setInt(   26, this->getEMTCTTCIn());
00231     m_writeStmt->setInt(   27, this->getEMTCSlotId());
00232     // laser
00233     m_writeStmt->setInt(28, this->getWaveLength());
00234     m_writeStmt->setInt(29, this->getPower());
00235     m_writeStmt->setInt(30, this->getOpticalSwitch());
00236     m_writeStmt->setInt(31, this->getFilter());
00237     m_writeStmt->setInt(32, this->getLaserControlOn());
00238     m_writeStmt->setString(33, this->getLaserControlHost() );
00239     m_writeStmt->setInt(   34, this->getLaserControlPort());
00240     m_writeStmt->setString(   35, this->getLaserTag());
00241 
00242     m_writeStmt->executeUpdate();
00243 
00244 
00245   } catch (SQLException &e) {
00246     throw(runtime_error("ODLaserConfig::writeDB():  "+e.getMessage()));
00247   }
00248   // Now get the ID
00249   if (!this->fetchID()) {
00250     throw(runtime_error("ODLaserConfig::writeDB:  Failed to write"));
00251   }
00252 
00253 
00254 }


Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 11 of file ODLaserConfig.h.


Member Data Documentation

std::string ODLaserConfig::m_aqmode [private]

Definition at line 144 of file ODLaserConfig.h.

Referenced by clear(), getMatacqAcquisitionMode(), and setMatacqAcquisitionMode().

int ODLaserConfig::m_chan_mask [private]

Definition at line 131 of file ODLaserConfig.h.

Referenced by clear(), getChannelMask(), and setChannelMask().

int ODLaserConfig::m_debug [private]

Definition at line 127 of file ODLaserConfig.h.

Referenced by clear(), getDebug(), and setDebug().

int ODLaserConfig::m_dummy [private]

Definition at line 126 of file ODLaserConfig.h.

Referenced by clear(), getDummy(), and setDummy().

int ODLaserConfig::m_emtc_1 [private]

Definition at line 148 of file ODLaserConfig.h.

Referenced by clear(), getEMTCNone(), and setEMTCNone().

int ODLaserConfig::m_emtc_2 [private]

Definition at line 149 of file ODLaserConfig.h.

Referenced by clear(), getWTE2LaserDelay(), and setWTE2LaserDelay().

int ODLaserConfig::m_emtc_3 [private]

Definition at line 150 of file ODLaserConfig.h.

Referenced by clear(), getLaserPhase(), and setLaserPhase().

int ODLaserConfig::m_emtc_4 [private]

Definition at line 151 of file ODLaserConfig.h.

Referenced by clear(), getEMTCTTCIn(), and setEMTCTTCIn().

int ODLaserConfig::m_emtc_5 [private]

Definition at line 152 of file ODLaserConfig.h.

Referenced by clear(), getEMTCSlotId(), and setEMTCSlotId().

int ODLaserConfig::m_filter [private]

Definition at line 158 of file ODLaserConfig.h.

Referenced by clear(), getFilter(), and setFilter().

int ODLaserConfig::m_fp_mode [private]

Definition at line 137 of file ODLaserConfig.h.

Referenced by clear(), getFPMode(), and setFPMode().

std::string ODLaserConfig::m_hal_add_file [private]

Definition at line 139 of file ODLaserConfig.h.

Referenced by clear(), getHalAddressTableFile(), and setHalAddressTableFile().

std::string ODLaserConfig::m_hal_mod_file [private]

Definition at line 138 of file ODLaserConfig.h.

Referenced by clear(), getHalModuleFile(), and setHalModuleFile().

std::string ODLaserConfig::m_hal_tab_file [private]

Definition at line 140 of file ODLaserConfig.h.

Referenced by clear(), getHalStaticTableFile(), and setHalStaticTableFile().

int ODLaserConfig::m_ID [private]

Definition at line 123 of file ODLaserConfig.h.

Referenced by fetchID(), getId(), ODLaserConfig(), prepareWrite(), and setId().

std::string ODLaserConfig::m_laser_tag [private]

Definition at line 163 of file ODLaserConfig.h.

Referenced by clear(), getLaserTag(), and setLaserTag().

std::string ODLaserConfig::m_laserhost [private]

Definition at line 160 of file ODLaserConfig.h.

Referenced by clear(), getLaserControlHost(), and setLaserControlHost().

int ODLaserConfig::m_laserport [private]

Definition at line 161 of file ODLaserConfig.h.

Referenced by clear(), getLaserControlPort(), and setLaserControlPort().

std::string ODLaserConfig::m_mode [private]

Definition at line 130 of file ODLaserConfig.h.

Referenced by clear(), getMatacqMode(), and setMatacqMode().

int ODLaserConfig::m_mq_base [private]

Definition at line 128 of file ODLaserConfig.h.

Referenced by clear(), getMatacqBaseAddress(), and setMatacqBaseAddress().

int ODLaserConfig::m_mq_fed [private]

Definition at line 133 of file ODLaserConfig.h.

Referenced by getMatacqFedId(), and setMatacqFedId().

std::string ODLaserConfig::m_mq_file [private]

Definition at line 145 of file ODLaserConfig.h.

Referenced by clear(), getLocalOutputFile(), and setLocalOutputFile().

int ODLaserConfig::m_mq_none [private]

Definition at line 129 of file ODLaserConfig.h.

Referenced by clear(), getMatacqNone(), and setMatacqNone().

int ODLaserConfig::m_on [private]

Definition at line 159 of file ODLaserConfig.h.

Referenced by clear(), getLaserControlOn(), and setLaserControlOn().

int ODLaserConfig::m_ped_count [private]

Definition at line 142 of file ODLaserConfig.h.

Referenced by clear(), getPedestalRunEventCount(), and setPedestalRunEventCount().

std::string ODLaserConfig::m_ped_file [private]

Definition at line 134 of file ODLaserConfig.h.

Referenced by clear(), getPedestalFile(), and setPedestalFile().

int ODLaserConfig::m_post_trig [private]

Definition at line 136 of file ODLaserConfig.h.

Referenced by clear(), getPostTrig(), and setPostTrig().

int ODLaserConfig::m_power [private]

Definition at line 156 of file ODLaserConfig.h.

Referenced by clear(), getPower(), and setPower().

int ODLaserConfig::m_raw_mode [private]

Definition at line 143 of file ODLaserConfig.h.

Referenced by clear(), getRawDataMode(), and setRawDataMode().

std::string ODLaserConfig::m_samples [private]

Definition at line 132 of file ODLaserConfig.h.

Referenced by clear(), getMaxSamplesForDaq(), and setMaxSamplesForDaq().

std::string ODLaserConfig::m_serial [private]

Definition at line 141 of file ODLaserConfig.h.

Referenced by clear(), getMatacqSerialNumber(), and setMatacqSerialNumber().

int ODLaserConfig::m_switch [private]

Definition at line 157 of file ODLaserConfig.h.

Referenced by clear(), getOpticalSwitch(), and setOpticalSwitch().

int ODLaserConfig::m_use_buffer [private]

Definition at line 135 of file ODLaserConfig.h.

Referenced by clear(), getUseBuffer(), and setUseBuffer().

int ODLaserConfig::m_wave [private]

Definition at line 155 of file ODLaserConfig.h.

Referenced by clear(), getWaveLength(), and setWaveLength().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:12 2009 for CMSSW by  doxygen 1.5.4