CMS 3D CMS Logo

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

#include <L1TGlobalUtil.h>

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
 
const std::string & gtTriggerMenuComment () const
 
const std::string & gtTriggerMenuName () const
 
const std::string & gtTriggerMenuVersion () const
 
 L1TGlobalUtil ()
 
const std::vector< std::pair
< std::string, bool > > & 
masks ()
 
void OverridePrescalesAndMasks (std::string filename, unsigned int psColumn=1)
 
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 retrieveL1Event (const edm::Event &iEvent, const edm::EventSetup &evSetup, edm::EDGetToken gtAlgToken)
 
void retrieveL1LumiBlock (const edm::EventSetup &evSetup)
 
void retrieveL1Run (const edm::EventSetup &evSetup)
 
void setVerbosity (const int verbosity)
 
const std::vector< std::pair
< std::string, bool > > & 
vetoMasks ()
 
 ~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 L1TUtmTriggerMenum_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 29 of file L1TGlobalUtil.h.

Constructor & Destructor Documentation

l1t::L1TGlobalUtil::L1TGlobalUtil ( )

Definition at line 28 of file L1TGlobalUtil.cc.

References validate-o2o-wbm::f1, edm::FileInPath::fullPath(), m_filledPrescales, m_l1GtMenuCacheID, m_numberPhysTriggers, m_PreScaleColumn, and m_preScaleFileName.

28  {
29  // initialize cached IDs
30  m_l1GtMenuCacheID = 0ULL;
31  m_filledPrescales = false;
32  edm::FileInPath f1("L1Trigger/L1TGlobal/data/Luminosity/startup/prescale_L1TGlobal.csv");
33  m_preScaleFileName = f1.fullPath();
34  m_numberPhysTriggers = 512; //need to get this out of the EventSetup
35  m_PreScaleColumn = 1;
36 
37 }
std::string m_preScaleFileName
unsigned int m_PreScaleColumn
unsigned long long m_l1GtMenuCacheID
unsigned int m_numberPhysTriggers
l1t::L1TGlobalUtil::~L1TGlobalUtil ( )

Definition at line 46 of file L1TGlobalUtil.cc.

46  {
47 }

Member Function Documentation

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

Definition at line 97 of file L1TGlobalUtil.h.

References m_decisionsFinal.

