CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
virtual boost::shared_ptr
< L1MuDTTFParameters
newObject (const std::string &objectKey)
 
 ~DTTFParametersOnlineProd ()
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
boost::shared_ptr
< L1MuDTTFParameters
produce (const L1MuDTTFParametersRcd &iRecord)
 
 ~L1ConfigOnlineProdBase ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- 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, boost::shared_ptr< L1MuDTTFParameters > data, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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::DbConnection m_dbConnection
 
cond::DbSession m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

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

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

Definition at line 34 of file DTTFParametersOnlineProd.cc.

Constructor & Destructor Documentation

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

Definition at line 51 of file DTTFParametersOnlineProd.cc.

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

Definition at line 62 of file DTTFParametersOnlineProd.cc.

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

Member Function Documentation

boost::shared_ptr< L1MuDTTFParameters > DTTFParametersOnlineProd::newObject ( const std::string &  objectKey)
virtual

Implements L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters >.

Definition at line 71 of file DTTFParametersOnlineProd.cc.

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

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