CMS 3D CMS Logo

KFin.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_KFin_h
2 #define L1Trigger_TrackFindingTracklet_KFin_h
3 
9 
10 #include <vector>
11 
12 namespace trklet {
13 
19  class KFin {
20  public:
21  KFin(const edm::ParameterSet& iConfig,
22  const tt::Setup* setup_,
23  const trackerTFP::DataFormats* dataFormats,
24  const trackerTFP::LayerEncoding* layerEncoding,
25  const ChannelAssignment* channelAssignment,
26  const Settings* settings,
27  int region);
28  ~KFin() {}
29 
30  // read in and organize input tracks and stubs
31  void consume(const tt::StreamsTrack& streamsTrack, const tt::StreamsStub& streamsStub);
32  // fill output products
33  void produce(tt::StreamsStub& accpetedStubs,
34  tt::StreamsTrack& acceptedTracks,
35  tt::StreamsStub& lostStubs,
37 
38  private:
39  // truncates double precision of val into base precision, +1.e-12 restores robustness of addition of 2 digitised values
40  double digi(double val, double base) const { return (floor(val / base + 1.e-12) + .5) * base; }
41  // basetransformation of val from baseLow into baseHigh using widthMultiplier bit multiplication
42  double redigi(double val, double baseLow, double baseHigh, int widthMultiplier) const;
43  struct Stub {
44  Stub(const TTStubRef& ttStubRef, int layer, double r, double phi, double z, bool psTilt)
45  : valid_(true), ttStubRef_(ttStubRef), layer_(layer), r_(r), phi_(phi), z_(z), psTilt_(psTilt) {}
46  bool valid_;
48  int layer_;
49  // radius w.r.t. chosenRofPhi in cm
50  double r_;
51  // phi residual in rad
52  double phi_;
53  // z residual in cm
54  double z_;
55  // phi uncertainty * sqrt(12) + additional terms in rad
56  double dPhi_;
57  // z uncertainty * sqrt(12) + additional terms in cm
58  double dZ_;
59  // true if barrel tilted module or encap PS module
60  bool psTilt_;
61  };
62  struct Track {
63  static constexpr int max_ = 8;
64  Track() { stubs_.reserve(max_); }
65  Track(const TTTrackRef& ttTrackRef,
66  bool valid,
67  double inv2R,
68  double phiT,
69  double cot,
70  double zT,
71  const std::vector<Stub*>& stubs)
72  : ttTrackRef_(ttTrackRef),
73  valid_(valid),
74  sector_(-1),
75  inv2R_(inv2R),
76  phiT_(phiT),
77  cot_(cot),
78  zT_(zT),
79  stubs_(stubs) {}
81  bool valid_;
83  int sector_;
84  double inv2R_;
85  double phiT_;
86  double cot_;
87  double zT_;
88  std::vector<Stub*> stubs_;
89  };
90 
91  // true if truncation is enbaled
93  // stub residuals are recalculated from seed parameter and TTStub position
95  // provides run-time constants
96  const tt::Setup* setup_;
97  // provides dataformats
99  // helper class to encode layer
101  // helper class to assign tracks to channel
103  // provides tracklet constants
105  // processing region (0 - 8) aka processing phi nonant
106  const int region_;
107  // storage of input tracks
108  std::vector<Track> tracks_;
109  // storage of input stubs
110  std::vector<Stub> stubs_;
111  // h/w liked organized pointer to input tracks
112  std::vector<std::vector<Track*>> input_;
113  // unified tracklet digitisation granularity
114  double baseUinv2R_;
115  double baseUphiT_;
116  double baseUcot_;
117  double baseUzT_;
118  double baseUr_;
119  double baseUphi_;
120  double baseUz_;
121  // KF input format digitisation granularity (identical to TMTT)
122  double baseLinv2R_;
123  double baseLphiT_;
124  double baseLcot_;
125  double baseLzT_;
126  double baseLr_;
127  double baseLphi_;
128  double baseLz_;
129  // Finer granularity (by powers of 2) than the TMTT one. Used to transform from Tracklet to TMTT base.
130  double baseHinv2R_;
131  double baseHphiT_;
132  double baseHcot_;
133  double baseHzT_;
134  double baseHr_;
135  double baseHphi_;
136  double baseHz_;
137  // digitisation granularity used for inverted cot(theta)
138  double baseInvCot_;
139  };
140 
141 } // namespace trklet
142 
143 #endif
double baseUcot_
Definition: KFin.h:116
bool enableTruncation_
Definition: KFin.h:92
double baseUzT_
Definition: KFin.h:117
Class to emulate transformation of tracklet tracks and stubs into TMTT format.
Definition: KFin.h:19
double baseUinv2R_
Definition: KFin.h:114
Stub(const TTStubRef &ttStubRef, int layer, double r, double phi, double z, bool psTilt)
Definition: KFin.h:44
double dPhi_
Definition: KFin.h:56
std::vector< StreamTrack > StreamsTrack
Definition: TTTypes.h:67
bool psTilt_
Definition: KFin.h:60
double z_
Definition: KFin.h:54
TTTrackRef ttTrackRef_
Definition: KFin.h:80
double phi_
Definition: KFin.h:52
double baseUphi_
Definition: KFin.h:119
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
std::vector< Stub > stubs_
Definition: KFin.h:110
Class to process and provide run-time constants used by Track Trigger emulators.
Definition: Setup.h:44
std::vector< StreamStub > StreamsStub
Definition: TTTypes.h:66
double baseLr_
Definition: KFin.h:126
base
Main Program
Definition: newFWLiteAna.py:92
double baseHzT_
Definition: KFin.h:133
double baseHcot_
Definition: KFin.h:132
void consume(const tt::StreamsTrack &streamsTrack, const tt::StreamsStub &streamsStub)
Definition: KFin.cc:60
double digi(double val, double base) const
Definition: KFin.h:40
const ChannelAssignment * channelAssignment_
Definition: KFin.h:102
double baseHphi_
Definition: KFin.h:135
double baseUr_
Definition: KFin.h:118
double phiT_
Definition: KFin.h:85
Class to assign tracklet tracks and stubs to output channel based on their Pt or seed type as well as...
double baseInvCot_
Definition: KFin.h:138
double baseHinv2R_
Definition: KFin.h:130
bool useTTStubResiduals_
Definition: KFin.h:94
double zT_
Definition: KFin.h:87
double baseLz_
Definition: KFin.h:128
KFin(const edm::ParameterSet &iConfig, const tt::Setup *setup_, const trackerTFP::DataFormats *dataFormats, const trackerTFP::LayerEncoding *layerEncoding, const ChannelAssignment *channelAssignment, const Settings *settings, int region)
Definition: KFin.cc:14
TTStubRef ttStubRef_
Definition: KFin.h:47
double r_
Definition: KFin.h:50
static constexpr int max_
Definition: KFin.h:63
const int region_
Definition: KFin.h:106
std::vector< Track > tracks_
Definition: KFin.h:108
const Settings * settings_
Definition: KFin.h:104
std::vector< std::vector< Track * > > input_
Definition: KFin.h:112
double baseLcot_
Definition: KFin.h:124
double baseHr_
Definition: KFin.h:134
double baseHphiT_
Definition: KFin.h:131
double dZ_
Definition: KFin.h:58
Track(const TTTrackRef &ttTrackRef, bool valid, double inv2R, double phiT, double cot, double zT, const std::vector< Stub *> &stubs)
Definition: KFin.h:65
~KFin()
Definition: KFin.h:28
double baseLinv2R_
Definition: KFin.h:122
double baseLzT_
Definition: KFin.h:125
std::vector< Stub * > stubs_
Definition: KFin.h:88
double redigi(double val, double baseLow, double baseHigh, int widthMultiplier) const
Definition: KFin.cc:428
double baseUphiT_
Definition: KFin.h:115
double baseHz_
Definition: KFin.h:136
double cot_
Definition: KFin.h:86
double inv2R_
Definition: KFin.h:84
Class to encode layer ids for Kalman Filter Layers consitent with rough r-z track parameters are coun...
Definition: LayerEncoding.h:19
double baseLphi_
Definition: KFin.h:127
double baseLphiT_
Definition: KFin.h:123
Class to calculate and provide dataformats used by Track Trigger emulator.
Definition: DataFormats.h:216
const trackerTFP::DataFormats * dataFormats_
Definition: KFin.h:98
const tt::Setup * setup_
Definition: KFin.h:96
void produce(tt::StreamsStub &accpetedStubs, tt::StreamsTrack &acceptedTracks, tt::StreamsStub &lostStubs, tt::StreamsTrack &lostTracks)
Definition: KFin.cc:202
const trackerTFP::LayerEncoding * layerEncoding_
Definition: KFin.h:100
double baseUz_
Definition: KFin.h:120