#include <OnlineDB/CSCCondDB/interface/CSCMap1.h>
Public Member Functions | |
void | chamber (int chamberid, CSCMapItem::MapItem *item) |
void | cratedmb (int crate, int dmb, CSCMapItem::MapItem *item) |
cscmap1 () throw (oracle::occi::SQLException) | |
Constructor for cscmap1. | |
void | ruiddu (int rui, int ddu_input, CSCMapItem::MapItem *item) |
~cscmap1 () throw (oracle::occi::SQLException) | |
Destructor for cscmap1. | |
Private Attributes | |
oracle::occi::Connection * | con |
oracle::occi::Environment * | env |
Definition at line 9 of file CSCMap1.h.
cscmap1::cscmap1 | ( | ) | throw (oracle::occi::SQLException) |
Constructor for cscmap1.
Definition at line 6 of file CSCMap1.cc.
References con, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and env.
00007 { 00008 std::string db_user; 00009 std::string db_pass; 00010 env = oracle::occi::Environment::createEnvironment (oracle::occi::Environment::DEFAULT); 00011 char* c_user = ::getenv("CSCMAP_AUTH_USER"); 00012 char* c_pass = ::getenv("CSCMAP_AUTH_PASSWORD"); 00013 db_user=std::string(c_user); 00014 db_pass=std::string(c_pass); 00015 con = env->createConnection (db_user,db_pass,"cms_orcoff_prod"); 00016 std::cout << "Connection to mapping DB is done." << std::endl; 00017 }// end of constructor cscmap1 ()
cscmap1::~cscmap1 | ( | ) | throw (oracle::occi::SQLException) |
void cscmap1::chamber | ( | int | chamberid, | |
CSCMapItem::MapItem * | item | |||
) |
Definition at line 28 of file CSCMap1.cc.
References CSCMapItem::MapItem::anodeIndex, CSCMapItem::MapItem::anodes, CSCMapItem::MapItem::chamber, CSCMapItem::MapItem::chamberId, CSCMapItem::MapItem::chamberLabel, con, CSCMapItem::MapItem::crateid, CSCMapItem::MapItem::crateLabel, CSCMapItem::MapItem::cscid, CSCMapItem::MapItem::cscIndex, CSCMapItem::MapItem::dcc_fifo, CSCMapItem::MapItem::ddu, CSCMapItem::MapItem::ddu_input, CSCMapItem::MapItem::ddu_slot, CSCMapItem::MapItem::dmb, GeomDetEnumerators::endcap, CSCMapItem::MapItem::endcap, CSCMapItem::MapItem::fed_crate, CSCMapItem::MapItem::fiber_crate, CSCMapItem::MapItem::fiber_pos, CSCMapItem::MapItem::fiber_socket, CSCMapItem::MapItem::layerIndex, CSCMapItem::MapItem::ring, CSCMapItem::MapItem::sector, CSCMapItem::MapItem::slink, CSCMapItem::MapItem::station, CSCMapItem::MapItem::stripIndex, CSCMapItem::MapItem::strips, and CSCMapItem::MapItem::trig_sector.
Referenced by CSCMap1Read::analyze(), cratedmb(), CSCChamberIndexValues::fillChamberIndex(), CSCChamberMapValues::fillChamberMap(), CSCCrateMapValues::fillCrateMap(), CSCDDUMapValues::fillDDUMap(), and ruiddu().
00029 { 00030 oracle::occi::Statement *stmt = con->createStatement(); 00031 00032 stmt->setSQL("begin cms_emu_cern.cscmap.chamberid_crate(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20); end;"); 00033 00034 stmt->setInt (1, chamberid); 00035 stmt->registerOutParam (2, oracle::occi::OCCISTRING, 10); 00036 stmt->registerOutParam (3, oracle::occi::OCCIINT); 00037 stmt->registerOutParam (4, oracle::occi::OCCIINT); 00038 stmt->registerOutParam (5, oracle::occi::OCCIINT); 00039 stmt->registerOutParam (6, oracle::occi::OCCIINT); 00040 stmt->registerOutParam (7, oracle::occi::OCCIINT); 00041 stmt->registerOutParam (8, oracle::occi::OCCIINT); 00042 stmt->registerOutParam (9, oracle::occi::OCCIINT); 00043 stmt->registerOutParam (10, oracle::occi::OCCISTRING, 10); 00044 stmt->registerOutParam (11, oracle::occi::OCCIINT); 00045 stmt->registerOutParam (12, oracle::occi::OCCIINT); 00046 stmt->registerOutParam (13, oracle::occi::OCCIINT); 00047 stmt->registerOutParam (14, oracle::occi::OCCIINT); 00048 stmt->registerOutParam (15, oracle::occi::OCCIINT); 00049 stmt->registerOutParam (16, oracle::occi::OCCIINT); 00050 stmt->registerOutParam (17, oracle::occi::OCCIINT); 00051 stmt->registerOutParam (18, oracle::occi::OCCIINT); 00052 stmt->registerOutParam (19, oracle::occi::OCCIINT); 00053 stmt->registerOutParam (20, oracle::occi::OCCIINT); 00054 00055 stmt->execute(); //execute procedure 00056 00057 item->chamberLabel = stmt->getString(10); 00058 item->chamberId = chamberid; 00059 int chamber = chamberid/10%100; 00060 int rest = (chamberid - chamber*10)/1000; 00061 int ring = rest%10; 00062 rest = (rest - ring)/10; 00063 int station = rest%10; 00064 int endcap = (rest - station)/10; 00065 item->endcap = endcap; 00066 item->station = station; 00067 item->ring = ring; 00068 item->chamber = chamber; 00069 item->cscIndex = stmt->getInt(13); 00070 item->layerIndex = stmt->getInt(14); 00071 item->stripIndex = stmt->getInt(15); 00072 item->anodeIndex = stmt->getInt(16); 00073 item->strips = stmt->getInt(11); 00074 item->anodes = stmt->getInt(12); 00075 item->crateLabel = stmt->getString(2); 00076 item->crateid = stmt->getInt(3); 00077 item->sector = stmt->getInt(8); 00078 item->trig_sector = stmt->getInt(9); 00079 item->dmb = stmt->getInt(5); 00080 item->cscid = stmt->getInt(7); 00081 00082 stmt->setSQL("begin cms_emu_cern.ddumap.chamberid_ddu(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19); end;"); 00083 00084 stmt->setInt (1, chamberid); 00085 stmt->registerOutParam (2, oracle::occi::OCCIINT); 00086 stmt->registerOutParam (3, oracle::occi::OCCIINT); 00087 stmt->registerOutParam (4, oracle::occi::OCCIINT); 00088 stmt->registerOutParam (5, oracle::occi::OCCIINT); 00089 stmt->registerOutParam (6, oracle::occi::OCCISTRING, 10); 00090 stmt->registerOutParam (7, oracle::occi::OCCIINT); 00091 stmt->registerOutParam (8, oracle::occi::OCCIINT); 00092 stmt->registerOutParam (9, oracle::occi::OCCIINT); 00093 stmt->registerOutParam (10, oracle::occi::OCCISTRING, 10); 00094 stmt->registerOutParam (11, oracle::occi::OCCIINT); 00095 stmt->registerOutParam (12, oracle::occi::OCCISTRING, 10); 00096 stmt->registerOutParam (13, oracle::occi::OCCIINT); 00097 stmt->registerOutParam (14, oracle::occi::OCCISTRING, 10); 00098 stmt->registerOutParam (15, oracle::occi::OCCIINT); 00099 stmt->registerOutParam (16, oracle::occi::OCCIINT); 00100 stmt->registerOutParam (17, oracle::occi::OCCIINT); 00101 stmt->registerOutParam (18, oracle::occi::OCCIINT); 00102 stmt->registerOutParam (19, oracle::occi::OCCIINT); 00103 00104 stmt->execute(); //execute procedure 00105 00106 item->ddu = stmt->getInt(2); 00107 item->ddu_input = stmt->getInt(5); 00108 item->slink = stmt->getInt(7); 00109 00110 item->fed_crate = stmt->getInt(3); 00111 item->ddu_slot = stmt->getInt(4); 00112 item->dcc_fifo = stmt->getString(6); 00113 item->fiber_crate = stmt->getInt(8); 00114 item->fiber_pos = stmt->getInt(9); 00115 item->fiber_socket = stmt->getString(10); 00116 00117 con->terminateStatement (stmt); 00118 } //end of chamber
void cscmap1::cratedmb | ( | int | crate, | |
int | dmb, | |||
CSCMapItem::MapItem * | item | |||
) |
Definition at line 120 of file CSCMap1.cc.
References CSCMapItem::MapItem::anodeIndex, CSCMapItem::MapItem::anodes, chamber(), CSCMapItem::MapItem::chamber, CSCMapItem::MapItem::chamberId, CSCMapItem::MapItem::chamberLabel, con, CSCMapItem::MapItem::crateid, CSCMapItem::MapItem::crateLabel, CSCMapItem::MapItem::cscid, CSCMapItem::MapItem::cscIndex, CSCMapItem::MapItem::dcc_fifo, CSCMapItem::MapItem::ddu, CSCMapItem::MapItem::ddu_input, CSCMapItem::MapItem::ddu_slot, CSCMapItem::MapItem::dmb, GeomDetEnumerators::endcap, CSCMapItem::MapItem::endcap, CSCMapItem::MapItem::fed_crate, CSCMapItem::MapItem::fiber_crate, CSCMapItem::MapItem::fiber_pos, CSCMapItem::MapItem::fiber_socket, CSCMapItem::MapItem::layerIndex, CSCMapItem::MapItem::ring, CSCMapItem::MapItem::sector, CSCMapItem::MapItem::slink, CSCMapItem::MapItem::station, CSCMapItem::MapItem::stripIndex, CSCMapItem::MapItem::strips, and CSCMapItem::MapItem::trig_sector.
Referenced by CSCMap1Read::analyze(), CSCCFEBConnectivityAnalyzer::~CSCCFEBConnectivityAnalyzer(), CSCCrossTalkAnalyzer::~CSCCrossTalkAnalyzer(), CSCGainAnalyzer::~CSCGainAnalyzer(), CSCNoiseMatrixAnalyzer::~CSCNoiseMatrixAnalyzer(), CSCSaturationAnalyzer::~CSCSaturationAnalyzer(), and CSCscaAnalyzer::~CSCscaAnalyzer().
00121 { 00122 oracle::occi::Statement *stmt = con->createStatement(); 00123 00124 stmt->setSQL("begin cms_emu_cern.cscmap.crateid_chamber(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17); end;"); 00125 00126 stmt->setInt (1, crate); 00127 stmt->setInt (2, dmb); 00128 stmt->registerOutParam (3, oracle::occi::OCCISTRING, 10); 00129 stmt->registerOutParam (4, oracle::occi::OCCIINT); 00130 stmt->registerOutParam (5, oracle::occi::OCCIINT); 00131 stmt->registerOutParam (6, oracle::occi::OCCIINT); 00132 stmt->registerOutParam (7, oracle::occi::OCCIINT); 00133 stmt->registerOutParam (8, oracle::occi::OCCIINT); 00134 stmt->registerOutParam (9, oracle::occi::OCCIINT); 00135 stmt->registerOutParam (10, oracle::occi::OCCIINT); 00136 stmt->registerOutParam (11, oracle::occi::OCCISTRING, 10); 00137 stmt->registerOutParam (12, oracle::occi::OCCIINT); 00138 stmt->registerOutParam (13, oracle::occi::OCCIINT); 00139 stmt->registerOutParam (14, oracle::occi::OCCIINT); 00140 stmt->registerOutParam (15, oracle::occi::OCCIINT); 00141 stmt->registerOutParam (16, oracle::occi::OCCIINT); 00142 stmt->registerOutParam (17, oracle::occi::OCCIINT); 00143 00144 stmt->execute(); //execute procedure 00145 00146 item->chamberLabel = stmt->getString(3); 00147 item->chamberId = stmt->getInt(4); 00148 int chamberid = item->chamberId; 00149 int chamber = chamberid/10%100; 00150 int rest = (chamberid - chamber*10)/1000; 00151 int ring = rest%10; 00152 rest = (rest - ring)/10; 00153 int station = rest%10; 00154 int endcap = (rest - station)/10; 00155 item->endcap = endcap; 00156 item->station = station; 00157 item->ring = ring; 00158 item->chamber = chamber; 00159 item->cscIndex = stmt->getInt(14); 00160 item->layerIndex = stmt->getInt(15); 00161 item->stripIndex = stmt->getInt(16); 00162 item->anodeIndex = stmt->getInt(17); 00163 item->strips = stmt->getInt(12); 00164 item->anodes = stmt->getInt(13); 00165 item->crateLabel = stmt->getString(11); 00166 item->crateid = stmt->getInt(9); 00167 item->sector = stmt->getInt(7); 00168 item->trig_sector = stmt->getInt(8); 00169 item->dmb = dmb; 00170 item->cscid = stmt->getInt(5); 00171 00172 stmt->setSQL("begin cms_emu_cern.ddumap.chamberid_ddu(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19); end;"); 00173 00174 stmt->setInt (1, chamberid); 00175 stmt->registerOutParam (2, oracle::occi::OCCIINT); 00176 stmt->registerOutParam (3, oracle::occi::OCCIINT); 00177 stmt->registerOutParam (4, oracle::occi::OCCIINT); 00178 stmt->registerOutParam (5, oracle::occi::OCCIINT); 00179 stmt->registerOutParam (6, oracle::occi::OCCISTRING, 10); 00180 stmt->registerOutParam (7, oracle::occi::OCCIINT); 00181 stmt->registerOutParam (8, oracle::occi::OCCIINT); 00182 stmt->registerOutParam (9, oracle::occi::OCCIINT); 00183 stmt->registerOutParam (10, oracle::occi::OCCISTRING, 10); 00184 stmt->registerOutParam (11, oracle::occi::OCCIINT); 00185 stmt->registerOutParam (12, oracle::occi::OCCISTRING, 10); 00186 stmt->registerOutParam (13, oracle::occi::OCCIINT); 00187 stmt->registerOutParam (14, oracle::occi::OCCISTRING, 10); 00188 stmt->registerOutParam (15, oracle::occi::OCCIINT); 00189 stmt->registerOutParam (16, oracle::occi::OCCIINT); 00190 stmt->registerOutParam (17, oracle::occi::OCCIINT); 00191 stmt->registerOutParam (18, oracle::occi::OCCIINT); 00192 stmt->registerOutParam (19, oracle::occi::OCCIINT); 00193 00194 stmt->execute(); //execute procedure 00195 00196 item->ddu = stmt->getInt(2); 00197 item->ddu_input = stmt->getInt(5); 00198 item->slink = stmt->getInt(7); 00199 00200 item->fed_crate = stmt->getInt(3); 00201 item->ddu_slot = stmt->getInt(4); 00202 item->dcc_fifo = stmt->getString(6); 00203 item->fiber_crate = stmt->getInt(8); 00204 item->fiber_pos = stmt->getInt(9); 00205 item->fiber_socket = stmt->getString(10); 00206 00207 con->terminateStatement (stmt); 00208 } //end of cratedmb
void cscmap1::ruiddu | ( | int | rui, | |
int | ddu_input, | |||
CSCMapItem::MapItem * | item | |||
) |
Definition at line 210 of file CSCMap1.cc.
References CSCMapItem::MapItem::anodeIndex, CSCMapItem::MapItem::anodes, chamber(), CSCMapItem::MapItem::chamber, CSCMapItem::MapItem::chamberId, CSCMapItem::MapItem::chamberLabel, con, CSCMapItem::MapItem::crateid, CSCMapItem::MapItem::crateLabel, CSCMapItem::MapItem::cscid, CSCMapItem::MapItem::cscIndex, CSCMapItem::MapItem::dcc_fifo, CSCMapItem::MapItem::ddu, CSCMapItem::MapItem::ddu_input, CSCMapItem::MapItem::ddu_slot, CSCMapItem::MapItem::dmb, GeomDetEnumerators::endcap, CSCMapItem::MapItem::endcap, CSCMapItem::MapItem::fed_crate, CSCMapItem::MapItem::fiber_crate, CSCMapItem::MapItem::fiber_pos, CSCMapItem::MapItem::fiber_socket, CSCMapItem::MapItem::layerIndex, CSCMapItem::MapItem::ring, CSCMapItem::MapItem::sector, CSCMapItem::MapItem::slink, CSCMapItem::MapItem::station, CSCMapItem::MapItem::stripIndex, CSCMapItem::MapItem::strips, and CSCMapItem::MapItem::trig_sector.
Referenced by CSCMap1Read::analyze().
00211 { 00212 oracle::occi::Statement *stmt = con->createStatement(); 00213 00214 stmt->setSQL("begin cms_emu_cern.ddumap.ddu_chamber(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19); end;"); 00215 00216 stmt->setInt (1, rui); 00217 stmt->setInt (2, ddu_input); 00218 stmt->registerOutParam (3, oracle::occi::OCCIINT); 00219 stmt->registerOutParam (4, oracle::occi::OCCIINT); 00220 stmt->registerOutParam (5, oracle::occi::OCCISTRING, 10); 00221 stmt->registerOutParam (6, oracle::occi::OCCIINT); 00222 stmt->registerOutParam (7, oracle::occi::OCCIINT); 00223 stmt->registerOutParam (8, oracle::occi::OCCIINT); 00224 stmt->registerOutParam (9, oracle::occi::OCCISTRING, 10); 00225 stmt->registerOutParam (10, oracle::occi::OCCIINT); 00226 stmt->registerOutParam (11, oracle::occi::OCCISTRING, 10); 00227 stmt->registerOutParam (12, oracle::occi::OCCIINT); 00228 stmt->registerOutParam (13, oracle::occi::OCCISTRING, 10); 00229 stmt->registerOutParam (14, oracle::occi::OCCIINT); 00230 stmt->registerOutParam (15, oracle::occi::OCCIINT); 00231 stmt->registerOutParam (16, oracle::occi::OCCIINT); 00232 stmt->registerOutParam (17, oracle::occi::OCCIINT); 00233 stmt->registerOutParam (18, oracle::occi::OCCIINT); 00234 stmt->registerOutParam (19, oracle::occi::OCCIINT); 00235 00236 stmt->execute(); //execute procedure 00237 00238 item->ddu = rui; 00239 item->ddu_input = ddu_input; 00240 item->slink = stmt->getInt(6); 00241 00242 item->fed_crate = stmt->getInt(3); 00243 item->ddu_slot = stmt->getInt(4); 00244 item->dcc_fifo = stmt->getString(5); 00245 item->fiber_crate = stmt->getInt(7); 00246 item->fiber_pos = stmt->getInt(8); 00247 item->fiber_socket = stmt->getString(9); 00248 int chamberid = stmt->getInt(14); 00249 00250 stmt->setSQL("begin cms_emu_cern.cscmap.chamberid_crate(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20); end;"); 00251 00252 stmt->setInt (1, chamberid); 00253 stmt->registerOutParam (2, oracle::occi::OCCISTRING, 10); 00254 stmt->registerOutParam (3, oracle::occi::OCCIINT); 00255 stmt->registerOutParam (4, oracle::occi::OCCIINT); 00256 stmt->registerOutParam (5, oracle::occi::OCCIINT); 00257 stmt->registerOutParam (6, oracle::occi::OCCIINT); 00258 stmt->registerOutParam (7, oracle::occi::OCCIINT); 00259 stmt->registerOutParam (8, oracle::occi::OCCIINT); 00260 stmt->registerOutParam (9, oracle::occi::OCCIINT); 00261 stmt->registerOutParam (10, oracle::occi::OCCISTRING, 10); 00262 stmt->registerOutParam (11, oracle::occi::OCCIINT); 00263 stmt->registerOutParam (12, oracle::occi::OCCIINT); 00264 stmt->registerOutParam (13, oracle::occi::OCCIINT); 00265 stmt->registerOutParam (14, oracle::occi::OCCIINT); 00266 stmt->registerOutParam (15, oracle::occi::OCCIINT); 00267 stmt->registerOutParam (16, oracle::occi::OCCIINT); 00268 stmt->registerOutParam (17, oracle::occi::OCCIINT); 00269 stmt->registerOutParam (18, oracle::occi::OCCIINT); 00270 stmt->registerOutParam (19, oracle::occi::OCCIINT); 00271 stmt->registerOutParam (20, oracle::occi::OCCIINT); 00272 00273 stmt->execute(); //execute procedure 00274 00275 item->chamberLabel = stmt->getString(10); 00276 item->chamberId = chamberid; 00277 int chamber = chamberid/10%100; 00278 int rest = (chamberid - chamber*10)/1000; 00279 int ring = rest%10; 00280 rest = (rest - ring)/10; 00281 int station = rest%10; 00282 int endcap = (rest - station)/10; 00283 item->endcap = endcap; 00284 item->station = station; 00285 item->ring = ring; 00286 item->chamber = chamber; 00287 item->cscIndex = stmt->getInt(13); 00288 item->layerIndex = stmt->getInt(14); 00289 item->stripIndex = stmt->getInt(15); 00290 item->anodeIndex = stmt->getInt(16); 00291 item->strips = stmt->getInt(11); 00292 item->anodes = stmt->getInt(12); 00293 item->crateLabel = stmt->getString(2); 00294 item->crateid = stmt->getInt(3); 00295 item->sector = stmt->getInt(8); 00296 item->trig_sector = stmt->getInt(9); 00297 item->dmb = stmt->getInt(5); 00298 item->cscid = stmt->getInt(7); 00299 00300 stmt->execute(); //execute procedure 00301 00302 con->terminateStatement (stmt); 00303 } //end of ruiddu
oracle::occi::Connection* cscmap1::con [private] |
Definition at line 14 of file CSCMap1.h.
Referenced by chamber(), cratedmb(), cscmap1(), ruiddu(), and ~cscmap1().
oracle::occi::Environment* cscmap1::env [private] |