CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 OuterEstimator;
25 class BarrelDetLayer;
26 class ForwardDetLayer;
28 
30 public:
31  enum class UseMeasurementTracker {
32  kNever = -1,
33  kForSiStrips = 0,
34  kAlways = 1
35  };
36 
38  assert(value >= -1 && value <= 1);
39  return static_cast<UseMeasurementTracker>(value);
40  }
41 
43  // mimic the old behaviour
44  if(value > 0.5) return UseMeasurementTracker::kAlways;
45  if(value > -0.5) return UseMeasurementTracker::kForSiStrips;
47  }
48 
50  TrackingRegion(rh),
59 
63 
65 
92  const GlobalPoint & vertexPos,
93  float ptMin, float rVertex, float zVertex,
94  float deltaEta, float deltaPhi,
95  UseMeasurementTracker whereToUseMeasurementTracker = UseMeasurementTracker::kNever,
96  bool precise = true,
97  const MeasurementTrackerEvent *measurementTracker = nullptr,
98  bool etaPhiRegion=false)
99  : RectangularEtaPhiTrackingRegion(dir, vertexPos, Range( -1/ptMin, 1/ptMin), rVertex, zVertex,
100  Margin(std::abs(deltaEta), std::abs(deltaEta)),
101  Margin(std::abs(deltaPhi), std::abs(deltaPhi)),
102  whereToUseMeasurementTracker, precise,
103  measurementTracker, etaPhiRegion)
104  {}
105 
113  const GlobalPoint & vertexPos,
114  float ptMin, float rVertex, float zVertex,
115  Margin etaMargin,
117  UseMeasurementTracker whereToUseMeasurementTracker = UseMeasurementTracker::kNever,
118  bool precise = true,
119  const MeasurementTrackerEvent *measurementTracker = nullptr,
120  bool etaPhiRegion=false)
121  : RectangularEtaPhiTrackingRegion(dir, vertexPos, Range( -1/ptMin, 1/ptMin), rVertex, zVertex,
122  etaMargin, phiMargin,
123  whereToUseMeasurementTracker, precise,
124  measurementTracker, etaPhiRegion)
125  {}
126 
132  const GlobalPoint & vertexPos,
133  Range invPtRange,
134  float rVertex, float zVertex,
135  Margin etaMargin,
137  UseMeasurementTracker whereToUseMeasurementTracker = UseMeasurementTracker::kNever,
138  bool precise = true,
139  const MeasurementTrackerEvent *measurementTracker = nullptr,
140  bool etaPhiRegion=false)
141  : TrackingRegionBase( dir, vertexPos, invPtRange, rVertex, zVertex),
142  thePhiMargin( phiMargin), theMeasurementTrackerUsage(whereToUseMeasurementTracker), thePrecise(precise),theUseEtaPhi(etaPhiRegion),
143  theMeasurementTracker(measurementTracker)
144  { initEtaRange(dir, etaMargin); }
145 
146 
148  const Range & etaRange() const { return theEtaRange; }
149 
152  const Margin & phiMargin() const { return thePhiMargin; }
153 
155  bool isPrecise() const { return thePrecise; }
156 
157  virtual TrackingRegion::Hits hits(
158  const edm::Event& ev,
159  const edm::EventSetup& es,
160  const SeedingLayerSetsHits::SeedingLayer& layer) const override;
161 
162  virtual HitRZCompatibility * checkRZ(const DetLayer* layer,
163  const Hit & outerHit,
164  const edm::EventSetup& iSetup,
165  const DetLayer* outerlayer=0,
166  float lr=0, float gz=0, float dr=0, float dz=0) const
167  { return checkRZOld(layer,outerHit->hit(),iSetup); }
168 
170  return new RectangularEtaPhiTrackingRegion(*this);
171  }
172 
173  virtual std::string name() const { return "RectangularEtaPhiTrackingRegion"; }
174  virtual std::string print() const;
175 
176 private:
178  const DetLayer* layer,
179  const TrackingRecHit* outerHit,
180  const edm::EventSetup& iSetup) const;
181 
182  OuterEstimator * estimator(const BarrelDetLayer* layer,const edm::EventSetup& iSetup) const dso_internal;
183  OuterEstimator * estimator(const ForwardDetLayer* layer,const edm::EventSetup& iSetup) const dso_internal;
184 
187 
189 
190 private:
191 
200 
201 
202 
204  using cacheHits=std::vector<cacheHitPointer>;
205 
206 
207 
208  /* wait... think!
209  * done? questions? think again, look where this region is constructed
210  * still question? study tracker code for the next couple of weeks, then we may discuss.
211  */
212  mutable cacheHits cache;
213 
214 };
215 
216 #endif
#define GCC11_FINAL
OuterEstimator * estimator(const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
RectangularEtaPhiTrackingRegion & operator=(RectangularEtaPhiTrackingRegion const &)=delete
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
const UseMeasurementTracker theMeasurementTrackerUsage
bool ev
HitRZCompatibility * checkRZOld(const DetLayer *layer, const TrackingRecHit *outerHit, const edm::EventSetup &iSetup) const
const MeasurementTrackerEvent * theMeasurementTracker
void initEtaRange(const GlobalVector &dir, const Margin &margin)
virtual RectangularEtaPhiTrackingRegion * clone() const
virtual TrackingRegion::Hits hits(const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const override
get hits from layer compatible with region constraints
Double_t margin
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
static UseMeasurementTracker doubleToUseMeasurementTracker(double value)
SeedingLayerSetsHits::Hits Hits
float ptMin() const
minimal pt of interest
string const
Definition: compareJSON.py:14
#define dso_internal
#define private
Definition: FWFileEntry.h:17
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)
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)
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