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  void addBMTFMuon(int, const L1MuKBMTrack&, std::unique_ptr<l1t::RegionalMuonCandBxCollection>&);
33 
34 private:
35  bool verbose_;
36  std::pair<bool, uint> match(const L1MuKBMTCombinedStubRef&, const L1MuKBMTCombinedStubRefVector&, int);
37  int correctedPhi(const L1MuKBMTCombinedStubRef&, int);
39  void propagate(L1MuKBMTrack&);
41  bool update(L1MuKBMTrack&, const L1MuKBMTCombinedStubRef&, int);
48  int hitPattern(const L1MuKBMTrack&);
49  int customBitmask(unsigned int, unsigned int, unsigned int, unsigned int);
50  bool getBit(int, int);
52  int phiAt2(const L1MuKBMTrack& track);
55  int rank(const L1MuKBMTrack&);
56  int wrapAround(int, int);
57  std::pair<bool, uint> getByCode(const L1MuKBMTrackCollection& tracks, int mask);
58  std::map<int, int> trackAddress(const L1MuKBMTrack&, int&);
59  int encode(bool ownwheel, int sector, bool tag);
60  uint twosCompToBits(int);
61  int fp_product(float, int, uint);
62 
64 
66  uint matchAbs(std::map<uint, uint>&, uint, uint);
67 
68  //LUT service
70  int ptLUT(int K);
71 
72  //Initial Curvature
73  std::vector<double> initK_;
74  std::vector<double> initK2_;
75 
76  //propagation coefficients
77  std::vector<double> eLoss_;
78  std::vector<double> aPhi_;
79  std::vector<double> aPhiB_;
80  std::vector<double> aPhiBNLO_;
81  std::vector<double> bPhi_;
82  std::vector<double> bPhiB_;
83  double phiAt2_;
84  std::vector<double> etaLUT0_;
85  std::vector<double> etaLUT1_;
86 
87  //Chi Square estimator input
90  std::vector<double> chiSquare_;
91  std::vector<int> chiSquareCutPattern_;
92  std::vector<int> chiSquareCutCurv_;
93  std::vector<int> chiSquareCut_;
94 
95  std::vector<double> trackComp_;
96  std::vector<double> trackCompErr1_;
97  std::vector<double> trackCompErr2_;
98  std::vector<int> trackCompPattern_;
99  std::vector<int> trackCompCutCurv_;
100  std::vector<int> trackCompCut_;
101  std::vector<int> chiSquareCutTight_;
102 
103  //bitmasks to run== diferent combinations for a given seed in a given station
104  std::vector<int> combos4_;
105  std::vector<int> combos3_;
106  std::vector<int> combos2_;
107  std::vector<int> combos1_;
108 
109  //STUFF NOT USED IN THE FIRMWARE BUT ONLY FOR DEBUGGING
111 
113  std::vector<double> mScatteringPhi_;
114  std::vector<double> mScatteringPhiB_;
115  //point resolution for phi
117  //point resolution for phiB
119  //point resolution for vertex
121 
122  //Sorter
123  class StubSorter {
124  public:
125  StubSorter(uint sector) { sec_ = sector; }
126 
128  if (correctedPhi(a) < correctedPhi(b))
129  return true;
130  return false;
131  }
132 
133  private:
134  int sec_;
136  if (stub->scNum() == sec_)
137  return stub->phi();
138  else if ((stub->scNum() == sec_ - 1) || (stub->scNum() == 11 && sec_ == 0))
139  return stub->phi() - 2144;
140  else if ((stub->scNum() == sec_ + 1) || (stub->scNum() == 0 && sec_ == 11))
141  return stub->phi() + 2144;
142  return 0;
143  }
144  };
145 };
146 #endif
L1TMuonBarrelKalmanAlgo::chiSquareCutCurv_
std::vector< int > chiSquareCutCurv_
Definition: L1TMuonBarrelKalmanAlgo.h:92
L1TMuonBarrelKalmanAlgo::globalChi2CutLimit_
uint globalChi2CutLimit_
Definition: L1TMuonBarrelKalmanAlgo.h:89
L1TMuonBarrelKalmanAlgo::Matrix32
ROOT::Math::SMatrix< double, 3, 2 > Matrix32
Definition: L1TMuonBarrelKalmanAlgo.h:20
L1TMuonBarrelKalmanAlgo::combos3_
std::vector< int > combos3_
Definition: L1TMuonBarrelKalmanAlgo.h:105
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
L1TMuonBarrelKalmanAlgo::pointResolutionPhi_
double pointResolutionPhi_
Definition: L1TMuonBarrelKalmanAlgo.h:116
L1TMuonBarrelKalmanAlgo::StubSorter
Definition: L1TMuonBarrelKalmanAlgo.h:123
L1TMuonBarrelKalmanAlgo::rank
int rank(const L1MuKBMTrack &)
Definition: L1TMuonBarrelKalmanAlgo.cc:996
L1TMuonBarrelKalmanAlgo::pointResolutionPhiB_
double pointResolutionPhiB_
Definition: L1TMuonBarrelKalmanAlgo.h:118
L1TMuonBarrelKalmanAlgo::combos2_
std::vector< int > combos2_
Definition: L1TMuonBarrelKalmanAlgo.h:106
L1TMuonBarrelKalmanAlgo::twosCompToBits
uint twosCompToBits(int)
Definition: L1TMuonBarrelKalmanAlgo.cc:1117
L1TMuonBarrelKalmanAlgo::mScatteringPhiB_
std::vector< double > mScatteringPhiB_
Definition: L1TMuonBarrelKalmanAlgo.h:114
L1TMuonBarrelKalmanAlgo::trackAddress
std::map< int, int > trackAddress(const L1MuKBMTrack &, int &)
Definition: L1TMuonBarrelKalmanAlgo.cc:1055
L1MuKBMTrackCollection
std::vector< L1MuKBMTrack > L1MuKBMTrackCollection
Definition: L1MuKBMTrack.h:15
L1TMuonBarrelKalmanAlgo::correctedPhiB
int correctedPhiB(const L1MuKBMTCombinedStubRef &)
Definition: L1TMuonBarrelKalmanAlgo.cc:287
L1TMuonBarrelKalmanAlgo::L1TMuonBarrelKalmanAlgo
L1TMuonBarrelKalmanAlgo(const edm::ParameterSet &settings)
Definition: L1TMuonBarrelKalmanAlgo.cc:4
L1TMuonBarrelKalmanAlgo::estimateCompatibility
void estimateCompatibility(L1MuKBMTrack &)
Definition: L1TMuonBarrelKalmanAlgo.cc:966
L1TMuonBarrelKalmanAlgo::vertexConstraintLUT
void vertexConstraintLUT(L1MuKBMTrack &)
Definition: L1TMuonBarrelKalmanAlgo.cc:681
L1TMuonBarrelKalmanAlgo::useOfflineAlgo_
bool useOfflineAlgo_
Definition: L1TMuonBarrelKalmanAlgo.h:112
L1TMuonBarrelKalmanAlgo::match
std::pair< bool, uint > match(const L1MuKBMTCombinedStubRef &, const L1MuKBMTCombinedStubRefVector &, int)
Definition: L1TMuonBarrelKalmanAlgo.cc:163
L1TMuonBarrelKalmanAlgo::StubSorter::operator()
bool operator()(const L1MuKBMTCombinedStubRef &a, const L1MuKBMTCombinedStubRef &b)
Definition: L1TMuonBarrelKalmanAlgo.h:127
L1TMuonBarrelKalmanAlgo::trackCompPattern_
std::vector< int > trackCompPattern_
Definition: L1TMuonBarrelKalmanAlgo.h:98
L1TMuonBarrelKalmanAlgo::aPhiB_
std::vector< double > aPhiB_
Definition: L1TMuonBarrelKalmanAlgo.h:79
L1TMuonBarrelKalmanAlgo::updateLUT
bool updateLUT(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &, int)
Definition: L1TMuonBarrelKalmanAlgo.cc:563
L1TMuonBarrelKalmanAlgo::aPhiBNLO_
std::vector< double > aPhiBNLO_
Definition: L1TMuonBarrelKalmanAlgo.h:80
L1TMuonBarrelKalmanLUTs
Definition: L1TMuonBarrelKalmanLUTs.h:9
L1TMuonBarrelKalmanAlgo::update
bool update(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &, int)
Definition: L1TMuonBarrelKalmanAlgo.cc:428
parallelization.uint
uint
Definition: parallelization.py:124
L1TMuonBarrelKalmanAlgo::updateOffline1D
bool updateOffline1D(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
Definition: L1TMuonBarrelKalmanAlgo.cc:515
edm::Ref
Definition: AssociativeIterator.h:58
L1TMuonBarrelKalmanAlgo::getByCode
std::pair< bool, uint > getByCode(const L1MuKBMTrackCollection &tracks, int mask)
Definition: L1TMuonBarrelKalmanAlgo.cc:41
L1TMuonBarrelKalmanAlgo::phiAt2
int phiAt2(const L1MuKBMTrack &track)
Definition: L1TMuonBarrelKalmanAlgo.cc:1273
L1TMuonBarrelKalmanAlgo::phiAt2_
double phiAt2_
Definition: L1TMuonBarrelKalmanAlgo.h:83
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
L1TMuonBarrelKalmanAlgo::Matrix13
ROOT::Math::SMatrix< double, 1, 3 > Matrix13
Definition: L1TMuonBarrelKalmanAlgo.h:22
L1TMuonBarrelKalmanLUTs.h
L1MuKBMTrack.h
L1TMuonBarrelKalmanAlgo::chiSquare_
std::vector< double > chiSquare_
Definition: L1TMuonBarrelKalmanAlgo.h:90
L1TMuonBarrelKalmanAlgo::fp_product
int fp_product(float, int, uint)
Definition: L1TMuonBarrelKalmanAlgo.cc:1124
L1TMuonBarrelKalmanAlgo::etaLUT0_
std::vector< double > etaLUT0_
Definition: L1TMuonBarrelKalmanAlgo.h:84
L1TMuonBarrelKalmanAlgo::CovarianceMatrix2
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > CovarianceMatrix2
Definition: L1TMuonBarrelKalmanAlgo.h:19
L1TMuonBarrelKalmanAlgo::matchAbs
uint matchAbs(std::map< uint, uint > &, uint, uint)
Definition: L1TMuonBarrelKalmanAlgo.cc:156
L1TMuonBarrelKalmanAlgo::mScatteringPhi_
std::vector< double > mScatteringPhi_
Definition: L1TMuonBarrelKalmanAlgo.h:113
b
double b
Definition: hdecay.h:118
L1TMuonBarrelKalmanAlgo::initK2_
std::vector< double > initK2_
Definition: L1TMuonBarrelKalmanAlgo.h:74
L1TMuonBarrelKalmanAlgo::pointResolutionVertex_
double pointResolutionVertex_
Definition: L1TMuonBarrelKalmanAlgo.h:120
L1TMuonBarrelKalmanAlgo::vertexConstraintOffline
void vertexConstraintOffline(L1MuKBMTrack &)
Definition: L1TMuonBarrelKalmanAlgo.cc:640
edm::ParameterSet
Definition: ParameterSet.h:36
L1TMuonBarrelKalmanAlgo::initK_
std::vector< double > initK_
Definition: L1TMuonBarrelKalmanAlgo.h:73
a
double a
Definition: hdecay.h:119
L1TMuonBarrelKalmanAlgo::etaLUT1_
std::vector< double > etaLUT1_
Definition: L1TMuonBarrelKalmanAlgo.h:85
L1TMuonBarrelKalmanAlgo
Definition: L1TMuonBarrelKalmanAlgo.h:16
L1TMuonBarrelKalmanAlgo::StubSorter::correctedPhi
int correctedPhi(const L1MuKBMTCombinedStubRef &stub)
Definition: L1TMuonBarrelKalmanAlgo.h:135
L1TMuonBarrelKalmanAlgo::globalChi2Cut_
uint globalChi2Cut_
Definition: L1TMuonBarrelKalmanAlgo.h:88
L1TMuonBarrelKalmanAlgo::customBitmask
int customBitmask(unsigned int, unsigned int, unsigned int, unsigned int)
Definition: L1TMuonBarrelKalmanAlgo.cc:311
L1TMuonBarrelKalmanAlgo::eLoss_
std::vector< double > eLoss_
Definition: L1TMuonBarrelKalmanAlgo.h:77
L1TMuonBarrelKalmanAlgo::Matrix31
ROOT::Math::SMatrix< double, 3, 1 > Matrix31
Definition: L1TMuonBarrelKalmanAlgo.h:23
L1TMuonBarrelKalmanAlgo::chain
std::pair< bool, L1MuKBMTrack > chain(const L1MuKBMTCombinedStubRef &, const L1MuKBMTCombinedStubRefVector &)
Definition: L1TMuonBarrelKalmanAlgo.cc:738
L1TMuonBarrelKalmanAlgo::StubSorter::StubSorter
StubSorter(uint sector)
Definition: L1TMuonBarrelKalmanAlgo.h:125
L1MuKBMTrack
Definition: L1MuKBMTrack.h:19
L1TMuonBarrelKalmanAlgo::calculateEta
void calculateEta(L1MuKBMTrack &track)
Definition: L1TMuonBarrelKalmanAlgo.cc:1215
L1TMuonBarrelKalmanAlgo::trackComp_
std::vector< double > trackComp_
Definition: L1TMuonBarrelKalmanAlgo.h:95
L1TMuonBarrelKalmanAlgo::Matrix23
ROOT::Math::SMatrix< double, 2, 3 > Matrix23
Definition: L1TMuonBarrelKalmanAlgo.h:21
L1TMuonBarrelKalmanAlgo::combos4_
std::vector< int > combos4_
Definition: L1TMuonBarrelKalmanAlgo.h:104
L1TMuonBarrelKalmanAlgo::chiSquareCutTight_
std::vector< int > chiSquareCutTight_
Definition: L1TMuonBarrelKalmanAlgo.h:101
L1TMuonBarrelKalmanAlgo::lutService_
L1TMuonBarrelKalmanLUTs * lutService_
Definition: L1TMuonBarrelKalmanAlgo.h:69
L1TMuonBarrelKalmanAlgo::updateEta
void updateEta(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
Definition: L1TMuonBarrelKalmanAlgo.cc:631
L1TMuonBarrelKalmanAlgo::vertexConstraint
void vertexConstraint(L1MuKBMTrack &)
Definition: L1TMuonBarrelKalmanAlgo.cc:633
L1TMuonBarrelKalmanAlgo::setFloatingPointValues
void setFloatingPointValues(L1MuKBMTrack &, bool)
Definition: L1TMuonBarrelKalmanAlgo.cc:702
L1TMuonBarrelKalmanAlgo::Matrix33
ROOT::Math::SMatrix< double, 3, 3 > Matrix33
Definition: L1TMuonBarrelKalmanAlgo.h:24
L1TMuonBarrelKalmanAlgo::hitPattern
int hitPattern(const L1MuKBMTrack &)
Definition: L1TMuonBarrelKalmanAlgo.cc:303
L1TMuonBarrelKalmanAlgo::chiSquareCutPattern_
std::vector< int > chiSquareCutPattern_
Definition: L1TMuonBarrelKalmanAlgo.h:91
L1TMuonBarrelKalmanAlgo::clean
L1MuKBMTrackCollection clean(const L1MuKBMTrackCollection &, uint)
Definition: L1TMuonBarrelKalmanAlgo.cc:1163
L1TMuonBarrelKalmanAlgo::estimateChiSquare
bool estimateChiSquare(L1MuKBMTrack &)
Definition: L1TMuonBarrelKalmanAlgo.cc:920
L1TMuonBarrelKalmanAlgo::bPhi_
std::vector< double > bPhi_
Definition: L1TMuonBarrelKalmanAlgo.h:81
L1TMuonBarrelKalmanAlgo::wrapAround
int wrapAround(int, int)
Definition: L1TMuonBarrelKalmanAlgo.cc:1005
L1TMuonBarrelKalmanAlgo::propagate
void propagate(L1MuKBMTrack &)
Definition: L1TMuonBarrelKalmanAlgo.cc:317
L1TMuonBarrelKalmanAlgo::updateOffline
bool updateOffline(L1MuKBMTrack &, const L1MuKBMTCombinedStubRef &)
Definition: L1TMuonBarrelKalmanAlgo.cc:440
L1TMuonBarrelKalmanAlgo::getBit
bool getBit(int, int)
Definition: L1TMuonBarrelKalmanAlgo.cc:315
L1TMuonBarrelKalmanAlgo::chiSquareCut_
std::vector< int > chiSquareCut_
Definition: L1TMuonBarrelKalmanAlgo.h:93
L1TMuonBarrelKalmanAlgo::Vector2
ROOT::Math::SVector< double, 2 > Vector2
Definition: L1TMuonBarrelKalmanAlgo.h:18
L1TMuonBarrelKalmanAlgo::encode
int encode(bool ownwheel, int sector, bool tag)
Definition: L1TMuonBarrelKalmanAlgo.cc:1013
RegionalMuonCand.h
L1TMuonBarrelKalmanAlgo::verbose_
bool verbose_
Definition: L1TMuonBarrelKalmanAlgo.h:35
L1TMuonBarrelKalmanAlgo::bPhiB_
std::vector< double > bPhiB_
Definition: L1TMuonBarrelKalmanAlgo.h:82
L1TMuonBarrelKalmanAlgo::StubSorter::sec_
int sec_
Definition: L1TMuonBarrelKalmanAlgo.h:134
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
L1TMuonBarrelKalmanAlgo::combos1_
std::vector< int > combos1_
Definition: L1TMuonBarrelKalmanAlgo.h:107
ParameterSet.h
L1TMuonBarrelKalmanAlgo::etaStubRank
uint etaStubRank(const L1MuKBMTCombinedStubRef &)
Definition: L1TMuonBarrelKalmanAlgo.cc:1204
L1TMuonBarrelKalmanAlgo::addBMTFMuon
void addBMTFMuon(int, const L1MuKBMTrack &, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &)
Definition: L1TMuonBarrelKalmanAlgo.cc:128
L1TMuonBarrelKalmanAlgo::trackCompCutCurv_
std::vector< int > trackCompCutCurv_
Definition: L1TMuonBarrelKalmanAlgo.h:99
L1TMuonBarrelKalmanAlgo::trackCompErr2_
std::vector< double > trackCompErr2_
Definition: L1TMuonBarrelKalmanAlgo.h:97
l1t::RegionalMuonCand
Definition: RegionalMuonCand.h:8
L1TMuonBarrelKalmanAlgo::convertToBMTF
l1t::RegionalMuonCand convertToBMTF(const L1MuKBMTrack &track)
Definition: L1TMuonBarrelKalmanAlgo.cc:50
L1TMuonBarrelKalmanAlgo::correctedPhi
int correctedPhi(const L1MuKBMTCombinedStubRef &, int)
Definition: L1TMuonBarrelKalmanAlgo.cc:292
L1TMuonBarrelKalmanAlgo::trackCompErr1_
std::vector< double > trackCompErr1_
Definition: L1TMuonBarrelKalmanAlgo.h:96
L1TMuonBarrelKalmanAlgo::ptLUT
int ptLUT(int K)
Definition: L1TMuonBarrelKalmanAlgo.cc:1129
L1TMuonBarrelKalmanAlgo::trackCompCut_
std::vector< int > trackCompCut_
Definition: L1TMuonBarrelKalmanAlgo.h:100
L1MuKBMTCombinedStubRefVector
std::vector< edm::Ref< L1MuKBMTCombinedStubCollection > > L1MuKBMTCombinedStubRefVector
Definition: L1MuKBMTCombinedStub.h:43
L1TMuonBarrelKalmanAlgo::aPhi_
std::vector< double > aPhi_
Definition: L1TMuonBarrelKalmanAlgo.h:78