File indexing completed on 2024-04-06 12:04:31
0001 #ifndef DataFormats_L1TGlobal_GlobalAlgBlk_h
0002 #define DataFormats_L1TGlobal_GlobalAlgBlk_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <vector>
0020 #include <iostream>
0021 #include <iomanip>
0022
0023
0024 #include "FWCore/Utilities/interface/typedefs.h"
0025 #include "DataFormats/L1Trigger/interface/BXVector.h"
0026
0027 #include "DataFormats/L1Trigger/interface/L1TObjComparison.h"
0028
0029
0030
0031 class GlobalAlgBlk;
0032 typedef BXVector<GlobalAlgBlk> GlobalAlgBlkBxCollection;
0033
0034 typedef l1t::ObjectRef<GlobalAlgBlk> GlobalAlgBlkRef;
0035 typedef l1t::ObjectRefBxCollection<GlobalAlgBlk> GlobalAlgBlkRefBxCollection;
0036 typedef l1t::ObjectRefPair<GlobalAlgBlk> GlobalAlgBlkRefPair;
0037 typedef l1t::ObjectRefPairBxCollection<GlobalAlgBlk> GlobalAlgBlkRefPairBxCollection;
0038
0039
0040
0041 class GlobalAlgBlk {
0042 public:
0043
0044 GlobalAlgBlk();
0045
0046 GlobalAlgBlk(int orbitNr, int bxNr, int bxInEvent);
0047
0048
0049 virtual ~GlobalAlgBlk();
0050
0051 public:
0052 static constexpr unsigned int maxPhysicsTriggers = 512;
0053
0054
0055 void setL1MenuUUID(int uuid) { m_orbitNr = uuid; }
0056 void setL1FirmwareUUID(int fuuid) { m_bxNr = fuuid; }
0057 void setbxInEventNr(int bxNr) { m_bxInEvent = bxNr; }
0058 void setFinalORVeto(bool fOR) { m_finalORVeto = fOR; }
0059 void setFinalORPreVeto(bool fOR) { m_finalORPreVeto = fOR; }
0060 void setFinalOR(bool fOR) { m_finalOR = fOR; }
0061 void setPreScColumn(int psC) { m_preScColumn = psC; }
0062
0063
0064 inline const int getL1MenuUUID() const { return m_orbitNr; }
0065 inline const int getL1FirmwareUUID() const { return m_bxNr; }
0066 inline const int getbxInEventNr() const { return m_bxInEvent; }
0067 inline const bool getFinalOR() const { return m_finalOR; }
0068 inline const bool getFinalORPreVeto() const { return m_finalORPreVeto; };
0069 inline const bool getFinalORVeto() const { return m_finalORVeto; }
0070 inline const int getPreScColumn() const { return m_preScColumn; }
0071
0072
0073 void copyInitialToInterm() { m_algoDecisionPreScaled = m_algoDecisionInitial; }
0074 void copyIntermToFinal() { m_algoDecisionFinal = m_algoDecisionPreScaled; }
0075
0076
0077 void setAlgoDecisionInitial(unsigned int bit, bool val);
0078 void setAlgoDecisionInterm(unsigned int bit, bool val);
0079 void setAlgoDecisionFinal(unsigned int bit, bool val);
0080
0081
0082 std::vector<bool> const& getAlgoDecisionInitial() const { return m_algoDecisionInitial; }
0083 std::vector<bool> const& getAlgoDecisionInterm() const { return m_algoDecisionPreScaled; }
0084 std::vector<bool> const& getAlgoDecisionFinal() const { return m_algoDecisionFinal; }
0085 bool getAlgoDecisionInitial(unsigned int bit) const;
0086 bool getAlgoDecisionInterm(unsigned int bit) const;
0087 bool getAlgoDecisionFinal(unsigned int bit) const;
0088
0089
0090 void reset();
0091
0092
0093 virtual bool operator==(const GlobalAlgBlk& rhs) const;
0094 virtual inline bool operator!=(const GlobalAlgBlk& rhs) const { return !(operator==(rhs)); };
0095
0096
0097 void print(std::ostream& myCout) const;
0098
0099 private:
0100
0101
0102
0103 int m_orbitNr;
0104
0105
0106 int m_bxNr;
0107
0108
0109 int m_bxInEvent;
0110
0111
0112 bool m_finalOR;
0113 bool m_finalORPreVeto;
0114 bool m_finalORVeto;
0115
0116
0117 int m_preScColumn;
0118
0119 std::vector<bool> m_algoDecisionInitial;
0120 std::vector<bool> m_algoDecisionPreScaled;
0121 std::vector<bool> m_algoDecisionFinal;
0122 };
0123
0124 #endif