97 { 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 95 of file L1TGlobalUtil.h.

References m_decisionsInitial.

95 { 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 96 of file L1TGlobalUtil.h.

References m_decisionsPrescaled.

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

Definition at line 395 of file L1TGlobalUtil.cc.

395  {
396 
397  std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo = m_algorithmMap->find(algName);
398  if(itAlgo != m_algorithmMap->end()) {
399  bit = (itAlgo->second).getIndex(); //algoBitNumber();
400  return true;
401  }
402 
403  return false; //did not find anything by that name
404 }
const std::map< std::string, L1TUtmAlgorithm > * m_algorithmMap
const bool l1t::L1TGlobalUtil::getAlgNameFromBit ( int &  bit,
std::string &  AlgName 
) const

Definition at line 406 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first.

406  {
407 
408  // since we are just looking up the name, doesn't matter which vector we get it from
409  if((m_decisionsInitial[bit]).first != "NULL") {
410  algName = (m_decisionsInitial[bit]).first;
411  return true;
412  }
413  return false; //No name associated with this bit
414 
415 }
std::vector< std::pair< std::string, bool > > m_decisionsInitial
const bool l1t::L1TGlobalUtil::getFinalDecisionByBit ( int &  bit,
bool &  decision 
) const

Definition at line 442 of file L1TGlobalUtil.cc.

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

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

Definition at line 506 of file L1TGlobalUtil.cc.

References edm::second().

506  {
507 
508  int bit = -1;
509  if(getAlgBitFromName(algName,bit)) {
510  decision = (m_decisionsFinal[bit]).second;
511  return true;
512  }
513 
514  return false; //trigger name was not the menu.
515 }
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 55 of file L1TGlobalUtil.h.

References m_finalOR.

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

Definition at line 417 of file L1TGlobalUtil.cc.

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

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

Definition at line 484 of file L1TGlobalUtil.cc.

References edm::second().

484  {
485 
486  int bit = -1;
487  if(getAlgBitFromName(algName,bit)) {
488  decision = (m_decisionsInitial[bit]).second;
489  return true;
490  }
491 
492  return false; //trigger name was not the menu.
493 }
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 l1t::L1TGlobalUtil::getMaskByBit ( int &  bit,
bool &  mask 
) const

Definition at line 462 of file L1TGlobalUtil.cc.

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

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

Definition at line 526 of file L1TGlobalUtil.cc.

References edm::second().

526  {
527 
528  int bit = -1;
529  if(getAlgBitFromName(algName,bit)) {
530  mask = (m_masks[bit]).second;
531  return true;
532  }
533 
534  return false; //trigger name was not the menu.
535 }
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 l1t::L1TGlobalUtil::getPrescaleByBit ( int &  bit,
int &  prescale 
) const

Definition at line 452 of file L1TGlobalUtil.cc.

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

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

Definition at line 516 of file L1TGlobalUtil.cc.

References edm::second().

516  {
517 
518  int bit = -1;
519  if(getAlgBitFromName(algName,bit)) {
520  prescale = (m_prescales[bit]).second;
521  return true;
522  }
523 
524  return false; //trigger name was not the menu.
525 }
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 l1t::L1TGlobalUtil::getPrescaledDecisionByBit ( int &  bit,
bool &  decision 
) const

Definition at line 432 of file L1TGlobalUtil.cc.

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

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

Definition at line 495 of file L1TGlobalUtil.cc.

References edm::second().

495  {
496 
497  int bit = -1;
498  if(getAlgBitFromName(algName,bit)) {
499  decision = (m_decisionsPrescaled[bit]).second;
500  return true;
501  }
502 
503  return false; //trigger name was not the menu.
504 }
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 l1t::L1TGlobalUtil::getVetoMaskByBit ( int &  bit,
bool &  veto 
) const

Definition at line 473 of file L1TGlobalUtil.cc.

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

473  {
474 
475  // Need some check that this is a valid bit
476  if((m_vetoMasks[bit]).first != "NULL") {
477  veto = (m_vetoMasks[bit]).second;
478  return true;
479  }
480 
481  return false; //couldn't get the information requested.
482 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, bool > > m_vetoMasks
const bool l1t::L1TGlobalUtil::getVetoMaskByName ( const std::string &  algName,
bool &  veto 
) const

Definition at line 536 of file L1TGlobalUtil.cc.

References edm::second().

536  {
537 
538  int bit = -1;
539  if(getAlgBitFromName(algName,bit)) {
540  veto = (m_vetoMasks[bit]).second;
541  return true;
542  }
543 
544  return false; //trigger name was not the menu.
545 }
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
const std::string& l1t::L1TGlobalUtil::gtTriggerMenuComment ( ) const
inline

Definition at line 109 of file L1TGlobalUtil.h.

References L1TUtmTriggerMenu::getComment(), and m_l1GtMenu.

109 {return m_l1GtMenu->getComment();}
const L1TUtmTriggerMenu * m_l1GtMenu
const std::string & getComment() const
const std::string& l1t::L1TGlobalUtil::gtTriggerMenuName ( ) const
inline

Definition at line 107 of file L1TGlobalUtil.h.

References L1TUtmTriggerMenu::getName(), and m_l1GtMenu.

107 {return m_l1GtMenu->getName();}
const L1TUtmTriggerMenu * m_l1GtMenu
const std::string & getName() const
const std::string& l1t::L1TGlobalUtil::gtTriggerMenuVersion ( ) const
inline

Definition at line 108 of file L1TGlobalUtil.h.

References L1TUtmTriggerMenu::getVersion(), and m_l1GtMenu.

108 {return m_l1GtMenu->getVersion();}
const L1TUtmTriggerMenu * m_l1GtMenu
const std::string & getVersion() const
void l1t::L1TGlobalUtil::loadPrescalesAndMasks ( )
private

Definition at line 176 of file L1TGlobalUtil.cc.

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

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

References m_masks.

103 { return m_masks; }
std::vector< std::pair< std::string, bool > > m_masks
void l1t::L1TGlobalUtil::OverridePrescalesAndMasks ( std::string  filename,
unsigned int  psColumn = 1 
)

Definition at line 39 of file L1TGlobalUtil.cc.

References validate-o2o-wbm::f1, and edm::FileInPath::fullPath().

39  {
40  edm::FileInPath f1("L1Trigger/L1TGlobal/data/Luminosity/startup/" + filename);
41  m_preScaleFileName = f1.fullPath();
42  m_PreScaleColumn = psColumn;
43 }
std::string m_preScaleFileName
unsigned int m_PreScaleColumn
tuple filename
Definition: lut2db_cfg.py:20
const std::vector<std::pair<std::string, int> >& l1t::L1TGlobalUtil::prescales ( )
inline

Definition at line 100 of file L1TGlobalUtil.h.

References m_prescales.

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

clear decision vectors on a menu change

Definition at line 333 of file L1TGlobalUtil.cc.

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

333  {
334 
335  // Reset all the vector contents with null information
336  m_decisionsInitial.clear();
338  m_decisionsPrescaled.clear();
340  m_decisionsFinal.clear();
342 
343 
344  for(unsigned int algBit = 0; algBit< m_numberPhysTriggers; algBit++) {
345 
346  (m_decisionsInitial[algBit]).first = "NULL";
347  (m_decisionsInitial[algBit]).second = false;
348 
349  (m_decisionsPrescaled[algBit]).first = "NULL";
350  (m_decisionsPrescaled[algBit]).second = false;
351 
352  (m_decisionsFinal[algBit]).first = "NULL";
353  (m_decisionsFinal[algBit]).second = false;
354 
355  }
356 
357 
358 }
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 l1t::L1TGlobalUtil::resetMaskVectors ( )
private

Definition at line 375 of file L1TGlobalUtil.cc.

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

375  {
376 
377  // Reset all the vector contents with null information
378  m_masks.clear();
380  m_vetoMasks.clear();
382 
383  for(unsigned int algBit = 0; algBit< m_numberPhysTriggers; algBit++) {
384 
385  (m_masks[algBit]).first = "NULL";
386  (m_masks[algBit]).second = true;
387 
388  (m_vetoMasks[algBit]).first = "NULL";
389  (m_vetoMasks[algBit]).second = false;
390 
391  }
392 
393 }
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 l1t::L1TGlobalUtil::resetPrescaleVectors ( )
private

Definition at line 360 of file L1TGlobalUtil.cc.

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

360  {
361 
362  // Reset all the vector contents with null information
363  m_prescales.clear();
365 
366  for(unsigned int algBit = 0; algBit< m_numberPhysTriggers; algBit++) {
367 
368  (m_prescales[algBit]).first = "NULL";
369  (m_prescales[algBit]).second = 1;
370 
371  }
372 
373 }
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, int > > m_prescales
unsigned int m_numberPhysTriggers
void l1t::L1TGlobalUtil::retrieveL1 ( const edm::Event iEvent,
const edm::EventSetup evSetup,
edm::EDGetToken  gtAlgToken 
)

initialize the class (mainly reserve)

Definition at line 49 of file L1TGlobalUtil.cc.

50  {
51 
52  // typically, the L1T menu (may change only between Runs)
53  retrieveL1Run(evSetup);
54  // typically the L1T prescales and index of specific prescale set used (may change only between LumiBlocks)
55  retrieveL1LumiBlock(evSetup);
56  // typically the event by event accept/reject info (changes between Events)
57  retrieveL1Event(iEvent,evSetup,gtAlgToken);
58 
59 }
void retrieveL1Event(const edm::Event &iEvent, const edm::EventSetup &evSetup, edm::EDGetToken gtAlgToken)
void retrieveL1LumiBlock(const edm::EventSetup &evSetup)
void retrieveL1Run(const edm::EventSetup &evSetup)
void l1t::L1TGlobalUtil::retrieveL1Event ( const edm::Event iEvent,
const edm::EventSetup evSetup,
edm::EDGetToken  gtAlgToken 
)

Definition at line 133 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, edm::Event::getByToken(), edm::second(), and AlCaHLTBitMon_QueryRunRegistry::string.

134  {
135 
136 // Get the Global Trigger Output Algorithm block
137  iEvent.getByToken(gtAlgToken,m_uGtAlgBlk);
138  m_finalOR = false;
139 
140  //Make sure we have a valid AlgBlk
141  if(m_uGtAlgBlk.isValid()) {
142  // get the GlabalAlgBlk (Stupid find better way) of BX=0
143  std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0);
144  if (algBlk != m_uGtAlgBlk->end(0)){
145  // Grab the final OR from the AlgBlk,
146  m_finalOR = algBlk->getFinalOR();
147 
148  // Make a map of the trigger name and whether it passed various stages (initial,prescale,final)
149  // Note: might be able to improve performance by not full remaking map with names each time
150  for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo = m_algorithmMap->begin(); itAlgo != m_algorithmMap->end(); itAlgo++) {
151 
152  // Get the algorithm name
153  std::string algName = itAlgo->first;
154  int algBit = (itAlgo->second).getIndex(); //algoBitNumber();
155 
156  bool decisionInitial = algBlk->getAlgoDecisionInitial(algBit);
157  (m_decisionsInitial[algBit]).first = algName;
158  (m_decisionsInitial[algBit]).second = decisionInitial;
159 
160  bool decisionPrescaled = algBlk->getAlgoDecisionInterm(algBit);
161  (m_decisionsPrescaled[algBit]).first = algName;
162  (m_decisionsPrescaled[algBit]).second = decisionPrescaled;
163 
164  bool decisionFinal = algBlk->getAlgoDecisionFinal(algBit);
165  (m_decisionsFinal[algBit]).first = algName;
166  (m_decisionsFinal[algBit]).second = decisionFinal;
167  }
168  } else {
169  //cout << "Error empty AlgBlk recovered.\n";
170  }
171  } else {
172  //cout<< "Error no valid uGT Algorithm Data with Token provided " << endl;
173  }
174 }
const_iterator end(int bx) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::vector< std::pair< std::string, bool > > m_decisionsInitial
const std::map< std::string, L1TUtmAlgorithm > * m_algorithmMap
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, bool > > m_decisionsPrescaled
bool isValid() const
Definition: HandleBase.h:75
std::vector< std::pair< std::string, bool > > m_decisionsFinal
edm::Handle< BXVector< GlobalAlgBlk > > m_uGtAlgBlk
const_iterator begin(int bx) const
void l1t::L1TGlobalUtil::retrieveL1LumiBlock ( const edm::EventSetup evSetup)

Definition at line 83 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, LogDebug, LogTrace, edm::second(), and AlCaHLTBitMon_QueryRunRegistry::string.

83  {
84 
85  // Fill the mask and prescales (dummy for now)
86  if(!m_filledPrescales) {
87 
88  // clear and dimension
91 
92  //Load the full prescale set for use
94 
95  // Set Prescale factors to initial (This is somewhat stupid...should fix up)
99 
100 
101  //Pick which set we are using
103  LogTrace("l1t|Global")
104  << "\nNo Prescale Set: " << m_PreScaleColumn
105  << "\nMax Prescale Set value : " << m_prescaleFactorsAlgoTrig->size()
106  << "\nSetting prescale column to 1"
107  << std::endl;
108  m_PreScaleColumn = 1;
109  }
110  LogDebug("l1t|Global") << "Grabing prescale column "<< m_PreScaleColumn << endl;
111  const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[m_PreScaleColumn-1];
112 
113  for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo = m_algorithmMap->begin(); itAlgo != m_algorithmMap->end(); itAlgo++) {
114 
115  // Get the algorithm name
116  std::string algName = itAlgo->first;
117  int algBit = (itAlgo->second).getIndex(); //algoBitNumber();
118 
119  (m_prescales[algBit]).first = algName;
120  (m_prescales[algBit]).second = prescaleSet[algBit];
121 
122  (m_masks[algBit]).first = algName;
123  (m_masks[algBit]).second = (*m_triggerMaskAlgoTrig)[algBit];
124 
125  (m_vetoMasks[algBit]).first = algName;
126  (m_vetoMasks[algBit]).second = (*m_triggerMaskVetoAlgoTrig)[algBit];
127  }
128 
129  m_filledPrescales = true;
130  }
131 }
#define LogDebug(id)
unsigned int m_PreScaleColumn
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
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_vetoMasks
#define LogTrace(id)
std::vector< unsigned int > m_initialTriggerMaskVetoAlgoTrig
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
std::vector< std::pair< std::string, int > > m_prescales
void l1t::L1TGlobalUtil::retrieveL1Run ( const edm::EventSetup evSetup)

