CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
l1t::L1TGlobalUtil Class Reference

#include <L1TGlobalUtil.h>

Classes

class  cc
 

Public Member Functions

const std::vector< std::pair
< std::string, bool > > & 
decisionsFinal ()
 
const std::vector< std::pair
< std::string, bool > > & 
decisionsInitial ()
 
const std::vector< std::pair
< std::string, bool > > & 
decisionsPrescaled ()
 
const bool getAlgBitFromName (const std::string &AlgName, int &bit) const
 
const bool getAlgNameFromBit (int &bit, std::string &AlgName) const
 
const bool getFinalDecisionByBit (int &bit, bool &decision) const
 
const bool getFinalDecisionByName (const std::string &algName, bool &decision) const
 
bool getFinalOR ()
 
const bool getInitialDecisionByBit (int &bit, bool &decision) const
 
const bool getInitialDecisionByName (const std::string &algName, bool &decision) const
 
const bool getMaskByBit (int &bit, bool &mask) const
 
const bool getMaskByName (const std::string &algName, bool &mask) const
 
const bool getPrescaleByBit (int &bit, int &prescale) const
 
const bool getPrescaleByName (const std::string &algName, int &prescale) const
 
const bool getPrescaledDecisionByBit (int &bit, bool &decision) const
 
const bool getPrescaledDecisionByName (const std::string &algName, bool &decision) const
 
const bool getVetoMaskByBit (int &bit, bool &veto) const
 
const bool getVetoMaskByName (const std::string &algName, bool &veto) const
 
 L1TGlobalUtil (std::string preScaleFileName, unsigned int psColumn)
 
const std::vector< std::pair
< std::string, bool > > & 
masks ()
 
const std::vector< std::pair
< std::string, int > > & 
prescales ()
 
void retrieveL1 (const edm::Event &iEvent, const edm::EventSetup &evSetup, edm::EDGetToken gtAlgToken)
 initialize the class (mainly reserve) More...
 
void setVerbosity (const int verbosity)
 
const std::vector< std::pair
< std::string, bool > > & 
vetoMasks ()
 
virtual ~L1TGlobalUtil ()
 

Private Member Functions

void loadPrescalesAndMasks ()
 
void resetDecisionVectors ()
 clear decision vectors on a menu change More...
 
void resetMaskVectors ()
 
void resetPrescaleVectors ()
 

Private Attributes

const std::map< std::string,
L1TUtmAlgorithm > * 
m_algorithmMap
 
std::vector< std::pair
< std::string, bool > > 
m_decisionsFinal
 
std::vector< std::pair
< std::string, bool > > 
m_decisionsInitial
 
std::vector< std::pair
< std::string, bool > > 
m_decisionsPrescaled
 
bool m_filledPrescales
 
bool m_finalOR
 
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
 
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
 
std::vector< unsigned int > m_initialTriggerMaskVetoAlgoTrig
 
const TriggerMenum_l1GtMenu
 
unsigned long long m_l1GtMenuCacheID
 
std::vector< std::pair
< std::string, bool > > 
m_masks
 
unsigned int m_numberPhysTriggers
 
unsigned int m_PreScaleColumn
 
const std::vector< std::vector
< int > > * 
m_prescaleFactorsAlgoTrig
 
std::string m_preScaleFileName
 
std::vector< std::pair
< std::string, int > > 
m_prescales
 
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
 
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
 
edm::Handle< BXVector
< GlobalAlgBlk > > 
m_uGtAlgBlk
 
int m_verbosity
 verbosity level More...
 
std::vector< std::pair
< std::string, bool > > 
m_vetoMasks
 

Detailed Description

Definition at line 38 of file L1TGlobalUtil.h.

Constructor & Destructor Documentation

L1TGlobalUtil::L1TGlobalUtil ( std::string  preScaleFileName,
unsigned int  psColumn 
)

Definition at line 34 of file L1TGlobalUtil.cc.

References m_filledPrescales, m_l1GtMenuCacheID, m_numberPhysTriggers, m_PreScaleColumn, and m_preScaleFileName.

