CMS 3D CMS Logo

List of all members | Public Member Functions
DTTFParametersOnlineProd Class Reference
Inheritance diagram for DTTFParametersOnlineProd:
L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 DTTFParametersOnlineProd (const edm::ParameterSet &)
 
std::unique_ptr< L1MuDTTFParametersnewObject (const std::string &objectKey) override
 
 ~DTTFParametersOnlineProd () override
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1MuDTTFParametersproduce (const L1MuDTTFParametersRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters >
bool getObjectKey (const L1MuDTTFParametersRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Attributes inherited from L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 33 of file DTTFParametersOnlineProd.cc.

Constructor & Destructor Documentation

DTTFParametersOnlineProd::DTTFParametersOnlineProd ( const edm::ParameterSet iConfig)

Definition at line 50 of file DTTFParametersOnlineProd.cc.

53 {
54  //the following line is needed to tell the framework what
55  // data is being produced
56 
57  //now do what ever other initialization is needed
58 }
DTTFParametersOnlineProd::~DTTFParametersOnlineProd ( )
override

Definition at line 61 of file DTTFParametersOnlineProd.cc.

62 {
63 
64  // do anything here that needs to be done at desctruction time
65  // (e.g. close files, deallocate resources etc.)
66 
67 }

Member Function Documentation

std::unique_ptr< L1MuDTTFParameters > DTTFParametersOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

Implements L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters >.

Definition at line 70 of file DTTFParametersOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), gather_cfg::cout, DEFINE_FWK_EVENTSETUP_MODULE, l1t::OMDSReader::QueryResults::fillVariable(), L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters >::m_omdsReader, l1t::OMDSReader::QueryResults::numberRows(), l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), AlCaHLTBitMon_QueryRunRegistry::string, and tmp.

