CMS 3D CMS Logo

RectangularEtaPhiTrackingRegion.h
Go to the documentation of this file.
1 #ifndef RectangularEtaPhiTrackingRegion_H
2 #define RectangularEtaPhiTrackingRegion_H
3 
13 //#include "CommonDet/TrajectoryParametrization/interface/GlobalTrajectoryParameters.h"
15 
18 
20 class BarrelDetLayer;
21 class ForwardDetLayer;
23 class MagneticField;
25 
27 public:
28  enum class UseMeasurementTracker { kNever = -1, kForSiStrips = 0, kAlways = 1 };
29 
31  assert(value >= -1 && value <= 1);
32  return static_cast<UseMeasurementTracker>(value);
33  }
34 
36  // mimic the old behaviour
37  if (value > 0.5)
39  if (value > -0.5)
42  }
43 
45 
47 
49  : TrackingRegion(rh),
58  theField(rh.theField),
59  theMSMaker(rh.theMSMaker) {}
63 
65 
93  const GlobalPoint& vertexPos,
94  float ptMin,
95  float rVertex,
96  float zVertex,
97  float deltaEta,
98  float deltaPhi,
99  const MagneticField& field,
101  bool precise = true,
104  bool etaPhiRegion = false)
106  vertexPos,
107  Range(-1 / ptMin, 1 / ptMin),
108  rVertex,
109  zVertex,
112  field,
113  msmaker,
114  precise,
117  etaPhiRegion) {}
118 
126  const GlobalPoint& vertexPos,
127  float ptMin,
128  float rVertex,
129  float zVertex,
130  Margin etaMargin,
132  const MagneticField& field,
134  bool precise = true,
137  bool etaPhiRegion = false)
139  vertexPos,
140  Range(-1 / ptMin, 1 / ptMin),
141  rVertex,
142  zVertex,
143  etaMargin,
144  phiMargin,
145  field,
146  msmaker,
147  precise,
150  etaPhiRegion) {}
151 
157  const GlobalPoint& vertexPos,
159  float rVertex,
160  float zVertex,
161  Margin etaMargin,
163  const MagneticField& field,
165  bool precise = true,
168  bool etaPhiRegion = false,
169  bool useMS = true)
174  theUseMS(useMS),
175  theUseEtaPhi(etaPhiRegion),
177  theField(&field),
178  theMSMaker(msmaker) {
179  initEtaRange(dir, etaMargin);
180  }
181 
183  const Range& etaRange() const { return theEtaRange; }
184  const Range& tanLambdaRange() const { return theLambdaRange; }
185 
188  const Margin& phiMargin() const { return thePhiMargin; }
189 
191  bool isPrecise() const { return thePrecise; }
192 
194 
197  void checkTracks(reco::TrackCollection const& tracks, std::vector<bool>& mask) const override;
198 
199  std::unique_ptr<HitRZCompatibility> checkRZ(const DetLayer* layer,
200  const Hit& outerHit,
201  const DetLayer* outerlayer = nullptr,
202  float lr = 0,
203  float gz = 0,
204  float dr = 0,
205  float dz = 0) const override {
206  return checkRZOld(layer, outerHit, outerlayer);
207  }
208 
209  std::unique_ptr<TrackingRegion> clone() const override {
210  return std::make_unique<RectangularEtaPhiTrackingRegion>(*this);
211  }
212 
213  std::string name() const override { return "RectangularEtaPhiTrackingRegion"; }
214  std::string print() const override;
215 
216 private:
217  std::unique_ptr<HitRZCompatibility> checkRZOld(const DetLayer* layer,
218  const Hit& outerHit,
219  const DetLayer* outerlayer) const;
220 
221  std::unique_ptr<MeasurementEstimator> estimator(const BarrelDetLayer* layer) const dso_internal;
222  std::unique_ptr<MeasurementEstimator> estimator(const ForwardDetLayer* layer) const dso_internal;
223 
226 
228 
229 private:
231  Range theLambdaRange; // this is actually tanLambda
236  bool theUseMS = false;
241 
244 
245  /* wait... think!
246  * done? questions? think again, look where this region is constructed
247  * still question? study tracker code for the next couple of weeks, then we may discuss.
248  */
249  mutable cacheHits cache;
250 };
251 
252 #endif
OuterHitPhiPrediction phiWindow(const MagneticField &field) const
std::unique_ptr< MeasurementEstimator > estimator(const BarrelDetLayer *layer) const
const Range & etaRange() const
allowed eta range [eta_min, eta_max] interval
std::unique_ptr< HitRZCompatibility > checkRZOld(const DetLayer *layer, const Hit &outerHit, const DetLayer *outerlayer) const
RectangularEtaPhiTrackingRegion & operator=(RectangularEtaPhiTrackingRegion const &)=delete
bool isPrecise() const
is precise error calculation switched on
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
const UseMeasurementTracker theMeasurementTrackerUsage
const MultipleScatteringParametrisationMaker * theMSMaker
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
assert(be >=bs)
static const double deltaEta
Definition: CaloConstants.h:8
constexpr uint32_t mask
Definition: gpuClustering.h:24
TrackingRegion::Hits hits(const SeedingLayerSetsHits::SeedingLayer &layer) const override
get hits from layer compatible with region constraints
constexpr std::array< uint8_t, layerIndexSize > layer
const MeasurementTrackerEvent * theMeasurementTracker
std::unique_ptr< TrackingRegion > clone() const override
void initEtaRange(const GlobalVector &dir, const Margin &margin)
float ptMin() const
minimal pt of interest
Double_t margin
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define dso_internal
Definition: Visibility.h:13
RectangularEtaPhiTrackingRegion(const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, const MagneticField &field, const MultipleScatteringParametrisationMaker *msmaker, bool precise=true, UseMeasurementTracker whereToUseMeasurementTracker=UseMeasurementTracker::kNever, const MeasurementTrackerEvent *measurementTracker=nullptr, bool etaPhiRegion=false)
Definition: value.py:1
static UseMeasurementTracker doubleToUseMeasurementTracker(double value)
auto const & tracks
cannot be loose
void checkTracks(reco::TrackCollection const &tracks, std::vector< bool > &mask) const override
SeedingLayerSetsHits::Hits Hits
Range invPtRange() const
inverse pt range
RectangularEtaPhiTrackingRegion(const GlobalVector &dir, const GlobalPoint &vertexPos, Range invPtRange, float rVertex, float zVertex, Margin etaMargin, Margin phiMargin, const MagneticField &field, const MultipleScatteringParametrisationMaker *msmaker, bool precise=true, UseMeasurementTracker whereToUseMeasurementTracker=UseMeasurementTracker::kNever, const MeasurementTrackerEvent *measurementTracker=nullptr, bool etaPhiRegion=false, bool useMS=true)
RectangularEtaPhiTrackingRegion(const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, Margin etaMargin, Margin phiMargin, const MagneticField &field, const MultipleScatteringParametrisationMaker *msmaker, bool precise=true, UseMeasurementTracker whereToUseMeasurementTracker=UseMeasurementTracker::kNever, const MeasurementTrackerEvent *measurementTracker=nullptr, bool etaPhiRegion=false)
RectangularEtaPhiTrackingRegion(RectangularEtaPhiTrackingRegion const &rh)
static UseMeasurementTracker intToUseMeasurementTracker(int value)
std::unique_ptr< HitRZCompatibility > checkRZ(const DetLayer *layer, const Hit &outerHit, const DetLayer *outerlayer=nullptr, float lr=0, float gz=0, float dr=0, float dz=0) const override
TkTrackingRegionsMargin< float > Margin