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,
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,
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,
141  bool etaPhiRegion=false, bool useMS=true)
142  : TrackingRegionBase( dir, vertexPos, invPtRange, rVertex, zVertex),
144  thePrecise(precise),theUseMS(useMS),theUseEtaPhi(etaPhiRegion),
146  { initEtaRange(dir, etaMargin); }
147 
148 
150  const Range & etaRange() const { return theEtaRange; }
151 
154  const Margin & phiMargin() const { return thePhiMargin; }
155 
157  bool isPrecise() const { return thePrecise; }
158 
159  virtual TrackingRegion::Hits hits(
160  const edm::EventSetup& es,
161  const SeedingLayerSetsHits::SeedingLayer& layer) const override;
162 
163  virtual HitRZCompatibility * checkRZ(const DetLayer* layer,
164  const Hit & outerHit,
165  const edm::EventSetup&iSetup,
166  const DetLayer* outerlayer=nullptr,
167  float lr=0, float gz=0, float dr=0, float dz=0) const override
168  { return checkRZOld(layer,outerHit,iSetup, outerlayer); }
169 
170  virtual RectangularEtaPhiTrackingRegion* clone() const override {
171  return new RectangularEtaPhiTrackingRegion(*this);
172  }
173 
174  virtual std::string name() const override { return "RectangularEtaPhiTrackingRegion"; }
175  virtual std::string print() const override;
176 
177 private:
179  const DetLayer* layer,
180  const Hit & outerHit,
181  const edm::EventSetup&iSetup,
182  const DetLayer* outerlayer) const;
183 
184  std::unique_ptr<MeasurementEstimator> estimator(const BarrelDetLayer* layer,const edm::EventSetup& iSetup) const dso_internal;
185  std::unique_ptr<MeasurementEstimator> estimator(const ForwardDetLayer* layer,const edm::EventSetup& iSetup) const dso_internal;
186 
189 
190  void initEtaRange( const GlobalVector & dir, const Margin& margin);
191 
192 private:
193 
196  Margin thePhiMargin;
199  bool thePrecise=false;
200  bool theUseMS=false;
201  bool theUseEtaPhi=false;
203 
204 
205 
207  using cacheHits=std::vector<cacheHitPointer>;
208 
209 
210 
211  /* wait... think!
212  * done? questions? think again, look where this region is constructed
213  * still question? study tracker code for the next couple of weeks, then we may discuss.
214  */
215  mutable cacheHits cache;
216 
217 };
218 
219 #endif
HitRZCompatibility * checkRZOld(const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer) const
RectangularEtaPhiTrackingRegion & operator=(RectangularEtaPhiTrackingRegion const &)=delete
virtual std::string name() const override
const UseMeasurementTracker theMeasurementTrackerUsage
virtual 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)
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
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
Definition: value.py:1
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
virtual std::string print() const override
static UseMeasurementTracker doubleToUseMeasurementTracker(double value)
SeedingLayerSetsHits::Hits Hits
float ptMin() const
minimal pt of interest
#define dso_internal
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
virtual RectangularEtaPhiTrackingRegion * clone() const override
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
virtual 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
TkTrackingRegionsMargin< float > Margin
const Range & etaRange() const
allowed eta range [eta_min, eta_max] interval