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

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

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

◆ ~csccableread()

csccableread::~csccableread ( )
noexcept

Destructor for cscmap

Destructor for csccableread.

Definition at line 21 of file CSCCableRead.cc.

21  {
22  env->terminateConnection(con);
23  oracle::occi::Environment::terminateEnvironment(env);
24 } // end of ~csccableread ()

References con, and env.

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

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

References con.

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

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().

csccableread::env
oracle::occi::Environment * env
Definition: CSCCableRead.h:10
SiStripPI::DEFAULT
Definition: SiStripPayloadInspectorHelper.h:786
gather_cfg.cout
cout
Definition: gather_cfg.py:144
csccableread::con
oracle::occi::Connection * con
Definition: CSCCableRead.h:11
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256