File indexing completed on 2024-04-06 12:19:51
0001 #ifndef L1GCTWHEELJETFPGA_H_
0002 #define L1GCTWHEELJETFPGA_H_
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctJetCand.h"
0018 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtHad.h"
0019
0020 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctProcessor.h"
0021 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctJetLeafCard.h"
0022
0023 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctUnsignedInt.h"
0024
0025 class L1GctJetSorter;
0026
0027 #include <vector>
0028
0029 class L1GctWheelJetFpga : public L1GctProcessor {
0030 public:
0031 typedef std::vector<L1GctJetCand> JetVector;
0032 typedef L1GctTwosComplement<L1GctInternHtMiss::kMissHxOrHyNBits> htComponentType;
0033 typedef L1GctJetLeafCard::hfTowerSumsType hfTowerSumsType;
0034
0035
0036 static const int MAX_JETS_OUT;
0037
0038
0039 static const unsigned int MAX_LEAF_CARDS;
0040
0041
0042 static const unsigned int MAX_JETS_PER_LEAF;
0043
0044
0045 L1GctWheelJetFpga(int id, const std::vector<L1GctJetLeafCard*>& inputLeafCards);
0046
0047
0048 ~L1GctWheelJetFpga() override;
0049
0050
0051 friend std::ostream& operator<<(std::ostream& os, const L1GctWheelJetFpga& fpga);
0052
0053
0054 void fetchInput() override;
0055
0056
0057 void process() override;
0058
0059
0060 void setInputJet(int i, const L1GctJetCand& jet);
0061
0062
0063 JetVector getInputJets() const { return m_inputJets; }
0064
0065
0066 htComponentType inputHx(unsigned leafnum) const { return m_inputHx.at(leafnum); }
0067 htComponentType inputHy(unsigned leafnum) const { return m_inputHy.at(leafnum); }
0068
0069
0070 hfTowerSumsType inputHfSums(unsigned leafnum) const { return m_inputHfSums.at(leafnum); }
0071
0072
0073 JetVector getCentralJets() const { return m_centralJets; }
0074
0075
0076 JetVector getForwardJets() const { return m_forwardJets; }
0077
0078
0079 JetVector getTauJets() const { return m_tauJets; }
0080
0081
0082 htComponentType getOutputHx() const { return m_outputHx; }
0083 htComponentType getOutputHy() const { return m_outputHy; }
0084
0085
0086 hfTowerSumsType getOutputHfSums() const { return m_outputHfSums; }
0087
0088
0089 bool setupOk() const { return checkSetup(); }
0090
0091
0092 std::vector<L1GctInternHtMiss> getInternalHtMiss() const;
0093
0094 protected:
0095
0096 void resetProcessor() override;
0097 void resetPipelines() override;
0098
0099
0100 void setupObjects() override;
0101
0102 private:
0103 static const int MAX_JETS_IN;
0104
0105
0106 int m_id;
0107
0108
0109 std::vector<L1GctJetLeafCard*> m_inputLeafCards;
0110
0111
0112 L1GctJetSorter* m_centralJetSorter;
0113 L1GctJetSorter* m_forwardJetSorter;
0114 L1GctJetSorter* m_tauJetSorter;
0115
0116
0117 JetVector m_inputJets;
0118
0119
0120 JetVector m_rawCentralJets;
0121 JetVector m_rawForwardJets;
0122 JetVector m_rawTauJets;
0123
0124
0125 std::vector<htComponentType> m_inputHx;
0126 std::vector<htComponentType> m_inputHy;
0127
0128
0129 std::vector<hfTowerSumsType> m_inputHfSums;
0130
0131
0132 JetVector m_centralJets;
0133 JetVector m_forwardJets;
0134 JetVector m_tauJets;
0135
0136
0137 htComponentType m_outputHx;
0138 htComponentType m_outputHy;
0139 hfTowerSumsType m_outputHfSums;
0140
0141 Pipeline<htComponentType> m_outputHxPipe;
0142 Pipeline<htComponentType> m_outputHyPipe;
0143
0144
0145
0146 bool checkSetup() const;
0147
0148 void storeJets(const JetVector& jets, unsigned short iLeaf, unsigned short offset);
0149
0150 void classifyJets();
0151
0152 void setupJetsVectors(const int16_t bx);
0153 };
0154
0155 std::ostream& operator<<(std::ostream& os, const L1GctWheelJetFpga& fpga);
0156
0157 #endif