Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-07 22:33:29

0001 #ifndef L1Trigger_TrackFindingTracklet_interface_TrackletLUT_h
0002 #define L1Trigger_TrackFindingTracklet_interface_TrackletLUT_h
0003 
0004 #include <string>
0005 #include <vector>
0006 #include <string>
0007 
0008 namespace trklet {
0009 
0010   class Settings;
0011 
0012   class TrackletLUT {
0013   public:
0014     TrackletLUT(const Settings& settings);
0015 
0016     TrackletLUT& operator=(const TrackletLUT& other) {
0017       name_ = other.name_;
0018       table_ = other.table_;
0019       nbits_ = other.nbits_;
0020       positive_ = other.positive_;
0021 
0022       return *this;
0023     }
0024 
0025     ~TrackletLUT() = default;
0026 
0027     enum MatchType { barrelphi, barrelz, disk2Sphi, disk2Sr, diskPSphi, diskPSr };
0028 
0029     //region only used for name - should be removed
0030     void initmatchcut(unsigned int layerdisk, MatchType type, unsigned int region);
0031 
0032     void initTPlut(bool fillInner,
0033                    unsigned int iSeed,
0034                    unsigned int layerdisk1,
0035                    unsigned int layerdisk2,
0036                    unsigned int nbitsfinephidiff,
0037                    unsigned int iTP);
0038 
0039     void initTPregionlut(unsigned int iSeed,
0040                          unsigned int layerdisk1,
0041                          unsigned int layerdisk2,
0042                          unsigned int iAllStub,
0043                          unsigned int nbitsfinephidiff,
0044                          unsigned int nbitsfinephi,
0045                          const TrackletLUT& tplutinner,
0046                          unsigned int iTP);
0047 
0048     void initteptlut(bool fillInner,
0049                      bool fillTEMem,
0050                      unsigned int iSeed,
0051                      unsigned int layerdisk1,
0052                      unsigned int layerdisk2,
0053                      unsigned int innerphibits,
0054                      unsigned int outerphibits,
0055                      double innerphimin,
0056                      double innerphimax,
0057                      double outerphimin,
0058                      double outerphimax,
0059                      const std::string& innermem,
0060                      const std::string& outermem);
0061 
0062     void initProjectionBend(double k_phider, unsigned int idisk, unsigned int nrbits, unsigned int nphiderbits);
0063 
0064     void initBendMatch(unsigned int layerdisk);
0065 
0066     enum VMRTableType { me, disk, inner, inneroverlap, innerthird };
0067 
0068     //region only used for name - should be removed
0069     void initVMRTable(unsigned int layerdisk, VMRTableType type, int region = -1);
0070 
0071     void initPhiCorrTable(unsigned int layerdisk, unsigned int rbits);
0072 
0073     void writeTable() const;
0074 
0075     int lookup(unsigned int index) const;
0076 
0077     unsigned int size() const { return table_.size(); }
0078 
0079   private:
0080     int getphiCorrValue(
0081         unsigned int layerdisk, unsigned int ibend, unsigned int irbin, double rmean, double dr, double drmax) const;
0082 
0083     int getVMRLookup(unsigned int layerdisk, double z, double r, double dz, double dr, int iseed = -1) const;
0084 
0085     const Settings& settings_;
0086 
0087     std::string name_;
0088 
0089     std::vector<int> table_;
0090 
0091     unsigned int nbits_;
0092 
0093     bool positive_;
0094   };
0095 };  // namespace trklet
0096 #endif