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
21 
23 
25 
28 
30 
31 #include "TString.h"
32 
33 // Simplified structure for single object conditions information
39  unsigned int quality;
40  unsigned int etaRange;
41  unsigned int threshold;
42 };
43 
44 // Simplified structure for single object conditions information
48  unsigned int bit;
49  int prescale;
50  unsigned int threshold; //
51  unsigned int quality; // Only aplicable to Muons
52  unsigned int etaRange; // Only aplicable to Muons
53 
54  bool operator<(const SingleObjectTrigger& iSOT) const {
55  if (this->etaRange > iSOT.etaRange) {
56  return true;
57  } else if (this->etaRange < iSOT.etaRange) {
58  return false;
59  }
60 
61  if (this->prescale < iSOT.prescale) {
62  return true;
63  } else if (this->prescale > iSOT.prescale) {
64  return false;
65  }
66 
67  if (this->quality > iSOT.quality) {
68  return true;
69  } else if (this->quality < iSOT.quality) {
70  return false;
71  }
72 
73  return this->threshold < iSOT.threshold;
74  }
75 };
76 
78 public:
79  struct Tokens {
82  };
83 
84  template <edm::Transition Tr = edm::Transition::Event>
86  Tokens tok;
87  tok.menu = iC.esConsumes<Tr>();
88  tok.l1GtPfAlgo = iC.esConsumes<Tr>();
89  return tok;
90  }
91 
92  L1TMenuHelper(const edm::EventSetup& iSetup, const Tokens& tokens); // Constructor
93  ~L1TMenuHelper(); // Destructor
94 
95  // Get Lowest Unprescaled Single Object Triggers
96  std::map<std::string, std::string> getLUSOTrigger(const std::map<std::string, bool>& iCategories,
97  int IndexRefPrescaleFactors,
98  L1GtUtils const& myUtils);
99  std::map<std::string, std::string> testAlgos(const std::map<std::string, std::string>&);
100 
101  // To convert enum to strings
105 
106  // Getters
107  int getPrescaleByAlias(const TString& iCategory, const TString& iAlias);
108  unsigned int getEtaRangeByAlias(const TString& iCategory, const TString& iAlias);
109  unsigned int getQualityAlias(const TString& iCategory, const TString& iAlias);
110 
111 private:
113  const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
114 
115  // Vectors to hold significant information about single object triggers
116  std::vector<SingleObjectTrigger> m_vTrigMu;
117  std::vector<SingleObjectTrigger> m_vTrigEG;
118  std::vector<SingleObjectTrigger> m_vTrigIsoEG;
119  std::vector<SingleObjectTrigger> m_vTrigJet;
120  std::vector<SingleObjectTrigger> m_vTrigCenJet;
121  std::vector<SingleObjectTrigger> m_vTrigForJet;
122  std::vector<SingleObjectTrigger> m_vTrigTauJet;
123  std::vector<SingleObjectTrigger> m_vTrigETM;
124  std::vector<SingleObjectTrigger> m_vTrigETT;
125  std::vector<SingleObjectTrigger> m_vTrigHTT;
126  std::vector<SingleObjectTrigger> m_vTrigHTM;
127 };
128 
129 #endif
bool operator<(const SingleObjectTrigger &iSOT) const
Definition: L1TMenuHelper.h:54
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > menu
Definition: L1TMenuHelper.h:80
L1GtConditionCategory conditionCategory
Definition: L1TMenuHelper.h:36
std::vector< SingleObjectTrigger > m_vTrigJet
unsigned int quality
Definition: L1TMenuHelper.h:51
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:40
L1GtConditionType
const L1GtTriggerMenu * m_l1GtMenu
L1GtConditionType conditionType
Definition: L1TMenuHelper.h:37
std::vector< SingleObjectTrigger > m_vTrigTauJet
unsigned int threshold
Definition: L1TMenuHelper.h:50
unsigned int threshold
Definition: L1TMenuHelper.h:41
unsigned int quality
Definition: L1TMenuHelper.h:39
std::vector< SingleObjectTrigger > m_vTrigHTM
std::vector< SingleObjectTrigger > m_vTrigHTT
unsigned int bit
Definition: L1TMenuHelper.h:48
unsigned int getQualityAlias(const TString &iCategory, const TString &iAlias)
unsigned int etaRange
Definition: L1TMenuHelper.h:52
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:85
std::vector< SingleObjectTrigger > m_vTrigETT
std::vector< SingleObjectTrigger > m_vTrigCenJet
std::string enumToStringL1GtConditionType(L1GtConditionType iConditionType)
edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > l1GtPfAlgo
Definition: L1TMenuHelper.h:81
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)