Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:16

0001 #ifndef L1Trigger_L1TTrackMatch_Cordic_HH
0002 #define L1Trigger_L1TTrackMatch_Cordic_HH
0003 
0004 #include "L1Trigger/L1TTrackMatch/interface/L1TkEtMissEmuAlgo.h"
0005 
0006 /*
0007 ** class  : Cordic
0008 ** author : Christopher Brown
0009 ** date   : 19/02/2021
0010 ** brief  : Integer sqrt and atan calculation for TrackMET emulation
0011 
0012 **        : 
0013 */
0014 
0015 class Cordic {
0016 public:
0017   Cordic();
0018   Cordic(const int aSteps, bool debug);
0019 
0020   template <typename T>
0021   void cordic_subfunc(T &x, T &y, T &z) const;
0022   l1tmetemu::EtMiss toPolar(l1tmetemu::Et_t x, l1tmetemu::Et_t y) const;
0023 
0024 private:
0025   const int cordicSteps;
0026 
0027   const bool debug;
0028 
0029   // To calculate atan
0030   std::vector<l1tmetemu::atan_lut_fixed_t> atanLUT;
0031   // To normalise final magnitude
0032   std::vector<l1tmetemu::atan_lut_fixed_t> magNormalisationLUT;
0033 };
0034 
0035 #endif