CMS 3D CMS Logo

List of all members | Public Member Functions
L1RCTChannelMaskOnlineProd Class Reference
Inheritance diagram for L1RCTChannelMaskOnlineProd:
L1ConfigOnlineProdBase< L1RCTChannelMaskRcd, L1RCTChannelMask > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1RCTChannelMaskOnlineProd (const edm::ParameterSet &iConfig)
 
std::shared_ptr< L1RCTChannelMasknewObject (const std::string &objectKey) override
 
 ~L1RCTChannelMaskOnlineProd () override
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1RCTChannelMaskRcd, L1RCTChannelMask >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::shared_ptr< L1RCTChannelMaskproduce (const L1RCTChannelMaskRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- 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 () noexcept(false)
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1RCTChannelMaskRcd, L1RCTChannelMask >
bool getObjectKey (const L1RCTChannelMaskRcd &record, std::shared_ptr< L1RCTChannelMask > 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::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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< L1RCTChannelMaskRcd, L1RCTChannelMask >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 37 of file L1RCTChannelMaskOnlineProd.cc.

Constructor & Destructor Documentation

L1RCTChannelMaskOnlineProd::L1RCTChannelMaskOnlineProd ( const edm::ParameterSet iConfig)
inline
L1RCTChannelMaskOnlineProd::~L1RCTChannelMaskOnlineProd ( )
inlineoverride

Definition at line 42 of file L1RCTChannelMaskOnlineProd.cc.

References newObject(), and AlCaHLTBitMon_QueryRunRegistry::string.

42 {}

Member Function Documentation

std::shared_ptr< L1RCTChannelMask > L1RCTChannelMaskOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

Implements L1ConfigOnlineProdBase< L1RCTChannelMaskRcd, L1RCTChannelMask >.

Definition at line 64 of file L1RCTChannelMaskOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), gather_cfg::cout, DEFINE_FWK_EVENTSETUP_MODULE, l1t::OMDSReader::QueryResults::fillVariable(), mps_fire::i, gen::k, funct::m, L1ConfigOnlineProdBase< L1RCTChannelMaskRcd, L1RCTChannelMask >::m_omdsReader, l1t::OMDSReader::QueryResults::numberRows(), l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~L1RCTChannelMaskOnlineProd().

65 {
66  using namespace edm::es;
67 
68 
69  std::cout << " Current key is " << objectKey <<std::endl;
70 
71  std::string rctSchema = "CMS_RCT" ;
72 
73  std::vector< std::string > dc_maskStrings;
74  dc_maskStrings.push_back( "HCAL_MASK_CR00_EVEN" );
75  dc_maskStrings.push_back( "HCAL_MASK_CR00_ODD" );
76  dc_maskStrings.push_back( "HCAL_MASK_CR01_EVEN" );
77  dc_maskStrings.push_back( "HCAL_MASK_CR01_ODD" );
78  dc_maskStrings.push_back( "HCAL_MASK_CR02_EVEN" );
79  dc_maskStrings.push_back( "HCAL_MASK_CR02_ODD" );
80  dc_maskStrings.push_back( "HCAL_MASK_CR03_EVEN" );
81  dc_maskStrings.push_back( "HCAL_MASK_CR03_ODD" );
82  dc_maskStrings.push_back( "HCAL_MASK_CR04_EVEN" );
83  dc_maskStrings.push_back( "HCAL_MASK_CR04_ODD" );
84  dc_maskStrings.push_back( "HCAL_MASK_CR05_EVEN" );
85  dc_maskStrings.push_back( "HCAL_MASK_CR05_ODD" );
86  dc_maskStrings.push_back( "HCAL_MASK_CR06_EVEN" );
87  dc_maskStrings.push_back( "HCAL_MASK_CR06_ODD" );
88  dc_maskStrings.push_back( "HCAL_MASK_CR07_EVEN" );
89  dc_maskStrings.push_back( "HCAL_MASK_CR07_ODD" );
90  dc_maskStrings.push_back( "HCAL_MASK_CR08_EVEN" );
91  dc_maskStrings.push_back( "HCAL_MASK_CR08_ODD" );
92  dc_maskStrings.push_back( "HCAL_MASK_CR09_EVEN" );
93  dc_maskStrings.push_back( "HCAL_MASK_CR09_ODD" );
94  dc_maskStrings.push_back( "HCAL_MASK_CR10_EVEN" );
95  dc_maskStrings.push_back( "HCAL_MASK_CR10_ODD" );
96  dc_maskStrings.push_back( "HCAL_MASK_CR11_EVEN" );
97  dc_maskStrings.push_back( "HCAL_MASK_CR11_ODD" );
98  dc_maskStrings.push_back( "HCAL_MASK_CR12_EVEN" );
99  dc_maskStrings.push_back( "HCAL_MASK_CR12_ODD" );
100  dc_maskStrings.push_back( "HCAL_MASK_CR13_EVEN" );
101  dc_maskStrings.push_back( "HCAL_MASK_CR13_ODD" );
102  dc_maskStrings.push_back( "HCAL_MASK_CR14_EVEN" );
103  dc_maskStrings.push_back( "HCAL_MASK_CR14_ODD" );
104  dc_maskStrings.push_back( "HCAL_MASK_CR15_EVEN" );
105  dc_maskStrings.push_back( "HCAL_MASK_CR15_ODD" );
106  dc_maskStrings.push_back( "HCAL_MASK_CR16_EVEN" );
107  dc_maskStrings.push_back( "HCAL_MASK_CR16_ODD" );
108  dc_maskStrings.push_back( "HCAL_MASK_CR17_EVEN" );
109  dc_maskStrings.push_back( "HCAL_MASK_CR17_ODD" );
110  dc_maskStrings.push_back( "ECAL_MASK_CR00_EVEN" );
111  dc_maskStrings.push_back( "ECAL_MASK_CR00_ODD" );
112  dc_maskStrings.push_back( "ECAL_MASK_CR01_EVEN" );
113  dc_maskStrings.push_back( "ECAL_MASK_CR01_ODD" );
114  dc_maskStrings.push_back( "ECAL_MASK_CR02_EVEN" );
115  dc_maskStrings.push_back( "ECAL_MASK_CR02_ODD" );
116  dc_maskStrings.push_back( "ECAL_MASK_CR03_EVEN" );
117  dc_maskStrings.push_back( "ECAL_MASK_CR03_ODD" );
118  dc_maskStrings.push_back( "ECAL_MASK_CR04_EVEN" );
119  dc_maskStrings.push_back( "ECAL_MASK_CR04_ODD" );
120  dc_maskStrings.push_back( "ECAL_MASK_CR05_EVEN" );
121  dc_maskStrings.push_back( "ECAL_MASK_CR05_ODD" );
122  dc_maskStrings.push_back( "ECAL_MASK_CR06_EVEN" );
123  dc_maskStrings.push_back( "ECAL_MASK_CR06_ODD" );
124  dc_maskStrings.push_back( "ECAL_MASK_CR07_EVEN" );
125  dc_maskStrings.push_back( "ECAL_MASK_CR07_ODD" );
126  dc_maskStrings.push_back( "ECAL_MASK_CR08_EVEN" );
127  dc_maskStrings.push_back( "ECAL_MASK_CR08_ODD" );
128  dc_maskStrings.push_back( "ECAL_MASK_CR09_EVEN" );
129  dc_maskStrings.push_back( "ECAL_MASK_CR09_ODD" );
130  dc_maskStrings.push_back( "ECAL_MASK_CR10_EVEN" );
131  dc_maskStrings.push_back( "ECAL_MASK_CR10_ODD" );
132  dc_maskStrings.push_back( "ECAL_MASK_CR11_EVEN" );
133  dc_maskStrings.push_back( "ECAL_MASK_CR11_ODD" );
134  dc_maskStrings.push_back( "ECAL_MASK_CR12_EVEN" );
135  dc_maskStrings.push_back( "ECAL_MASK_CR12_ODD" );
136  dc_maskStrings.push_back( "ECAL_MASK_CR13_EVEN" );
137  dc_maskStrings.push_back( "ECAL_MASK_CR13_ODD" );
138  dc_maskStrings.push_back( "ECAL_MASK_CR14_EVEN" );
139  dc_maskStrings.push_back( "ECAL_MASK_CR14_ODD" );
140  dc_maskStrings.push_back( "ECAL_MASK_CR15_EVEN" );
141  dc_maskStrings.push_back( "ECAL_MASK_CR15_ODD" );
142  dc_maskStrings.push_back( "ECAL_MASK_CR16_EVEN" );
143  dc_maskStrings.push_back( "ECAL_MASK_CR16_ODD" );
144  dc_maskStrings.push_back( "ECAL_MASK_CR17_EVEN" );
145  dc_maskStrings.push_back( "ECAL_MASK_CR17_ODD" );
146 
147  l1t::OMDSReader::QueryResults dcMaskResults =
149  dc_maskStrings,
150  rctSchema,
151  "RCT_DEADCHANNEL_SUMMARY",
152  "RCT_DEADCHANNEL_SUMMARY.ID",
153  m_omdsReader.basicQuery( "DC_SUM_ID",
154  rctSchema,
155  "RCT_RUN_SETTINGS_KEY",
156  "RCT_RUN_SETTINGS_KEY.ID",
157  m_omdsReader.singleAttribute( objectKey))) ;
158 
159 
160 
161  if( dcMaskResults.queryFailed() ||
162  dcMaskResults.numberRows() != 1 ) // check query successful
163  {
164  edm::LogError( "L1-O2O" ) << "Problem with L1RCTChannelMask key." ;
165 
166 
167  std::cout << " Returened rows " << dcMaskResults.numberRows() <<std::endl;
168  return std::shared_ptr< L1RCTChannelMask >() ;
169  }
170 
172 
173  long long hcal_temp = 0LL;
174  int ecal_temp = 0;
175  for(int i = 0 ; i < 36 ; i++) {
176  dcMaskResults.fillVariable(dc_maskStrings.at(i),hcal_temp);
177  for(int j = 0; j < 32 ; j++)
178  if(j< 28)
179  m->hcalMask[i/2][i%2][j] = ((hcal_temp >> j ) & 1) == 1;
180  else
181  m->hfMask[i/2][i%2][j-28] = ((hcal_temp >> j ) & 1) == 1;
182  }
183  for(int i = 36; i < 72 ; i++) {
184  dcMaskResults.fillVariable(dc_maskStrings.at(i),ecal_temp);
185  for(int j = 0; j < 28 ; j++) {
186  int k = i - 36;
187  m->ecalMask[k/2][k%2][j] = ((ecal_temp >> j ) & 1) ==1;
188  }
189  }
190 
191  // FIND dummy cards from TSC key in crate conf
192 
193 
194 
195  std::vector< std::string > cardMaskStrings;
196  cardMaskStrings.push_back("RC0");
197  cardMaskStrings.push_back("RC1");
198  cardMaskStrings.push_back("RC2");
199  cardMaskStrings.push_back("RC3");
200  cardMaskStrings.push_back("RC4");
201  cardMaskStrings.push_back("RC5");
202  cardMaskStrings.push_back("RC6");
203  cardMaskStrings.push_back("JSC");
204 
205 
206  std::vector< std::string > crateIDStrings;
207  crateIDStrings.push_back("RCT_CRATE_0");
208  crateIDStrings.push_back("RCT_CRATE_1");
209  crateIDStrings.push_back("RCT_CRATE_2");
210  crateIDStrings.push_back("RCT_CRATE_3");
211  crateIDStrings.push_back("RCT_CRATE_4");
212  crateIDStrings.push_back("RCT_CRATE_5");
213  crateIDStrings.push_back("RCT_CRATE_6");
214  crateIDStrings.push_back("RCT_CRATE_7");
215  crateIDStrings.push_back("RCT_CRATE_8");
216  crateIDStrings.push_back("RCT_CRATE_9");
217  crateIDStrings.push_back("RCT_CRATE_10");
218  crateIDStrings.push_back("RCT_CRATE_11");
219  crateIDStrings.push_back("RCT_CRATE_12");
220  crateIDStrings.push_back("RCT_CRATE_13");
221  crateIDStrings.push_back("RCT_CRATE_14");
222  crateIDStrings.push_back("RCT_CRATE_15");
223  crateIDStrings.push_back("RCT_CRATE_16");
224  crateIDStrings.push_back("RCT_CRATE_17");
225 
226 
227  l1t::OMDSReader::QueryResults crate_conf =
228  m_omdsReader.basicQuery( "CRATE_CONF",
229  rctSchema,
230  "RCT_RUN_SETTINGS_KEY",
231  "RCT_RUN_SETTINGS_KEY.ID",
232  m_omdsReader.singleAttribute( objectKey)) ;
233 
234  int crateNum = 0;
235  for( std::vector<std::string>::iterator crate = crateIDStrings.begin(); crate !=crateIDStrings.end() ; ++crate) {
236  // std::cout << "crate conf " << *crate <<std::endl;
237  l1t::OMDSReader::QueryResults cardConfResults =
238  m_omdsReader.basicQuery(cardMaskStrings,
239  rctSchema,
240  "CRATE_CONF_DUMMY",
241  "CRATE_CONF_DUMMY.CRATE_CONF",
242  m_omdsReader.basicQuery( *crate,
243  rctSchema,
244  "RCT_CRATE_CONF",
245  "RCT_CRATE_CONF.RCT_KEY",
246  crate_conf
247  ));
248  bool extantCard[8];
249  int cardNum =0 ;
250  for(std::vector<std::string>::iterator card = cardMaskStrings.begin(); card!=cardMaskStrings.end(); ++card){
251  cardConfResults.fillVariable(*card,extantCard[cardNum]);
252 
253  if(!extantCard[cardNum]){
254  switch(cardNum){
255  case 6 :
256 
257  for ( int k = 0 ; k <4 ; k++) {
258 
259  m->ecalMask[crateNum][0][(cardNum/2)*8 + k ] |= !extantCard[cardNum];
260  m->ecalMask[crateNum][1][(cardNum/2)*8 + k ] |= !extantCard[cardNum];
261  m->hcalMask[crateNum][0][(cardNum/2)*8 + k ] |= !extantCard[cardNum];
262  m->hcalMask[crateNum][1][(cardNum/2)*8 + k ] |= !extantCard[cardNum];
263  }
264  break;
265  case 7 :
266 
267  for ( int k = 0 ; k <4 ; k++) {
268  m->hfMask[crateNum][0][k] |= !extantCard[cardNum];
269  m->hfMask[crateNum][1][k] |= !extantCard[cardNum];
270  }
271  break;
272  default:
273 
274  for(int k = 0; k < 8 ; k++ ){
275  m->hcalMask[crateNum][cardNum%2][(cardNum/2)*8 + k] |= !extantCard[cardNum];
276  m->ecalMask[crateNum][cardNum%2][(cardNum/2)*8 + k] |= !extantCard[cardNum];
277  }
278  }
279  }
280  cardNum++;
281  }
282  crateNum++;
283  }
284  /*
285  std::cout << "check fill" <<std::endl;
286  for(int i = 0; i< 18; i++)
287  for(int j =0; j< 2; j++){
288  for(int k =0; k<28; k++){
289  if(m->ecalMask[i][j][k])
290  std::cout << "ecal masked channel: crate " << i << " phi " << j <<" ieta " <<k <<std::endl;
291  if(m->hcalMask[i][j][k])
292  std::cout << "hcal masked channel: crate " << i << " phi " << j <<" ieta " <<k <<std::endl;
293  }
294  for(int k =0; k<4;k++)
295  if(m->hfMask[i][j][k])
296  std::cout << "hf masked channel: crate " << i << " phi " << j <<" ieta " <<k <<std::endl;
297  }
298 
299  */
300  //~~~~~~~~~ Instantiate new L1RCTChannelMask object. ~~~~~~~~~
301 
302 
303  return std::shared_ptr< L1RCTChannelMask >(m);
304 }
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="")
Definition: OMDSReader.cc:86
int k[5][pyjets_maxn]