CMS 3D CMS Logo

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