Definition at line 61 of file L1TGlobalUtil.cc.

References edm::EventSetup::get(), and edm::ESHandle< class >::product().

61  {
62 
63  // get / update the trigger menu from the EventSetup
64  // local cache & check on cacheIdentifier
65  unsigned long long l1GtMenuCacheID = evSetup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
66 
67  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
68 
70  evSetup.get< L1TUtmTriggerMenuRcd>().get(l1GtMenu) ;
71  m_l1GtMenu = l1GtMenu.product();
72 
73  //std::cout << "Attempting to fill the map " << std::endl;
75 
76  //reset vectors since we have new menu
78 
79  m_l1GtMenuCacheID = l1GtMenuCacheID;
80  }
81 }
const L1TUtmTriggerMenu * m_l1GtMenu
void resetDecisionVectors()
clear decision vectors on a menu change
const std::map< std::string, L1TUtmAlgorithm > * m_algorithmMap
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
void l1t::L1TGlobalUtil::setVerbosity ( const int  verbosity)
inline

Definition at line 51 of file L1TGlobalUtil.h.

References m_verbosity, and HLT_FULL_cff::verbosity.

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

Definition at line 104 of file L1TGlobalUtil.h.

References m_vetoMasks.

104 { 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 128 of file L1TGlobalUtil.h.

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

Definition at line 153 of file L1TGlobalUtil.h.

Referenced by decisionsFinal().

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

Definition at line 151 of file L1TGlobalUtil.h.

Referenced by decisionsInitial().

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

Definition at line 152 of file L1TGlobalUtil.h.

Referenced by decisionsPrescaled().

bool l1t::L1TGlobalUtil::m_filledPrescales
private

Definition at line 124 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

bool l1t::L1TGlobalUtil::m_finalOR
private

Definition at line 148 of file L1TGlobalUtil.h.

Referenced by getFinalOR().

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

Definition at line 137 of file L1TGlobalUtil.h.

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

Definition at line 139 of file L1TGlobalUtil.h.

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

Definition at line 141 of file L1TGlobalUtil.h.

const L1TUtmTriggerMenu* l1t::L1TGlobalUtil::m_l1GtMenu
private

Definition at line 120 of file L1TGlobalUtil.h.

Referenced by gtTriggerMenuComment(), gtTriggerMenuName(), and gtTriggerMenuVersion().

unsigned long long l1t::L1TGlobalUtil::m_l1GtMenuCacheID
private

Definition at line 121 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

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

Definition at line 155 of file L1TGlobalUtil.h.

Referenced by masks().

unsigned int l1t::L1TGlobalUtil::m_numberPhysTriggers
private

Definition at line 131 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

unsigned int l1t::L1TGlobalUtil::m_PreScaleColumn
private

Definition at line 135 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

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

Definition at line 138 of file L1TGlobalUtil.h.

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

Definition at line 134 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

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

Definition at line 154 of file L1TGlobalUtil.h.

Referenced by prescales().

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

Definition at line 140 of file L1TGlobalUtil.h.

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

Definition at line 142 of file L1TGlobalUtil.h.

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

Definition at line 145 of file L1TGlobalUtil.h.

int l1t::L1TGlobalUtil::m_verbosity
private

verbosity level

Definition at line 159 of file L1TGlobalUtil.h.

Referenced by setVerbosity().

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

Definition at line 156 of file L1TGlobalUtil.h.

Referenced by vetoMasks().