CMS 3D CMS Logo

L1TMuonBarrelKalmanAlgo.h
Go to the documentation of this file.
1 /*
2 Kalman Filter L1 Muon algorithm
3 Michalis Bachtis (UCLA)
4 Sep. 2017
5 
6 */
7 
8 #ifndef L1TMuonBarrelKalmanAlgo_H
9 #define L1TMuonBarrelKalmanAlgo_H
10 
15 
17  public:
18  typedef ROOT::Math::SVector<double,2> Vector2;
19  typedef ROOT::Math::SMatrix<double,2,2,ROOT::Math::MatRepSym<double,2> > CovarianceMatrix2;
20  typedef ROOT::Math::SMatrix<double,3,2> Matrix32;
21  typedef ROOT::Math::SMatrix<double,2,3> Matrix23;
22  typedef ROOT::Math::SMatrix<double,1,3> Matrix13;
23  typedef ROOT::Math::SMatrix<double,3,1> Matrix31;
24  typedef ROOT::Math::SMatrix<double,3,3> Matrix33;
25 
27  std::pair<bool,L1MuKBMTrack> chain(const L1MuKBMTCombinedStubRef&, const L1MuKBMTCombinedStubRefVector&);
30  void addBMTFMuon(int,const L1MuKBMTrack&,std::unique_ptr<l1t::RegionalMuonCandBxCollection>&);
31 
32 
33 
34 
35 
36 
37 
38  private:
39  bool verbose_;
40  std::pair<bool,uint> match(const L1MuKBMTrack&, const L1MuKBMTCombinedStubRefVector&);
41  int correctedPhi(const L1MuKBMTCombinedStubRef&,int);
43  void propagate(L1MuKBMTrack&);
52  int hitPattern(const L1MuKBMTrack&);
53  int customBitmask(unsigned int,unsigned int,unsigned int,unsigned int);
54  bool getBit(int,int);
57  int rank(const L1MuKBMTrack&);
58  int wrapAround(int,int);
59  std::pair<bool,uint> getByCode(const L1MuKBMTrackCollection& tracks,int mask);
60  std::map<int,int> trackAddress(const L1MuKBMTrack&,int&);
61  int encode(bool ownwheel,int sector,bool tag);
62  uint twosCompToBits(int);
63 
64  //LUT service
65  std::unique_ptr<L1TMuonBarrelKalmanLUTs> lutService_;
66 
67 
68  //Initial Curvature
69  std::vector<double> initK_;
70  std::vector<double> initK2_;
71 
72  //propagation coefficients
73  std::vector<double> eLoss_;
74  std::vector<double> aPhi_;
75  std::vector<double> aPhiB_;
76  std::vector<double> aPhiBNLO_;
77  std::vector<double> bPhi_;
78  std::vector<double> bPhiB_;
79  std::vector<double> etaLUT0_;
80  std::vector<double> etaLUT1_;
81 
82  //Chi Square estimator input
84  std::vector<double> chiSquare_;
85  std::vector<int> chiSquareCutPattern_;
86  std::vector<int> chiSquareCutCurv_;
87  std::vector<int> chiSquareCut_;
88 
89 
90  //bitmasks to run== diferent combinations for a given seed in a given station
91  std::vector<int> combos4_;
92  std::vector<int> combos3_;
93  std::vector<int> combos2_;
94  std::vector<int> combos1_;
95 
96 
97  //STUFF NOT USED IN THE FIRMWARE BUT ONLY FOR DEBUGGING
99 
101  std::vector<double> mScatteringPhi_;
102  std::vector<double> mScatteringPhiB_;
103  //point resolution for phi
105  //point resolution for phiB
107  //point resolution for vertex
109 
110 
111 
112  //Sorter
113  class StubSorter {
114  public:
115  StubSorter(uint sector) {
116  sec_ = sector;
117  }
118 
120  if (correctedPhi(a)<correctedPhi(b))
121  return true;
122  return false;
123  }
124 
125 
126  private:
127  int sec_;
129  if (stub->scNum()==sec_)
130  return stub->phi();
131  else if ((stub->scNum()==sec_-1) || (stub->scNum()==11 && sec_==0))
132  return stub->phi()-2144;
133  else if ((stub->scNum()==sec_+1) || (stub->scNum()==0 && sec_==11))
134  return stub->phi()+2144;
135  return 0;
136  }
137 
138  };
139 
140  class TrackSorter {
141  public:
143  }
144 
145  bool operator() (const L1MuKBMTrack& a ,const L1MuKBMTrack& b) {
147  return true;
148  return false;
149  }
150  };
151 
152 
153 
154 
155 
156 
157 
158 };
159 #endif
160 
161 
162 
std::vector< double > bPhiB_
int correctedPhiB(const L1MuKBMTCombinedStubRef &)
std::vector< double > aPhi_
ROOT::Math::SMatrix< double, 3, 3 > Matrix33
std::vector< double > aPhiB_
std::pair< bool, uint > match(const L1MuKBMTrack &, const L1MuKBMTCombinedStubRefVector &)
std::vector< double > aPhiBNLO_
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > CovarianceMatrix2
L1TMuonBarrelKalmanAlgo(const edm::ParameterSet &settings)
std::vector< double > mScatteringPhiB_
bool update(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &, int)
void estimateChiSquare(L1MuKBMTrack &)
int rank(const L1MuKBMTrack &)
bool updateOffline1D(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
std::vector< edm::Ref< L1MuKBMTCombinedStubCollection > > L1MuKBMTCombinedStubRefVector
void vertexConstraintLUT(L1MuKBMTrack &)
std::pair< bool, uint > getByCode(const L1MuKBMTrackCollection &tracks, int mask)
std::vector< double > chiSquare_
bool updateLUT(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &, int)
std::vector< double > initK2_
std::vector< double > etaLUT0_
ROOT::Math::SVector< double, 2 > Vector2
std::vector< double > etaLUT1_
std::vector< double > mScatteringPhi_
void vertexConstraint(L1MuKBMTrack &)
int customBitmask(unsigned int, unsigned int, unsigned int, unsigned int)
int correctedPhi(const L1MuKBMTCombinedStubRef &stub)
std::vector< double > eLoss_
void vertexConstraintOffline(L1MuKBMTrack &)
std::vector< double > bPhi_
std::vector< double > initK_
void updateEta(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
ROOT::Math::SMatrix< double, 2, 3 > Matrix23
void setFloatingPointValues(L1MuKBMTrack &, bool)
ROOT::Math::SMatrix< double, 1, 3 > Matrix13
int encode(bool ownwheel, int sector, bool tag)
std::vector< int > chiSquareCutPattern_
std::unique_ptr< L1TMuonBarrelKalmanLUTs > lutService_
std::pair< bool, L1MuKBMTrack > chain(const L1MuKBMTCombinedStubRef &, const L1MuKBMTCombinedStubRefVector &)
def uint(string)
int curvatureAtVertex() const
Definition: L1MuKBMTrack.cc:54
double b
Definition: hdecay.h:120
std::vector< int > chiSquareCut_
void addBMTFMuon(int, const L1MuKBMTrack &, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &)
L1MuKBMTrackCollection cleanAndSort(const L1MuKBMTrackCollection &, uint)
int hitPattern(const L1MuKBMTrack &)
std::vector< L1MuKBMTrack > L1MuKBMTrackCollection
Definition: L1MuKBMTrack.h:14
double a
Definition: hdecay.h:121
int correctedPhi(const L1MuKBMTCombinedStubRef &, int)
std::vector< int > chiSquareCutCurv_
ROOT::Math::SMatrix< double, 3, 1 > Matrix31
bool updateOffline(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
ROOT::Math::SMatrix< double, 3, 2 > Matrix32
void resolveEtaUnit(L1MuKBMTrackCollection &)
bool operator()(const L1MuKBMTCombinedStubRef &a, const L1MuKBMTCombinedStubRef &b)
std::map< int, int > trackAddress(const L1MuKBMTrack &, int &)