35 {
36 
37  // initialize cached IDs
38  m_l1GtMenuCacheID = 0ULL;
39 
40  m_filledPrescales = false;
41 
42  m_preScaleFileName = preScaleFileName;
43 
44  m_numberPhysTriggers = 512; //need to get this out of the EventSetup
45 
46  m_PreScaleColumn = psColumn;
47 
48 }
std::string m_preScaleFileName
unsigned int m_PreScaleColumn
unsigned long long m_l1GtMenuCacheID
unsigned int m_numberPhysTriggers
L1TGlobalUtil::~L1TGlobalUtil ( )
virtual

Definition at line 51 of file L1TGlobalUtil.cc.

51  {
52 
53 }

Member Function Documentation

const std::vector<std::pair<std::string, bool> >& l1t::L1TGlobalUtil::decisionsFinal ( )
inline

Definition at line 105 of file L1TGlobalUtil.h.

References m_decisionsFinal.

105 { return m_decisionsFinal; }
std::vector< std::pair< std::string, bool > > m_decisionsFinal
const std::vector<std::pair<std::string, bool> >& l1t::L1TGlobalUtil::decisionsInitial ( )
inline

Definition at line 103 of file L1TGlobalUtil.h.

References m_decisionsInitial.

103 { return m_decisionsInitial; }
std::vector< std::pair< std::string, bool > > m_decisionsInitial
const std::vector<std::pair<std::string, bool> >& l1t::L1TGlobalUtil::decisionsPrescaled ( )
inline

Definition at line 104 of file L1TGlobalUtil.h.

References m_decisionsPrescaled.

104 { return m_decisionsPrescaled; }
std::vector< std::pair< std::string, bool > > m_decisionsPrescaled
const bool L1TGlobalUtil::getAlgBitFromName ( const std::string &  AlgName,
int &  bit 
) const

Definition at line 387 of file L1TGlobalUtil.cc.

387  {
388 
389  std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo = m_algorithmMap->find(algName);
390  if(itAlgo != m_algorithmMap->end()) {
391  bit = (itAlgo->second).getIndex(); //algoBitNumber();
392  return true;
393  }
394 
395  return false; //did not find anything by that name
396 }
const std::map< std::string, L1TUtmAlgorithm > * m_algorithmMap
const bool L1TGlobalUtil::getAlgNameFromBit ( int &  bit,
std::string &  AlgName 
) const

Definition at line 398 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first.

398  {
399 
400  // since we are just looking up the name, doesn't matter which vector we get it from
401  if((m_decisionsInitial[bit]).first != "NULL") {
402  algName = (m_decisionsInitial[bit]).first;
403  return true;
404  }
405  return false; //No name associated with this bit
406 
407 }
std::vector< std::pair< std::string, bool > > m_decisionsInitial
const bool L1TGlobalUtil::getFinalDecisionByBit ( int &  bit,
bool &  decision 
) const

Definition at line 434 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, and edm::second().

