CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1GctGlobalEnergyAlgos.h
Go to the documentation of this file.
1 #ifndef L1GCTGLOBALENERGYALGOS_H_
2 #define L1GCTGLOBALENERGYALGOS_H_
3 
7 
10 
11 #include <vector>
12 
14 class L1GctWheelJetFpga;
16 
34 public:
41 
42  enum maxValues {
46  };
47 
49  L1GctGlobalEnergyAlgos(const std::vector<L1GctWheelEnergyFpga*>& WheelFpga,
50  const std::vector<L1GctWheelJetFpga*>& WheelJetFpga);
52  ~L1GctGlobalEnergyAlgos() override;
53 
55  friend std::ostream& operator<<(std::ostream& os, const L1GctGlobalEnergyAlgos& fpga);
56 
58  void reset();
59 
61  void fetchInput() override;
62 
64  void process() override;
65 
67  void setBxRange(const int firstBx, const int numberOfBx);
68 
70  void setNextBx(const int bx);
71 
73  void setInputWheelEx(unsigned wheel, int energy, bool overflow);
75  void setInputWheelEy(unsigned wheel, int energy, bool overflow);
77  void setInputWheelEt(unsigned wheel, unsigned energy, bool overflow);
79  void setInputWheelHt(unsigned wheel, unsigned energy, bool overflow);
81  void setInputWheelHx(unsigned wheel, unsigned energy, bool overflow);
82  void setInputWheelHy(unsigned wheel, unsigned energy, bool overflow);
83 
85  void setInputWheelJc(unsigned wheel, unsigned jcnum, unsigned count);
86 
97 
99  inline std::vector<etComponentType> getInputExValPlusWheel() const { return m_exValPlusPipe.contents; }
101  inline std::vector<etComponentType> getInputEyValPlusWheel() const { return m_eyValPlusPipe.contents; }
103  inline std::vector<etComponentType> getInputExVlMinusWheel() const { return m_exVlMinusPipe.contents; }
105  inline std::vector<etComponentType> getInputEyVlMinusWheel() const { return m_eyVlMinusPipe.contents; }
107  inline std::vector<etTotalType> getInputEtValPlusWheel() const { return m_etValPlusPipe.contents; }
109  inline std::vector<etHadType> getInputHtValPlusWheel() const { return m_htValPlusPipe.contents; }
111  inline std::vector<etComponentType> getInputHxValPlusWheel() const { return m_hxValPlusPipe.contents; }
112  inline std::vector<etComponentType> getInputHyValPlusWheel() const { return m_hyValPlusPipe.contents; }
114  inline std::vector<etTotalType> getInputEtVlMinusWheel() const { return m_etVlMinusPipe.contents; }
116  inline std::vector<etHadType> getInputHtVlMinusWheel() const { return m_htVlMinusPipe.contents; }
118  inline std::vector<etComponentType> getInputHxVlMinusWheel() const { return m_hxVlMinusPipe.contents; }
119  inline std::vector<etComponentType> getInputHyVlMinusWheel() const { return m_hyVlMinusPipe.contents; }
120 
123  inline std::vector<etMissType> getEtMissColl() const { return m_outputEtMiss.contents; }
125  inline std::vector<etMissPhiType> getEtMissPhiColl() const { return m_outputEtMissPhi.contents; }
127  inline std::vector<etTotalType> getEtSumColl() const { return m_outputEtSum.contents; }
129  inline std::vector<etHadType> getEtHadColl() const { return m_outputEtHad.contents; }
131  inline std::vector<etMissType> getHtMissColl() const { return m_outputHtMiss.contents; }
133  inline std::vector<etMissPhiType> getHtMissPhiColl() const { return m_outputHtMissPhi.contents; }
134 
135  void setJetFinderParams(const L1GctJetFinderParams* const jfpars);
136  void setHtMissScale(const L1CaloEtScale* const scale);
137 
138  // get the missing Ht LUT (used by L1GctPrintLuts)
140 
142  bool setupOk() const;
143 
144 protected:
146  void resetProcessor() override;
147  void resetPipelines() override;
148 
150  void setupObjects() override {}
151 
152 private:
153  // Here are the algorithm types we get our inputs from
158 
159  // Here's the class that does the Hf sums
161 
162  // Missing Et and missing Ht
165 
166  // input data
173 
180 
181  // stored copies of input data
182  Pipeline<etComponentType> m_exValPlusPipe;
183  Pipeline<etComponentType> m_eyValPlusPipe;
184  Pipeline<etTotalType> m_etValPlusPipe;
185  Pipeline<etHadType> m_htValPlusPipe;
186  Pipeline<etComponentType> m_hxValPlusPipe;
187  Pipeline<etComponentType> m_hyValPlusPipe;
188 
189  Pipeline<etComponentType> m_exVlMinusPipe;
190  Pipeline<etComponentType> m_eyVlMinusPipe;
191  Pipeline<etTotalType> m_etVlMinusPipe;
192  Pipeline<etHadType> m_htVlMinusPipe;
193  Pipeline<etComponentType> m_hxVlMinusPipe;
194  Pipeline<etComponentType> m_hyVlMinusPipe;
195 
196  // output data
197  Pipeline<etMissType> m_outputEtMiss;
198  Pipeline<etMissPhiType> m_outputEtMissPhi;
199  Pipeline<etTotalType> m_outputEtSum;
200  Pipeline<etHadType> m_outputEtHad;
201  Pipeline<etMissType> m_outputHtMiss;
202  Pipeline<etMissPhiType> m_outputHtMissPhi;
203 
204  bool m_setupOk;
205 };
206 
207 std::ostream& operator<<(std::ostream& os, const L1GctGlobalEnergyAlgos& fpga);
208 
209 #endif /*L1GCTGLOBALENERGYALGOS_H_*/
L1GctMet::etmiss_vec etmiss_vec
Emulates the energy summing on a GCT Wheel card.
std::vector< etComponentType > getInputHyValPlusWheel() const
bool setupOk() const
check setup
void reset()
clear internal buffers
std::vector< etComponentType > getInputHxVlMinusWheel() const
return input Ht value wheel 0
std::vector< etTotalType > getInputEtVlMinusWheel() const
return input Et value wheel 0
Pipeline< etMissType > m_outputHtMiss
friend std::ostream & operator<<(std::ostream &os, const L1GctGlobalEnergyAlgos &fpga)
Overload &lt;&lt; operator.
Represents a GCT Wheel Jet FPGA.
std::vector< etMissType > getHtMissColl() const
return output missing Ht magnitude
Emulates the GCT summing and packing of Hf Et sums and tower-over-threshold counts.
L1GctMet::etMissType etMissType
Pipeline< etComponentType > m_eyVlMinusPipe
Pipeline< etComponentType > m_exValPlusPipe
void fetchInput() override
get input data from sources
void setInputWheelEx(unsigned wheel, int energy, bool overflow)
set input Ex value per wheel (0 or 1); not used in normal operation
Pipeline< etMissPhiType > m_outputHtMissPhi
Pipeline< etComponentType > m_hyVlMinusPipe
Pipeline< etComponentType > m_hxVlMinusPipe
std::vector< etHadType > getInputHtValPlusWheel() const
return input Ht value wheel 1
std::vector< etTotalType > getEtSumColl() const
return output total scalar Et
Pipeline< etComponentType > m_hxValPlusPipe
L1GctWheelEnergyFpga * getMinusWheelFpga() const
provide access to input pointer, Wheel Energy Fpga 0
void setInputWheelHy(unsigned wheel, unsigned energy, bool overflow)
void setJetFinderParams(const L1GctJetFinderParams *const jfpars)
L1GctWheelJetFpga * m_plusWheelJetFpga
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
LUT for conversion of Ht components x and y to magnitude and angle.
L1GctMet::etMissPhiType etMissPhiType
Stores Level-1 missing Et in (Ex, Ey) form, allowing it to be retrieved as (magnitude, angle)
Definition: L1GctMet.h:20
void setupObjects() override
Initialise inputs with null objects for the correct bunch crossing if required.
std::vector< etMissType > getEtMissColl() const
std::vector< etComponentType > getInputEyValPlusWheel() const
return input Ex value wheel 1
void setHtMissScale(const L1CaloEtScale *const scale)
ABC for a GCT trigger data processing unit.
std::vector< etComponentType > getInputExVlMinusWheel() const
return input Ey value wheel 0
L1GctUnsignedInt< L1GctEtTotal::kEtTotalNBits > etTotalType
L1GctWheelEnergyFpga * getPlusWheelFpga() const
provide access to input pointer, Wheel Energy Fpga 1
Pipeline< etHadType > m_outputEtHad
std::vector< etComponentType > getInputHyVlMinusWheel() const
L1GctWheelEnergyFpga * m_minusWheelFpga
L1GctWheelJetFpga * getMinusWheelJetFpga() const
provide access to input pointer, Wheel Jet Fpga 0
void setInputWheelHx(unsigned wheel, unsigned energy, bool overflow)
set input Ht component values per wheel (0 or 1); not used in normal operation
L1GctGlobalEnergyAlgos(const std::vector< L1GctWheelEnergyFpga * > &WheelFpga, const std::vector< L1GctWheelJetFpga * > &WheelJetFpga)
Constructor needs the Wheel card Fpgas set up first.
const L1GctHtMissLut * getHtMissLut() const
Definition: L1GctMet.h:66
Pipeline< etTotalType > m_etValPlusPipe
L1GctGlobalHfSumAlgos * m_hfSumProcessor
L1GctUnsignedInt< L1GctEtHad::kEtHadNBits > etHadType
Emulates the GCT global energy algorithms.
L1GctGlobalHfSumAlgos * getHfSumProcessor() const
provide access to hf sum processor
void process() override
process the data, fill output buffers
Pipeline< etComponentType > m_hyValPlusPipe
void setBxRange(const int firstBx, const int numberOfBx)
define the bunch crossing range to process
Pipeline< etHadType > m_htValPlusPipe
void setInputWheelHt(unsigned wheel, unsigned energy, bool overflow)
set input Ht value per wheel (0 or 1); not used in normal operation
L1GctWheelJetFpga * m_minusWheelJetFpga
std::vector< etTotalType > getInputEtValPlusWheel() const
return input Et value wheel 1
Pipeline< etComponentType > m_exVlMinusPipe
void setInputWheelEy(unsigned wheel, int energy, bool overflow)
set input Ey value per wheel (0 or 1); not used in normal operation
Pipeline< etMissPhiType > m_outputEtMissPhi
std::vector< etMissPhiType > getHtMissPhiColl() const
return output missing Ht value
L1GctWheelEnergyFpga * m_plusWheelFpga
Pipeline< etComponentType > m_eyValPlusPipe
std::vector< etComponentType > getInputEyVlMinusWheel() const
return input Ey value wheel 0
std::vector< etHadType > getEtHadColl() const
return std::vector&lt; output calibrated jet Et
std::vector< etComponentType > getInputHxValPlusWheel() const
return input Ht component values wheel 1
Pipeline< etMissType > m_outputEtMiss
std::vector< etComponentType > getInputExValPlusWheel() const
return input Ex value wheel 1
const L1GctHtMissLut * getHtMissLut() const
std::vector< etHadType > getInputHtVlMinusWheel() const
return input Ht value wheel 0
void setInputWheelJc(unsigned wheel, unsigned jcnum, unsigned count)
set input jet count (number 0-11) per wheel (0 or 1); not used in normal operation ...
~L1GctGlobalEnergyAlgos() override
Destructor.
Pipeline< etHadType > m_htVlMinusPipe
L1GctWheelEnergyFpga::etComponentType etComponentType
void setNextBx(const int bx)
partially clear buffers
std::vector< etMissPhiType > getEtMissPhiColl() const
return output missing Et value
Pipeline< etTotalType > m_outputEtSum
Pipeline< etTotalType > m_etVlMinusPipe
void resetProcessor() override
Separate reset methods for the processor itself and any data stored in pipelines. ...
void setInputWheelEt(unsigned wheel, unsigned energy, bool overflow)
set input Et value per wheel (0 or 1); not used in normal operation
L1GctWheelJetFpga * getPlusWheelJetFpga() const
provide access to input pointer, Wheel Jet Fpga 1