CMS 3D CMS Logo

State.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackerTFP_State_h
2 #define L1Trigger_TrackerTFP_State_h
3 
6 
7 #include <vector>
8 #include <numeric>
9 
10 namespace trackerTFP {
11 
12  // Class to represent a Kalman Filter State
13  class State {
14  public:
15  // default constructor
16  State(State* state);
17  // proto state constructor
18  State(const DataFormats* dataFormats, TrackKFin* track, int trackId);
19  // combinatoric state constructor
21  // updated state constructor
22  State(State* state, const std::vector<double>& doubles);
23  ~State() {}
24 
25  // Determine quality of completed state
26  void finish();
27  // number of skipped layers
28  int numSkippedLayers() const { return numSkippedLayers_; }
29  // number of consitent layers
30  int numConsistentLayers() const { return numConsistentLayers_; }
31  // input track
32  TrackKFin* track() const { return track_; }
33  // parent state (nullpointer if no parent available)
34  State* parent() const { return parent_; }
35  // stub to add to state
36  StubKFin* stub() const { return stub_; }
37  // hitPattern of so far added stubs
38  const TTBV& hitPattern() const { return hitPattern_; }
39  // track id of input track
40  int trackId() const { return trackId_; }
41  // pattern of maybe layers for input track
42  TTBV maybePattern() const { return track_->maybePattern(); }
43  // stub id per layer of so far added stubs
44  const std::vector<int>& layerMap() const { return layerMap_; }
45  // layer id of the current stub to add
46  int layer() const { return stub_->layer(); }
47  // helix inv2R wrt input helix
48  double x0() const { return x0_; }
49  // helix phi at radius ChosenRofPhi wrt input helix
50  double x1() const { return x1_; }
51  // helix cot(Theta) wrt input helix
52  double x2() const { return x2_; }
53  // helix z at radius chosenRofZ wrt input helix
54  double x3() const { return x3_; }
55  // cov. matrix element
56  double C00() const { return C00_; }
57  // cov. matrix element
58  double C01() const { return C01_; }
59  // cov. matrix element
60  double C11() const { return C11_; }
61  // cov. matrix element
62  double C22() const { return C22_; }
63  // cov. matrix element
64  double C23() const { return C23_; }
65  // cov. matrix element
66  double C33() const { return C33_; }
67  // Derivative of predicted stub coords wrt helix params: stub radius minus chosenRofPhi
68  double H00() const { return stub_->r(); }
69  // Derivative of predicted stub coords wrt helix params: stub radius minus chosenRofZ
70  double H12() const { return stub_->r() + dataFormats_->chosenRofPhi() - setup_->chosenRofZ(); }
71  // stub phi residual wrt input helix
72  double m0() const { return stub_->phi(); }
73  // stub z residual wrt input helix
74  double m1() const { return stub_->z(); }
75  // stub projected phi uncertainty
76  double dPhi() const { return stub_->dPhi(); }
77  // stub projected z uncertainty
78  double dZ() const { return stub_->dZ(); }
79  // squared stub projected phi uncertainty instead of wheight (wrong but simpler)
80  double v0() const { return pow(stub_->dPhi(), 2); }
81  // squared stub projected z uncertainty instead of wheight (wrong but simpler)
82  double v1() const { return pow(stub_->dZ(), 2); }
83  // output frame
84  tt::FrameTrack frame() const { return TrackKF(*track_, x1_, x0_, x3_, x2_).frame(); }
85  // fill collection of stubs added so far to state
86  void fill(std::vector<StubKF>& stubs) const;
87 
88  private:
89  // provides data fomats
91  // provides run-time constants
92  const tt::Setup* setup_;
93  // input track
95  // track id
96  int trackId_;
97  // previous state, nullptr for first states
99  // stub to add
101  // shows which stub on each layer has been added so far
102  std::vector<int> layerMap_;
103  // shows which layer has been added so far
105  // helix inv2R wrt input helix
106  double x0_;
107  // helix phi at radius ChosenRofPhi wrt input helix
108  double x1_;
109  // helix cot(Theta) wrt input helix
110  double x2_;
111  // helix z at radius chosenRofZ wrt input helix
112  double x3_;
113 
114  // cov. matrix
115 
116  double C00_;
117  double C01_;
118  double C11_;
119  double C22_;
120  double C23_;
121  double C33_;
122 
123  // number of skipped layers
125  // number of consistent layers
127  };
128 
129 } // namespace trackerTFP
130 
131 #endif
double dPhi() const
Definition: DataFormats.h:808
double r() const
Definition: DataFormats.h:802
double C22_
Definition: State.h:119
double dZ() const
Definition: State.h:78
double H00() const
Definition: State.h:68
double x0() const
Definition: State.h:48
State * parent() const
Definition: State.h:34
double chosenRofZ() const
Definition: Setup.h:413
tt::FrameTrack frame() const
Definition: DataFormats.h:865
StubKFin * stub_
Definition: State.h:100
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
const TTBV & maybePattern() const
Definition: DataFormats.h:912
Class to process and provide run-time constants used by Track Trigger emulators.
Definition: Setup.h:44
double z() const
Definition: DataFormats.h:806
const TTBV & hitPattern() const
Definition: State.h:38
const std::vector< int > & layerMap() const
Definition: State.h:44
double x3_
Definition: State.h:112
double C00() const
Definition: State.h:56
int numSkippedLayers() const
Definition: State.h:28
constexpr int pow(int x)
Definition: conifer.h:24
double C23() const
Definition: State.h:64
TrackKFin * track_
Definition: State.h:94
int numSkippedLayers_
Definition: State.h:124
double C33_
Definition: State.h:121
ROOT::VecOps::RVec< double > doubles
Definition: Resolutions.cc:7
double x0_
Definition: State.h:106
int numConsistentLayers() const
Definition: State.h:30
double C23_
Definition: State.h:120
void finish()
Definition: State.cc:107
std::vector< int > layerMap_
Definition: State.h:102
double chosenRofPhi() const
Definition: DataFormats.h:508
std::pair< TTTrackRef, Frame > FrameTrack
Definition: TTTypes.h:62
double C22() const
Definition: State.h:62
tt::FrameTrack frame() const
Definition: State.h:84
TTBV hitPattern_
Definition: State.h:104
const DataFormats * dataFormats_
Definition: State.h:90
double x1() const
Definition: State.h:50
const tt::Setup * setup_
Definition: State.h:92
double v0() const
Definition: State.h:80
double C01_
Definition: State.h:117
double m0() const
Definition: State.h:72
double x2_
Definition: State.h:110
void fill(std::vector< StubKF > &stubs) const
Definition: State.cc:97
int layer() const
Definition: State.h:46
double H12() const
Definition: State.h:70
TrackKFin * track() const
Definition: State.h:32
double C00_
Definition: State.h:116
StubKFin * stub() const
Definition: State.h:36
double x3() const
Definition: State.h:54
int numConsistentLayers_
Definition: State.h:126
TTBV maybePattern() const
Definition: State.h:42
double dPhi() const
Definition: State.h:76
double C11() const
Definition: State.h:60
double dZ() const
Definition: DataFormats.h:810
double v1() const
Definition: State.h:82
double x1_
Definition: State.h:108
double x2() const
Definition: State.h:52
double C11_
Definition: State.h:118
double m1() const
Definition: State.h:74
State * parent_
Definition: State.h:98
Class to calculate and provide dataformats used by Track Trigger emulator.
Definition: DataFormats.h:216
State(State *state)
Definition: State.cc:9
double C33() const
Definition: State.h:66
int trackId() const
Definition: State.h:40
double phi() const
Definition: DataFormats.h:804
double C01() const
Definition: State.h:58