test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static 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 > > & 
decisionsInterm ()
 
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
 
const bool getInitialDecisionByBit (int &bit, bool &decision) const
 
const bool getInitialDecisionByName (const std::string &algName, bool &decision) const
 
const bool getIntermDecisionByBit (int &bit, bool &decision) const
 
const bool getIntermDecisionByName (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 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 (edm::ParameterSet const &pset, edm::ConsumesCollector &&iC)
 
 L1TGlobalUtil (edm::ParameterSet const &pset, edm::ConsumesCollector &iC)
 
template<typename T >
 L1TGlobalUtil (edm::ParameterSet const &pset, edm::ConsumesCollector &&iC, T &module)
 
template<typename T >
 L1TGlobalUtil (edm::ParameterSet const &pset, edm::ConsumesCollector &iC, T &module)
 
template<typename T >
 L1TGlobalUtil (edm::ParameterSet const &pset, edm::ConsumesCollector &&iC, T &module, edm::InputTag const &l1tAlgBlkInputTag, edm::InputTag const &l1tExtBlkInputTag)
 
template<typename T >
 L1TGlobalUtil (edm::ParameterSet const &pset, edm::ConsumesCollector &iC, T &module, edm::InputTag const &l1tAlgBlkInputTag, edm::InputTag const &l1tExtBlkInputTag)
 
const std::vector< std::pair
< std::string, bool > > & 
masks ()
 
void OverridePrescalesAndMasks (std::string filename, unsigned int psColumn=1)
 
unsigned int prescaleColumn () const
 
const std::vector< std::pair
< std::string, int > > & 
prescales ()
 
void retrieveL1 (const edm::Event &iEvent, const edm::EventSetup &evSetup)
 initialize the class (mainly reserve) More...
 
void retrieveL1 (const edm::Event &iEvent, const edm::EventSetup &evSetup, edm::EDGetToken gtAlgToken)
 
void retrieveL1Event (const edm::Event &iEvent, const edm::EventSetup &evSetup)
 
void retrieveL1Event (const edm::Event &iEvent, const edm::EventSetup &evSetup, edm::EDGetToken gtAlgToken)
 
void retrieveL1Setup (const edm::EventSetup &evSetup)
 
void setVerbosity (const int verbosity)
 
const std::vector< std::pair
< std::string, bool > > & 
vetoMasks ()
 
virtual ~L1TGlobalUtil ()
 destructor More...
 

Static Public Member Functions

static void fillDescription (edm::ParameterSetDescription &desc)
 

Private Member Functions

 L1TGlobalUtil ()
 
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_decisionsInterm
 
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::unique_ptr
< L1TGlobalUtilHelper
m_l1tGlobalUtilHelper
 
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 ( edm::ParameterSet const &  pset,
edm::ConsumesCollector &&  iC 
)

Definition at line 39 of file L1TGlobalUtil.cc.

l1t::L1TGlobalUtil::L1TGlobalUtil ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC 
)

Definition at line 43 of file L1TGlobalUtil.cc.

References m_l1tGlobalUtilHelper.

44  :
45  L1TGlobalUtil() {
47 }
std::unique_ptr< L1TGlobalUtilHelper > m_l1tGlobalUtilHelper
template<typename T >
l1t::L1TGlobalUtil::L1TGlobalUtil ( edm::ParameterSet const &  pset,
edm::ConsumesCollector &&  iC,
T module 
)

Definition at line 216 of file L1TGlobalUtil.h.

template<typename T >
l1t::L1TGlobalUtil::L1TGlobalUtil ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC,
T module 
)

Definition at line 222 of file L1TGlobalUtil.h.

References m_l1tGlobalUtilHelper.

224  :
225  L1TGlobalUtil() {
227  iC,
228  module));
229  }
std::unique_ptr< L1TGlobalUtilHelper > m_l1tGlobalUtilHelper
Definition: vlib.h:208
template<typename T >
l1t::L1TGlobalUtil::L1TGlobalUtil ( edm::ParameterSet const &  pset,
edm::ConsumesCollector &&  iC,
T module,
edm::InputTag const &  l1tAlgBlkInputTag,
edm::InputTag const &  l1tExtBlkInputTag 
)

