40 virtual boost::shared_ptr< L1MuDTTFParameters >
newObject(
41 const std::string& objectKey ) ;
70 boost::shared_ptr< L1MuDTTFParameters >
73 using namespace edm::es;
75 boost::shared_ptr< L1MuDTTFParameters > pDTTFParameters(
78 pDTTFParameters->reset() ;
80 std::string dttfSchema =
"CMS_DT_TF" ;
83 std::vector< std::string > crateKeyColumns ;
84 crateKeyColumns.push_back(
"WEDGE_CRATE_1" ) ;
85 crateKeyColumns.push_back(
"WEDGE_CRATE_2" ) ;
86 crateKeyColumns.push_back(
"WEDGE_CRATE_3" ) ;
87 crateKeyColumns.push_back(
"WEDGE_CRATE_4" ) ;
88 crateKeyColumns.push_back(
"WEDGE_CRATE_5" ) ;
89 crateKeyColumns.push_back(
"WEDGE_CRATE_6" ) ;
98 if( crateKeyResults.queryFailed() ||
99 crateKeyResults.numberRows() != 1 )
102 <<
"Problem with L1MuDTTFParameters key " << objectKey ;
103 return boost::shared_ptr< L1MuDTTFParameters >() ;
107 std::string crateKeys[ 6 ] ;
108 for(
int icrate = 0 ; icrate < 6 ; ++icrate )
110 crateKeyResults.fillVariable( crateKeyColumns[ icrate ],
111 crateKeys[ icrate ] ) ;
112 std::cout <<
"Crate " << icrate <<
" key "
113 << crateKeys[ icrate ] << std::endl ;
117 std::string sectorNames[ 12 ] = {
118 "R",
"L",
"R",
"L",
"L",
"R",
"L",
"R",
"R",
"L",
"R",
"L" } ;
121 int crateNumbers[ 12 ] = { 3, 3, 4, 4, 5, 5, 2, 2, 1, 1, 0, 0 } ;
124 int wheelNumbers[ 6 ] = { -3, -2, -1, 1, 2, 3 } ;
127 std::string wheelNames[ 6 ] = {
"N2",
"N1",
"N0",
"P0",
"P1",
"P2" } ;
130 std::vector< std::string > phtfMaskColumns ;
131 phtfMaskColumns.push_back(
"INREC_QUAL_ST1" ) ;
132 phtfMaskColumns.push_back(
"INREC_QUAL_ST2" ) ;
133 phtfMaskColumns.push_back(
"INREC_QUAL_ST3" ) ;
134 phtfMaskColumns.push_back(
"INREC_QUAL_ST4" ) ;
135 phtfMaskColumns.push_back(
"SOC_QUAL_CSC" ) ;
136 phtfMaskColumns.push_back(
"SOC_STDIS_N" ) ;
137 phtfMaskColumns.push_back(
"SOC_STDIS_WL" ) ;
138 phtfMaskColumns.push_back(
"SOC_STDIS_WR" ) ;
139 phtfMaskColumns.push_back(
"SOC_STDIS_ZL" ) ;
140 phtfMaskColumns.push_back(
"SOC_STDIS_ZR" ) ;
141 phtfMaskColumns.push_back(
"SOC_QCUT_ST1" ) ;
142 phtfMaskColumns.push_back(
"SOC_QCUT_ST2" ) ;
143 phtfMaskColumns.push_back(
"SOC_QCUT_ST4" ) ;
144 phtfMaskColumns.push_back(
"SOC_RUN_21" ) ;
145 phtfMaskColumns.push_back(
"SOC_NBX_DEL" ) ;
146 phtfMaskColumns.push_back(
"SOC_CSC_ETACANC" ) ;
147 phtfMaskColumns.push_back(
"SOC_OPENLUT_EXTR" ) ;
150 for(
int isc = 0 ; isc < 12 ; ++isc )
152 int crateNumber = crateNumbers[ isc ] ;
153 std::cout <<
"isc " << isc <<
" icr " << crateNumber << std::endl ;
156 for(
int iwh = 0 ; iwh < 6 ; ++iwh )
158 std::string sectorWheelName =
159 sectorNames[ isc ] + wheelNames[ iwh ] ;
161 int nwh = wheelNumbers[ iwh ] ;
164 std::string crateKey ;
165 if( crateKeyResults.fillVariable( crateKeyColumns[ crateNumber ],
169 std::vector< std::string > phtfKeyColumns ;
170 phtfKeyColumns.push_back(
"PHTF_" + sectorWheelName ) ;
176 "WEDGE_CRATE_CONF.ID",
178 crateKeyColumns[ crateNumber ] ) ;
184 <<
"Problem with WEDGE_CRATE_CONF key." ;
185 return boost::shared_ptr< L1MuDTTFParameters >() ;
191 std::cout <<
"PHTF key " << dummy << std::endl ;
204 <<
"Problem with PHTF_CONF key." ;
205 return boost::shared_ptr< L1MuDTTFParameters >() ;
212 pDTTFParameters->set_inrec_qual_st1( nwh, isc, tmp ) ;
215 pDTTFParameters->set_inrec_qual_st2( nwh, isc, tmp ) ;
218 pDTTFParameters->set_inrec_qual_st3( nwh, isc, tmp ) ;
220 std::cout <<
" INREC_QUAL_ST4 " << tmp << std::endl ;
221 pDTTFParameters->set_inrec_qual_st4( nwh, isc, tmp ) ;
222 std::cout <<
" SOC_QUAL_CSC " << tmp << std::endl ;
223 pDTTFParameters->set_soc_qual_csc( nwh, isc, tmp ) ;
227 pDTTFParameters->set_soc_stdis_n( nwh, isc, tmp ) ;
230 pDTTFParameters->set_soc_stdis_wl( nwh, isc, tmp ) ;
233 pDTTFParameters->set_soc_stdis_wr( nwh, isc, tmp ) ;
236 pDTTFParameters->set_soc_stdis_zl( nwh, isc, tmp ) ;
238 std::cout <<
" SOC_STDIS_ZR " << tmp << std::endl ;
239 pDTTFParameters->set_soc_stdis_zr( nwh, isc, tmp ) ;
243 pDTTFParameters->set_soc_qcut_st1( nwh, isc, tmp ) ;
246 pDTTFParameters->set_soc_qcut_st2( nwh, isc, tmp ) ;
248 std::cout <<
" SOC_QCUT_ST4 " << tmp << std::endl ;
249 pDTTFParameters->set_soc_qcut_st4( nwh, isc, tmp ) ;
253 pDTTFParameters->set_soc_run_21( nwh, isc, tmp ) ;
256 pDTTFParameters->set_soc_nbx_del( nwh, isc, tmp ) ;
257 phtfMaskResults.
fillVariable(
"SOC_CSC_ETACANC", tmp ) ;
259 pDTTFParameters->set_soc_csc_etacanc( nwh, isc, tmp ) ;
260 phtfMaskResults.
fillVariable(
"SOC_OPENLUT_EXTR", tmp ) ;
261 std::cout <<
" SOC_OPENLUT_EXTR " << tmp << std::endl ;
262 pDTTFParameters->set_soc_openlut_extr( nwh, isc, tmp ) ;
268 return pDTTFParameters ;
bool fillVariable(const std::string &columnName, T &outputVariable) const
const QueryResults singleAttribute(const T &data) const
DTTFParametersOnlineProd(const edm::ParameterSet &)
const QueryResults basicQuery(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &tableName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="") const
l1t::OMDSReader m_omdsReader
virtual boost::shared_ptr< L1MuDTTFParameters > newObject(const std::string &objectKey)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
std::vector< std::vector< double > > tmp
~DTTFParametersOnlineProd()