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 
32 
33  void addBMTFMuon(int,const L1MuKBMTrack&,std::unique_ptr<l1t::RegionalMuonCandBxCollection>&);
35 
36 
37 
38 
39 
40  private:
41  bool verbose_;
42  std::pair<bool,uint> match(const L1MuKBMTCombinedStubRef&, const L1MuKBMTCombinedStubRefVector&,int );
43  int correctedPhi(const L1MuKBMTCombinedStubRef&,int);
45  void propagate(L1MuKBMTrack&);
54  int hitPattern(const L1MuKBMTrack&);
55  int customBitmask(unsigned int,unsigned int,unsigned int,unsigned int);
56  bool getBit(int,int);
58  int phiAt2(const L1MuKBMTrack& track);
61  int rank(const L1MuKBMTrack&);
62  int wrapAround(int,int);
63  std::pair<bool,uint> getByCode(const L1MuKBMTrackCollection& tracks,int mask);
64  std::map<int,int> trackAddress(const L1MuKBMTrack&,int&);
65  int encode(bool ownwheel,int sector,bool tag);
66  uint twosCompToBits(int);
67  int fp_product(float,int, uint);
68 
70 
72  uint matchAbs(std::map<uint,uint>&, uint, uint);
73 
74 
75  //LUT service
77  int ptLUT(int K);
78 
79 
80  //Initial Curvature
81  std::vector<double> initK_;
82  std::vector<double> initK2_;
83 
84  //propagation coefficients
85  std::vector<double> eLoss_;
86  std::vector<double> aPhi_;
87  std::vector<double> aPhiB_;
88  std::vector<double> aPhiBNLO_;
89  std::vector<double> bPhi_;
90  std::vector<double> bPhiB_;
91  double phiAt2_;
92  std::vector<double> etaLUT0_;
93  std::vector<double> etaLUT1_;
94 
95  //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  std::vector<double> trackComp_;
104  std::vector<double> trackCompErr1_;
105  std::vector<double> trackCompErr2_;
106  std::vector<int> trackCompPattern_;
107  std::vector<int> trackCompCutCurv_;
108  std::vector<int> trackCompCut_;
109  std::vector<int> chiSquareCutTight_;
110 
111 
112  //bitmasks to run== diferent combinations for a given seed in a given station
113  std::vector<int> combos4_;
114  std::vector<int> combos3_;
115  std::vector<int> combos2_;
116  std::vector<int> combos1_;
117 
118 
119  //STUFF NOT USED IN THE FIRMWARE BUT ONLY FOR DEBUGGING
121 
123  std::vector<double> mScatteringPhi_;
124  std::vector<double> mScatteringPhiB_;
125  //point resolution for phi
127  //point resolution for phiB
129  //point resolution for vertex
131 
132 
133 
134  //Sorter
135  class StubSorter {
136  public:
137  StubSorter(uint sector) {
138  sec_ = sector;
139  }
140 
142  if (correctedPhi(a)<correctedPhi(b))
143  return true;
144  return false;
145  }
146 
147 
148  private:
149  int sec_;
151  if (stub->scNum()==sec_)
152  return stub->phi();
153  else if ((stub->scNum()==sec_-1) || (stub->scNum()==11 && sec_==0))
154  return stub->phi()-2144;
155  else if ((stub->scNum()==sec_+1) || (stub->scNum()==0 && sec_==11))
156  return stub->phi()+2144;
157  return 0;
158  }
159 
160  };
161 
162 
163 
164 
165 
166 
167 
168 
169 };
170 #endif
171 
172 
173 
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 update(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &, int)
int rank(const L1MuKBMTrack &)
std::vector< int > trackCompPattern_
bool updateOffline1D(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
void estimateCompatibility(L1MuKBMTrack &)
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 > trackComp_
std::vector< double > etaLUT1_
std::vector< double > mScatteringPhi_
L1TMuonBarrelKalmanLUTs * lutService_
void vertexConstraint(L1MuKBMTrack &)
int customBitmask(unsigned int, unsigned int, unsigned int, unsigned int)
int correctedPhi(const L1MuKBMTCombinedStubRef &stub)
std::vector< double > eLoss_
bool estimateChiSquare(L1MuKBMTrack &)
void vertexConstraintOffline(L1MuKBMTrack &)
uint matchAbs(std::map< uint, uint > &, uint, uint)
std::vector< int > chiSquareCutTight_
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)
double b
Definition: hdecay.h:120
void addBMTFMuon(int, const L1MuKBMTrack &, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &)
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< double > trackCompErr1_
std::vector< int > chiSquareCutCurv_
std::vector< double > trackCompErr2_
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::vector< int > trackCompCutCurv_
std::map< int, int > trackAddress(const L1MuKBMTrack &, int &)