434  {
435 
436  // Need some check that this is a valid bit
437  if((m_decisionsFinal[bit]).first != "NULL") {
438  decision = (m_decisionsFinal[bit]).second;
439  return true;
440  }
441 
442  return false; //couldn't get the information requested.
443 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, bool > > m_decisionsFinal
const bool L1TGlobalUtil::getFinalDecisionByName ( const std::string &  algName,
bool &  decision 
) const

Definition at line 498 of file L1TGlobalUtil.cc.

References edm::second().

498  {
499 
500  int bit = -1;
501  if(getAlgBitFromName(algName,bit)) {
502  decision = (m_decisionsFinal[bit]).second;
503  return true;
504  }
505 
506  return false; //trigger name was not the menu.
507 }
const bool getAlgBitFromName(const std::string &AlgName, int &bit) const
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, bool > > m_decisionsFinal
bool l1t::L1TGlobalUtil::getFinalOR ( )
inline

Definition at line 63 of file L1TGlobalUtil.h.

References m_finalOR.

63 {return m_finalOR;}
const bool L1TGlobalUtil::getInitialDecisionByBit ( int &  bit,
bool &  decision 
) const

Definition at line 409 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, and edm::second().

409  {
410 
411  /*
412  for(std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0); algBlk != m_uGtAlgBlk->end(0); ++algBlk) {
413  decision = algBlk->getAlgoDecisionFinal(bit);
414  }
415  */
416  // Need some check that this is a valid bit
417  if((m_decisionsInitial[bit]).first != "NULL") {
418  decision = (m_decisionsInitial[bit]).second;
419  return true;
420  }
421 
422  return false; //couldn't get the information requested.
423 }
std::vector< std::pair< std::string, bool > > m_decisionsInitial
U second(std::pair< T, U > const &p)
const bool L1TGlobalUtil::getInitialDecisionByName ( const std::string &  algName,
bool &  decision 
) const

Definition at line 476 of file L1TGlobalUtil.cc.

References edm::second().

476  {
477 
478  int bit = -1;
479  if(getAlgBitFromName(algName,bit)) {
480  decision = (m_decisionsInitial[bit]).second;
481  return true;
482  }
483 
484  return false; //trigger name was not the menu.
485 }
const bool getAlgBitFromName(const std::string &AlgName, int &bit) const
std::vector< std::pair< std::string, bool > > m_decisionsInitial
U second(std::pair< T, U > const &p)
const bool L1TGlobalUtil::getMaskByBit ( int &  bit,
bool &  mask 
) const

Definition at line 454 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, and edm::second().

454  {
455 
456  // Need some check that this is a valid bit
457  if((m_masks[bit]).first != "NULL") {
458  mask = (m_masks[bit]).second;
459  return true;
460  }
461 
462  return false; //couldn't get the information requested.
463 }
std::vector< std::pair< std::string, bool > > m_masks
U second(std::pair< T, U > const &p)
const bool L1TGlobalUtil::getMaskByName ( const std::string &  algName,
bool &  mask 
) const

Definition at line 518 of file L1TGlobalUtil.cc.

References edm::second().

518  {
519 
520  int bit = -1;
521  if(getAlgBitFromName(algName,bit)) {
522  mask = (m_masks[bit]).second;
523  return true;
524  }
525 
526  return false; //trigger name was not the menu.
527 }
const bool getAlgBitFromName(const std::string &AlgName, int &bit) const
std::vector< std::pair< std::string, bool > > m_masks
U second(std::pair< T, U > const &p)
const bool L1TGlobalUtil::getPrescaleByBit ( int &  bit,
int &  prescale 
) const

Definition at line 444 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, and edm::second().

444  {
445 
446  // Need some check that this is a valid bit
447  if((m_prescales[bit]).first != "NULL") {
448  prescale = (m_prescales[bit]).second;
449  return true;
450  }
451 
452  return false; //couldn't get the information requested.
453 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, int > > m_prescales
const bool L1TGlobalUtil::getPrescaleByName ( const std::string &  algName,
int &  prescale 
) const

Definition at line 508 of file L1TGlobalUtil.cc.

References edm::second().

508  {
509 
510  int bit = -1;
511  if(getAlgBitFromName(algName,bit)) {
512  prescale = (m_prescales[bit]).second;
513  return true;
514  }
515 
516  return false; //trigger name was not the menu.
517 }
const bool getAlgBitFromName(const std::string &AlgName, int &bit) const
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, int > > m_prescales
const bool L1TGlobalUtil::getPrescaledDecisionByBit ( int &  bit,
bool &  decision 
) const

Definition at line 424 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, and edm::second().

424  {
425 
426  // Need some check that this is a valid bit
427  if((m_decisionsPrescaled[bit]).first != "NULL") {
428  decision = (m_decisionsPrescaled[bit]).second;
429  return true;
430  }
431 
432  return false; //couldn't get the information requested.
433 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, bool > > m_decisionsPrescaled
const bool L1TGlobalUtil::getPrescaledDecisionByName ( const std::string &  algName,
bool &  decision 
) const

Definition at line 487 of file L1TGlobalUtil.cc.

References edm::second().

487  {
488 
489  int bit = -1;
490  if(getAlgBitFromName(algName,bit)) {
491  decision = (m_decisionsPrescaled[bit]).second;
492  return true;
493  }
494 
495  return false; //trigger name was not the menu.
496 }
const bool getAlgBitFromName(const std::string &AlgName, int &bit) const
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, bool > > m_decisionsPrescaled
const bool L1TGlobalUtil::getVetoMaskByBit ( int &  bit,
bool &  veto 
) const

Definition at line 465 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, and edm::second().

465  {
466 
467  // Need some check that this is a valid bit
468  if((m_vetoMasks[bit]).first != "NULL") {
469  veto = (m_vetoMasks[bit]).second;
470  return true;
471  }
472 
473  return false; //couldn't get the information requested.
474 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, bool > > m_vetoMasks
const bool L1TGlobalUtil::getVetoMaskByName ( const std::string &  algName,
bool &  veto 
) const

Definition at line 528 of file L1TGlobalUtil.cc.

References edm::second().

528  {
529 
530  int bit = -1;
531  if(getAlgBitFromName(algName,bit)) {
532  veto = (m_vetoMasks[bit]).second;
533  return true;
534  }
535 
536  return false; //trigger name was not the menu.
537 }
const bool getAlgBitFromName(const std::string &AlgName, int &bit) const
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, bool > > m_vetoMasks
void L1TGlobalUtil::loadPrescalesAndMasks ( )
private

Definition at line 168 of file L1TGlobalUtil.cc.

References cuy::col, plotBeamSpotDB::first, geometryCSVtoXML::line, LogTrace, cmsHarvester::sep, findQualityFiles::size, split, AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

168  {
169 
170  std::fstream inputPrescaleFile;
171  inputPrescaleFile.open(m_preScaleFileName);
172 
173  std::vector<std::vector<int> > vec;
174  std::vector<std::vector<int> > prescale_vec;
175 
176  std::vector<unsigned int> temp_triggerMask;
177  std::vector<unsigned int> temp_triggerVetoMask;
178 
179  if( inputPrescaleFile ){
180  std::string prefix1("#");
181  std::string prefix2("-1");
182 
183  std::string line;
184 
185  bool first = true;
186 
187  while( getline(inputPrescaleFile,line) ){
188 
189  if( !line.compare(0, prefix1.size(), prefix1) ) continue;
190  //if( !line.compare(0, prefix2.size(), prefix2) ) continue;
191 
192  istringstream split(line);
193  int value;
194  int col = 0;
195  char sep;
196 
197  while( split >> value ){
198  if( first ){
199  // Each new value read on line 1 should create a new inner vector
200  vec.push_back(std::vector<int>());
201  }
202 
203  vec[col].push_back(value);
204  ++col;
205 
206  // read past the separator
207  split>>sep;
208  }
209 
210  // Finished reading line 1 and creating as many inner
211  // vectors as required
212  first = false;
213  }
214 
215 
216  int NumPrescaleSets = 0;
217 
218  int maskColumn = -1;
219  int maskVetoColumn = -1;
220  for( int iCol=0; iCol<int(vec.size()); iCol++ ){
221  if( vec[iCol].size() > 0 ){
222  int firstRow = vec[iCol][0];
223 
224  if( firstRow > 0 ) NumPrescaleSets++;
225  else if( firstRow==-2 ) maskColumn = iCol;
226  else if( firstRow==-3 ) maskVetoColumn = iCol;
227  }
228  }
229 
230  // Fill default values for mask and veto mask
231  for( unsigned int iBit = 0; iBit < m_numberPhysTriggers; ++iBit ){
232  unsigned int inputDefaultMask = 1;
233  unsigned int inputDefaultVetoMask = 0;
234  temp_triggerMask.push_back(inputDefaultMask);
235  temp_triggerVetoMask.push_back(inputDefaultVetoMask);
236  }
237 
238 // cout << " Mask Column " << maskColumn << " VetoColumn " << maskVetoColumn << endl;
239 
240  // Fill non-trivial mask and veto mask
241  if( maskColumn>=0 || maskVetoColumn>=0 ){
242  for( int iBit=1; iBit<int(vec[0].size()); iBit++ ){
243  unsigned int algoBit = vec[0][iBit];
244  // algoBit must be less than the number of triggers
245  if( algoBit < m_numberPhysTriggers ){
246  if( maskColumn>=0 ){
247  unsigned int triggerMask = vec[maskColumn][iBit];
248  temp_triggerMask[algoBit] = triggerMask;
249 // cout << "Settting Mask for bit " << algoBit << " to " << triggerMask << endl;
250  }
251  if( maskVetoColumn>=0 ){
252  unsigned int triggerVetoMask = vec[maskVetoColumn][iBit];
253  temp_triggerVetoMask[algoBit] = triggerVetoMask;
254  }
255  }
256  }
257  }
258 
259 
260  if( NumPrescaleSets > 0 ){
261  // Fill default prescale set
262  for( int iSet=0; iSet<NumPrescaleSets; iSet++ ){
263  prescale_vec.push_back(std::vector<int>());
264  for( unsigned int iBit = 0; iBit < m_numberPhysTriggers; ++iBit ){
265  int inputDefaultPrescale = 1;
266  prescale_vec[iSet].push_back(inputDefaultPrescale);
267  }
268  }
269 
270  // Fill non-trivial prescale set
271  for( int iBit=1; iBit<int(vec[0].size()); iBit++ ){
272  unsigned int algoBit = vec[0][iBit];
273  // algoBit must be less than the number of triggers
274  if( algoBit < m_numberPhysTriggers ){
275  for( int iSet=0; iSet<int(vec.size()); iSet++ ){
276  int useSet = -1;
277  if( vec[iSet].size() > 0 ){
278  useSet = vec[iSet][0];
279  }
280  useSet -= 1;
281 
282  if( useSet<0 ) continue;
283 
284  int prescale = vec[iSet][iBit];
285  prescale_vec[useSet][algoBit] = prescale;
286  }
287  }
288  else{
289  LogTrace("l1t|Global")
290  << "\nPrescale file has algo bit: " << algoBit
291  << "\nThis is larger than the number of triggers: " << m_numberPhysTriggers
292  << "\nSomething is wrong. Ignoring."
293  << std::endl;
294  }
295  }
296  }
297 
298  }
299  else {
300  LogTrace("l1t|Global")
301  << "\nCould not find file: " << m_preScaleFileName
302  << "\nFilling the prescale vectors with prescale 1"
303  << "\nSetting prescale set to 1"
304  << std::endl;
305 
306  m_PreScaleColumn = 1;
307 
308  for( int col=0; col < 1; col++ ){
309  prescale_vec.push_back(std::vector<int>());
310  for( unsigned int iBit = 0; iBit < m_numberPhysTriggers; ++iBit ){
311  int inputDefaultPrescale = 1;
312  prescale_vec[col].push_back(inputDefaultPrescale);
313  }
314  }
315  }
316 
317  inputPrescaleFile.close();
318 
319  m_initialPrescaleFactorsAlgoTrig = prescale_vec;
320  m_initialTriggerMaskAlgoTrig = temp_triggerMask;
321  m_initialTriggerMaskVetoAlgoTrig = temp_triggerVetoMask;
322 
323 }
std::string m_preScaleFileName
unsigned int m_PreScaleColumn
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
#define LogTrace(id)
std::vector< unsigned int > m_initialTriggerMaskVetoAlgoTrig
int col
Definition: cuy.py:1008
double split
Definition: MVATrainer.cc:139
tuple size
Write out results.
unsigned int m_numberPhysTriggers
const std::vector<std::pair<std::string, bool> >& l1t::L1TGlobalUtil::masks ( )
inline

Definition at line 111 of file L1TGlobalUtil.h.

References m_masks.

111 { return m_masks; }
std::vector< std::pair< std::string, bool > > m_masks
const std::vector<std::pair<std::string, int> >& l1t::L1TGlobalUtil::prescales ( )
inline

Definition at line 108 of file L1TGlobalUtil.h.

References m_prescales.

108 { return m_prescales; }
std::vector< std::pair< std::string, int > > m_prescales
void L1TGlobalUtil::resetDecisionVectors ( )
private

clear decision vectors on a menu change

Definition at line 325 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, and edm::second().

325  {
326 
327  // Reset all the vector contents with null information
328  m_decisionsInitial.clear();
330  m_decisionsPrescaled.clear();
332  m_decisionsFinal.clear();
334 
335 
336  for(unsigned int algBit = 0; algBit< m_numberPhysTriggers; algBit++) {
337 
338  (m_decisionsInitial[algBit]).first = "NULL";
339  (m_decisionsInitial[algBit]).second = false;
340 
341  (m_decisionsPrescaled[algBit]).first = "NULL";
342  (m_decisionsPrescaled[algBit]).second = false;
343 
344  (m_decisionsFinal[algBit]).first = "NULL";
345  (m_decisionsFinal[algBit]).second = false;
346 
347  }
348 
349 
350 }
std::vector< std::pair< std::string, bool > > m_decisionsInitial
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, bool > > m_decisionsPrescaled
std::vector< std::pair< std::string, bool > > m_decisionsFinal
unsigned int m_numberPhysTriggers
void L1TGlobalUtil::resetMaskVectors ( )
private

Definition at line 367 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, and edm::second().

367  {
368 
369  // Reset all the vector contents with null information
370  m_masks.clear();
372  m_vetoMasks.clear();
374 
375  for(unsigned int algBit = 0; algBit< m_numberPhysTriggers; algBit++) {
376 
377  (m_masks[algBit]).first = "NULL";
378  (m_masks[algBit]).second = true;
379 
380  (m_vetoMasks[algBit]).first = "NULL";
381  (m_vetoMasks[algBit]).second = false;
382 
383  }
384 
385 }
std::vector< std::pair< std::string, bool > > m_masks
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, bool > > m_vetoMasks
unsigned int m_numberPhysTriggers
void L1TGlobalUtil::resetPrescaleVectors ( )
private

Definition at line 352 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, and edm::second().

352  {
353 
354  // Reset all the vector contents with null information
355  m_prescales.clear();
357 
358  for(unsigned int algBit = 0; algBit< m_numberPhysTriggers; algBit++) {
359 
360  (m_prescales[algBit]).first = "NULL";
361  (m_prescales[algBit]).second = 1;
362 
363  }
364 
365 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, int > > m_prescales
unsigned int m_numberPhysTriggers
void L1TGlobalUtil::retrieveL1 ( const edm::Event iEvent,
const edm::EventSetup evSetup,
edm::EDGetToken  gtAlgToken 
)

initialize the class (mainly reserve)

Definition at line 56 of file L1TGlobalUtil.cc.

References gather_cfg::cout, plotBeamSpotDB::first, edm::EventSetup::get(), L1TUtmTriggerMenu::getAlgorithmMap(), edm::Event::getByToken(), LogDebug, LogTrace, edm::ESHandle< class >::product(), edm::second(), and AlCaHLTBitMon_QueryRunRegistry::string.

57  {
58 
59  // get / update the trigger menu from the EventSetup
60  // local cache & check on cacheIdentifier
61  unsigned long long l1GtMenuCacheID = evSetup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
62 
63  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
64 
66  evSetup.get< L1TUtmTriggerMenuRcd>().get(l1GtMenu) ;
67  const L1TUtmTriggerMenu* utml1GtMenu = l1GtMenu.product();
68 
69  //std::cout << "Attempting to fill the map " << std::endl;
70  m_algorithmMap = &(utml1GtMenu->getAlgorithmMap());
71 
72  //reset vectors since we have new menu
74 
75  m_l1GtMenuCacheID = l1GtMenuCacheID;
76  }
77 
78  // Fill the mask and prescales (dummy for now)
79  if(!m_filledPrescales) {
80 
81  // clear and dimension
84 
85  //Load the full prescale set for use
87 
88  // Set Prescale factors to initial (This is somewhat stupid...should fix up)
92 
93 
94  //Pick which set we are using
96  LogTrace("l1t|Global")
97  << "\nNo Prescale Set: " << m_PreScaleColumn
98  << "\nMax Prescale Set value : " << m_prescaleFactorsAlgoTrig->size()
99  << "\nSetting prescale column to 1"
100  << std::endl;
101  m_PreScaleColumn = 1;
102  }
103  LogDebug("l1t|Global") << "Grabing prescale column "<< m_PreScaleColumn << endl;
104  const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[m_PreScaleColumn-1];
105 
106  for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo = m_algorithmMap->begin(); itAlgo != m_algorithmMap->end(); itAlgo++) {
107 
108  // Get the algorithm name
109  std::string algName = itAlgo->first;
110  int algBit = (itAlgo->second).getIndex(); //algoBitNumber();
111 
112  (m_prescales[algBit]).first = algName;
113  (m_prescales[algBit]).second = prescaleSet[algBit];
114 
115  (m_masks[algBit]).first = algName;
116  (m_masks[algBit]).second = (*m_triggerMaskAlgoTrig)[algBit];
117 
118  (m_vetoMasks[algBit]).first = algName;
119  (m_vetoMasks[algBit]).second = (*m_triggerMaskVetoAlgoTrig)[algBit];
120  }
121 
122  m_filledPrescales = true;
123  }
124 
125 
126 
127 // Get the Global Trigger Output Algorithm block
128  iEvent.getByToken(gtAlgToken,m_uGtAlgBlk);
129  m_finalOR = false;
130 
131  //Make sure we have a valid AlgBlk
132  if(m_uGtAlgBlk.isValid()) {
133  // get the GlabalAlgBlk (Stupid find better way) of BX=0
134  std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0);
135 
136  // Grab the final OR from the AlgBlk,
137  m_finalOR = algBlk->getFinalOR();
138 
139  // Make a map of the trigger name and whether it passed various stages (initial,prescale,final)
140  // Note: might be able to improve performance by not full remaking map with names each time
141  for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo = m_algorithmMap->begin(); itAlgo != m_algorithmMap->end(); itAlgo++) {
142 
143  // Get the algorithm name
144  std::string algName = itAlgo->first;
145  int algBit = (itAlgo->second).getIndex(); //algoBitNumber();
146 
147  bool decisionInitial = algBlk->getAlgoDecisionInitial(algBit);
148  (m_decisionsInitial[algBit]).first = algName;
149  (m_decisionsInitial[algBit]).second = decisionInitial;
150 
151  bool decisionPrescaled = algBlk->getAlgoDecisionPreScaled(algBit);
152  (m_decisionsPrescaled[algBit]).first = algName;
153  (m_decisionsPrescaled[algBit]).second = decisionPrescaled;
154 
155  bool decisionFinal = algBlk->getAlgoDecisionFinal(algBit);
156  (m_decisionsFinal[algBit]).first = algName;
157  (m_decisionsFinal[algBit]).second = decisionFinal;
158 
159  }
160  } else {
161 
162  cout
163  << "Error no valid uGT Algorithm Data with Token provided " << endl;
164  }
165 
166 }
#define LogDebug(id)
void resetDecisionVectors()
clear decision vectors on a menu change
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
unsigned int m_PreScaleColumn
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
std::vector< std::pair< std::string, bool > > m_decisionsInitial
std::vector< std::pair< std::string, bool > > m_masks
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
const std::map< std::string, L1TUtmAlgorithm > * m_algorithmMap
U second(std::pair< T, U > const &p)
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
std::vector< std::pair< std::string, bool > > m_decisionsPrescaled
bool isValid() const
Definition: HandleBase.h:75
std::vector< std::pair< std::string, bool > > m_vetoMasks
#define LogTrace(id)
unsigned long long m_l1GtMenuCacheID
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
const std::map< std::string, L1TUtmAlgorithm > & getAlgorithmMap() const
std::vector< std::pair< std::string, bool > > m_decisionsFinal
std::vector< unsigned int > m_initialTriggerMaskVetoAlgoTrig
tuple cout
Definition: gather_cfg.py:145
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
edm::Handle< BXVector< GlobalAlgBlk > > m_uGtAlgBlk
const_iterator begin(int bx) const
std::vector< std::pair< std::string, int > > m_prescales
void l1t::L1TGlobalUtil::setVerbosity ( const int  verbosity)
inline

