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"
16 
17 
20 
21 
22 
24 class BarrelDetLayer;
25 class ForwardDetLayer;
27 
29 public:
30  enum class UseMeasurementTracker {
31  kNever = -1,
32  kForSiStrips = 0,
33  kAlways = 1
34  };
35 
37  assert(value >= -1 && value <= 1);
38  return static_cast<UseMeasurementTracker>(value);
39  }
40 
42  // mimic the old behaviour
43  if(value > 0.5) return UseMeasurementTracker::kAlways;
44  if(value > -0.5) return UseMeasurementTracker::kForSiStrips;
46  }
47 
49 
51  TrackingRegion(rh),
60 
64 
66 
93  const GlobalPoint & vertexPos,
94  float ptMin, float rVertex, float zVertex,
95  float deltaEta, float deltaPhi,
97  bool precise = true,
98  const MeasurementTrackerEvent *measurementTracker = nullptr,
99  bool etaPhiRegion=false)
100  : RectangularEtaPhiTrackingRegion(dir, vertexPos, Range( -1/ptMin, 1/ptMin), rVertex, zVertex,
101  Margin(std::abs(deltaEta), std::abs(deltaEta)),
102  Margin(std::abs(deltaPhi), std::abs(deltaPhi)),
104  measurementTracker, etaPhiRegion)
105  {}
106 
114  const GlobalPoint & vertexPos,
115  float ptMin, float rVertex, float zVertex,
116  Margin etaMargin,
117  Margin phiMargin,
119  bool precise = true,
120  const MeasurementTrackerEvent *measurementTracker = nullptr,
121  bool etaPhiRegion=false)
122  : RectangularEtaPhiTrackingRegion(dir, vertexPos, Range( -1/ptMin, 1/ptMin), rVertex, zVertex,
123  etaMargin, phiMargin,
125  measurementTracker, etaPhiRegion)
126  {}
127 
133  const GlobalPoint & vertexPos,
134  Range invPtRange,
135  float rVertex, float zVertex,
136  Margin etaMargin,
137  Margin phiMargin,
139  bool precise = true,
140  const MeasurementTrackerEvent *measurementTracker = nullptr,
141  bool etaPhiRegion=false, bool useMS=true)
142  : TrackingRegionBase( dir, vertexPos, invPtRange, rVertex, zVertex),
144  thePrecise(precise),theUseMS(useMS),theUseEtaPhi(etaPhiRegion),
145  theMeasurementTracker(measurementTracker)
146  { initEtaRange(dir, etaMargin); }
147 
148 
150  const Range & etaRange() const { return theEtaRange; }
151  const Range & tanLambdaRange() const { return theLambdaRange; }
152 
155  const Margin & phiMargin() const { return thePhiMargin; }
156 
158  bool isPrecise() const { return thePrecise; }
159 
161  const edm::EventSetup& es,
162  const SeedingLayerSetsHits::SeedingLayer& layer) const override;
163 
165  const Hit & outerHit,
166  const edm::EventSetup&iSetup,
167  const DetLayer* outerlayer=nullptr,
168  float lr=0, float gz=0, float dr=0, float dz=0) const override
169  { return checkRZOld(layer,outerHit,iSetup, outerlayer); }
170 
172  return new RectangularEtaPhiTrackingRegion(*this);
173  }
174 
175  std::string name() const override { return "RectangularEtaPhiTrackingRegion"; }
176  std::string print() const override;
177 
178 private:
180  const DetLayer* layer,
181  const Hit & outerHit,
182  const edm::EventSetup&iSetup,
183  const DetLayer* outerlayer) const;
184 
185  std::unique_ptr<MeasurementEstimator> estimator(const BarrelDetLayer* layer,const edm::EventSetup& iSetup) const dso_internal;
186  std::unique_ptr<MeasurementEstimator> estimator(const ForwardDetLayer* layer,const edm::EventSetup& iSetup) const dso_internal;
187 
190 
191  void initEtaRange( const GlobalVector & dir, const Margin& margin);
192 
193 private:
194 
196  Range theLambdaRange; // this is actually tanLambda
197  Margin thePhiMargin;
200  bool thePrecise=false;
201  bool theUseMS=false;
202  bool theUseEtaPhi=false;
204 
205 
206 
208  using cacheHits=std::vector<cacheHitPointer>;
209 
210 
211 
212  /* wait... think!
213  * done? questions? think again, look where this region is constructed
214  * still question? study tracker code for the next couple of weeks, then we may discuss.
215  */
216  mutable cacheHits cache;
217 
218 };
219 
220 #endif
HitRZCompatibility * checkRZOld(const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer) const
RectangularEtaPhiTrackingRegion & operator=(RectangularEtaPhiTrackingRegion const &)=delete
const UseMeasurementTracker theMeasurementTrackerUsage
TrackingRegion::Hits hits(const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const override
get hits from layer compatible with region constraints
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
HitRZCompatibility * checkRZ(const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer=0, float lr=0, float gz=0, float dr=0, float dz=0) const override
static const double deltaEta
Definition: CaloConstants.h:8
RectangularEtaPhiTrackingRegion(const GlobalVector &dir, const GlobalPoint &vertexPos, Range invPtRange, float rVertex, float zVertex, Margin etaMargin, Margin phiMargin, UseMeasurementTracker whereToUseMeasurementTracker=UseMeasurementTracker::kNever, bool precise=true, const MeasurementTrackerEvent *measurementTracker=0, bool etaPhiRegion=false, bool useMS=true)
std::unique_ptr< MeasurementEstimator > estimator(const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
RectangularEtaPhiTrackingRegion * clone() const override
const MeasurementTrackerEvent * theMeasurementTracker
void initEtaRange(const GlobalVector &dir, const Margin &margin)
Double_t margin
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define dso_internal
Definition: Visibility.h:13
Definition: value.py:1
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
static UseMeasurementTracker doubleToUseMeasurementTracker(double value)
SeedingLayerSetsHits::Hits Hits
float ptMin() const
minimal pt of interest
RectangularEtaPhiTrackingRegion(const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, Margin etaMargin, Margin phiMargin, UseMeasurementTracker whereToUseMeasurementTracker=UseMeasurementTracker::kNever, bool precise=true, const MeasurementTrackerEvent *measurementTracker=0, bool etaPhiRegion=false)
RectangularEtaPhiTrackingRegion(const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, UseMeasurementTracker whereToUseMeasurementTracker=UseMeasurementTracker::kNever, bool precise=true, const MeasurementTrackerEvent *measurementTracker=0, bool etaPhiRegion=false)
Range invPtRange() const
inverse pt range
RectangularEtaPhiTrackingRegion(RectangularEtaPhiTrackingRegion const &rh)
bool isPrecise() const
is precise error calculation switched on
static UseMeasurementTracker intToUseMeasurementTracker(int value)
dbl *** dir
Definition: mlp_gen.cc:35
TkTrackingRegionsMargin< float > Margin
const Range & etaRange() const
allowed eta range [eta_min, eta_max] interval