File indexing completed on 2024-11-15 23:40:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef L1Trigger_TrackFindingTracklet_interface_TrackletLUT_h
0012 #define L1Trigger_TrackFindingTracklet_interface_TrackletLUT_h
0013
0014 #include <string>
0015 #include <vector>
0016 #include <string>
0017
0018 #include "L1Trigger/TrackTrigger/interface/Setup.h"
0019
0020 class Setup;
0021
0022 namespace trklet {
0023
0024 class Settings;
0025
0026 class TrackletLUT {
0027 public:
0028 TrackletLUT(const Settings& settings);
0029
0030 TrackletLUT& operator=(const TrackletLUT& other) {
0031 name_ = other.name_;
0032 table_ = other.table_;
0033 nbits_ = other.nbits_;
0034 positive_ = other.positive_;
0035
0036 return *this;
0037 }
0038
0039 ~TrackletLUT() = default;
0040
0041 enum MatchType {
0042 barrelphi,
0043 barrelz,
0044 disk2Sphi,
0045 disk2Sr,
0046 diskPSphi,
0047 diskPSr,
0048 alphainner,
0049 alphaouter,
0050 rSSinner,
0051 rSSouter
0052 };
0053
0054
0055 void initmatchcut(unsigned int layerdisk, MatchType type, unsigned int region);
0056
0057
0058
0059 void initTPlut(bool fillInner,
0060 unsigned int iSeed,
0061 unsigned int layerdisk1,
0062 unsigned int layerdisk2,
0063 unsigned int nbitsfinephidiff,
0064 unsigned int iTP);
0065
0066
0067
0068
0069 void initTPregionlut(unsigned int iSeed,
0070 unsigned int layerdisk1,
0071 unsigned int layerdisk2,
0072 unsigned int iAllStub,
0073 unsigned int nbitsfinephidiff,
0074 unsigned int nbitsfinephi,
0075 const TrackletLUT& tplutinner,
0076 unsigned int iTP);
0077
0078
0079 void initteptlut(bool fillInner,
0080 bool fillTEMem,
0081 unsigned int iSeed,
0082 unsigned int layerdisk1,
0083 unsigned int layerdisk2,
0084 unsigned int innerphibits,
0085 unsigned int outerphibits,
0086 double innerphimin,
0087 double innerphimax,
0088 double outerphimin,
0089 double outerphimax,
0090 const std::string& innermem,
0091 const std::string& outermem);
0092
0093
0094 void initProjectionBend(double k_phider, unsigned int idisk, unsigned int nrbits, unsigned int nphiderbits);
0095
0096
0097 void initBendMatch(unsigned int layerdisk);
0098
0099 void initProjectionDiskRadius(int nrbits);
0100
0101 enum VMRTableType { me, disk, inner, inneroverlap, innerthird };
0102
0103
0104
0105 void initVMRTable(unsigned int layerdisk, VMRTableType type, int region = -1, bool combined = true);
0106
0107
0108
0109 void initPhiCorrTable(unsigned int layerdisk, unsigned int rbits);
0110
0111
0112 void writeTable() const;
0113
0114
0115 int lookup(unsigned int index) const;
0116
0117 unsigned int size() const { return table_.size(); }
0118
0119 unsigned int nbits() const { return nbits_; }
0120
0121 private:
0122 const Settings& settings_;
0123 const tt::Setup* setup_;
0124
0125
0126 std::vector<const tt::SensorModule*> getSensorModules(unsigned int layerdisk,
0127 bool isPS,
0128 std::array<double, 2> tan_range = {{-1, -1}},
0129 unsigned int nzbins = 1,
0130 unsigned int zbin = 0);
0131
0132 std::array<double, 2> getTanRange(const std::vector<const tt::SensorModule*>& sensorModules);
0133
0134 std::vector<std::array<double, 2>> getBendCut(unsigned int layerdisk,
0135 const std::vector<const tt::SensorModule*>& sensorModules,
0136 bool isPS,
0137 double FEbendcut = 0);
0138
0139 int getphiCorrValue(
0140 unsigned int layerdisk, double bend, unsigned int irbin, double rmean, double dr, double drmax) const;
0141
0142 int getVMRLookup(unsigned int layerdisk, double z, double r, double dz, double dr, int iseed = -1) const;
0143
0144 std::string name_;
0145
0146 std::vector<int> table_;
0147
0148 unsigned int nbits_;
0149
0150 bool positive_;
0151 };
0152 };
0153 #endif