Definition at line 58 of file L1TGlobalUtil.h.

References m_verbosity, and HLT_FULL_cff::verbosity.

58  {
60  }
int m_verbosity
verbosity level
const std::vector<std::pair<std::string, bool> >& l1t::L1TGlobalUtil::vetoMasks ( )
inline

Definition at line 112 of file L1TGlobalUtil.h.

References m_vetoMasks.

112 { return m_vetoMasks; }
std::vector< std::pair< std::string, bool > > m_vetoMasks

Member Data Documentation

const std::map<std::string, L1TUtmAlgorithm>* l1t::L1TGlobalUtil::m_algorithmMap
private

Definition at line 131 of file L1TGlobalUtil.h.

std::vector<std::pair<std::string, bool> > l1t::L1TGlobalUtil::m_decisionsFinal
private

Definition at line 158 of file L1TGlobalUtil.h.

Referenced by decisionsFinal().

std::vector<std::pair<std::string, bool> > l1t::L1TGlobalUtil::m_decisionsInitial
private

Definition at line 156 of file L1TGlobalUtil.h.

Referenced by decisionsInitial().

std::vector<std::pair<std::string, bool> > l1t::L1TGlobalUtil::m_decisionsPrescaled
private

Definition at line 157 of file L1TGlobalUtil.h.

