File indexing completed on 2024-04-06 12:19:50
0001 #ifndef L1GCTELECTRONSORTER_H_
0002 #define L1GCTELECTRONSORTER_H_
0003
0004 #include "DataFormats/L1CaloTrigger/interface/L1CaloEmCand.h"
0005
0006 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEmCand.h"
0007 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctProcessor.h"
0008
0009 #include <vector>
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 class L1GctElectronSorter : public L1GctProcessor {
0027 public:
0028
0029
0030
0031
0032
0033 struct prioritisedEmCand {
0034 L1GctEmCand emCand;
0035 unsigned short priority;
0036
0037
0038 prioritisedEmCand() : emCand(), priority(0) {}
0039 prioritisedEmCand(L1GctEmCand& c, unsigned short p) : emCand(c), priority(p) {}
0040 prioritisedEmCand(L1CaloEmCand& c, unsigned short p) : emCand(c), priority(p) {}
0041
0042
0043 unsigned rank() const { return emCand.rank(); }
0044 };
0045
0046
0047
0048 static bool rankByGt(const prioritisedEmCand& x, const prioritisedEmCand& y) {
0049 return (x.rank() > y.rank() || ((x.rank() == y.rank()) && (x.priority < y.priority)));
0050 }
0051
0052
0053 L1GctElectronSorter(int nInputs, bool iso);
0054
0055 ~L1GctElectronSorter() override;
0056
0057
0058 void fetchInput() override;
0059
0060
0061 void process() override;
0062
0063
0064 void setInputEmCand(const L1CaloEmCand& cand);
0065
0066
0067 inline std::vector<L1CaloEmCand> getInputCands() { return m_inputCands; }
0068
0069
0070 inline std::vector<L1GctEmCand> getOutputCands() { return m_outputCands; }
0071
0072
0073 friend std::ostream& operator<<(std::ostream& s, const L1GctElectronSorter& card);
0074
0075 protected:
0076
0077 void resetProcessor() override;
0078 void resetPipelines() override {}
0079
0080
0081 void setupObjects() override;
0082
0083 private:
0084
0085
0086 int m_id;
0087
0088
0089 bool m_isolation;
0090
0091
0092 std::vector<L1CaloEmCand> m_inputCands;
0093
0094
0095 std::vector<L1GctEmCand> m_outputCands;
0096 };
0097
0098 std::ostream& operator<<(std::ostream& s, const L1GctElectronSorter& card);
0099 #endif