#include <CaloOnlineTools/HcalOnlineDb/interface/DBlmapReader.h>
Public Member Functions | |
DBlmapReader () | |
VectorLMAP * | GetLMAP (int version) |
void | lrTestFunction (void) |
void | PrintEMAPfromLMAP (FILE *emap, VectorLMAP *lmapHBEFO) |
void | PrintLMAP (FILE *HBEFmap, FILE *HOmap, VectorLMAP *lmapHBEFO) |
Definition at line 82 of file DBlmapReader.h.
DBlmapReader::DBlmapReader | ( | ) | [inline] |
VectorLMAP * DBlmapReader::GetLMAP | ( | int | version = 30 |
) |
Definition at line 19 of file DBlmapReader.cc.
References HLT_VtxMuL3::connect, GenMuonPlsPt100GeV_cfg::cout, archive::db, e, lat::endl(), getString(), and sstemp.
00019 { 00020 HCALConfigDB * db = new HCALConfigDB(); 00021 const string _accessor = "occi://CMS_HCL_PRTTYPE_HCAL_READER@anyhost/int2r?PASSWORD=HCAL_Reader_88,LHWM_VERSION=22"; 00022 db -> connect( _accessor ); 00023 00024 oracle::occi::Connection * myConn = db -> getConnection(); 00025 00026 int CHAcount = 0; 00027 VectorLMAP* lmapHBEFO = new VectorLMAP(); 00028 00029 sstemp.str(""); 00030 sstemp<<"'"<<LMversion<<"'"; 00031 string verstring = sstemp.str(); 00032 sstemp.str(""); 00033 00034 try { 00035 Statement* stmt = myConn -> createStatement(); 00036 00037 string query = (" SELECT C.VERSION, "); 00038 query += " H.SIDE, H.ETA, H.PHI, "; 00039 query += " H.DELTA_PHI, H.DEPTH, H.SUBDETECTOR, H.RBX, H.WEDGE, "; 00040 query += " H.SECTOR, H.RM_SLOT, H.HPD_PIXEL, H.QIE_SLOT, H.ADC, "; 00041 query += " H.RM_FIBER, H.FIBER_CHANNEL, H.LETTER_CODE, H.CRATE, H.HTR_SLOT, "; 00042 query += " H.HTR_FPGA, H.HTR_FIBER, H.DCC_SL, H.SPIGOT, H.DCC_SLOT, "; 00043 query += " H.SLB_SITE, H.SLB_CHANNEL, H.SLB_CHANNEL2, H.SLB_CABLE, H.RCT_CRATE, "; 00044 query += " H.RCT_CARD, H.RCT_CONNECTOR, H.RCT_NAME, H.FED_ID "; 00045 query += " FROM CMS_HCL_HCAL_CONDITION_OWNER.HCAL_HARDWARE_LOGICAL_MAPS_V3 H inner join "; 00046 query += " CMS_HCL_CORE_CONDITION_OWNER.COND_DATA_SETS C "; 00047 query += " on C.CONDITION_DATA_SET_ID=H.CONDITION_DATA_SET_ID "; 00048 query += " inner join CMS_HCL_CORE_CONDITION_OWNER.KINDS_OF_CONDITIONS K "; 00049 query += " on K.KIND_OF_CONDITION_ID=C.KIND_OF_CONDITION_ID "; 00050 query += " where C.IS_RECORD_DELETED='F' and K.IS_RECORD_DELETED='F' "; 00051 query += " and K.NAME='HCAL hardware logical channel maps v3' "; 00052 query += " and C.VERSION="; 00053 query += verstring; 00054 00055 //SELECT 00056 ResultSet *rs = stmt->executeQuery(query.c_str()); 00057 00058 while (rs->next() && CHAcount < 10000) { 00059 00060 lmapHBEFO -> versionC . push_back( rs -> getInt(1) ); 00061 lmapHBEFO -> sideC . push_back( rs -> getInt(2) ); 00062 lmapHBEFO -> etaC . push_back( rs -> getInt(3) ); 00063 lmapHBEFO -> phiC . push_back( rs -> getInt(4) ); 00064 lmapHBEFO -> dphiC . push_back( rs -> getInt(5) ); 00065 00066 lmapHBEFO -> depthC . push_back( rs -> getInt(6) ); 00067 lmapHBEFO -> detC . push_back( rs -> getString(7) ); 00068 lmapHBEFO -> rbxC . push_back( rs -> getString(8) ); 00069 lmapHBEFO -> wedgeC . push_back( rs -> getInt(9) ); 00070 lmapHBEFO -> sectorC . push_back( rs -> getInt(10) ); 00071 00072 lmapHBEFO -> rmC . push_back( rs -> getInt(11) ); 00073 lmapHBEFO -> pixelC . push_back( rs -> getInt(12) ); 00074 lmapHBEFO -> qieC . push_back( rs -> getInt(13) ); 00075 lmapHBEFO -> adcC . push_back( rs -> getInt(14) ); 00076 lmapHBEFO -> rm_fiC . push_back( rs -> getInt(15) ); 00077 00078 lmapHBEFO -> fi_chC . push_back( rs -> getInt(16) ); 00079 lmapHBEFO -> let_codeC . push_back( rs -> getString(17) ); 00080 lmapHBEFO -> crateC . push_back( rs -> getInt(18) ); 00081 lmapHBEFO -> htrC . push_back( rs -> getInt(19) ); 00082 lmapHBEFO -> fpgaC . push_back( rs -> getString(20) ); 00083 00084 lmapHBEFO -> htr_fiC . push_back( rs -> getInt(21) ); 00085 lmapHBEFO -> dcc_slC . push_back( rs -> getInt(22) ); 00086 lmapHBEFO -> spigoC . push_back( rs -> getInt(23) ); 00087 lmapHBEFO -> dccC . push_back( rs -> getInt(24) ); 00088 lmapHBEFO -> slbC . push_back( rs -> getInt(25) ); 00089 00090 lmapHBEFO -> slbinC . push_back( rs -> getString(26) ); 00091 lmapHBEFO -> slbin2C . push_back( rs -> getString(27) ); 00092 lmapHBEFO -> slnamC . push_back( rs -> getString(28) ); 00093 lmapHBEFO -> rctcraC . push_back( rs -> getInt(29) ); 00094 lmapHBEFO -> rctcarC . push_back( rs -> getInt(30) ); 00095 00096 lmapHBEFO -> rctconC . push_back( rs -> getInt(31) ); 00097 lmapHBEFO -> rctnamC . push_back( rs -> getString(32) ); 00098 lmapHBEFO -> fedidC . push_back( rs -> getInt(33) ); 00099 00100 lmapHBEFO -> orderC . push_back( CHAcount ); 00101 00102 CHAcount++; 00103 } 00104 //Always terminate statement 00105 myConn -> terminateStatement(stmt); 00106 } 00107 catch (SQLException& e) { 00108 cout<<"Couldn't get statement"<<endl; 00109 } 00110 db -> disconnect(); 00111 00112 return lmapHBEFO; 00113 }
Definition at line 13 of file DBlmapReader.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
void DBlmapReader::PrintEMAPfromLMAP | ( | FILE * | emap, | |
VectorLMAP * | lmapHBEFO | |||
) |
Definition at line 142 of file DBlmapReader.cc.
References i, VectorLMAP::orderC, printEMAProw(), SortByGeometry(), and SortByHardware().
00142 { 00143 00144 int CHAcount = lmapHBEFO->orderC.size(); 00145 00146 lmapHBEFO = SortByHardware(lmapHBEFO); 00147 for (i = 0; i < CHAcount; i++){ 00148 if (lmapHBEFO ->detC[lmapHBEFO -> orderC[i]] != "HO") printEMAProw(i, emap, lmapHBEFO); 00149 } 00150 00151 lmapHBEFO = SortByGeometry(lmapHBEFO); 00152 for (i = 0; i < CHAcount; i++){ 00153 if (lmapHBEFO -> detC[lmapHBEFO -> orderC[i]] == "HO") printEMAProw(i, emap, lmapHBEFO); 00154 } 00155 00156 return; 00157 }
void DBlmapReader::PrintLMAP | ( | FILE * | HBEFmap, | |
FILE * | HOmap, | |||
VectorLMAP * | lmapHBEFO | |||
) |
Definition at line 115 of file DBlmapReader.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), i, VectorLMAP::orderC, printHBHEHF(), printHO(), SortByGeometry(), and SortByHardware().
00115 { 00116 00117 int CHAcount = lmapHBEFO->orderC.size(); 00118 00119 lmapHBEFO = SortByHardware(lmapHBEFO); 00120 for (i = 0; i < CHAcount; i++){ 00121 if (lmapHBEFO -> orderC[i] >= CHAcount){ 00122 cout<<"Bad order vector"; 00123 break; 00124 } 00125 00126 if (lmapHBEFO -> detC[lmapHBEFO -> orderC[i]] != "HO") printHBHEHF(i, HBEFmap, lmapHBEFO); 00127 } 00128 00129 lmapHBEFO = SortByGeometry(lmapHBEFO); 00130 for (i = 0; i < CHAcount; i++){ 00131 if (lmapHBEFO -> orderC[i] >= CHAcount){ 00132 cout<<"Bad order vector"; 00133 break; 00134 } 00135 if (lmapHBEFO -> detC[lmapHBEFO -> orderC[i]] == "HO") printHO(i, HOmap, lmapHBEFO); 00136 } 00137 00138 cout<<CHAcount<<endl; 00139 return; 00140 }