Referenced by decisionsPrescaled().

bool l1t::L1TGlobalUtil::m_filledPrescales
private

Definition at line 127 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

bool l1t::L1TGlobalUtil::m_finalOR
private

Definition at line 153 of file L1TGlobalUtil.h.

Referenced by getFinalOR().

std::vector<std::vector<int> > l1t::L1TGlobalUtil::m_initialPrescaleFactorsAlgoTrig
private

Definition at line 142 of file L1TGlobalUtil.h.

std::vector<unsigned int> l1t::L1TGlobalUtil::m_initialTriggerMaskAlgoTrig
private

Definition at line 144 of file L1TGlobalUtil.h.

std::vector<unsigned int> l1t::L1TGlobalUtil::m_initialTriggerMaskVetoAlgoTrig
private

Definition at line 146 of file L1TGlobalUtil.h.

const TriggerMenu* l1t::L1TGlobalUtil::m_l1GtMenu
private

Definition at line 123 of file L1TGlobalUtil.h.

unsigned long long l1t::L1TGlobalUtil::m_l1GtMenuCacheID
private

Definition at line 124 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

std::vector<std::pair<std::string, bool> > l1t::L1TGlobalUtil::m_masks
private

Definition at line 160 of file L1TGlobalUtil.h.

Referenced by masks().

