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&);
28 
30 
31 
33  void addBMTFMuon(int,const L1MuKBMTrack&,std::unique_ptr<l1t::RegionalMuonCandBxCollection>&);
35 
36 
37 
38 
39 
40 
41 
42  private:
43  bool verbose_;
44  std::pair<bool,uint> match(const L1MuKBMTCombinedStubRef&, const L1MuKBMTCombinedStubRefVector&,int );
45  int correctedPhi(const L1MuKBMTCombinedStubRef&,int);
47  void propagate(L1MuKBMTrack&);
56  int hitPattern(const L1MuKBMTrack&);
57  int customBitmask(unsigned int,unsigned int,unsigned int,unsigned int);
58  bool getBit(int,int);
60  int phiAt2(const L1MuKBMTrack& track);
62  int rank(const L1MuKBMTrack&);
63  int wrapAround(int,int);
64  std::pair<bool,uint> getByCode(const L1MuKBMTrackCollection& tracks,int mask);
65  std::map<int,int> trackAddress(const L1MuKBMTrack&,int&);
66  int encode(bool ownwheel,int sector,bool tag);
67  uint twosCompToBits(int);
68  int fp_product(float,int, uint);
69 
71 
73 
74 
75  //LUT service
77  bool punchThroughVeto(const L1MuKBMTrack& track);
78  int ptLUT(int K);
79 
80 
81  //Initial Curvature
82  std::vector<double> initK_;
83  std::vector<double> initK2_;
84 
85  //propagation coefficients
86  std::vector<double> eLoss_;
87  std::vector<double> aPhi_;
88  std::vector<double> aPhiB_;
89  std::vector<double> aPhiBNLO_;
90  std::vector<double> bPhi_;
91  std::vector<double> bPhiB_;
92  std::vector<double> phiAt2_;
93  std::vector<double> etaLUT0_;
94  std::vector<double> etaLUT1_;
95 
96  //Chi Square estimator input
98  std::vector<double> chiSquare_;
99  std::vector<int> chiSquareCutPattern_;
100  std::vector<int> chiSquareCutCurv_;
101  std::vector<int> chiSquareCut_;
102 
103 
104  //bitmasks to run== diferent combinations for a given seed in a given station
105  std::vector<int> combos4_;
106  std::vector<int> combos3_;
107  std::vector<int> combos2_;
108  std::vector<int> combos1_;
109 
110 
111  //STUFF NOT USED IN THE FIRMWARE BUT ONLY FOR DEBUGGING
113 
115  std::vector<double> mScatteringPhi_;
116  std::vector<double> mScatteringPhiB_;
117  //point resolution for phi
119  //point resolution for phiB
121  //point resolution for vertex
123 
124 
125 
126  //Sorter
127  class StubSorter {
128  public:
129  StubSorter(uint sector) {
130  sec_ = sector;
131  }
132 
134  if (correctedPhi(a)<correctedPhi(b))
135  return true;
136  return false;
137  }
138 
139 
140  private:
141  int sec_;
143  if (stub->scNum()==sec_)
144  return stub->phi();
145  else if ((stub->scNum()==sec_-1) || (stub->scNum()==11 && sec_==0))
146  return stub->phi()-2144;
147  else if ((stub->scNum()==sec_+1) || (stub->scNum()==0 && sec_==11))
148  return stub->phi()+2144;
149  return 0;
150  }
151 
152  };
153 
154  class TrackSorter {
155  public:
157  }
158 
159  bool operator() (const L1MuKBMTrack& a ,const L1MuKBMTrack& b) {
161  return true;
162  return false;
163  }
164  };
165 
166 
167 
168 
169 
170 
171 
172 };
173 #endif
174 
175 
176 
std::vector< double > bPhiB_
int correctedPhiB(const L1MuKBMTCombinedStubRef &)
l1t::RegionalMuonCand convertToBMTF(const L1MuKBMTrack &track)
std::vector< double > aPhi_
ROOT::Math::SMatrix< double, 3, 3 > Matrix33
std::vector< double > aPhiB_
std::vector< double > aPhiBNLO_
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > CovarianceMatrix2
L1TMuonBarrelKalmanAlgo(const edm::ParameterSet &settings)
std::pair< bool, uint > match(const L1MuKBMTCombinedStubRef &, const L1MuKBMTCombinedStubRefVector &, int)
std::vector< double > mScatteringPhiB_
int phiAt2(const L1MuKBMTrack &track)
bool punchThroughVeto(const L1MuKBMTrack &track)
bool update(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &, int)
void estimateChiSquare(L1MuKBMTrack &)
int rank(const L1MuKBMTrack &)
std::vector< double > phiAt2_
bool updateOffline1D(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
std::vector< edm::Ref< L1MuKBMTCombinedStubCollection > > L1MuKBMTCombinedStubRefVector
void vertexConstraintLUT(L1MuKBMTrack &)
std::pair< bool, uint > getByCode(const L1MuKBMTrackCollection &tracks, int mask)
int fp_product(float, int, uint)
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_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1TMuonBarrelKalmanLUTs * lutService_
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
L1MuKBMTrackCollection clean(const L1MuKBMTrackCollection &, uint)
int encode(bool ownwheel, int sector, bool tag)
std::vector< int > chiSquareCutPattern_
std::pair< bool, L1MuKBMTrack > chain(const L1MuKBMTCombinedStubRef &, const L1MuKBMTCombinedStubRefVector &)
void calculateEta(L1MuKBMTrack &track)
def uint(string)
int curvatureAtVertex() const
Definition: L1MuKBMTrack.cc:54
double b
Definition: hdecay.h:120
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:15
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
bool operator()(const L1MuKBMTCombinedStubRef &a, const L1MuKBMTCombinedStubRef &b)
uint etaStubRank(const L1MuKBMTCombinedStubRef &)
std::map< int, int > trackAddress(const L1MuKBMTrack &, int &)