File indexing completed on 2024-04-06 12:19:51
0001 #ifndef L1GCTGLOBALENERGYALGOS_H_
0002 #define L1GCTGLOBALENERGYALGOS_H_
0003
0004 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtTotal.h"
0005 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtHad.h"
0006 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtMiss.h"
0007
0008 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctProcessor.h"
0009 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctMet.h"
0010
0011 #include <vector>
0012
0013 class L1GctWheelEnergyFpga;
0014 class L1GctWheelJetFpga;
0015 class L1GctGlobalHfSumAlgos;
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 class L1GctGlobalEnergyAlgos : public L1GctProcessor {
0034 public:
0035 typedef L1GctUnsignedInt<L1GctEtTotal::kEtTotalNBits> etTotalType;
0036 typedef L1GctUnsignedInt<L1GctEtHad::kEtHadNBits> etHadType;
0037 typedef L1GctMet::etMissType etMissType;
0038 typedef L1GctMet::etMissPhiType etMissPhiType;
0039 typedef L1GctMet::etmiss_vec etmiss_vec;
0040 typedef L1GctWheelEnergyFpga::etComponentType etComponentType;
0041
0042 enum maxValues {
0043 etTotalMaxValue = L1GctEtTotal::kEtTotalMaxValue,
0044 etHadMaxValue = L1GctEtHad::kEtHadMaxValue,
0045 etMissMaxValue = L1GctEtMiss::kEtMissMaxValue
0046 };
0047
0048
0049 L1GctGlobalEnergyAlgos(const std::vector<L1GctWheelEnergyFpga*>& WheelFpga,
0050 const std::vector<L1GctWheelJetFpga*>& WheelJetFpga);
0051
0052 ~L1GctGlobalEnergyAlgos() override;
0053
0054
0055 friend std::ostream& operator<<(std::ostream& os, const L1GctGlobalEnergyAlgos& fpga);
0056
0057
0058 void reset();
0059
0060
0061 void fetchInput() override;
0062
0063
0064 void process() override;
0065
0066
0067 void setBxRange(const int firstBx, const int numberOfBx);
0068
0069
0070 void setNextBx(const int bx);
0071
0072
0073 void setInputWheelEx(unsigned wheel, int energy, bool overflow);
0074
0075 void setInputWheelEy(unsigned wheel, int energy, bool overflow);
0076
0077 void setInputWheelEt(unsigned wheel, unsigned energy, bool overflow);
0078
0079 void setInputWheelHt(unsigned wheel, unsigned energy, bool overflow);
0080
0081 void setInputWheelHx(unsigned wheel, unsigned energy, bool overflow);
0082 void setInputWheelHy(unsigned wheel, unsigned energy, bool overflow);
0083
0084
0085 void setInputWheelJc(unsigned wheel, unsigned jcnum, unsigned count);
0086
0087
0088 L1GctWheelEnergyFpga* getPlusWheelFpga() const { return m_plusWheelFpga; }
0089
0090 L1GctWheelEnergyFpga* getMinusWheelFpga() const { return m_minusWheelFpga; }
0091
0092 L1GctWheelJetFpga* getPlusWheelJetFpga() const { return m_plusWheelJetFpga; }
0093
0094 L1GctWheelJetFpga* getMinusWheelJetFpga() const { return m_minusWheelJetFpga; }
0095
0096 L1GctGlobalHfSumAlgos* getHfSumProcessor() const { return m_hfSumProcessor; }
0097
0098
0099 inline std::vector<etComponentType> getInputExValPlusWheel() const { return m_exValPlusPipe.contents; }
0100
0101 inline std::vector<etComponentType> getInputEyValPlusWheel() const { return m_eyValPlusPipe.contents; }
0102
0103 inline std::vector<etComponentType> getInputExVlMinusWheel() const { return m_exVlMinusPipe.contents; }
0104
0105 inline std::vector<etComponentType> getInputEyVlMinusWheel() const { return m_eyVlMinusPipe.contents; }
0106
0107 inline std::vector<etTotalType> getInputEtValPlusWheel() const { return m_etValPlusPipe.contents; }
0108
0109 inline std::vector<etHadType> getInputHtValPlusWheel() const { return m_htValPlusPipe.contents; }
0110
0111 inline std::vector<etComponentType> getInputHxValPlusWheel() const { return m_hxValPlusPipe.contents; }
0112 inline std::vector<etComponentType> getInputHyValPlusWheel() const { return m_hyValPlusPipe.contents; }
0113
0114 inline std::vector<etTotalType> getInputEtVlMinusWheel() const { return m_etVlMinusPipe.contents; }
0115
0116 inline std::vector<etHadType> getInputHtVlMinusWheel() const { return m_htVlMinusPipe.contents; }
0117
0118 inline std::vector<etComponentType> getInputHxVlMinusWheel() const { return m_hxVlMinusPipe.contents; }
0119 inline std::vector<etComponentType> getInputHyVlMinusWheel() const { return m_hyVlMinusPipe.contents; }
0120
0121
0122
0123 inline std::vector<etMissType> getEtMissColl() const { return m_outputEtMiss.contents; }
0124
0125 inline std::vector<etMissPhiType> getEtMissPhiColl() const { return m_outputEtMissPhi.contents; }
0126
0127 inline std::vector<etTotalType> getEtSumColl() const { return m_outputEtSum.contents; }
0128
0129 inline std::vector<etHadType> getEtHadColl() const { return m_outputEtHad.contents; }
0130
0131 inline std::vector<etMissType> getHtMissColl() const { return m_outputHtMiss.contents; }
0132
0133 inline std::vector<etMissPhiType> getHtMissPhiColl() const { return m_outputHtMissPhi.contents; }
0134
0135 void setJetFinderParams(const L1GctJetFinderParams* const jfpars);
0136 void setHtMissScale(const L1CaloEtScale* const scale);
0137
0138
0139 const L1GctHtMissLut* getHtMissLut() const { return m_mhtComponents.getHtMissLut(); }
0140
0141
0142 bool setupOk() const;
0143
0144 protected:
0145
0146 void resetProcessor() override;
0147 void resetPipelines() override;
0148
0149
0150 void setupObjects() override {}
0151
0152 private:
0153
0154 L1GctWheelEnergyFpga* m_plusWheelFpga;
0155 L1GctWheelEnergyFpga* m_minusWheelFpga;
0156 L1GctWheelJetFpga* m_plusWheelJetFpga;
0157 L1GctWheelJetFpga* m_minusWheelJetFpga;
0158
0159
0160 L1GctGlobalHfSumAlgos* m_hfSumProcessor;
0161
0162
0163 L1GctMet m_metComponents;
0164 L1GctMet m_mhtComponents;
0165
0166
0167 etComponentType m_exValPlusWheel;
0168 etComponentType m_eyValPlusWheel;
0169 etTotalType m_etValPlusWheel;
0170 etHadType m_htValPlusWheel;
0171 etComponentType m_hxValPlusWheel;
0172 etComponentType m_hyValPlusWheel;
0173
0174 etComponentType m_exVlMinusWheel;
0175 etComponentType m_eyVlMinusWheel;
0176 etTotalType m_etVlMinusWheel;
0177 etHadType m_htVlMinusWheel;
0178 etComponentType m_hxVlMinusWheel;
0179 etComponentType m_hyVlMinusWheel;
0180
0181
0182 Pipeline<etComponentType> m_exValPlusPipe;
0183 Pipeline<etComponentType> m_eyValPlusPipe;
0184 Pipeline<etTotalType> m_etValPlusPipe;
0185 Pipeline<etHadType> m_htValPlusPipe;
0186 Pipeline<etComponentType> m_hxValPlusPipe;
0187 Pipeline<etComponentType> m_hyValPlusPipe;
0188
0189 Pipeline<etComponentType> m_exVlMinusPipe;
0190 Pipeline<etComponentType> m_eyVlMinusPipe;
0191 Pipeline<etTotalType> m_etVlMinusPipe;
0192 Pipeline<etHadType> m_htVlMinusPipe;
0193 Pipeline<etComponentType> m_hxVlMinusPipe;
0194 Pipeline<etComponentType> m_hyVlMinusPipe;
0195
0196
0197 Pipeline<etMissType> m_outputEtMiss;
0198 Pipeline<etMissPhiType> m_outputEtMissPhi;
0199 Pipeline<etTotalType> m_outputEtSum;
0200 Pipeline<etHadType> m_outputEtHad;
0201 Pipeline<etMissType> m_outputHtMiss;
0202 Pipeline<etMissPhiType> m_outputHtMissPhi;
0203
0204 bool m_setupOk;
0205 };
0206
0207 std::ostream& operator<<(std::ostream& os, const L1GctGlobalEnergyAlgos& fpga);
0208
0209 #endif