Definition at line 232 of file L1TGlobalUtil.h.

236  :
237  L1TGlobalUtil(pset, iC, module, l1tAlgBlkInputTag, l1tExtBlkInputTag) { }
Definition: vlib.h:208
template<typename T >
l1t::L1TGlobalUtil::L1TGlobalUtil ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC,
T module,
edm::InputTag const &  l1tAlgBlkInputTag,
edm::InputTag const &  l1tExtBlkInputTag 
)

Definition at line 240 of file L1TGlobalUtil.h.

References m_l1tGlobalUtilHelper.

244  :
245  L1TGlobalUtil() {
247  iC,
248  module,
249  l1tAlgBlkInputTag,
250  l1tExtBlkInputTag));
251  }
std::unique_ptr< L1TGlobalUtilHelper > m_l1tGlobalUtilHelper
Definition: vlib.h:208
l1t::L1TGlobalUtil::~L1TGlobalUtil ( )
virtual

destructor

Definition at line 50 of file L1TGlobalUtil.cc.

50  {
51 
52  // empty
53 
54 }
l1t::L1TGlobalUtil::L1TGlobalUtil ( )
private

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

Member Function Documentation

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

Definition at line 142 of file L1TGlobalUtil.h.

References m_decisionsFinal.

142 { 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 140 of file L1TGlobalUtil.h.

References m_decisionsInitial.

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

Definition at line 141 of file L1TGlobalUtil.h.

References m_decisionsInterm.

141 { return m_decisionsInterm; }
std::vector< std::pair< std::string, bool > > m_decisionsInterm
static void l1t::L1TGlobalUtil::fillDescription ( edm::ParameterSetDescription desc)
inlinestatic

Definition at line 78 of file L1TGlobalUtil.h.

References l1t::L1TGlobalUtilHelper::fillDescription().

78  {
80  }
static void fillDescription(edm::ParameterSetDescription &desc)
const bool l1t::L1TGlobalUtil::getAlgBitFromName ( const std::string &  AlgName,
int &  bit 
) const

Definition at line 413 of file L1TGlobalUtil.cc.

413  {
414 
415  std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo = m_algorithmMap->find(algName);
416  if(itAlgo != m_algorithmMap->end()) {
417  bit = (itAlgo->second).getIndex(); //algoBitNumber();
418  return true;
419  }
420 
421  return false; //did not find anything by that name
422 }
const std::map< std::string, L1TUtmAlgorithm > * m_algorithmMap
const bool l1t::L1TGlobalUtil::getAlgNameFromBit ( int &  bit,
std::string &  AlgName 
) const

Definition at line 424 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first.

424  {
425 
426  // since we are just looking up the name, doesn't matter which vector we get it from
427  if((m_decisionsInitial[bit]).first != "NULL") {
428  algName = (m_decisionsInitial[bit]).first;
429  return true;
430  }
431  return false; //No name associated with this bit
432 
433 }
std::vector< std::pair< std::string, bool > > m_decisionsInitial
const bool l1t::L1TGlobalUtil::getFinalDecisionByBit ( int &  bit,
bool &  decision 
) const

Definition at line 460 of file L1TGlobalUtil.cc.

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

460  {
461 
462  // Need some check that this is a valid bit
463  if((m_decisionsFinal[bit]).first != "NULL") {
464  decision = (m_decisionsFinal[bit]).second;
465  return true;
466  }
467 
468  return false; //couldn't get the information requested.
469 }
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 524 of file L1TGlobalUtil.cc.

References edm::second().

524  {
525 
526  int bit = -1;
527  if(getAlgBitFromName(algName,bit)) {
528  decision = (m_decisionsFinal[bit]).second;
529  return true;
530  }
531 
532  return false; //trigger name was not the menu.
533 }
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 ( ) const
inline

Definition at line 100 of file L1TGlobalUtil.h.

References m_finalOR.

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

Definition at line 435 of file L1TGlobalUtil.cc.

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

435  {
436 
437  /*
438  for(std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0); algBlk != m_uGtAlgBlk->end(0); ++algBlk) {
439  decision = algBlk->getAlgoDecisionFinal(bit);
440  }
441  */
442  // Need some check that this is a valid bit
443  if((m_decisionsInitial[bit]).first != "NULL") {
444  decision = (m_decisionsInitial[bit]).second;
445  return true;
446  }
447 
448  return false; //couldn't get the information requested.
449 }
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 502 of file L1TGlobalUtil.cc.

References edm::second().

502  {
503 
504  int bit = -1;
505  if(getAlgBitFromName(algName,bit)) {
506  decision = (m_decisionsInitial[bit]).second;
507  return true;
508  }
509 
510  return false; //trigger name was not the menu.
511 }
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::getIntermDecisionByBit ( int &  bit,
bool &  decision 
) const

Definition at line 450 of file L1TGlobalUtil.cc.

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

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

Definition at line 513 of file L1TGlobalUtil.cc.

References edm::second().

513  {
514 
515  int bit = -1;
516  if(getAlgBitFromName(algName,bit)) {
517  decision = (m_decisionsInterm[bit]).second;
518  return true;
519  }
520 
521  return false; //trigger name was not the menu.
522 }
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_decisionsInterm
const bool l1t::L1TGlobalUtil::getMaskByBit ( int &  bit,
bool &  mask 
) const

Definition at line 480 of file L1TGlobalUtil.cc.

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

480  {
481 
482  // Need some check that this is a valid bit
483  if((m_masks[bit]).first != "NULL") {
484  mask = (m_masks[bit]).second;
485  return true;
486  }
487 
488  return false; //couldn't get the information requested.
489 }
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 544 of file L1TGlobalUtil.cc.

References edm::second().

544  {
545 
546  int bit = -1;
547  if(getAlgBitFromName(algName,bit)) {
548  mask = (m_masks[bit]).second;
549  return true;
550  }
551 
552  return false; //trigger name was not the menu.
553 }
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 470 of file L1TGlobalUtil.cc.

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

470  {
471 
472  // Need some check that this is a valid bit
473  if((m_prescales[bit]).first != "NULL") {
474  prescale = (m_prescales[bit]).second;
475  return true;
476  }
477 
478  return false; //couldn't get the information requested.
479 }
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 534 of file L1TGlobalUtil.cc.

References edm::second().

Referenced by HLTPrescaleProvider::prescaleValues(), and HLTPrescaleProvider::prescaleValuesInDetail().

534  {
535 
536  int bit = -1;
537  if(getAlgBitFromName(algName,bit)) {
538  prescale = (m_prescales[bit]).second;
539  return true;
540  }
541 
542  return false; //trigger name was not the menu.
543 }
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::getVetoMaskByBit ( int &  bit,
bool &  veto 
) const

Definition at line 491 of file L1TGlobalUtil.cc.

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

491  {
492 
493  // Need some check that this is a valid bit
494  if((m_vetoMasks[bit]).first != "NULL") {
495  veto = (m_vetoMasks[bit]).second;
496  return true;
497  }
498 
499  return false; //couldn't get the information requested.
500 }
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 554 of file L1TGlobalUtil.cc.

References edm::second().

554  {
555 
556  int bit = -1;
557  if(getAlgBitFromName(algName,bit)) {
558  veto = (m_vetoMasks[bit]).second;
559  return true;
560  }
561 
562  return false; //trigger name was not the menu.
563 }
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 154 of file L1TGlobalUtil.h.

References L1TUtmTriggerMenu::getComment(), and m_l1GtMenu.

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

Definition at line 152 of file L1TGlobalUtil.h.

References L1TUtmTriggerMenu::getName(), and m_l1GtMenu.

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

Definition at line 153 of file L1TGlobalUtil.h.

References L1TUtmTriggerMenu::getVersion(), and m_l1GtMenu.

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

Definition at line 194 of file L1TGlobalUtil.cc.

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

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

References m_masks.

148 { 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 56 of file L1TGlobalUtil.cc.

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

56  {
57  edm::FileInPath f1("L1Trigger/L1TGlobal/data/Luminosity/startup/" + filename);
58  m_preScaleFileName = f1.fullPath();
59  m_PreScaleColumn = psColumn;
60 }
std::string m_preScaleFileName
unsigned int m_PreScaleColumn
tuple filename
Definition: lut2db_cfg.py:20
unsigned int l1t::L1TGlobalUtil::prescaleColumn ( ) const
inline

Definition at line 157 of file L1TGlobalUtil.h.

References m_PreScaleColumn.

Referenced by HLTPrescaleProvider::prescaleSet().

157 {return m_PreScaleColumn;}
unsigned int m_PreScaleColumn
const std::vector<std::pair<std::string, int> >& l1t::L1TGlobalUtil::prescales ( )
inline

Definition at line 145 of file L1TGlobalUtil.h.

References m_prescales.

145 { 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 351 of file L1TGlobalUtil.cc.

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

351  {
352 
353  // Reset all the vector contents with null information
354  m_decisionsInitial.clear();
356  m_decisionsInterm.clear();
358  m_decisionsFinal.clear();
360 
361 
362  for(unsigned int algBit = 0; algBit< m_numberPhysTriggers; algBit++) {
363 
364  (m_decisionsInitial[algBit]).first = "NULL";
365  (m_decisionsInitial[algBit]).second = false;
366 
367  (m_decisionsInterm[algBit]).first = "NULL";
368  (m_decisionsInterm[algBit]).second = false;
369 
370  (m_decisionsFinal[algBit]).first = "NULL";
371  (m_decisionsFinal[algBit]).second = false;
372 
373  }
374 
375 
376 }
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_decisionsInterm
std::vector< std::pair< std::string, bool > > m_decisionsFinal
unsigned int m_numberPhysTriggers
void l1t::L1TGlobalUtil::resetMaskVectors ( )
private

Definition at line 393 of file L1TGlobalUtil.cc.

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

393  {
394 
395  // Reset all the vector contents with null information
396  m_masks.clear();
398  m_vetoMasks.clear();
400 
401  for(unsigned int algBit = 0; algBit< m_numberPhysTriggers; algBit++) {
402 
403  (m_masks[algBit]).first = "NULL";
404  (m_masks[algBit]).second = true;
405 
406  (m_vetoMasks[algBit]).first = "NULL";
407  (m_vetoMasks[algBit]).second = false;
408 
409  }
410 
411 }
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 378 of file L1TGlobalUtil.cc.

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

378  {
379 
380  // Reset all the vector contents with null information
381  m_prescales.clear();
383 
384  for(unsigned int algBit = 0; algBit< m_numberPhysTriggers; algBit++) {
385 
386  (m_prescales[algBit]).first = "NULL";
387  (m_prescales[algBit]).second = 1;
388 
389  }
390 
391 }
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 
)

initialize the class (mainly reserve)

Definition at line 62 of file L1TGlobalUtil.cc.

62  {
63  // typically, the L1T menu and prescale table (may change only between Runs)
64  retrieveL1Setup(evSetup);
65  // typically the prescale set index used and the event by event accept/reject info (changes between Events)
66  retrieveL1Event(iEvent,evSetup);
67 }
void retrieveL1Event(const edm::Event &iEvent, const edm::EventSetup &evSetup)
void retrieveL1Setup(const edm::EventSetup &evSetup)
void l1t::L1TGlobalUtil::retrieveL1 ( const edm::Event iEvent,
const edm::EventSetup evSetup,
edm::EDGetToken  gtAlgToken 
)

Definition at line 69 of file L1TGlobalUtil.cc.

70  {
71  // typically, the L1T menu and prescale table (may change only between Runs)
72  retrieveL1Setup(evSetup);
73  // typically the prescale set index used and the event by event accept/reject info (changes between Events)
74  retrieveL1Event(iEvent,evSetup,gtAlgToken);
75 }
void retrieveL1Event(const edm::Event &iEvent, const edm::EventSetup &evSetup)
void retrieveL1Setup(const edm::EventSetup &evSetup)
void l1t::L1TGlobalUtil::retrieveL1Event ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)

Definition at line 146 of file L1TGlobalUtil.cc.

Referenced by HLTPrescaleProvider::prescaleSet(), HLTPrescaleProvider::prescaleValues(), and HLTPrescaleProvider::prescaleValuesInDetail().

146  {
147  retrieveL1Event(iEvent, evSetup, m_l1tGlobalUtilHelper->l1tAlgBlkToken());
148 }
void retrieveL1Event(const edm::Event &iEvent, const edm::EventSetup &evSetup)
std::unique_ptr< L1TGlobalUtilHelper > m_l1tGlobalUtilHelper
void l1t::L1TGlobalUtil::retrieveL1Event ( const edm::Event iEvent,
const edm::EventSetup evSetup,
edm::EDGetToken  gtAlgToken 
)

Definition at line 150 of file L1TGlobalUtil.cc.

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

151  {
152 
153 // Get the Global Trigger Output Algorithm block
154  iEvent.getByToken(gtAlgToken,m_uGtAlgBlk);
155  m_finalOR = false;
156 
157  //Make sure we have a valid AlgBlk
158  if(m_uGtAlgBlk.isValid()) {
159  // get the GlabalAlgBlk (Stupid find better way) of BX=0
160  std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0);
161  if (algBlk != m_uGtAlgBlk->end(0)){
162  m_PreScaleColumn = static_cast<unsigned int>(algBlk->getPreScColumn());
163  // Grab the final OR from the AlgBlk,
164  m_finalOR = algBlk->getFinalOR();
165 
166  // Make a map of the trigger name and whether it passed various stages (initial,prescale,final)
167  // Note: might be able to improve performance by not full remaking map with names each time
168  for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo = m_algorithmMap->begin(); itAlgo != m_algorithmMap->end(); itAlgo++) {
169 
170  // Get the algorithm name
171  std::string algName = itAlgo->first;
172  int algBit = (itAlgo->second).getIndex(); //algoBitNumber();
173 
174  bool decisionInitial = algBlk->getAlgoDecisionInitial(algBit);
175  (m_decisionsInitial[algBit]).first = algName;
176  (m_decisionsInitial[algBit]).second = decisionInitial;
177 
178  bool decisionInterm = algBlk->getAlgoDecisionInterm(algBit);
179  (m_decisionsInterm[algBit]).first = algName;
180  (m_decisionsInterm[algBit]).second = decisionInterm;
181 
182  bool decisionFinal = algBlk->getAlgoDecisionFinal(algBit);
183  (m_decisionsFinal[algBit]).first = algName;
184  (m_decisionsFinal[algBit]).second = decisionFinal;
185  }
186  } else {
187  //cout << "Error empty AlgBlk recovered.\n";
188  }
189  } else {
190  //cout<< "Error no valid uGT Algorithm Data with Token provided " << endl;
191  }
192 }
const_iterator end(int bx) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
unsigned int m_PreScaleColumn
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)
bool isValid() const
Definition: HandleBase.h:75
std::vector< std::pair< std::string, bool > > m_decisionsInterm
std::vector< std::pair< std::string, bool > > m_decisionsFinal
edm::Handle< BXVector< GlobalAlgBlk > > m_uGtAlgBlk
const_iterator begin(int bx) const
void l1t::L1TGlobalUtil::retrieveL1Setup ( const edm::EventSetup evSetup)

