CMS 3D CMS Logo

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)
 
std::unique_ptr< L1GctJetFinderParamsnewObject (const std::string &objectKey) override
 
 ~L1GctJetFinderParamsOnlineProd () override
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1GctJetFinderParamsRcd, L1GctJetFinderParams >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1GctJetFinderParamsproduce (const L1GctJetFinderParamsRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1GctJetFinderParamsRcd, L1GctJetFinderParams >
bool getObjectKey (const L1GctJetFinderParamsRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
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 >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- 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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Attributes inherited from L1ConfigOnlineProdBase< L1GctJetFinderParamsRcd, L1GctJetFinderParams >
std::optional< edm::ESConsumesCollectorT< L1GctJetFinderParamsRcd > > m_consumesCollector
 
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::L1GctJetFinderParamsOnlineProd ( const edm::ParameterSet iConfig)
inline

◆ ~L1GctJetFinderParamsOnlineProd()

L1GctJetFinderParamsOnlineProd::~L1GctJetFinderParamsOnlineProd ( )
inlineoverride

Definition at line 9 of file L1GctJetFinderParamsOnlineProd.cc.

9 {}

Member Function Documentation

◆ newObject()

std::unique_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(), mps_check::columns, TauDecayModes::dec, l1t::OMDSReader::QueryResults::fillVariable(), mps_fire::i, dqmiolumiharvest::j, L1ConfigOnlineProdBase< L1GctJetFinderParamsRcd, L1GctJetFinderParams >::m_omdsReader, L1GctJetFinderParams::N_CENTRAL_ETA_VALUES, L1GctJetFinderParams::NUMBER_ETA_VALUES, l1t::OMDSReader::QueryResults::queryFailed(), bookConverter::results, l1t::OMDSReader::singleAttribute(), and AlCaHLTBitMon_QueryRunRegistry::string.

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