CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > menu
Definition: L1TMenuHelper.h:81
L1GtConditionCategory conditionCategory
Definition: L1TMenuHelper.h:37
std::vector< SingleObjectTrigger > m_vTrigJet
unsigned int quality
Definition: L1TMenuHelper.h:52
std::string enumToStringL1GtObject(L1GtObject iObject)
std::vector< SingleObjectTrigger > m_vTrigETM
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
std::vector< SingleObjectTrigger > m_vTrigMu
unsigned int etaRange
Definition: L1TMenuHelper.h:41
L1GtConditionType
const L1GtTriggerMenu * m_l1GtMenu
L1GtConditionType conditionType
Definition: L1TMenuHelper.h:38
std::vector< SingleObjectTrigger > m_vTrigTauJet
unsigned int threshold
Definition: L1TMenuHelper.h:51
unsigned int threshold
Definition: L1TMenuHelper.h:42
unsigned int quality
Definition: L1TMenuHelper.h:40
bool operator<(const SingleObjectTrigger &iSOT) const
Definition: L1TMenuHelper.h:55
std::vector< SingleObjectTrigger > m_vTrigHTM
std::vector< SingleObjectTrigger > m_vTrigHTT
unsigned int bit
Definition: L1TMenuHelper.h:49
unsigned int getQualityAlias(const TString &iCategory, const TString &iAlias)
unsigned int etaRange
Definition: L1TMenuHelper.h:53
std::map< std::string, std::string > testAlgos(const std::map< std::string, std::string > &)
std::vector< SingleObjectTrigger > m_vTrigIsoEG
static Tokens consumes(edm::ConsumesCollector iC)
Definition: L1TMenuHelper.h:86
std::vector< SingleObjectTrigger > m_vTrigETT
std::vector< SingleObjectTrigger > m_vTrigCenJet
std::string enumToStringL1GtConditionType(L1GtConditionType iConditionType)
edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > l1GtPfAlgo
Definition: L1TMenuHelper.h:82
std::string enumToStringL1GtConditionCategory(L1GtConditionCategory iConditionCategory)
std::vector< SingleObjectTrigger > m_vTrigForJet
std::vector< SingleObjectTrigger > m_vTrigEG
unsigned int getEtaRangeByAlias(const TString &iCategory, const TString &iAlias)
L1GtConditionCategory
condition categories
int getPrescaleByAlias(const TString &iCategory, const TString &iAlias)
L1TMenuHelper(const edm::EventSetup &iSetup, const Tokens &tokens)
std::map< std::string, std::string > getLUSOTrigger(const std::map< std::string, bool > &iCategories, int IndexRefPrescaleFactors, L1GtUtils const &myUtils)