CMS 3D CMS Logo

L1GctWheelEnergyFpga.h
Go to the documentation of this file.
1 #ifndef L1GCTWHEELENERGYFPGA_H_
2 #define L1GCTWHEELENERGYFPGA_H_
3 
6 
11 
12 #include <vector>
13 
14 class L1GctJetLeafCard;
15 
31 public:
36 
37  enum maxValues {
40  };
41 
43  static const unsigned int MAX_LEAF_CARDS;
44 
46  L1GctWheelEnergyFpga(int id, const std::vector<L1GctJetLeafCard*>& leafCards);
48  ~L1GctWheelEnergyFpga() override;
49 
51  friend std::ostream& operator<<(std::ostream& os, const L1GctWheelEnergyFpga& fpga);
52 
54  void fetchInput() override;
55 
57  void process() override;
58 
60  void setInputEnergy(unsigned i, int ex, int ey, unsigned et, unsigned ht);
61 
63  L1GctJetLeafCard* getinputLeafCard(unsigned leafnum) const { return m_inputLeafCards.at(leafnum); }
64 
66  inline etComponentType getInputEx(unsigned leafnum) const { return m_inputEx.at(leafnum); }
68  inline etComponentType getInputEy(unsigned leafnum) const { return m_inputEy.at(leafnum); }
70  inline etTotalType getInputEt(unsigned leafnum) const { return m_inputEt.at(leafnum); }
72  inline etHadType inputHt(unsigned leafnum) const { return m_inputHt.at(leafnum); }
73 
75  inline etComponentType getOutputEx() const { return m_outputEx; }
77  inline etComponentType getOutputEy() const { return m_outputEy; }
79  inline etTotalType getOutputEt() const { return m_outputEt; }
81  inline etHadType getOutputHt() const { return m_outputHt; }
82 
84  std::vector<L1GctInternEtSum> getInternalEtSums() const;
85 
87  bool setupOk() const { return m_setupOk; }
88 
89 protected:
91  void resetProcessor() override;
92  void resetPipelines() override;
93 
95  void setupObjects() override {}
96 
97 private:
100  int m_id;
103  std::vector<L1GctJetLeafCard*> m_inputLeafCards;
106  std::vector<etComponentType> m_inputEx;
107  std::vector<etComponentType> m_inputEy;
108  std::vector<etTotalType> m_inputEt;
109  std::vector<etHadType> m_inputHt;
112  etComponentType m_outputEx;
113  etComponentType m_outputEy;
114  etTotalType m_outputEt;
115  etHadType m_outputHt;
116 
118  bool m_setupOk;
119 
121  Pipeline<etComponentType> m_outputExPipe;
122  Pipeline<etComponentType> m_outputEyPipe;
123  Pipeline<etTotalType> m_outputEtPipe;
124  Pipeline<etHadType> m_outputHtPipe;
125 };
126 
127 std::ostream& operator<<(std::ostream& os, const L1GctWheelEnergyFpga& fpga);
128 
129 #endif /*L1GCTWHEELENERGYFPGA_H_*/
Emulates the energy summing on a GCT Wheel card.
friend std::ostream & operator<<(std::ostream &os, const L1GctWheelEnergyFpga &fpga)
Overload << operator.
etComponentType m_outputEx
output data
L1GctJetLeafCard * getinputLeafCard(unsigned leafnum) const
provide access to input Leaf card pointer (0-2)
void resetProcessor() override
Separate reset methods for the processor itself and any data stored in pipelines. ...
etComponentType getInputEx(unsigned leafnum) const
get input Ex value from a Leaf card (0-2)
etTotalType getInputEt(unsigned leafnum) const
get input Et value from a Leaf card (0-2)
void fetchInput() override
get input data from sources; this is the standard way to provide input
void setupObjects() override
Initialise inputs with null objects for the correct bunch crossing if required.
Pipeline< etHadType > m_outputHtPipe
etComponentType getOutputEy() const
get output Ey value
std::vector< etHadType > m_inputHt
void setInputEnergy(unsigned i, int ex, int ey, unsigned et, unsigned ht)
set input data; not used in normal operation
bool setupOk() const
check the setup
ABC for a GCT trigger data processing unit.
std::vector< L1GctInternEtSum > getInternalEtSums() const
get the Et sums in internal component format
Pipeline< etTotalType > m_outputEtPipe
etComponentType getOutputEx() const
get output Ex value
std::vector< etComponentType > m_inputEx
the input components from each input card
std::vector< etTotalType > m_inputEt
Pipeline< etComponentType > m_outputExPipe
record the output data history
etHadType getOutputHt() const
get the output Ht
L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits > etTotalType
typedefs for energy values in fixed numbers of bits
std::vector< etComponentType > m_inputEy
bool m_setupOk
check the setup
L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits > etHadType
etTotalType getOutputEt() const
get output Et value
L1GctWheelEnergyFpga(int id, const std::vector< L1GctJetLeafCard * > &leafCards)
Constructor, needs the Leaf cards to be set up first. id should be 0 or 1.
void resetPipelines() override
std::vector< L1GctJetLeafCard * > m_inputLeafCards
the jet leaf card
Pipeline< etComponentType > m_outputEyPipe
etComponentType getInputEy(unsigned leafnum) const
get input Ey value from a Leaf card (0-2)
void process() override
process the data, fill output buffers
etHadType inputHt(unsigned leafnum) const
get input Ht value from a Leaf card (0-2)
static const unsigned int MAX_LEAF_CARDS
Max number of leaf card pointers.
L1GctTwosComplement< L1GctInternEtSum::kMissExOrEyNBits > etComponentType
~L1GctWheelEnergyFpga() override
Destructor.