File indexing completed on 2023-03-17 11:13:38
0001 #ifndef L1Trigger_TrackFindingTMTT_Sector_h
0002 #define L1Trigger_TrackFindingTMTT_Sector_h
0003
0004 #include "L1Trigger/TrackFindingTMTT/interface/TP.h"
0005
0006 #include <vector>
0007 #include <unordered_map>
0008
0009 namespace tmtt {
0010
0011 class Settings;
0012 class Stub;
0013
0014 class Sector {
0015 public:
0016
0017 Sector(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaSec);
0018
0019
0020 bool inside(const Stub* stub) const { return (this->insideEta(stub) && this->insidePhi(stub)); }
0021 bool insideEta(const Stub* stub) const;
0022 bool insidePhi(const Stub* stub) const;
0023
0024
0025 std::vector<bool> insideEtaSubSecs(const Stub* stub) const;
0026
0027 unsigned int iPhiSec() const { return iPhiSec_; }
0028 unsigned int iEtaReg() const { return iEtaReg_; }
0029 float phiCentre() const { return phiCentre_; }
0030 float etaMin() const { return etaMin_; }
0031 float etaMax() const { return etaMax_; }
0032
0033 float sectorHalfWidth() const { return sectorHalfWidth_; }
0034 float zAtChosenR_Min() const {
0035 return zOuterMin_;
0036 }
0037 float zAtChosenR_Max() const { return zOuterMax_; }
0038
0039
0040
0041
0042 std::unordered_map<const Stub*, std::pair<bool, bool>> stubsInside(const TP& tp) const;
0043
0044
0045
0046
0047 void numStubsInside(const TP& tp,
0048 unsigned int& nStubsInsideEtaPhi,
0049 unsigned int& nStubsInsideEta,
0050 unsigned int& nStubsInsidePhi) const;
0051
0052
0053 bool insidePhiSec(const TP& tp) const {
0054 return (std::abs(tp.trkPhiAtR(chosenRofPhi_) - phiCentre_) < sectorHalfWidth_);
0055 }
0056 bool insideEtaReg(const TP& tp) const {
0057 return (tp.trkZAtR(chosenRofZ_) > zOuterMin_ && tp.trkZAtR(chosenRofZ_) < zOuterMax_);
0058 }
0059
0060 private:
0061
0062 bool insideEtaRange(const Stub* stub, float zRangeMin, float zRangeMax) const;
0063
0064
0065 int64_t forceBitWidth(const float value, const UInt_t nBits) const;
0066
0067
0068 std::vector<bool> subEtaFwCalc(const int rT, const int z) const;
0069
0070 private:
0071 const Settings* settings_;
0072
0073
0074 unsigned int iPhiSec_;
0075 unsigned int iEtaReg_;
0076 float beamWindowZ_;
0077 float etaMin_;
0078 float etaMax_;
0079 float chosenRofZ_;
0080 float zOuterMin_;
0081 float zOuterMax_;
0082
0083
0084 float phiCentre_;
0085 float sectorHalfWidth_;
0086 float chosenRofPhi_;
0087 float minPt_;
0088 float assumedPhiTrkRes_;
0089 bool useStubPhi_;
0090 bool useStubPhiTrk_;
0091 bool calcPhiTrkRes_;
0092
0093
0094 unsigned int numSubSecsEta_;
0095 std::vector<float> zOuterMinSub_;
0096 std::vector<float> zOuterMaxSub_;
0097 };
0098
0099 }
0100
0101 #endif