CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TGlobalUtil.h
Go to the documentation of this file.
1 #ifndef L1TGlobalUtil_h
2 #define L1TGlobalUtil_h
3 
15 // system include files
16 #include <vector>
17 
19 
20 // Objects to produce for the output record.
24 
27 
29 
30 // forward declarations
31 //class TriggerMenu;
32 
33 
34 // class declaration
35 
36 namespace l1t {
37 
39 {
40 
41 public:
42 
43  // constructors
44  L1TGlobalUtil(std::string preScaleFileName, unsigned int psColumn);
45 
46  // destructor
47  virtual ~L1TGlobalUtil();
48 
49 public:
50 
52  void retrieveL1(const edm::Event& iEvent, const edm::EventSetup& evSetup,
53  edm::EDGetToken gtAlgToken);
54 
55 
56 public:
57 
58  inline void setVerbosity(const int verbosity) {
60  }
61 
62 
63  inline bool getFinalOR() {return m_finalOR;}
64 
65  // get the trigger bit from the name
66  const bool getAlgBitFromName(const std::string& AlgName, int& bit) const;
67 
68  // get the name from the trigger bit
69  const bool getAlgNameFromBit(int& bit, std::string& AlgName) const;
70 
71  // Access results for particular trigger bit
72  const bool getInitialDecisionByBit(int& bit, bool& decision) const;
73  const bool getPrescaledDecisionByBit(int& bit, bool& decision) const;
74  const bool getFinalDecisionByBit(int& bit, bool& decision) const;
75 
76  // Access Prescale
77  const bool getPrescaleByBit(int& bit, int& prescale) const;
78 
79  // Access Masks:
80  // follows logic of uGT board:
81  // finalDecision[AlgBit] = ( prescaledDecision[AlgBit] & mask[AlgBit] ) implying:
82  // If mask = true, algorithm bit (true/false) keeps its value
83  // If mask = false, algorithm bit is forced to false for the finalDecision
84  //
85  // If vetoMask = true and Algorithm is true, the FINOR (final global decision) is forced to false (ie. event is vetoed)
86  // If vetoMask = false, algorithm cannot veto FINOR (final global decision)
87  const bool getMaskByBit(int& bit, bool& mask) const;
88  const bool getVetoMaskByBit(int& bit, bool& veto) const;
89 
90  // Access results for particular trigger name
91  const bool getInitialDecisionByName(const std::string& algName, bool& decision) const;
92  const bool getPrescaledDecisionByName(const std::string& algName, bool& decision) const;
93  const bool getFinalDecisionByName(const std::string& algName, bool& decision) const;
94 
95  // Access Prescales
96  const bool getPrescaleByName(const std::string& algName, int& prescale) const;
97 
98  // Access Masks (see note) above
99  const bool getMaskByName(const std::string& algName, bool& mask) const;
100  const bool getVetoMaskByName(const std::string& algName, bool& veto) const;
101 
102  // Some inline commands to return the full vectors
103  inline const std::vector<std::pair<std::string, bool> >& decisionsInitial() { return m_decisionsInitial; }
104  inline const std::vector<std::pair<std::string, bool> >& decisionsPrescaled() { return m_decisionsPrescaled; }
105  inline const std::vector<std::pair<std::string, bool> >& decisionsFinal() { return m_decisionsFinal; }
106 
107  // Access all prescales
108  inline const std::vector<std::pair<std::string, int> >& prescales() { return m_prescales; }
109 
110  // Access Masks (see note) above
111  inline const std::vector<std::pair<std::string, bool> >& masks() { return m_masks; }
112  inline const std::vector<std::pair<std::string, bool> >& vetoMasks() { return m_vetoMasks; }
113 
114 private:
115 
117  void resetDecisionVectors();
118  void resetPrescaleVectors();
119  void resetMaskVectors();
120  void loadPrescalesAndMasks();
121 
122  // trigger menu
124  unsigned long long m_l1GtMenuCacheID;
125 
126  // prescales and masks
128 
129  // algorithm maps
130  //const AlgorithmMap* m_algorithmMap;
131  const std::map<std::string, L1TUtmAlgorithm>* m_algorithmMap;
132 
133 private:
134 
135  // Number of physics triggers
136  unsigned int m_numberPhysTriggers;
137 
138  //file and container for prescale factors
140  unsigned int m_PreScaleColumn;
141 
142  std::vector<std::vector<int> > m_initialPrescaleFactorsAlgoTrig;
143  const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
144  std::vector<unsigned int> m_initialTriggerMaskAlgoTrig;
145  const std::vector<unsigned int>* m_triggerMaskAlgoTrig;
146  std::vector<unsigned int> m_initialTriggerMaskVetoAlgoTrig;
147  const std::vector<unsigned int>* m_triggerMaskVetoAlgoTrig;
148 
149  // access to the results block from uGT
151 
152  // final OR
153  bool m_finalOR;
154 
155  // Vectors containing the trigger name and information about that trigger
156  std::vector<std::pair<std::string, bool> > m_decisionsInitial;
157  std::vector<std::pair<std::string, bool> > m_decisionsPrescaled;
158  std::vector<std::pair<std::string, bool> > m_decisionsFinal;
159  std::vector<std::pair<std::string, int> > m_prescales;
160  std::vector<std::pair<std::string, bool> > m_masks;
161  std::vector<std::pair<std::string, bool> > m_vetoMasks;
162 
165 
166 
167 };
168 
169 }
170 #endif
void setVerbosity(const int verbosity)
Definition: L1TGlobalUtil.h:58
const bool getAlgNameFromBit(int &bit, std::string &AlgName) const
const bool getFinalDecisionByBit(int &bit, bool &decision) const
std::string m_preScaleFileName
void resetDecisionVectors()
clear decision vectors on a menu change
const std::vector< std::pair< std::string, int > > & prescales()
unsigned int m_PreScaleColumn
const std::vector< std::pair< std::string, bool > > & masks()
const TriggerMenu * m_l1GtMenu
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
const bool getPrescaledDecisionByBit(int &bit, bool &decision) const
L1TGlobalUtil(std::string preScaleFileName, unsigned int psColumn)
const bool getAlgBitFromName(const std::string &AlgName, int &bit) const
std::vector< std::pair< std::string, bool > > m_decisionsInitial
const bool getVetoMaskByBit(int &bit, bool &veto) const
std::vector< std::pair< std::string, bool > > m_masks
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
const bool getPrescaleByBit(int &bit, int &prescale) const
const std::map< std::string, L1TUtmAlgorithm > * m_algorithmMap
int iEvent
Definition: GenABIO.cc:230
const std::vector< std::pair< std::string, bool > > & vetoMasks()
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
const bool getPrescaledDecisionByName(const std::string &algName, bool &decision) const
const std::vector< std::pair< std::string, bool > > & decisionsInitial()
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
const bool getInitialDecisionByBit(int &bit, bool &decision) const
std::vector< std::pair< std::string, bool > > m_decisionsPrescaled
const bool getVetoMaskByName(const std::string &algName, bool &veto) const
std::vector< std::pair< std::string, bool > > m_vetoMasks
const bool getMaskByBit(int &bit, bool &mask) const
int m_verbosity
verbosity level
unsigned long long m_l1GtMenuCacheID
const bool getMaskByName(const std::string &algName, bool &mask) const
void retrieveL1(const edm::Event &iEvent, const edm::EventSetup &evSetup, edm::EDGetToken gtAlgToken)
initialize the class (mainly reserve)
virtual ~L1TGlobalUtil()
const bool getPrescaleByName(const std::string &algName, int &prescale) const
const bool getInitialDecisionByName(const std::string &algName, bool &decision) const
std::vector< std::pair< std::string, bool > > m_decisionsFinal
const bool getFinalDecisionByName(const std::string &algName, bool &decision) const
std::vector< unsigned int > m_initialTriggerMaskVetoAlgoTrig
const std::vector< std::pair< std::string, bool > > & decisionsPrescaled()
const std::vector< std::pair< std::string, bool > > & decisionsFinal()
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
edm::Handle< BXVector< GlobalAlgBlk > > m_uGtAlgBlk
std::vector< std::pair< std::string, int > > m_prescales
unsigned int m_numberPhysTriggers