CMS 3D CMS Logo

L1TMenuHelper.h
Go to the documentation of this file.
1 #ifndef DQM_L1TMONITOR_L1TMENUHELPER_H
2 #define DQM_L1TMONITOR_L1TMENUHELPER_H
3 
4 /*
5  * \file L1TMenuHelper.h
6  *
7  * \author J. Pela
8  *
9 */
10 
11 // system include files
12 #include <iostream>
13 #include <fstream>
14 #include <vector>
15 #include <memory>
16 #include <unistd.h>
17 
18 // user include files
22 
24 
26 
29 
31 
32 #include "TString.h"
33 
34 // Simplified structure for single object conditions information
40  unsigned int quality;
41  unsigned int etaRange;
42  unsigned int threshold;
43 };
44 
45 // Simplified structure for single object conditions information
49  unsigned int bit;
50  int prescale;
51  unsigned int threshold; //
52  unsigned int quality; // Only aplicable to Muons
53  unsigned int etaRange; // Only aplicable to Muons
54 
55  bool operator<(const SingleObjectTrigger& iSOT) const {
56  if (this->etaRange > iSOT.etaRange) {
57  return true;
58  } else if (this->etaRange < iSOT.etaRange) {
59  return false;
60  }
61 
62  if (this->prescale < iSOT.prescale) {
63  return true;
64  } else if (this->prescale > iSOT.prescale) {
65  return false;
66  }
67 
68  if (this->quality > iSOT.quality) {
69  return true;
70  } else if (this->quality < iSOT.quality) {
71  return false;
72  }
73 
74  return this->threshold < iSOT.threshold;
75  }
76 };
77 
79 public:
80  struct Tokens {
83  };
84 
85  template <edm::Transition Tr = edm::Transition::Event>
87  Tokens tok;
88  tok.menu = iC.esConsumes<Tr>();
89  tok.l1GtPfAlgo = iC.esConsumes<Tr>();
90  return tok;
91  }
92 
93  L1TMenuHelper(const edm::EventSetup& iSetup, const Tokens& tokens); // Constructor
94  ~L1TMenuHelper(); // Destructor
95 
96  // Get Lowest Unprescaled Single Object Triggers
97  std::map<std::string, std::string> getLUSOTrigger(const std::map<std::string, bool>& iCategories,
98  int IndexRefPrescaleFactors,
99  L1GtUtils const& myUtils);
100  std::map<std::string, std::string> testAlgos(const std::map<std::string, std::string>&);
101 
102  // To convert enum to strings
106 
107  // Getters
108  int getPrescaleByAlias(const TString& iCategory, const TString& iAlias);
109  unsigned int getEtaRangeByAlias(const TString& iCategory, const TString& iAlias);
110  unsigned int getQualityAlias(const TString& iCategory, const TString& iAlias);
111 
112 private:
114  const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
115 
116  // Vectors to hold significant information about single object triggers
117  std::vector<SingleObjectTrigger> m_vTrigMu;
118  std::vector<SingleObjectTrigger> m_vTrigEG;
119  std::vector<SingleObjectTrigger> m_vTrigIsoEG;
120  std::vector<SingleObjectTrigger> m_vTrigJet;
121  std::vector<SingleObjectTrigger> m_vTrigCenJet;
122  std::vector<SingleObjectTrigger> m_vTrigForJet;
123  std::vector<SingleObjectTrigger> m_vTrigTauJet;
124  std::vector<SingleObjectTrigger> m_vTrigETM;
125  std::vector<SingleObjectTrigger> m_vTrigETT;
126  std::vector<SingleObjectTrigger> m_vTrigHTT;
127  std::vector<SingleObjectTrigger> m_vTrigHTM;
128 };
129 
130 #endif
L1TMenuHelper::m_vTrigForJet
std::vector< SingleObjectTrigger > m_vTrigForJet
Definition: L1TMenuHelper.h:122
L1GtTriggerMenu.h
SingleObjectCondition::object
L1GtObject object
Definition: L1TMenuHelper.h:39
L1TMenuHelper::~L1TMenuHelper
~L1TMenuHelper()
Definition: L1TMenuHelper.cc:47
L1GlobalTriggerReadoutSetupFwd.h
L1TMenuHelper::L1TMenuHelper
L1TMenuHelper(const edm::EventSetup &iSetup, const Tokens &tokens)
Definition: L1TMenuHelper.cc:38
L1TMenuHelper::m_prescaleFactorsAlgoTrig
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
Definition: L1TMenuHelper.h:114
L1TMenuHelper::m_vTrigCenJet
std::vector< SingleObjectTrigger > m_vTrigCenJet
Definition: L1TMenuHelper.h:121
SingleObjectTrigger::bit
unsigned int bit
Definition: L1TMenuHelper.h:49
L1TMenuHelper::m_vTrigHTM
std::vector< SingleObjectTrigger > m_vTrigHTM
Definition: L1TMenuHelper.h:127
L1TMenuHelper::m_vTrigEG
std::vector< SingleObjectTrigger > m_vTrigEG
Definition: L1TMenuHelper.h:118
L1TMenuHelper::Tokens
Definition: L1TMenuHelper.h:80
L1TMenuHelper::getQualityAlias
unsigned int getQualityAlias(const TString &iCategory, const TString &iAlias)
Definition: L1TMenuHelper.cc:750
L1TMenuHelper::Tokens::menu
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > menu
Definition: L1TMenuHelper.h:81
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
L1TMenuHelper::getPrescaleByAlias
int getPrescaleByAlias(const TString &iCategory, const TString &iAlias)
Definition: L1TMenuHelper.cc:600
SingleObjectCondition::name
std::string name
Definition: L1TMenuHelper.h:36
L1GtConditionCategory
L1GtConditionCategory
condition categories
Definition: L1GtDefinitions.h:26
L1TMenuHelper::m_vTrigHTT
std::vector< SingleObjectTrigger > m_vTrigHTT
Definition: L1TMenuHelper.h:126
SingleObjectTrigger::threshold
unsigned int threshold
Definition: L1TMenuHelper.h:51
MakerMacros.h
SingleObjectTrigger::prescale
int prescale
Definition: L1TMenuHelper.h:50
Service.h
L1TMenuHelper::m_l1GtMenu
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1TMenuHelper.h:113
L1GtUtils
Definition: L1GtUtils.h:66
SingleObjectTrigger
Definition: L1TMenuHelper.h:46
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1TMenuHelper::m_vTrigETM
std::vector< SingleObjectTrigger > m_vTrigETM
Definition: L1TMenuHelper.h:124
L1GtConditionType
L1GtConditionType
Definition: L1GtDefinitions.h:4
L1TMenuHelper::m_vTrigMu
std::vector< SingleObjectTrigger > m_vTrigMu
Definition: L1TMenuHelper.h:117
SingleObjectTrigger::alias
std::string alias
Definition: L1TMenuHelper.h:48
L1TMenuHelper::m_vTrigJet
std::vector< SingleObjectTrigger > m_vTrigJet
Definition: L1TMenuHelper.h:120
L1TMenuHelper
Definition: L1TMenuHelper.h:78
L1GtTriggerMenu
Definition: L1GtTriggerMenu.h:48
Event.h
L1TMenuHelper::consumes
static Tokens consumes(edm::ConsumesCollector iC)
Definition: L1TMenuHelper.h:86
SingleObjectCondition::etaRange
unsigned int etaRange
Definition: L1TMenuHelper.h:41
L1TMenuHelper::m_vTrigIsoEG
std::vector< SingleObjectTrigger > m_vTrigIsoEG
Definition: L1TMenuHelper.h:119
edm::EventSetup
Definition: EventSetup.h:57
L1TMenuHelper::testAlgos
std::map< std::string, std::string > testAlgos(const std::map< std::string, std::string > &)
Definition: L1TMenuHelper.cc:395
SingleObjectTrigger::object
L1GtObject object
Definition: L1TMenuHelper.h:47
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd >
L1TMenuHelper::m_vTrigTauJet
std::vector< SingleObjectTrigger > m_vTrigTauJet
Definition: L1TMenuHelper.h:123
SingleObjectCondition::conditionCategory
L1GtConditionCategory conditionCategory
Definition: L1TMenuHelper.h:37
L1TMenuHelper::m_vTrigETT
std::vector< SingleObjectTrigger > m_vTrigETT
Definition: L1TMenuHelper.h:125
L1TMenuHelper::Tokens::l1GtPfAlgo
edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > l1GtPfAlgo
Definition: L1TMenuHelper.h:82
SingleObjectTrigger::etaRange
unsigned int etaRange
Definition: L1TMenuHelper.h:53
L1TMenuHelper::getLUSOTrigger
std::map< std::string, std::string > getLUSOTrigger(const std::map< std::string, bool > &iCategories, int IndexRefPrescaleFactors, L1GtUtils const &myUtils)
Definition: L1TMenuHelper.cc:53
Frameworkfwd.h
L1GtUtils.h
SingleObjectCondition
Definition: L1TMenuHelper.h:35
L1TMenuHelper::enumToStringL1GtConditionCategory
std::string enumToStringL1GtConditionCategory(L1GtConditionCategory iConditionCategory)
Definition: L1TMenuHelper.cc:554
L1TMenuHelper::getEtaRangeByAlias
unsigned int getEtaRangeByAlias(const TString &iCategory, const TString &iAlias)
Definition: L1TMenuHelper.cc:675
L1TMenuHelper::enumToStringL1GtConditionType
std::string enumToStringL1GtConditionType(L1GtConditionType iConditionType)
Definition: L1TMenuHelper.cc:487
SingleObjectCondition::threshold
unsigned int threshold
Definition: L1TMenuHelper.h:42
SingleObjectCondition::conditionType
L1GtConditionType conditionType
Definition: L1TMenuHelper.h:38
L1GtTriggerMenuFwd.h
SingleObjectCondition::quality
unsigned int quality
Definition: L1TMenuHelper.h:40
L1TMenuHelper::enumToStringL1GtObject
std::string enumToStringL1GtObject(L1GtObject iObject)
Definition: L1TMenuHelper.cc:420
SingleObjectTrigger::quality
unsigned int quality
Definition: L1TMenuHelper.h:52
SingleObjectTrigger::operator<
bool operator<(const SingleObjectTrigger &iSOT) const
Definition: L1TMenuHelper.h:55
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
L1GtObject