CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
csccableread Class Reference

#include <CSCCableRead.h>

Public Member Functions

void cable_read (int chamber_index, std::string *chamber_label, float *cfeb_length, std::string *cfeb_rev, float *alct_length, std::string *alct_rev, float *cfeb_tmb_skew_delay, float *cfeb_timing_corr)
 
 csccableread () throw (oracle::occi::SQLException)
 
 ~csccableread () throw (oracle::occi::SQLException)
 

Private Attributes

oracle::occi::Connection * con
 
oracle::occi::Environment * env
 

Detailed Description

Definition at line 8 of file CSCCableRead.h.

Constructor & Destructor Documentation

csccableread::csccableread ( )
throw (oracle::occi::SQLException
)

Constructor for csccableread

Definition at line 7 of file CSCCableRead.cc.

References con, gather_cfg::cout, env, and AlCaHLTBitMon_QueryRunRegistry::string.

8  {
9  std::string db_user;
10  std::string db_pass;
11  env = oracle::occi::Environment::createEnvironment (oracle::occi::Environment::DEFAULT);
12  char* c_user = ::getenv("CSCMAP_AUTH_USER");
13  char* c_pass = ::getenv("CSCMAP_AUTH_PASSWORD");
14  db_user=std::string(c_user);
15  db_pass=std::string(c_pass);
16  con = env->createConnection (db_user,db_pass,"cms_orcoff_prod");
17  std::cout << "Connection to cable DB is done." << std::endl;
18  }// end of constructor csccableread ()
oracle::occi::Environment * env
Definition: CSCCableRead.h:12
tuple cout
Definition: gather_cfg.py:121
oracle::occi::Connection * con
Definition: CSCCableRead.h:13
csccableread::~csccableread ( )
throw (oracle::occi::SQLException
)

Destructor for cscmap

Destructor for csccableread.

Definition at line 22 of file CSCCableRead.cc.

References con, and env.

23  {
24  env->terminateConnection (con);
25  oracle::occi::Environment::terminateEnvironment (env);
26  } // end of ~csccableread ()
oracle::occi::Environment * env
Definition: CSCCableRead.h:12
oracle::occi::Connection * con
Definition: CSCCableRead.h:13

Member Function Documentation

void csccableread::cable_read ( int  chamber_index,
std::string *  chamber_label,
float *  cfeb_length,
std::string *  cfeb_rev,
float *  alct_length,
std::string *  alct_rev,
float *  cfeb_tmb_skew_delay,
float *  cfeb_timing_corr 
)

Definition at line 28 of file CSCCableRead.cc.

References con.

Referenced by CSCChamberTimeCorrectionsReadTest::analyze(), and CSCChamberTimeCorrectionsValues::prefill().

31  {
32  oracle::occi::Statement *stmt = con->createStatement();
33  stmt->setSQL("begin cms_emu_cern.cable_read.cable(:1, :2, :3, :4, :5, :6, :7, :8); end;");
34 
35 // stmt->setInt (1, chamber_index);
36 // stmt->registerOutParam(2, oracle::occi::OCCISTRING, 9);
37 // stmt->registerOutParam(3, oracle::occi::OCCIINT);
38 // stmt->registerOutParam(4, oracle::occi::OCCISTRING, 1);
39 // stmt->registerOutParam(5, oracle::occi::OCCIINT);
40 // stmt->registerOutParam(6, oracle::occi::OCCISTRING, 1);
41 // stmt->registerOutParam(7, oracle::occi::OCCIINT);
42 // stmt->registerOutParam(8, oracle::occi::OCCIINT);
43 //
44 // stmt->execute(); //execute procedure
45 //
46 // *chamber_label = stmt->getString(2);
47 // *cfeb_length = stmt->getInt(3);
48 // *cfeb_rev = stmt->getString(4);
49 // *alct_length = stmt->getInt(5);
50 // *alct_rev = stmt->getString(6);
51 // *cfeb_tmb_skew_delay = stmt->getInt(7);
52 // *cfeb_timing_corr = stmt->getInt(8);
53 
54 
55  stmt->setInt (1, chamber_index);
56  stmt->registerOutParam(2, oracle::occi::OCCISTRING, 9);
57  stmt->registerOutParam(3, oracle::occi::OCCIFLOAT);
58  stmt->registerOutParam(4, oracle::occi::OCCISTRING, 1);
59  stmt->registerOutParam(5, oracle::occi::OCCIFLOAT);
60  stmt->registerOutParam(6, oracle::occi::OCCISTRING, 1);
61  stmt->registerOutParam(7, oracle::occi::OCCIFLOAT);
62  stmt->registerOutParam(8, oracle::occi::OCCIFLOAT);
63 
64  stmt->execute(); //execute procedure
65 
66  *chamber_label = stmt->getString(2);
67  *cfeb_length = stmt->getFloat(3);
68  *cfeb_rev = stmt->getString(4);
69  *alct_length = stmt->getFloat(5);
70  *alct_rev = stmt->getString(6);
71  *cfeb_tmb_skew_delay = stmt->getFloat(7);
72  *cfeb_timing_corr = stmt->getFloat(8);
73 
74  con->terminateStatement (stmt);
75  } //end of cable_read
oracle::occi::Connection * con
Definition: CSCCableRead.h:13

Member Data Documentation

oracle::occi::Connection* csccableread::con
private

Definition at line 13 of file CSCCableRead.h.

Referenced by cable_read(), csccableread(), and ~csccableread().

oracle::occi::Environment* csccableread::env
private

Definition at line 12 of file CSCCableRead.h.

Referenced by csccableread(), and ~csccableread().