CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
ODCCSConfig Class Reference

#include <ODCCSConfig.h>

Inheritance diagram for ODCCSConfig:
IODConfig IDBObject

Public Member Functions

int fetchNextId () noexcept(false)
 
int getBC0Counter () const
 
int getBC0Delay () const
 
std::string getBGOSource () const
 
int getClock () const
 
int getDaccal () const
 
int getDAQBCIDPreset () const
 
int getDelay () const
 
std::string getGain () const
 
int getId () const
 
std::string getMemGain () const
 
int getOffsetHigh () const
 
int getOffsetLow () const
 
int getOffsetMid () const
 
std::string getTable ()
 
int getTEDelay () const
 
int getTrgBCIDPreset () const
 
std::string getTrgFilter () const
 
std::string getTrgMode () const
 
int getTTSMask () const
 
 ODCCSConfig ()
 
void setBC0Counter (int x)
 
void setBC0Delay (int x)
 
void setBGOSource (std::string x)
 
void setClock (int x)
 
void setDaccal (int x)
 
void setDAQBCIDPreset (int x)
 
void setDelay (int x)
 
void setGain (std::string x)
 
void setId (int id)
 
void setMemGain (std::string x)
 
void setOffsetHigh (int x)
 
void setOffsetLow (int x)
 
void setOffsetMid (int x)
 
void setParameters (const std::map< std::string, std::string > &my_keys_map)
 
void setTEDelay (int x)
 
void setTrgBCIDPreset (int x)
 
void setTrgFilter (std::string x)
 
void setTrgMode (std::string x)
 
void setTTSMask (int x)
 
 ~ODCCSConfig ()
 
- Public Member Functions inherited from IODConfig
std::string getConfigTag ()
 
void setConfigTag (std::string x)
 
- Public Member Functions inherited from IDBObject
oracle::occi::Connection * getConn () const
 
oracle::occi::Environment * getEnv () const
 
