CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
L1GctJetFinderParamsOnlineProd Class Reference
Inheritance diagram for L1GctJetFinderParamsOnlineProd:
L1ConfigOnlineProdBase< L1GctJetFinderParamsRcd, L1GctJetFinderParams > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1GctJetFinderParamsOnlineProd (const edm::ParameterSet &iConfig)
 
virtual boost::shared_ptr
< L1GctJetFinderParams
newObject (const std::string &objectKey) override
 
 ~L1GctJetFinderParamsOnlineProd ()
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1GctJetFinderParamsRcd, L1GctJetFinderParams >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
boost::shared_ptr
< L1GctJetFinderParams
produce (const L1GctJetFinderParamsRcd &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< L1GctJetFinderParamsRcd, L1GctJetFinderParams >
bool getObjectKey (const L1GctJetFinderParamsRcd &record, boost::shared_ptr< L1GctJetFinderParams > 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< L1GctJetFinderParamsRcd, L1GctJetFinderParams >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 5 of file L1GctJetFinderParamsOnlineProd.cc.

Constructor & Destructor Documentation

L1GctJetFinderParamsOnlineProd::L1GctJetFinderParamsOnlineProd ( const edm::ParameterSet iConfig)
inline
L1GctJetFinderParamsOnlineProd::~L1GctJetFinderParamsOnlineProd ( )
inline

Definition at line 9 of file L1GctJetFinderParamsOnlineProd.cc.

9 {}

Member Function Documentation

boost::shared_ptr< L1GctJetFinderParams > L1GctJetFinderParamsOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

Implements L1ConfigOnlineProdBase< L1GctJetFinderParamsRcd, L1GctJetFinderParams >.

Definition at line 16 of file L1GctJetFinderParamsOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), TauDecayModes::dec, l1t::OMDSReader::QueryResults::fillVariable(), i, j, L1ConfigOnlineProdBase< L1GctJetFinderParamsRcd, L1GctJetFinderParams >::m_omdsReader, L1GctJetFinderParams::N_CENTRAL_ETA_VALUES, L1GctJetFinderParams::NUMBER_ETA_VALUES, l1t::OMDSReader::QueryResults::queryFailed(), python.entryComment::results, l1t::OMDSReader::singleAttribute(), and AlCaHLTBitMon_QueryRunRegistry::string.

17 {
18  // Execute SQL queries to get data from OMDS (using key) and make C++ object
19  // Example: SELECT A_PARAMETER FROM CMS_XXX.XXX_CONF WHERE XXX_CONF.XXX_KEY = objectKey
20 
21  // get parameters
22  std::vector< std::string > columns;
23  columns.push_back( "GCT_RGN_ET_LSB" );
24  columns.push_back( "GCT_HT_LSB" );
25  columns.push_back( "GCT_CJET_SEED_ET_THRESHOLD" );
26  columns.push_back( "GCT_TJET_SEED_ET_THRESHOLD" );
27  columns.push_back( "GCT_FJET_SEED_ET_THRESHOLD" );
28  columns.push_back( "GCT_HT_JET_ET_THRESHOLD" );
29  columns.push_back( "GCT_MHT_JET_ET_THRESHOLD" );
30  columns.push_back( "GCT_TAU_ISO_ET_THRESHOLD" );
31  columns.push_back( "GCT_CEN_JET_ETA_MAX" );
32  columns.push_back( "GCT_JET_CORR_KEY" );
33 
36  columns,
37  "CMS_GCT",
38  "GCT_PHYS_PARAMS",
39  "GCT_PHYS_PARAMS.CONFIG_KEY",
40  m_omdsReader.singleAttribute( objectKey ) ) ;
41 
42  if( results.queryFailed() ) // check if query was successful
43  {
44  edm::LogError( "L1-O2O" ) << "Problem with L1GctJetFinderParams key." ;
45  return boost::shared_ptr< L1GctJetFinderParams >() ;
46  }
47 
48  // fill values
49  double rgnEtLsb=0.;
50  double htLsb=0.;
51  double cJetSeed=0.;
52  double tJetSeed=0.;
53  double fJetSeed=0.;
54  double tauIsoEtThresh=0.;
55  double htJetEtThresh=0.;
56  double mhtJetEtThresh=0.;
57  short int etaBoundary=7;
58  int corrType=0;
59  std::vector< std::vector<double> > jetCorrCoeffs;
60  std::vector< std::vector<double> > tauCorrCoeffs;
61  bool convertToEnergy=false; // Not in OMDS
62  std::vector<double> energyConvCoeffs(11); // Not in OMDS
63  std::string jetCorrKey;
64 
65  results.fillVariable( "GCT_RGN_ET_LSB", rgnEtLsb );
66  results.fillVariable( "GCT_HT_LSB", htLsb );
67  results.fillVariable( "GCT_CJET_SEED_ET_THRESHOLD", cJetSeed );
68  results.fillVariable( "GCT_TJET_SEED_ET_THRESHOLD", tJetSeed );
69  results.fillVariable( "GCT_FJET_SEED_ET_THRESHOLD", fJetSeed );
70  results.fillVariable( "GCT_TAU_ISO_ET_THRESHOLD", tauIsoEtThresh );
71  results.fillVariable( "GCT_HT_JET_ET_THRESHOLD", htJetEtThresh );
72  results.fillVariable( "GCT_MHT_JET_ET_THRESHOLD", mhtJetEtThresh );
73  results.fillVariable( "GCT_CEN_JET_ETA_MAX", etaBoundary );
74  results.fillVariable( "GCT_JET_CORR_KEY", jetCorrKey );
75 
76  edm::LogInfo("L1-O2O") << "L1 jet corrections key : " << jetCorrKey << std::endl;
77 
78  // get jet corr coefficients
79  std::vector< std::string > jetCorrColumns;
80  jetCorrColumns.push_back( "GCT_JETCORR_TYPE" );
81  jetCorrColumns.push_back( "GCT_JETCORR_NETA_10" );
82  jetCorrColumns.push_back( "GCT_JETCORR_NETA_9" );
83  jetCorrColumns.push_back( "GCT_JETCORR_NETA_8" );
84  jetCorrColumns.push_back( "GCT_JETCORR_NETA_7" );
85  jetCorrColumns.push_back( "GCT_JETCORR_NETA_6" );
86  jetCorrColumns.push_back( "GCT_JETCORR_NETA_5" );
87  jetCorrColumns.push_back( "GCT_JETCORR_NETA_4" );
88  jetCorrColumns.push_back( "GCT_JETCORR_NETA_3" );
89  jetCorrColumns.push_back( "GCT_JETCORR_NETA_2" );
90  jetCorrColumns.push_back( "GCT_JETCORR_NETA_1" );
91  jetCorrColumns.push_back( "GCT_JETCORR_NETA_0" );
92  jetCorrColumns.push_back( "GCT_JETCORR_PETA_0" );
93  jetCorrColumns.push_back( "GCT_JETCORR_PETA_1" );
94  jetCorrColumns.push_back( "GCT_JETCORR_PETA_2" );
95  jetCorrColumns.push_back( "GCT_JETCORR_PETA_3" );
96  jetCorrColumns.push_back( "GCT_JETCORR_PETA_4" );
97  jetCorrColumns.push_back( "GCT_JETCORR_PETA_5" );
98  jetCorrColumns.push_back( "GCT_JETCORR_PETA_6" );
99  jetCorrColumns.push_back( "GCT_JETCORR_PETA_7" );
100  jetCorrColumns.push_back( "GCT_JETCORR_PETA_8" );
101  jetCorrColumns.push_back( "GCT_JETCORR_PETA_9" );
102  jetCorrColumns.push_back( "GCT_JETCORR_PETA_10" );
103 
104  l1t::OMDSReader::QueryResults jetCorrResults =
106  jetCorrColumns,
107  "CMS_GCT",
108  "GCT_JET_CORRECTIONS",
109  "GCT_JET_CORRECTIONS.CONFIG_KEY",
110  m_omdsReader.singleAttribute( jetCorrKey ) ) ;
111 
112  if( jetCorrResults.queryFailed() ) // check if query was successful
113  {
114  edm::LogError( "L1-O2O" ) << "Problem getting L1 jet corrections" ;
115  return boost::shared_ptr< L1GctJetFinderParams >() ;
116  }
117 
118  // fill jet corr type
119  jetCorrResults.fillVariable( "GCT_JETCORR_TYPE", corrType );
120 
121  edm::LogInfo("L1-O2O") << "L1 jet corrections type : " << corrType << std::endl;
122 
123  // get coefficients
124  for (unsigned i=0; i < L1GctJetFinderParams::NUMBER_ETA_VALUES; ++i) {
125 
126  // get corr key for eta value
127  std::stringstream etaCol;
128  etaCol << "GCT_JETCORR_NETA_" << std::dec << i;
129  std::string etaKey;
130  jetCorrResults.fillVariable( etaCol.str(), etaKey );
131 
132  std::vector< std::string > coeffColumns;
133  coeffColumns.push_back( "GCT_JETCORR_C0" );
134  coeffColumns.push_back( "GCT_JETCORR_C1" );
135  coeffColumns.push_back( "GCT_JETCORR_C2" );
136  coeffColumns.push_back( "GCT_JETCORR_C3" );
137  coeffColumns.push_back( "GCT_JETCORR_C4" );
138  coeffColumns.push_back( "GCT_JETCORR_C5" );
139  coeffColumns.push_back( "GCT_JETCORR_C6" );
140  coeffColumns.push_back( "GCT_JETCORR_C7" );
141  coeffColumns.push_back( "GCT_JETCORR_C8" );
142  coeffColumns.push_back( "GCT_JETCORR_C9" );
143  coeffColumns.push_back( "GCT_JETCORR_C10" );
144  coeffColumns.push_back( "GCT_JETCORR_C11" );
145  coeffColumns.push_back( "GCT_JETCORR_C12" );
146  coeffColumns.push_back( "GCT_JETCORR_C13" );
147  coeffColumns.push_back( "GCT_JETCORR_C14" );
148  coeffColumns.push_back( "GCT_JETCORR_C15" );
149  coeffColumns.push_back( "GCT_JETCORR_C16" );
150  coeffColumns.push_back( "GCT_JETCORR_C17" );
151  coeffColumns.push_back( "GCT_JETCORR_C18" );
152  coeffColumns.push_back( "GCT_JETCORR_C19" );
153 
154  l1t::OMDSReader::QueryResults jetCorrResults =
156  coeffColumns,
157  "CMS_GCT",
158  "GCT_JET_COEFFS",
159  "GCT_JET_COEFFS.CONFIG_KEY",
160  m_omdsReader.singleAttribute( etaKey ) ) ;
161 
162  if( results.queryFailed() ) // check if query was successful
163  {
164  edm::LogError( "L1-O2O" ) << "Problem getting L1 jet correction coefficients" ;
165  return boost::shared_ptr< L1GctJetFinderParams >() ;
166  }
167 
168  // fill coeffs - TODO
169  std::vector<double> coeffs;
170 
171  unsigned nCoeffs = 0;
172  if (corrType == 0) nCoeffs = 0;
173  else if (corrType == 2) nCoeffs=8; // ORCA style
174  else if (corrType == 3) nCoeffs=4; // Simple
175  else if (corrType == 4) nCoeffs=15; // piecewise-cubic
176  else if (corrType == 5) nCoeffs=6; // PF
177  else {
178  edm::LogError( "L1-O2O" ) << "Unsupported jet correction type : " << corrType ;
179  return boost::shared_ptr< L1GctJetFinderParams >() ;
180  }
181 
182  for (unsigned j=0; j< nCoeffs; ++j) {
183  std::stringstream coeffCol;
184  coeffCol << "GCT_JETCORR_C" << std::dec << j;
185  // int coeff;
186  double coeff;
187  jetCorrResults.fillVariable( coeffCol.str(), coeff );
188 
189  coeffs.push_back(coeff);
190  }
191 
192  jetCorrCoeffs.push_back(coeffs);
193 
194  // copy to tau coeffs
195  if (i < L1GctJetFinderParams::N_CENTRAL_ETA_VALUES) tauCorrCoeffs.push_back(coeffs);
196 
197  }
198 
199 
200 
201  return boost::shared_ptr< L1GctJetFinderParams >(
202  new L1GctJetFinderParams( rgnEtLsb,
203  htLsb,
204  cJetSeed,
205  fJetSeed,
206  tJetSeed,
207  tauIsoEtThresh,
208  htJetEtThresh,
209  mhtJetEtThresh,
210  etaBoundary,
211  corrType,
212  jetCorrCoeffs,
213  tauCorrCoeffs,
214  convertToEnergy,
215  energyConvCoeffs
216 
217  )
218  );
219 
220 }
int i
Definition: DBlmapReader.cc:9
static const unsigned N_CENTRAL_ETA_VALUES
Number of eta bins used in correction.
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
int j
Definition: DBlmapReader.cc:9
static const unsigned NUMBER_ETA_VALUES
Number of eta bins used in correction.