CMS 3D CMS Logo

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 () noexcept(false)
 
 ~csccableread () noexcept(false)
 

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::csccableread ( )
noexcept

Constructor for csccableread

Definition at line 8 of file CSCCableRead.cc.

References cms::cuda::assert(), con, gather_cfg::cout, copyBadStrip_cfg::db_user, SiStripPI::DEFAULT, env, and AlCaHLTBitMon_QueryRunRegistry::string.

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

◆ ~csccableread()

csccableread::~csccableread ( )
noexcept

Destructor for cscmap

Destructor for csccableread.

Definition at line 24 of file CSCCableRead.cc.

References con, and env.

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

Member Function Documentation

◆ cable_read()

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 29 of file CSCCableRead.cc.

References con.

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

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

Member Data Documentation

◆ con

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

Definition at line 11 of file CSCCableRead.h.

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

◆ env

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

Definition at line 10 of file CSCCableRead.h.

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