CMS 3D CMS Logo

List of all members | Public Member Functions
L1GctChannelMaskOnlineProd Class Reference
Inheritance diagram for L1GctChannelMaskOnlineProd:
L1ConfigOnlineProdBase< L1GctChannelMaskRcd, L1GctChannelMask > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1GctChannelMaskOnlineProd (const edm::ParameterSet &iConfig)
 
std::unique_ptr< L1GctChannelMasknewObject (const std::string &objectKey) override
 
 ~L1GctChannelMaskOnlineProd () override
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1GctChannelMaskRcd, L1GctChannelMask >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1GctChannelMaskproduce (const L1GctChannelMaskRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (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
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (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< L1GctChannelMaskRcd, L1GctChannelMask >
bool getObjectKey (const L1GctChannelMaskRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &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< L1GctChannelMaskRcd, L1GctChannelMask >
std::optional< edm::ESConsumesCollectorT< L1GctChannelMaskRcd > > 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 L1GctChannelMaskOnlineProd.cc.

Constructor & Destructor Documentation

◆ L1GctChannelMaskOnlineProd()

L1GctChannelMaskOnlineProd::L1GctChannelMaskOnlineProd ( const edm::ParameterSet iConfig)
inline

◆ ~L1GctChannelMaskOnlineProd()

L1GctChannelMaskOnlineProd::~L1GctChannelMaskOnlineProd ( )
inlineoverride

Definition at line 9 of file L1GctChannelMaskOnlineProd.cc.

9 {}

Member Function Documentation

◆ newObject()

std::unique_ptr< L1GctChannelMask > L1GctChannelMaskOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

Implements L1ConfigOnlineProdBase< L1GctChannelMaskRcd, L1GctChannelMask >.

Definition at line 16 of file L1GctChannelMaskOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), TauDecayModes::dec, l1t::OMDSReader::QueryResults::fillVariable(), mps_fire::i, LEDCalibrationChannels::ieta, L1ConfigOnlineProdBase< L1GctChannelMaskRcd, L1GctChannelMask >::m_omdsReader, gpuClustering::pixelStatus::mask, l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), and AlCaHLTBitMon_QueryRunRegistry::string.

16  {
17  // get EM mask data
19  "GCT_EM_MASK", "CMS_GCT", "GCT_MASKS", "GCT_MASKS.CONFIG_KEY", m_omdsReader.singleAttribute(objectKey));
20 
21  if (emMaskResults.queryFailed()) { // check if query was successful
22  edm::LogError("L1-O2O") << "Problem with L1GctChannelMask EM mask for key " << objectKey;
23  return std::unique_ptr<L1GctChannelMask>();
24  }
25 
26  int emMask = -1;
27  emMaskResults.fillVariable(emMask);
28 
29  // get region masks
31  "GCT_RGN_MASK_KEY", "CMS_GCT", "GCT_MASKS", "GCT_MASKS.CONFIG_KEY", m_omdsReader.singleAttribute(objectKey));
32 
33  if (rgnMaskKeyResults.queryFailed()) { // check if query was successful
34  edm::LogError("L1-O2O") << "Problem with L1GctChannelMask region mask for key " << objectKey;
35  return std::unique_ptr<L1GctChannelMask>();
36  }
37 
38  std::string rgnKey;
39  rgnMaskKeyResults.fillVariable(rgnKey);
40 
41  std::vector<std::string> rgnMaskCols;
42  rgnMaskCols.push_back("RCT_CRATE_0_RGN_MASK");
43  rgnMaskCols.push_back("RCT_CRATE_1_RGN_MASK");
44  rgnMaskCols.push_back("RCT_CRATE_2_RGN_MASK");
45  rgnMaskCols.push_back("RCT_CRATE_3_RGN_MASK");
46  rgnMaskCols.push_back("RCT_CRATE_4_RGN_MASK");
47  rgnMaskCols.push_back("RCT_CRATE_5_RGN_MASK");
48  rgnMaskCols.push_back("RCT_CRATE_6_RGN_MASK");
49  rgnMaskCols.push_back("RCT_CRATE_7_RGN_MASK");
50  rgnMaskCols.push_back("RCT_CRATE_8_RGN_MASK");
51  rgnMaskCols.push_back("RCT_CRATE_9_RGN_MASK");
52  rgnMaskCols.push_back("RCT_CRATE_10_RGN_MASK");
53  rgnMaskCols.push_back("RCT_CRATE_11_RGN_MASK");
54  rgnMaskCols.push_back("RCT_CRATE_12_RGN_MASK");
55  rgnMaskCols.push_back("RCT_CRATE_13_RGN_MASK");
56  rgnMaskCols.push_back("RCT_CRATE_14_RGN_MASK");
57  rgnMaskCols.push_back("RCT_CRATE_15_RGN_MASK");
58  rgnMaskCols.push_back("RCT_CRATE_16_RGN_MASK");
59  rgnMaskCols.push_back("RCT_CRATE_17_RGN_MASK");
60 
62  rgnMaskCols, "CMS_GCT", "GCT_RGN_MASKS", "GCT_RGN_MASKS.CONFIG_KEY", m_omdsReader.singleAttribute(rgnKey));
63 
64  // get energy sum masks
66  "GCT_ESUM_MASK_KEY", "CMS_GCT", "GCT_MASKS", "GCT_MASKS.CONFIG_KEY", m_omdsReader.singleAttribute(objectKey));
67 
68  if (esumMaskKeyResults.queryFailed()) { // check if query was successful
69  edm::LogError("L1-O2O") << "Problem with L1GctChannelMask energy sum mask for key " << objectKey;
70  return std::unique_ptr<L1GctChannelMask>();
71  }
72 
73  std::string esumKey;
74  esumMaskKeyResults.fillVariable(esumKey);
75 
76  std::vector<std::string> esumMaskCols;
77  esumMaskCols.push_back("GCT_TET_MASK");
78  esumMaskCols.push_back("GCT_MET_MASK");
79  esumMaskCols.push_back("GCT_HT_MASK");
80  esumMaskCols.push_back("GCT_MHT_MASK");
81 
83  esumMaskCols, "CMS_GCT", "GCT_ESUM_MASKS", "GCT_ESUM_MASKS.CONFIG_KEY", m_omdsReader.singleAttribute(esumKey));
84 
85  // create masks object
86  auto masks = std::make_unique<L1GctChannelMask>();
87 
88  // set EM masks
89  for (int i = 0; i < 18; i++) {
90  if ((emMask & (1 << i)) != 0)
91  masks->maskEmCrate(i); // mask crate if emMask bit i is set
92  }
93 
94  // set region masks
95  for (unsigned irct = 0; irct < 18; irct++) {
96  std::stringstream rgnCol;
97  rgnCol << "RCT_CRATE_" << std::dec << irct << "_RGN_MASK";
98  int mask;
99  rgnMaskResults.fillVariable(rgnCol.str(), mask);
100  if (mask != 0) {
101  for (unsigned irgn = 0; irgn < 22; ++irgn) {
102  if ((mask & (1 << irgn)) != 0) {
103  edm::LogError("L1-O2O") << "Masked region, but no O2O code!";
104  }
105  }
106  }
107  }
108 
109  // set esum masks
110  int tetMask, metMask, htMask, mhtMask;
111  esumMaskResults.fillVariable("GCT_TET_MASK", tetMask);
112  esumMaskResults.fillVariable("GCT_MET_MASK", metMask);
113  esumMaskResults.fillVariable("GCT_HT_MASK", htMask);
114  esumMaskResults.fillVariable("GCT_MHT_MASK", mhtMask);
115 
116  for (int ieta = 0; ieta < 22; ieta++) {
117  if ((tetMask & (1 << ieta)) != 0)
118  masks->maskTotalEt(ieta);
119  if ((metMask & (1 << ieta)) != 0)
120  masks->maskMissingEt(ieta);
121  if ((htMask & (1 << ieta)) != 0)
122  masks->maskTotalHt(ieta);
123  if ((mhtMask & (1 << ieta)) != 0)
124  masks->maskMissingHt(ieta);
125  }
126 
127  return masks;
128 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
Log< level::Error, false > LogError
constexpr uint32_t mask
Definition: gpuClustering.h:26
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