71 {
72  auto pDTTFParameters = std::make_unique< L1MuDTTFParameters >() ;
73 
74  pDTTFParameters->reset() ;
75 
76  std::string dttfSchema = "CMS_DT_TF" ;
77 
78  // Order of strings is used below -- don't change!
79  std::vector< std::string > crateKeyColumns ;
80  crateKeyColumns.push_back( "WEDGE_CRATE_1" ) ;
81  crateKeyColumns.push_back( "WEDGE_CRATE_2" ) ;
82  crateKeyColumns.push_back( "WEDGE_CRATE_3" ) ;
83  crateKeyColumns.push_back( "WEDGE_CRATE_4" ) ;
84  crateKeyColumns.push_back( "WEDGE_CRATE_5" ) ;
85  crateKeyColumns.push_back( "WEDGE_CRATE_6" ) ;
86 
87  l1t::OMDSReader::QueryResults crateKeyResults =
88  m_omdsReader.basicQuery( crateKeyColumns,
89  dttfSchema,
90  "DTTF_CONF",
91  "DTTF_CONF.ID",
92  m_omdsReader.singleAttribute( objectKey ) ) ;
93 
94  if( crateKeyResults.queryFailed() ||
95  crateKeyResults.numberRows() != 1 ) // check query successful
96  {
97  edm::LogError( "L1-O2O" )
98  << "Problem with L1MuDTTFParameters key " << objectKey ;
99  return std::unique_ptr< L1MuDTTFParameters >() ;
100  }
101 
102  // print crate keys -- delete when done debugging
103  std::string crateKeys[ 6 ] ;
104  for( int icrate = 0 ; icrate < 6 ; ++icrate )
105  {
106  crateKeyResults.fillVariable( crateKeyColumns[ icrate ],
107  crateKeys[ icrate ] ) ;
108  std::cout << "Crate " << icrate << " key "
109  << crateKeys[ icrate ] << std::endl ;
110  }
111 
112  // Map of sector (0-11) to name (L/R)
113  std::string sectorNames[ 12 ] = {
114  "R", "L", "R", "L", "L", "R", "L", "R", "R", "L", "R", "L" } ;
115 
116  // Map of sector (0-11) to crate (0-5)
117  int crateNumbers[ 12 ] = { 3, 3, 4, 4, 5, 5, 2, 2, 1, 1, 0, 0 } ;
118 
119  // Map of wheel array index to wheel number (+- 3, 2, 1).
120  int wheelNumbers[ 6 ] = { -3, -2, -1, 1, 2, 3 } ;
121 
122  // Map of wheel array index to name ({N,P}{0,1,2}).
123  std::string wheelNames[ 6 ] = { "N2", "N1", "N0", "P0", "P1", "P2" } ;
124 
125  // Needed over and over later
126  std::vector< std::string > phtfMaskColumns ;
127  phtfMaskColumns.push_back( "INREC_QUAL_ST1" ) ;
128  phtfMaskColumns.push_back( "INREC_QUAL_ST2" ) ;
129  phtfMaskColumns.push_back( "INREC_QUAL_ST3" ) ;
130  phtfMaskColumns.push_back( "INREC_QUAL_ST4" ) ;
131  phtfMaskColumns.push_back( "SOC_QUAL_CSC" ) ;
132  phtfMaskColumns.push_back( "SOC_STDIS_N" ) ;
133  phtfMaskColumns.push_back( "SOC_STDIS_WL" ) ;
134  phtfMaskColumns.push_back( "SOC_STDIS_WR" ) ;
135  phtfMaskColumns.push_back( "SOC_STDIS_ZL" ) ;
136  phtfMaskColumns.push_back( "SOC_STDIS_ZR" ) ;
137  phtfMaskColumns.push_back( "SOC_QCUT_ST1" ) ;
138  phtfMaskColumns.push_back( "SOC_QCUT_ST2" ) ;
139  phtfMaskColumns.push_back( "SOC_QCUT_ST4" ) ;
140  phtfMaskColumns.push_back( "SOC_RUN_21" ) ;
141  phtfMaskColumns.push_back( "SOC_NBX_DEL" ) ;
142  phtfMaskColumns.push_back( "SOC_CSC_ETACANC" ) ;
143  phtfMaskColumns.push_back( "SOC_OPENLUT_EXTR" ) ;
144 
145  // Loop over sectors 0-11
146  for( int isc = 0 ; isc < 12 ; ++isc )
147  {
148  int crateNumber = crateNumbers[ isc ] ;
149  std::cout << "isc " << isc << " icr " << crateNumber << std::endl ;
150 
151  // Loop over wheels 0-5
152  for( int iwh = 0 ; iwh < 6 ; ++iwh )
153  {
154  std::string sectorWheelName =
155  sectorNames[ isc ] + wheelNames[ iwh ] ;
156 
157  int nwh = wheelNumbers[ iwh ] ;
158 
159  // Check if non-null crate key
160  std::string crateKey ;
161  if( crateKeyResults.fillVariable( crateKeyColumns[ crateNumber ],
162  crateKey ) )
163  {
164  // Get PHTF key
165  std::vector< std::string > phtfKeyColumns ;
166  phtfKeyColumns.push_back( "PHTF_" + sectorWheelName ) ;
167 
168  l1t::OMDSReader::QueryResults phtfKeyResults =
169  m_omdsReader.basicQuery( phtfKeyColumns,
170  dttfSchema,
171  "WEDGE_CRATE_CONF",
172  "WEDGE_CRATE_CONF.ID",
173  crateKeyResults,
174  crateKeyColumns[ crateNumber ] ) ;
175 
176  if( phtfKeyResults.queryFailed() ||
177  phtfKeyResults.numberRows() != 1 )
178  {
179  edm::LogError( "L1-O2O" )
180  << "Problem with WEDGE_CRATE_CONF key." ;
181  return std::unique_ptr< L1MuDTTFParameters >() ;
182  }
183 
185  if( phtfKeyResults.fillVariable( dummy ) )
186  {
187  std::cout << "PHTF key " << dummy << std::endl ;
188 
189  l1t::OMDSReader::QueryResults phtfMaskResults =
190  m_omdsReader.basicQuery( phtfMaskColumns,
191  dttfSchema,
192  "PHTF_CONF",
193  "PHTF_CONF.ID",
194  phtfKeyResults ) ;
195 
196  if( phtfMaskResults.queryFailed() ||
197  phtfMaskResults.numberRows() != 1 )
198  {
199  edm::LogError( "L1-O2O" )
200  << "Problem with PHTF_CONF key." ;
201  return std::unique_ptr< L1MuDTTFParameters >() ;
202  }
203 
204  long long tmp ;
205 
206  phtfMaskResults.fillVariable( "INREC_QUAL_ST1", tmp ) ;
207  std::cout << " INREC_QUAL_ST1 " << tmp ;
208  pDTTFParameters->set_inrec_qual_st1( nwh, isc, tmp ) ;
209  phtfMaskResults.fillVariable( "INREC_QUAL_ST2", tmp ) ;
210  std::cout << " INREC_QUAL_ST2 " << tmp ;
211  pDTTFParameters->set_inrec_qual_st2( nwh, isc, tmp ) ;
212  phtfMaskResults.fillVariable( "INREC_QUAL_ST3", tmp ) ;
213  std::cout << " INREC_QUAL_ST3 " << tmp ;
214  pDTTFParameters->set_inrec_qual_st3( nwh, isc, tmp ) ;
215  phtfMaskResults.fillVariable( "INREC_QUAL_ST4", tmp ) ;
216  std::cout << " INREC_QUAL_ST4 " << tmp << std::endl ;
217  pDTTFParameters->set_inrec_qual_st4( nwh, isc, tmp ) ;
218  std::cout << " SOC_QUAL_CSC " << tmp << std::endl ;
219  pDTTFParameters->set_soc_qual_csc( nwh, isc, tmp ) ;
220 
221  phtfMaskResults.fillVariable( "SOC_STDIS_N", tmp ) ;
222  std::cout << " SOC_STDIS_N " << tmp ;
223  pDTTFParameters->set_soc_stdis_n( nwh, isc, tmp ) ;
224  phtfMaskResults.fillVariable( "SOC_STDIS_WL", tmp ) ;
225  std::cout << " SOC_STDIS_WL " << tmp ;
226  pDTTFParameters->set_soc_stdis_wl( nwh, isc, tmp ) ;
227  phtfMaskResults.fillVariable( "SOC_STDIS_WR", tmp ) ;
228  std::cout << " SOC_STDIS_WR " << tmp ;
229  pDTTFParameters->set_soc_stdis_wr( nwh, isc, tmp ) ;
230  phtfMaskResults.fillVariable( "SOC_STDIS_ZL", tmp ) ;
231  std::cout << " SOC_STDIS_ZL " << tmp ;
232  pDTTFParameters->set_soc_stdis_zl( nwh, isc, tmp ) ;
233  phtfMaskResults.fillVariable( "SOC_STDIS_ZR", tmp ) ;
234  std::cout << " SOC_STDIS_ZR " << tmp << std::endl ;
235  pDTTFParameters->set_soc_stdis_zr( nwh, isc, tmp ) ;
236 
237  phtfMaskResults.fillVariable( "SOC_QCUT_ST1", tmp ) ;
238  std::cout << " SOC_QCUT_ST1 " << tmp ;
239  pDTTFParameters->set_soc_qcut_st1( nwh, isc, tmp ) ;
240  phtfMaskResults.fillVariable( "SOC_QCUT_ST2", tmp ) ;
241  std::cout << " SOC_QCUT_ST2 " << tmp ;
242  pDTTFParameters->set_soc_qcut_st2( nwh, isc, tmp ) ;
243  phtfMaskResults.fillVariable( "SOC_QCUT_ST4", tmp ) ;
244  std::cout << " SOC_QCUT_ST4 " << tmp << std::endl ;
245  pDTTFParameters->set_soc_qcut_st4( nwh, isc, tmp ) ;
246 
247  phtfMaskResults.fillVariable( "SOC_RUN_21", tmp ) ;
248  std::cout << " SOC_RUN_21 " << tmp ;
249  pDTTFParameters->set_soc_run_21( nwh, isc, tmp ) ;
250  phtfMaskResults.fillVariable( "SOC_NBX_DEL", tmp ) ;
251  std::cout << " SOC_NBX_DEL " << tmp ;
252  pDTTFParameters->set_soc_nbx_del( nwh, isc, tmp ) ;
253  phtfMaskResults.fillVariable( "SOC_CSC_ETACANC", tmp ) ;
254  std::cout << " SOC_CSC_ETACANC " << tmp ;
255  pDTTFParameters->set_soc_csc_etacanc( nwh, isc, tmp ) ;
256  phtfMaskResults.fillVariable( "SOC_OPENLUT_EXTR", tmp ) ;
257  std::cout << " SOC_OPENLUT_EXTR " << tmp << std::endl ;
258  pDTTFParameters->set_soc_openlut_extr( nwh, isc, tmp ) ;
259  }
260  }
261  }
262  }
263 
264  return pDTTFParameters ;
265 }
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
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="")
Definition: OMDSReader.cc:86
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100