void setConnection (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
virtual ~IDBObject ()
 

Private Member Functions

void clear ()
 
void fetchData (ODCCSConfig *result) noexcept(false)
 
int fetchID () noexcept(false)
 
void prepareWrite () noexcept(false)
 
void writeDB () noexcept(false)
 

Private Attributes

int m_bc0
 
int m_bc0_delay
 
std::string m_bgo
 
int m_clock
 
int m_daccal
 
int m_daq
 
int m_delay
 
std::string m_gain
 
int m_ID
 
std::string m_memgain
 
int m_offset_high
 
int m_offset_low
 
int m_offset_mid
 
std::string m_pedestal_offset_release
 
std::string m_system
 
int m_te_delay
 
int m_trg
 
std::string m_trg_filter
 
std::string m_trg_mode
 
int m_tts_mask
 

Friends

class EcalCondDBInterface
 

Additional Inherited Members

- Public Types inherited from IODConfig
typedef oracle::occi::Clob Clob
 
typedef oracle::occi::SQLException SQLException
 
typedef oracle::occi::Statement Statement
 
typedef oracle::occi::Stream Stream
 
- Public Attributes inherited from IODConfig
std::string m_config_tag
 
- Static Public Attributes inherited from IDBObject
static int const ECALDB_NROWS =1024
 
- Protected Member Functions inherited from IODConfig
void checkPrepare () noexcept(false)
 
void createReadStatement () noexcept(false)
 
void populateClob (Clob &clob, std::string fname, unsigned int bufsize) noexcept(false)
 
unsigned char * readClob (Clob &clob, int size) noexcept(false)
 
void setPrefetchRowCount (int ncount) noexcept(false)
 
void terminateReadStatement () noexcept(false)
 
void terminateWriteStatement () noexcept(false)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const noexcept(false)
 
- Protected Attributes inherited from IODConfig
Statementm_readStmt
 
Statementm_writeStmt
 
- Protected Attributes inherited from IDBObject
oracle::occi::Connection * m_conn
 
oracle::occi::Environment * m_env
 

Detailed Description

Definition at line 9 of file ODCCSConfig.h.

Constructor & Destructor Documentation

ODCCSConfig::ODCCSConfig ( )

Definition at line 19 of file ODCCSConfig.cc.

References hitfit::clear(), and NULL.

20 {
21  m_env = NULL;
22  m_conn = NULL;
23  m_writeStmt = NULL;
24  m_readStmt = NULL;
25  m_config_tag="";
26  m_ID=0;
27  clear();
28 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
Statement * m_writeStmt
Definition: IODConfig.h:36
#define NULL
Definition: scimark2.h:8
std::string m_config_tag
Definition: IODConfig.h:27
Statement * m_readStmt
Definition: IODConfig.h:37
void clear()
Definition: ODCCSConfig.cc:31
ODCCSConfig::~ODCCSConfig ( )

Definition at line 52 of file ODCCSConfig.cc.

53 {
54 }

Member Function Documentation

void ODCCSConfig::clear ( void  )
private

Definition at line 31 of file ODCCSConfig.cc.

References MY_NULL.

Referenced by setTEDelay().

31  {
34  m_gain="";
35  m_memgain="";
39  m_trg_mode="";
40  m_trg_filter="";
41  m_bgo="";
43  m_daq=MY_NULL;
44  m_trg=MY_NULL;
45  m_bc0=MY_NULL;
48 }
std::string m_bgo
Definition: ODCCSConfig.h:95
int m_tts_mask
Definition: ODCCSConfig.h:96
#define MY_NULL
Definition: ODCCSConfig.cc:12
std::string m_memgain
Definition: ODCCSConfig.h:86
std::string m_trg_filter
Definition: ODCCSConfig.h:93
int m_offset_high
Definition: ODCCSConfig.h:87
std::string m_trg_mode
Definition: ODCCSConfig.h:92
int m_offset_low
Definition: ODCCSConfig.h:88
int m_offset_mid
Definition: ODCCSConfig.h:89
std::string m_gain
Definition: ODCCSConfig.h:85
void ODCCSConfig::fetchData ( ODCCSConfig result)
privatenoexcept

Definition at line 195 of file ODCCSConfig.cc.

References MillePedeFileConverter_cfg::e, and mps_fire::result.

Referenced by setTEDelay().

197 {
198  this->checkConnection();
199  result->clear();
200  if(result->getId()==0 && (result->getConfigTag()=="") ){
201  throw(std::runtime_error("ODCCSConfig::fetchData(): no Id defined for this ODCCSConfig "));
202  }
203 
204  try {
205 
206  m_readStmt->setSQL("SELECT * "
207  "FROM ECAL_CCS_CONFIGURATION "
208  " where ( CCS_configuration_id = :1 or CCS_tag=:2 )" );
209  m_readStmt->setInt(1, result->getId());
210  m_readStmt->setString(2, result->getConfigTag());
211  ResultSet* rset = m_readStmt->executeQuery();
212 
213  rset->next();
214 
215  // 1 is the id and 2 is the config tag
216 
217  result->setId(rset->getInt(1));
218  result->setConfigTag(rset->getString(2));
219 
220  result->setDaccal( rset->getInt(3) );
221  result->setDelay( rset->getInt(4) );
222  result->setGain( rset->getString(5) );
223  result->setMemGain( rset->getString(6) );
224  result->setOffsetHigh( rset->getInt(7) );
225  result->setOffsetLow( rset->getInt(8) );
226  result->setOffsetMid( rset->getInt(9) );
227  result->setTrgMode( rset->getString(10) );
228  result->setTrgFilter( rset->getString(11) );
229  result->setClock( rset->getInt(12) );
230  result->setBGOSource( rset->getString(13) );
231  result->setTTSMask( rset->getInt(14) );
232  result->setDAQBCIDPreset( rset->getInt(15) );
233  result->setTrgBCIDPreset( rset->getInt(16) );
234  result->setBC0Counter( rset->getInt(17) );
235 
236 
237  } catch (SQLException &e) {
238  throw(std::runtime_error("ODCCSConfig::fetchData(): "+e.getMessage()));
239  }
240 }
void setBC0Counter(int x)
Definition: ODCCSConfig.h:58
void setDelay(int x)
Definition: ODCCSConfig.h:24
void setClock(int x)
Definition: ODCCSConfig.h:48
void setOffsetLow(int x)
Definition: ODCCSConfig.h:36
int getId() const
Definition: ODCCSConfig.h:19
void setOffsetMid(int x)
Definition: ODCCSConfig.h:39
void checkConnection() const noexcept(false)
Definition: IDBObject.h:41
void setTrgBCIDPreset(int x)
Definition: ODCCSConfig.h:56
void setOffsetHigh(int x)
Definition: ODCCSConfig.h:33
void setTrgFilter(std::string x)
Definition: ODCCSConfig.h:45
void setTrgMode(std::string x)
Definition: ODCCSConfig.h:42
void setDAQBCIDPreset(int x)
Definition: ODCCSConfig.h:54
void setId(int id)
Definition: ODCCSConfig.h:18
void setGain(std::string x)
Definition: ODCCSConfig.h:27
void setMemGain(std::string x)
Definition: ODCCSConfig.h:30
void setConfigTag(std::string x)
Definition: IODConfig.h:31
oracle::occi::SQLException SQLException
Definition: IODConfig.h:22
void setTTSMask(int x)
Definition: ODCCSConfig.h:52
Statement * m_readStmt
Definition: IODConfig.h:37
std::string getConfigTag()
Definition: IODConfig.h:32
void setDaccal(int x)
Definition: ODCCSConfig.h:21
void clear()
Definition: ODCCSConfig.cc:31
void setBGOSource(std::string x)
Definition: ODCCSConfig.h:50
int ODCCSConfig::fetchID ( )
privatenoexcept

Definition at line 242 of file ODCCSConfig.cc.

References MillePedeFileConverter_cfg::e.

Referenced by setTEDelay().

243 {
244  // Return from memory if available
245  if (m_ID!=0) {
246  return m_ID;
247  }
248 
249  this->checkConnection();
250 
251  try {
252  Statement* stmt = m_conn->createStatement();
253  stmt->setSQL("SELECT ccs_configuration_id FROM ecal_ccs_configuration "
254  "WHERE ccs_tag=:ccs_tag "
255  );
256 
257  stmt->setString(1, getConfigTag() );
258 
259  ResultSet* rset = stmt->executeQuery();
260 
261  if (rset->next()) {
262  m_ID = rset->getInt(1);
263  } else {
264  m_ID = 0;
265  }
266  m_conn->terminateStatement(stmt);
267  } catch (SQLException &e) {
268  throw(std::runtime_error("ODCCSConfig::fetchID: "+e.getMessage()));
269  }
270 
271  return m_ID;
272 }
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void checkConnection() const noexcept(false)
Definition: IDBObject.h:41
oracle::occi::Statement Statement
Definition: IODConfig.h:23
oracle::occi::SQLException SQLException
Definition: IODConfig.h:22
std::string getConfigTag()
Definition: IODConfig.h:32
int ODCCSConfig::fetchNextId ( )
noexcept

Definition at line 58 of file ODCCSConfig.cc.

References MillePedeFileConverter_cfg::e, and mps_fire::result.

Referenced by setTEDelay().

58  {
59 
60  int result=0;
61  try {
62  this->checkConnection();
63 
64  m_readStmt = m_conn->createStatement();
65  m_readStmt->setSQL("select ecal_CCS_config_sq.NextVal from dual");
66  ResultSet* rset = m_readStmt->executeQuery();
67  while (rset->next ()){
68  result= rset->getInt(1);
69  }
70  m_conn->terminateStatement(m_readStmt);
71  return result;
72 
73  } catch (SQLException &e) {
74  throw(std::runtime_error("ODCCSConfig::fetchNextId(): "+e.getMessage()));
75  }
76 
77 }
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void checkConnection() const noexcept(false)
Definition: IDBObject.h:41
oracle::occi::SQLException SQLException
Definition: IODConfig.h:22
Statement * m_readStmt
Definition: IODConfig.h:37
int ODCCSConfig::getBC0Counter ( ) const
inline

Definition at line 59 of file ODCCSConfig.h.

References m_bc0.

59 { return m_bc0; }
int ODCCSConfig::getBC0Delay ( ) const
inline

Definition at line 60 of file ODCCSConfig.h.

References m_bc0_delay.

60 { return m_bc0_delay; }
std::string ODCCSConfig::getBGOSource ( ) const
inline

Definition at line 51 of file ODCCSConfig.h.

References m_bgo.

51 { return m_bgo; }
std::string m_bgo
Definition: ODCCSConfig.h:95
int ODCCSConfig::getClock ( ) const
inline

Definition at line 49 of file ODCCSConfig.h.

References m_clock.

49 { return m_clock; }
int ODCCSConfig::getDaccal ( ) const
inline

Definition at line 22 of file ODCCSConfig.h.

References m_daccal.

22 { return m_daccal; }
int ODCCSConfig::getDAQBCIDPreset ( ) const
inline

Definition at line 55 of file ODCCSConfig.h.

References m_daq.

55 { return m_daq; }
int ODCCSConfig::getDelay ( ) const
inline

Definition at line 25 of file ODCCSConfig.h.

References m_delay.

25 { return m_delay; }
std::string ODCCSConfig::getGain ( ) const
inline

Definition at line 28 of file ODCCSConfig.h.

References m_gain.

28 { return m_gain; }
std::string m_gain
Definition: ODCCSConfig.h:85
int ODCCSConfig::getId ( void  ) const
inline

Definition at line 19 of file ODCCSConfig.h.

References m_ID.

19 { return m_ID; }
std::string ODCCSConfig::getMemGain ( ) const
inline

Definition at line 31 of file ODCCSConfig.h.

References m_memgain.

31 { return m_memgain; }
std::string m_memgain
Definition: ODCCSConfig.h:86
int ODCCSConfig::getOffsetHigh ( ) const
inline

Definition at line 34 of file ODCCSConfig.h.

References m_offset_high.

34 { return m_offset_high; }
int m_offset_high
Definition: ODCCSConfig.h:87
int ODCCSConfig::getOffsetLow ( ) const
inline

Definition at line 37 of file ODCCSConfig.h.

References m_offset_low.

37 { return m_offset_low; }
int m_offset_low
Definition: ODCCSConfig.h:88
int ODCCSConfig::getOffsetMid ( ) const
inline

Definition at line 40 of file ODCCSConfig.h.

References m_offset_mid.

40 { return m_offset_mid; }
int m_offset_mid
Definition: ODCCSConfig.h:89
std::string ODCCSConfig::getTable ( )
inlinevirtual

Implements IODConfig.

Definition at line 16 of file ODCCSConfig.h.

16 { return "ECAL_CCS_CONFIGURATION"; }
int ODCCSConfig::getTEDelay ( ) const
inline

Definition at line 62 of file ODCCSConfig.h.

References m_te_delay.

62 { return m_te_delay; }
int ODCCSConfig::getTrgBCIDPreset ( ) const
inline

Definition at line 57 of file ODCCSConfig.h.

References m_trg.

57 { return m_trg; }
std::string ODCCSConfig::getTrgFilter ( ) const
inline

Definition at line 46 of file ODCCSConfig.h.

References m_trg_filter.

46 { return m_trg_filter; }
std::string m_trg_filter
Definition: ODCCSConfig.h:93
std::string ODCCSConfig::getTrgMode ( ) const
inline

Definition at line 43 of file ODCCSConfig.h.

References m_trg_mode.

43 { return m_trg_mode; }
std::string m_trg_mode
Definition: ODCCSConfig.h:92
int ODCCSConfig::getTTSMask ( ) const
inline

Definition at line 53 of file ODCCSConfig.h.

References m_tts_mask.

53 { return m_tts_mask; }
int m_tts_mask
Definition: ODCCSConfig.h:96
void ODCCSConfig::prepareWrite ( )
privatevirtualnoexcept

Implements IODConfig.

Definition at line 79 of file ODCCSConfig.cc.

References MillePedeFileConverter_cfg::e.

Referenced by setTEDelay().

81 {
82  this->checkConnection();
83  int next_id=fetchNextId();
84 
85  try {
86  m_writeStmt = m_conn->createStatement();
87  m_writeStmt->setSQL("INSERT INTO ECAL_CCS_CONFIGURATION ( ccs_configuration_id, ccs_tag ,"
88  " daccal, delay, gain, memgain, offset_high,offset_low,offset_mid, trg_mode, trg_filter, "
89  " clock, BGO_SOURCE, TTS_MASK, DAQ_BCID_PRESET , TRIG_BCID_PRESET, BC0_COUNTER, BC0_DELAY, TE_DELAY ) "
90  "VALUES ( "
91  " :ccs_configuration_id, :ccs_tag, :daccal, :delay, :gain, :memgain, :offset_high,:offset_low,"
92  " :offset_mid, :trg_mode, :trg_filter, :clock, :BGO_SOURCE, :TTS_MASK, "
93  " :DAQ_BCID_PRESET , :TRIG_BCID_PRESET, :BC0_COUNTER, :BC0_DELAY, :TE_DELAY) ");
94 
95  m_writeStmt->setInt(1, next_id);
96  m_ID=next_id;
97 
98  } catch (SQLException &e) {
99  throw(std::runtime_error("ODCCSConfig::prepareWrite(): "+e.getMessage()));
100  }
101 
102 }
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
Statement * m_writeStmt
Definition: IODConfig.h:36
int fetchNextId() noexcept(false)
Definition: ODCCSConfig.cc:58
void checkConnection() const noexcept(false)
Definition: IDBObject.h:41
oracle::occi::SQLException SQLException
Definition: IODConfig.h:22
void ODCCSConfig::setBC0Counter ( int  x)
inline

Definition at line 58 of file ODCCSConfig.h.

References m_bc0, and x.

58 { m_bc0 = x; }
void ODCCSConfig::setBC0Delay ( int  x)
inline

Definition at line 61 of file ODCCSConfig.h.

References m_bc0_delay, and x.

61 { m_bc0_delay = x; }
void ODCCSConfig::setBGOSource ( std::string  x)
inline

Definition at line 50 of file ODCCSConfig.h.

References m_bgo, and x.

50 { m_bgo = x; }
std::string m_bgo
Definition: ODCCSConfig.h:95
void ODCCSConfig::setClock ( int  x)
inline

Definition at line 48 of file ODCCSConfig.h.

References m_clock, and x.

48 { m_clock = x; }
void ODCCSConfig::setDaccal ( int  x)
inline

Definition at line 21 of file ODCCSConfig.h.

References m_daccal, and x.

21 { m_daccal = x; }
void ODCCSConfig::setDAQBCIDPreset ( int  x)
inline

Definition at line 54 of file ODCCSConfig.h.

References m_daq, and x.

54 { m_daq = x; }
void ODCCSConfig::setDelay ( int  x)
inline

Definition at line 24 of file ODCCSConfig.h.

References m_delay, and x.

24 { m_delay = x; }
void ODCCSConfig::setGain ( std::string  x)
inline

Definition at line 27 of file ODCCSConfig.h.

References m_gain, and x.

27 { m_gain = x; }
std::string m_gain
Definition: ODCCSConfig.h:85
void ODCCSConfig::setId ( int  id)
inline

Definition at line 18 of file ODCCSConfig.h.

References hcalTTPDigis_cfi::id, and m_ID.

void ODCCSConfig::setMemGain ( std::string  x)
inline

Definition at line 30 of file ODCCSConfig.h.

References m_memgain, and x.

30 { m_memgain = x; }
std::string m_memgain
Definition: ODCCSConfig.h:86
void ODCCSConfig::setOffsetHigh ( int  x)
inline

Definition at line 33 of file ODCCSConfig.h.

References m_offset_high, and x.

33 { m_offset_high = x; }
int m_offset_high
Definition: ODCCSConfig.h:87
void ODCCSConfig::setOffsetLow ( int  x)
inline

Definition at line 36 of file ODCCSConfig.h.

References m_offset_low, and x.

36 { m_offset_low = x; }
int m_offset_low
Definition: ODCCSConfig.h:88
void ODCCSConfig::setOffsetMid ( int  x)
inline

Definition at line 39 of file ODCCSConfig.h.

References m_offset_mid, and x.

39 { m_offset_mid = x; }
int m_offset_mid
Definition: ODCCSConfig.h:89
void ODCCSConfig::setParameters ( const std::map< std::string, std::string > &  my_keys_map)

Definition at line 104 of file ODCCSConfig.cc.

Referenced by setTEDelay().

104  {
105 
106  // parses the result of the XML parser that is a map of
107  // string string with variable name variable value
108 
109  for( std::map<std::string, std::string >::const_iterator ci=
110  my_keys_map.begin(); ci!=my_keys_map.end(); ci++ ) {
111 
112  if(ci->first== "CCS_CONFIGURATION_ID") setConfigTag(ci->second);
113  else if(ci->first== "DACCAL") setDaccal(atoi(ci->second.c_str()) );
114  else if(ci->first== "GAIN") setGain(ci->second);
115  else if(ci->first== "MEMGAIN") setMemGain(ci->second);
116  else if(ci->first== "OFFSET_HIGH") setOffsetHigh(atoi(ci->second.c_str() ));
117  else if(ci->first== "OFFSET_LOW") setOffsetLow(atoi(ci->second.c_str() ));
118  else if(ci->first== "OFFSET_MID") setOffsetMid(atoi(ci->second.c_str() ));
119  else if(ci->first== "TRG_MODE") setTrgMode(ci->second );
120  else if(ci->first== "TRG_FILTER") setTrgFilter(ci->second );
121  else if(ci->first== "CLOCK") setClock(atoi(ci->second.c_str()) );
122  else if(ci->first== "BGO_SOURCE") setBGOSource(ci->second) ;
123  else if(ci->first== "TTS_MASK") setTTSMask(atoi(ci->second.c_str()) );
124  else if(ci->first== "DAQ_BCID_PRESET") setDAQBCIDPreset(atoi(ci->second.c_str() ));
125  else if(ci->first== "TRIG_BCID_PRESET") setTrgBCIDPreset(atoi(ci->second.c_str()) );
126  else if(ci->first== "BC0_COUNTER") setBC0Counter(atoi(ci->second.c_str() ));
127  else if(ci->first== "BC0_DELAY") setBC0Delay(atoi(ci->second.c_str() ));
128  else if(ci->first== "TE_DELAY") setTEDelay(atoi(ci->second.c_str() ));
129  else if(ci->first== "DELAY") setDelay(atoi(ci->second.c_str() ));
130 
131  }
132 
133 }
void setBC0Counter(int x)
Definition: ODCCSConfig.h:58
void setDelay(int x)
Definition: ODCCSConfig.h:24
void setClock(int x)
Definition: ODCCSConfig.h:48
void setOffsetLow(int x)
Definition: ODCCSConfig.h:36
void setOffsetMid(int x)
Definition: ODCCSConfig.h:39
void setTrgBCIDPreset(int x)
Definition: ODCCSConfig.h:56
void setOffsetHigh(int x)
Definition: ODCCSConfig.h:33
void setTrgFilter(std::string x)
Definition: ODCCSConfig.h:45
void setTrgMode(std::string x)
Definition: ODCCSConfig.h:42
void setDAQBCIDPreset(int x)
Definition: ODCCSConfig.h:54
void setBC0Delay(int x)
Definition: ODCCSConfig.h:61
void setTEDelay(int x)
Definition: ODCCSConfig.h:63
void setGain(std::string x)
Definition: ODCCSConfig.h:27
void setMemGain(std::string x)
Definition: ODCCSConfig.h:30
void setConfigTag(std::string x)
Definition: IODConfig.h:31
void setTTSMask(int x)
Definition: ODCCSConfig.h:52
void setDaccal(int x)
Definition: ODCCSConfig.h:21
void setBGOSource(std::string x)
Definition: ODCCSConfig.h:50
void ODCCSConfig::setTEDelay ( int  x)
inline
void ODCCSConfig::setTrgBCIDPreset ( int  x)
inline

Definition at line 56 of file ODCCSConfig.h.

References m_trg, and x.

56 { m_trg = x; }
void ODCCSConfig::setTrgFilter ( std::string  x)
inline

Definition at line 45 of file ODCCSConfig.h.

References m_trg_filter, and x.

45 { m_trg_filter = x; }
std::string m_trg_filter
Definition: ODCCSConfig.h:93
void ODCCSConfig::setTrgMode ( std::string  x)
inline

Definition at line 42 of file ODCCSConfig.h.

References m_trg_mode, and x.

42 { m_trg_mode = x; }
std::string m_trg_mode
Definition: ODCCSConfig.h:92
void ODCCSConfig::setTTSMask ( int  x)
inline

Definition at line 52 of file ODCCSConfig.h.

References m_tts_mask, and x.

52 { m_tts_mask = x; }
int m_tts_mask
Definition: ODCCSConfig.h:96
void ODCCSConfig::writeDB ( )
privatenoexcept

Definition at line 135 of file ODCCSConfig.cc.

References MillePedeFileConverter_cfg::e, SET_INT, and SET_STRING.

Referenced by setTEDelay().

137 {
138  this->checkConnection();
139  this->checkPrepare();
140 
141  try {
142 
143  // number 1 is the id
144  // m_writeStmt->setString(2, this->getConfigTag());
145  // m_writeStmt->setInt(3, this->getDaccal());
146  // m_writeStmt->setInt(4, this->getDelay());
147  // m_writeStmt->setString(5, this->getGain());
148  // m_writeStmt->setString(6, this->getMemGain());
149  // m_writeStmt->setInt(7, this->getOffsetHigh());
150  // m_writeStmt->setInt(8, this->getOffsetLow());
151  // m_writeStmt->setInt(9, this->getOffsetMid());
152  // m_writeStmt->setString(10, this->getTrgMode() );
153  // m_writeStmt->setString(11, this->getTrgFilter() );
154  // m_writeStmt->setInt( 12, this->getClock() );
155  // m_writeStmt->setString(13, this->getBGOSource() );
156  // m_writeStmt->setInt(14, this->getTTSMask() );
157  // m_writeStmt->setInt(15, this->getDAQBCIDPreset() );
158  // m_writeStmt->setInt(16, this->getTrgBCIDPreset() );
159  // m_writeStmt->setInt(17, this->getBC0Counter() );
160 
161  SET_STRING(m_writeStmt, 2, this->getConfigTag());
162  SET_INT (m_writeStmt, 3, this->getDaccal());
163  SET_INT (m_writeStmt, 4, this->getDelay());
164  SET_STRING(m_writeStmt, 5, this->getGain());
165  SET_STRING(m_writeStmt, 6, this->getMemGain());
166  SET_INT (m_writeStmt, 7, this->getOffsetHigh());
167  SET_INT (m_writeStmt, 8, this->getOffsetLow());
168  SET_INT (m_writeStmt, 9, this->getOffsetMid());
169  SET_STRING(m_writeStmt, 10, this->getTrgMode());
170  SET_STRING(m_writeStmt, 11, this->getTrgFilter());
171  SET_INT (m_writeStmt, 12, this->getClock());
172  SET_STRING(m_writeStmt, 13, this->getBGOSource());
173  SET_INT (m_writeStmt, 14, this->getTTSMask());
174  SET_INT (m_writeStmt, 15, this->getDAQBCIDPreset());
175  SET_INT (m_writeStmt, 16, this->getTrgBCIDPreset());
176  SET_INT (m_writeStmt, 17, this->getBC0Counter());
177  SET_INT (m_writeStmt, 18, this->getBC0Delay());
178  SET_INT (m_writeStmt, 19, this->getTEDelay());
179 
180  m_writeStmt->executeUpdate();
181 
182 
183  } catch (SQLException &e) {
184  throw(std::runtime_error("ODCCSConfig::writeDB(): "+e.getMessage()));
185  }
186  // Now get the ID
187  if (!this->fetchID()) {
188  throw(std::runtime_error("ODCCSConfig::writeDB: Failed to write"));
189  }
190 
191 
192 }
int getTTSMask() const
Definition: ODCCSConfig.h:53
Statement * m_writeStmt
Definition: IODConfig.h:36
int getTEDelay() const
Definition: ODCCSConfig.h:62
int getBC0Delay() const
Definition: ODCCSConfig.h:60
std::string getTrgFilter() const
Definition: ODCCSConfig.h:46
int fetchID() noexcept(false)
Definition: ODCCSConfig.cc:242
int getOffsetHigh() const
Definition: ODCCSConfig.h:34
int getClock() const
Definition: ODCCSConfig.h:49
int getOffsetLow() const
Definition: ODCCSConfig.h:37
std::string getBGOSource() const
Definition: ODCCSConfig.h:51
#define SET_STRING(statement, paramNum, paramVal)
Definition: ODCCSConfig.cc:14
void checkConnection() const noexcept(false)
Definition: IDBObject.h:41
int getDelay() const
Definition: ODCCSConfig.h:25
int getDaccal() const
Definition: ODCCSConfig.h:22
std::string getMemGain() const
Definition: ODCCSConfig.h:31
std::string getTrgMode() const
Definition: ODCCSConfig.h:43
std::string getGain() const
Definition: ODCCSConfig.h:28
oracle::occi::SQLException SQLException
Definition: IODConfig.h:22
int getBC0Counter() const
Definition: ODCCSConfig.h:59
std::string getConfigTag()
Definition: IODConfig.h:32
int getTrgBCIDPreset() const
Definition: ODCCSConfig.h:57
#define SET_INT(statement, paramNum, paramVal)
Definition: ODCCSConfig.cc:13
void checkPrepare() noexcept(false)
Definition: IODConfig.h:39
int getOffsetMid() const
Definition: ODCCSConfig.h:40
int getDAQBCIDPreset() const
Definition: ODCCSConfig.h:55

Friends And Related Function Documentation

friend class EcalCondDBInterface
friend

Definition at line 11 of file ODCCSConfig.h.

Member Data Documentation

int ODCCSConfig::m_bc0
private

Definition at line 99 of file ODCCSConfig.h.

Referenced by getBC0Counter(), and setBC0Counter().

int ODCCSConfig::m_bc0_delay
private

Definition at line 100 of file ODCCSConfig.h.

Referenced by getBC0Delay(), and setBC0Delay().

std::string ODCCSConfig::m_bgo
private

Definition at line 95 of file ODCCSConfig.h.

Referenced by getBGOSource(), and setBGOSource().

int ODCCSConfig::m_clock
private

Definition at line 94 of file ODCCSConfig.h.

Referenced by getClock(), and setClock().

int ODCCSConfig::m_daccal
private

Definition at line 83 of file ODCCSConfig.h.

Referenced by getDaccal(), and setDaccal().

int ODCCSConfig::m_daq
private

Definition at line 97 of file ODCCSConfig.h.

Referenced by getDAQBCIDPreset(), and setDAQBCIDPreset().

int ODCCSConfig::m_delay
private

Definition at line 84 of file ODCCSConfig.h.

Referenced by getDelay(), and setDelay().

std::string ODCCSConfig::m_gain
private

Definition at line 85 of file ODCCSConfig.h.

Referenced by getGain(), and setGain().

int ODCCSConfig::m_ID
private

Definition at line 82 of file ODCCSConfig.h.

Referenced by getId(), and setId().

std::string ODCCSConfig::m_memgain
private

Definition at line 86 of file ODCCSConfig.h.

Referenced by getMemGain(), and setMemGain().

int ODCCSConfig::m_offset_high
private

Definition at line 87 of file ODCCSConfig.h.

Referenced by getOffsetHigh(), and setOffsetHigh().

int ODCCSConfig::m_offset_low
private

Definition at line 88 of file ODCCSConfig.h.

Referenced by getOffsetLow(), and setOffsetLow().

int ODCCSConfig::m_offset_mid
private

Definition at line 89 of file ODCCSConfig.h.

Referenced by getOffsetMid(), and setOffsetMid().

std::string ODCCSConfig::m_pedestal_offset_release
private

Definition at line 90 of file ODCCSConfig.h.

std::string ODCCSConfig::m_system
private

Definition at line 91 of file ODCCSConfig.h.

int ODCCSConfig::m_te_delay
private

Definition at line 101 of file ODCCSConfig.h.

Referenced by getTEDelay(), and setTEDelay().

int ODCCSConfig::m_trg
private

Definition at line 98 of file ODCCSConfig.h.

Referenced by getTrgBCIDPreset(), and setTrgBCIDPreset().

std::string ODCCSConfig::m_trg_filter
private

Definition at line 93 of file ODCCSConfig.h.

Referenced by getTrgFilter(), and setTrgFilter().

std::string ODCCSConfig::m_trg_mode
private

Definition at line 92 of file ODCCSConfig.h.

Referenced by getTrgMode(), and setTrgMode().

int ODCCSConfig::m_tts_mask
private

Definition at line 96 of file ODCCSConfig.h.

Referenced by getTTSMask(), and setTTSMask().