Definition at line 77 of file L1TGlobalUtil.cc.

References plotBeamSpotDB::first, edm::EventSetup::get(), LogDebug, LogTrace, edm::ESHandle< class >::product(), edm::second(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HLTPrescaleProvider::init().

77  {
78 
79  // get / update the trigger menu from the EventSetup
80  // local cache & check on cacheIdentifier
81  unsigned long long l1GtMenuCacheID = evSetup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
82 
83  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
84 
86  evSetup.get< L1TUtmTriggerMenuRcd>().get(l1GtMenu) ;
87  m_l1GtMenu = l1GtMenu.product();
88 
89  //std::cout << "Attempting to fill the map " << std::endl;
91 
92  //reset vectors since we have new menu
94 
95  m_l1GtMenuCacheID = l1GtMenuCacheID;
96  }
97 
98  // Fill the mask and prescales (dummy for now)
99  if(!m_filledPrescales) {
100 
101  // clear and dimension
104 
105  //Load the full prescale set for use
107 
108  // Set Prescale factors to initial (This is somewhat stupid...should fix up)
112 
113 
114  //Pick which set we are using
116  LogTrace("l1t|Global")
117  << "\nNo Prescale Set: " << m_PreScaleColumn
118  << "\nMax Prescale Set value : " << m_prescaleFactorsAlgoTrig->size()
119  << "\nSetting prescale column to 1"
120  << std::endl;
121  m_PreScaleColumn = 1;
122  }
123  LogDebug("l1t|Global") << "Grabing prescale column "<< m_PreScaleColumn << endl;
124  const std::vector<int>& prescaleSet = (*m_prescaleFactorsAlgoTrig)[m_PreScaleColumn-1];
125 
126  for (std::map<std::string, L1TUtmAlgorithm>::const_iterator itAlgo = m_algorithmMap->begin(); itAlgo != m_algorithmMap->end(); itAlgo++) {
127 
128  // Get the algorithm name
129  std::string algName = itAlgo->first;
130  int algBit = (itAlgo->second).getIndex(); //algoBitNumber();
131 
132  (m_prescales[algBit]).first = algName;
133  (m_prescales[algBit]).second = prescaleSet[algBit];
134 
135  (m_masks[algBit]).first = algName;
136  (m_masks[algBit]).second = (*m_triggerMaskAlgoTrig)[algBit];
137 
138  (m_vetoMasks[algBit]).first = algName;
139  (m_vetoMasks[algBit]).second = (*m_triggerMaskVetoAlgoTrig)[algBit];
140  }
141 
142  m_filledPrescales = true;
143  }
144 }
#define LogDebug(id)
const L1TUtmTriggerMenu * m_l1GtMenu
unsigned int m_PreScaleColumn
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
void resetDecisionVectors()
clear decision vectors on a menu change
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)
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< unsigned int > m_initialTriggerMaskVetoAlgoTrig
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
std::vector< std::pair< std::string, int > > m_prescales
void l1t::L1TGlobalUtil::setVerbosity ( const int  verbosity)
inline

