CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual boost::shared_ptr
< L1GctChannelMask
newObject (const std::string &objectKey)
 
 ~L1GctChannelMaskOnlineProd ()
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1GctChannelMaskRcd, L1GctChannelMask >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
boost::shared_ptr
< L1GctChannelMask
produce (const L1GctChannelMaskRcd &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< L1GctChannelMaskRcd, L1GctChannelMask >
bool getObjectKey (const L1GctChannelMaskRcd &record, boost::shared_ptr< L1GctChannelMask > 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< L1GctChannelMaskRcd, L1GctChannelMask >
bool m_copyFromCondDB
 
cond::DbConnection m_dbConnection
 
cond::DbSession m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 5 of file L1GctChannelMaskOnlineProd.cc.

Constructor & Destructor Documentation

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

Definition at line 9 of file L1GctChannelMaskOnlineProd.cc.

9 {}

Member Function Documentation

boost::shared_ptr< L1GctChannelMask > L1GctChannelMaskOnlineProd::newObject ( const std::string &  objectKey)
virtual

Implements L1ConfigOnlineProdBase< L1GctChannelMaskRcd, L1GctChannelMask >.

Definition at line 16 of file L1GctChannelMaskOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), l1t::OMDSReader::QueryResults::fillVariable(), i, L1ConfigOnlineProdBase< L1GctChannelMaskRcd, L1GctChannelMask >::m_omdsReader, masks, l1t::OMDSReader::QueryResults::queryFailed(), and l1t::OMDSReader::singleAttribute().

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