File indexing completed on 2024-04-06 12:19:51
0001 #ifndef L1GCTJETLEAFCARD_H_
0002 #define L1GCTJETLEAFCARD_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/L1GctJetFinderBase.h"
0010 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctTwosComplement.h"
0011 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctUnsignedInt.h"
0012
0013 #include <vector>
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 class L1GctJetCand;
0027
0028 class L1GctJetLeafCard : public L1GctProcessor {
0029 public:
0030
0031 enum jetFinderType { tdrJetFinder, hardwareJetFinder, nullJetFinder };
0032
0033
0034 static const int MAX_JET_FINDERS;
0035
0036
0037 typedef L1GctUnsignedInt<L1GctInternEtSum::kTotEtOrHtNBits> etTotalType;
0038 typedef L1GctUnsignedInt<L1GctInternEtSum::kTotEtOrHtNBits> etHadType;
0039
0040 typedef L1GctTwosComplement<L1GctInternEtSum::kMissExOrEyNBits> etComponentType;
0041 typedef L1GctTwosComplement<L1GctInternHtMiss::kMissHxOrHyNBits> htComponentType;
0042
0043 typedef L1GctJetFinderBase::hfTowerSumsType hfTowerSumsType;
0044
0045 enum maxValues {
0046 etTotalMaxValue = L1GctInternEtSum::kTotEtOrHtMaxValue,
0047 htTotalMaxValue = L1GctInternEtSum::kTotEtOrHtMaxValue
0048 };
0049
0050
0051 L1GctJetLeafCard(int id, int iphi, jetFinderType jfType = tdrJetFinder);
0052
0053 ~L1GctJetLeafCard() override;
0054
0055
0056 void setNeighbourLeafCards(const std::vector<L1GctJetLeafCard*>& neighbours);
0057
0058
0059 bool setupOk() const;
0060
0061
0062 friend std::ostream& operator<<(std::ostream& os, const L1GctJetLeafCard& card);
0063
0064
0065 void reset();
0066
0067
0068 void fetchInput() override;
0069
0070
0071 void process() override;
0072
0073
0074 void setBxRange(const int firstBx, const int numberOfBx);
0075
0076
0077 void setNextBx(const int bx);
0078
0079
0080 L1GctJetFinderBase* getJetFinderA() const { return m_jetFinderA; }
0081 L1GctJetFinderBase* getJetFinderB() const { return m_jetFinderB; }
0082 L1GctJetFinderBase* getJetFinderC() const { return m_jetFinderC; }
0083
0084
0085 std::vector<L1GctJetCand> getOutputJetsA() const;
0086 std::vector<L1GctJetCand> getOutputJetsB() const;
0087 std::vector<L1GctJetCand> getOutputJetsC() const;
0088
0089
0090 etComponentType getOutputEx() const { return m_exSum; }
0091
0092
0093 etComponentType getOutputEy() const { return m_eySum; }
0094
0095
0096 etComponentType getOutputHx() const { return m_hxSum; }
0097 etComponentType getOutputHy() const { return m_hySum; }
0098
0099
0100 etTotalType getOutputEt() const { return m_etSum; }
0101 etHadType getOutputHt() const { return m_htSum; }
0102
0103 hfTowerSumsType getOutputHfSums() const { return m_hfSums; }
0104
0105
0106
0107 std::vector<etComponentType> getAllOutputEx() const { return m_exSumPipe.contents; }
0108
0109
0110 std::vector<etComponentType> getAllOutputEy() const { return m_eySumPipe.contents; }
0111
0112
0113 std::vector<htComponentType> getAllOutputHx() const { return m_hxSumPipe.contents; }
0114 std::vector<htComponentType> getAllOutputHy() const { return m_hySumPipe.contents; }
0115
0116
0117 std::vector<etTotalType> getAllOutputEt() const { return m_etSumPipe.contents; }
0118 std::vector<etHadType> getAllOutputHt() const { return m_htSumPipe.contents; }
0119
0120 std::vector<hfTowerSumsType> getAllOutputHfSums() const { return m_hfSumsPipe.contents; }
0121
0122
0123 std::vector<L1GctInternEtSum> getInternalEtSums() const;
0124 std::vector<L1GctInternHtMiss> getInternalHtMiss() const;
0125
0126 protected:
0127
0128 void resetProcessor() override;
0129 void resetPipelines() override;
0130
0131
0132 void setupObjects() override {}
0133
0134 private:
0135
0136 int m_id;
0137
0138
0139 jetFinderType m_whichJetFinder;
0140
0141
0142 L1GctJetFinderBase* m_jetFinderA;
0143 L1GctJetFinderBase* m_jetFinderB;
0144 L1GctJetFinderBase* m_jetFinderC;
0145
0146
0147
0148 int phiPosition;
0149
0150 etComponentType m_exSum;
0151 etComponentType m_eySum;
0152 htComponentType m_hxSum;
0153 htComponentType m_hySum;
0154 etTotalType m_etSum;
0155 etHadType m_htSum;
0156
0157 hfTowerSumsType m_hfSums;
0158
0159
0160 Pipeline<etComponentType> m_exSumPipe;
0161 Pipeline<etComponentType> m_eySumPipe;
0162 Pipeline<htComponentType> m_hxSumPipe;
0163 Pipeline<htComponentType> m_hySumPipe;
0164 Pipeline<etTotalType> m_etSumPipe;
0165 Pipeline<etHadType> m_htSumPipe;
0166 Pipeline<hfTowerSumsType> m_hfSumsPipe;
0167
0168 bool m_ctorInputOk;
0169 };
0170
0171 std::ostream& operator<<(std::ostream& os, const L1GctJetLeafCard& card);
0172
0173 #endif