File indexing completed on 2023-03-17 11:11:18
0001 #ifndef L1GCTWHEELENERGYFPGA_H_
0002 #define L1GCTWHEELENERGYFPGA_H_
0003
0004 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtTotal.h"
0005 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtMiss.h"
0006
0007 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctProcessor.h"
0008 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctJetLeafCard.h"
0009 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctTwosComplement.h"
0010 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctUnsignedInt.h"
0011
0012 #include <vector>
0013
0014 class L1GctJetLeafCard;
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 class L1GctWheelEnergyFpga : public L1GctProcessor {
0031 public:
0032
0033 typedef L1GctUnsignedInt<L1GctInternEtSum::kTotEtOrHtNBits> etTotalType;
0034 typedef L1GctUnsignedInt<L1GctInternEtSum::kTotEtOrHtNBits> etHadType;
0035 typedef L1GctTwosComplement<L1GctInternEtSum::kMissExOrEyNBits> etComponentType;
0036
0037 enum maxValues {
0038 etTotalMaxValue = L1GctInternEtSum::kTotEtOrHtMaxValue,
0039 htTotalMaxValue = L1GctInternEtSum::kTotEtOrHtMaxValue
0040 };
0041
0042
0043 static const unsigned int MAX_LEAF_CARDS;
0044
0045
0046 L1GctWheelEnergyFpga(int id, const std::vector<L1GctJetLeafCard*>& leafCards);
0047
0048 ~L1GctWheelEnergyFpga() override;
0049
0050
0051 friend std::ostream& operator<<(std::ostream& os, const L1GctWheelEnergyFpga& fpga);
0052
0053
0054 void fetchInput() override;
0055
0056
0057 void process() override;
0058
0059
0060 void setInputEnergy(unsigned i, int ex, int ey, unsigned et, unsigned ht);
0061
0062
0063 L1GctJetLeafCard* getinputLeafCard(unsigned leafnum) const { return m_inputLeafCards.at(leafnum); }
0064
0065
0066 inline etComponentType getInputEx(unsigned leafnum) const { return m_inputEx.at(leafnum); }
0067
0068 inline etComponentType getInputEy(unsigned leafnum) const { return m_inputEy.at(leafnum); }
0069
0070 inline etTotalType getInputEt(unsigned leafnum) const { return m_inputEt.at(leafnum); }
0071
0072 inline etHadType inputHt(unsigned leafnum) const { return m_inputHt.at(leafnum); }
0073
0074
0075 inline etComponentType getOutputEx() const { return m_outputEx; }
0076
0077 inline etComponentType getOutputEy() const { return m_outputEy; }
0078
0079 inline etTotalType getOutputEt() const { return m_outputEt; }
0080
0081 inline etHadType getOutputHt() const { return m_outputHt; }
0082
0083
0084 std::vector<L1GctInternEtSum> getInternalEtSums() const;
0085
0086
0087 bool setupOk() const { return m_setupOk; }
0088
0089 protected:
0090
0091 void resetProcessor() override;
0092 void resetPipelines() override;
0093
0094
0095 void setupObjects() override {}
0096
0097 private:
0098
0099
0100 int m_id;
0101
0102
0103 std::vector<L1GctJetLeafCard*> m_inputLeafCards;
0104
0105
0106 std::vector<etComponentType> m_inputEx;
0107 std::vector<etComponentType> m_inputEy;
0108 std::vector<etTotalType> m_inputEt;
0109 std::vector<etHadType> m_inputHt;
0110
0111
0112 etComponentType m_outputEx;
0113 etComponentType m_outputEy;
0114 etTotalType m_outputEt;
0115 etHadType m_outputHt;
0116
0117
0118 bool m_setupOk;
0119
0120
0121 Pipeline<etComponentType> m_outputExPipe;
0122 Pipeline<etComponentType> m_outputEyPipe;
0123 Pipeline<etTotalType> m_outputEtPipe;
0124 Pipeline<etHadType> m_outputHtPipe;
0125 };
0126
0127 std::ostream& operator<<(std::ostream& os, const L1GctWheelEnergyFpga& fpga);
0128
0129 #endif