Definition at line 96 of file L1TGlobalUtil.h.

References m_verbosity, and HLT_25ns10e33_v2_cff::verbosity.

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

Definition at line 149 of file L1TGlobalUtil.h.

References m_vetoMasks.

149 { 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 178 of file L1TGlobalUtil.h.

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

Definition at line 203 of file L1TGlobalUtil.h.

Referenced by decisionsFinal().

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

Definition at line 201 of file L1TGlobalUtil.h.

Referenced by decisionsInitial().

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

Definition at line 202 of file L1TGlobalUtil.h.

Referenced by decisionsInterm().

bool l1t::L1TGlobalUtil::m_filledPrescales
private

Definition at line 174 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

bool l1t::L1TGlobalUtil::m_finalOR
private

Definition at line 198 of file L1TGlobalUtil.h.

Referenced by getFinalOR().

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

Definition at line 187 of file L1TGlobalUtil.h.

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

Definition at line 189 of file L1TGlobalUtil.h.

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

Definition at line 191 of file L1TGlobalUtil.h.

const L1TUtmTriggerMenu* l1t::L1TGlobalUtil::m_l1GtMenu
private

Definition at line 170 of file L1TGlobalUtil.h.

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

unsigned long long l1t::L1TGlobalUtil::m_l1GtMenuCacheID
private

Definition at line 171 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

std::unique_ptr<L1TGlobalUtilHelper> l1t::L1TGlobalUtil::m_l1tGlobalUtilHelper
private

Definition at line 211 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

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

Definition at line 205 of file L1TGlobalUtil.h.

Referenced by masks().

unsigned int l1t::L1TGlobalUtil::m_numberPhysTriggers
private

Definition at line 181 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

unsigned int l1t::L1TGlobalUtil::m_PreScaleColumn
private

Definition at line 185 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil(), and prescaleColumn().

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

Definition at line 188 of file L1TGlobalUtil.h.

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

Definition at line 184 of file L1TGlobalUtil.h.

Referenced by L1TGlobalUtil().

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

Definition at line 204 of file L1TGlobalUtil.h.

Referenced by prescales().

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

Definition at line 190 of file L1TGlobalUtil.h.

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

Definition at line 192 of file L1TGlobalUtil.h.

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

Definition at line 195 of file L1TGlobalUtil.h.

int l1t::L1TGlobalUtil::m_verbosity
private

verbosity level

Definition at line 209 of file L1TGlobalUtil.h.

Referenced by setVerbosity().

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

Definition at line 206 of file L1TGlobalUtil.h.

Referenced by vetoMasks().