unsigned int l1t::L1TGlobalUtil::m_numberPhysTriggers
private

Definition at line 136 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

unsigned int l1t::L1TGlobalUtil::m_PreScaleColumn
private

Definition at line 140 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

const std::vector<std::vector<int> >* l1t::L1TGlobalUtil::m_prescaleFactorsAlgoTrig
private

Definition at line 143 of file L1TGlobalUtil.h.

std::string l1t::L1TGlobalUtil::m_preScaleFileName
private

Definition at line 139 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

std::vector<std::pair<std::string, int> > l1t::L1TGlobalUtil::m_prescales
private

Definition at line 159 of file L1TGlobalUtil.h.

Referenced by prescales().

const std::vector<unsigned int>* l1t::L1TGlobalUtil::m_triggerMaskAlgoTrig
private

Definition at line 145 of file L1TGlobalUtil.h.

const std::vector<unsigned int>* l1t::L1TGlobalUtil::m_triggerMaskVetoAlgoTrig
private

Definition at line 147 of file L1TGlobalUtil.h.

edm::Handle<BXVector<GlobalAlgBlk> > l1t::L1TGlobalUtil::m_uGtAlgBlk
private

Definition at line 150 of file L1TGlobalUtil.h.

int l1t::L1TGlobalUtil::m_verbosity
private

verbosity level

Definition at line 164 of file L1TGlobalUtil.h.

Referenced by setVerbosity().

std::vector<std::pair<std::string, bool> > l1t::L1TGlobalUtil::m_vetoMasks
private

Definition at line 161 of file L1TGlobalUtil.h.

Referenced by vetoMasks().