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 ()
 
 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< L1MuDTTFParametersRcd, L1MuDTTFParameters >
bool getObjectKey (const L1MuDTTFParametersRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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={})
 
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< 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 32 of file DTTFParametersOnlineProd.cc.

Constructor & Destructor Documentation

◆ DTTFParametersOnlineProd()

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

Definition at line 46 of file DTTFParametersOnlineProd.cc.

48  //the following line is needed to tell the framework what
49  // data is being produced
50 
51  //now do what ever other initialization is needed
52 }

◆ ~DTTFParametersOnlineProd()

DTTFParametersOnlineProd::~DTTFParametersOnlineProd ( )
override

Definition at line 54 of file DTTFParametersOnlineProd.cc.

54  {
55  // do anything here that needs to be done at desctruction time
56  // (e.g. close files, deallocate resources etc.)
57 }

Member Function Documentation

◆ newObject()

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

Implements L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters >.

Definition at line 59 of file DTTFParametersOnlineProd.cc.

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

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(), AlCaHLTBitMon_QueryRunRegistry::string, and createJobs::tmp.

l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters >::m_omdsReader
l1t::OMDSReader m_omdsReader
Definition: L1ConfigOnlineProdBase.h:65
gather_cfg.cout
cout
Definition: gather_cfg.py:144
l1t::OMDSReader::singleAttribute
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
L1ConfigOnlineProdBase< L1MuDTTFParametersRcd, L1MuDTTFParameters >
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
l1t::OMDSReader::QueryResults::fillVariable
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::OMDSReader::QueryResults::numberRows
int numberRows() const
Definition: OMDSReader.h:60
l1t::OMDSReader::basicQuery
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
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
l1t::OMDSReader::QueryResults::queryFailed
bool queryFailed() const
Definition: OMDSReader.h:59
dummy
Definition: DummySelector.h:38