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;
46  return UseMeasurementTracker::kNever;
47  }
48 
50  TrackingRegion(rh),
51  theEtaRange(rh.theEtaRange),
52  theLambdaRange(rh.theLambdaRange),
53  thePhiMargin(rh.thePhiMargin),
54  theMeanLambda(rh.theMeanLambda),
55  theMeasurementTrackerUsage(rh.theMeasurementTrackerUsage),
56  thePrecise(rh.thePrecise),
57  theUseEtaPhi(rh.theUseEtaPhi),
58  theMeasurementTracker(rh.theMeasurementTracker) {}
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,
116  Margin phiMargin,
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,
136  Margin phiMargin,
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:
177  HitRZCompatibility* checkRZOld(
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 
185  OuterHitPhiPrediction phiWindow(const edm::EventSetup& iSetup) const dso_internal;
186  HitRZConstraint rzConstraint() const dso_internal;
187 
188  void initEtaRange( const GlobalVector & dir, const Margin& margin);
189 
190 private:
191 
192  Range theEtaRange;
193  Range theLambdaRange;
194  Margin thePhiMargin;
195  float theMeanLambda;
196  const UseMeasurementTracker theMeasurementTrackerUsage;
197  bool thePrecise;
198  bool theUseEtaPhi;
199  const MeasurementTrackerEvent *theMeasurementTracker;
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
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=nullptr, bool etaPhiRegion=false)
const Margin & phiMargin() const
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition: MagVolume.h:20
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:8
virtual RectangularEtaPhiTrackingRegion * clone() const
TkTrackingRegionsMargin< float > Margin
virtual std::string name() const
bool isPrecise() const
is precise error calculation switched on
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=nullptr, bool etaPhiRegion=false)
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, UseMeasurementTracker whereToUseMeasurementTracker=UseMeasurementTracker::kNever, bool precise=true, const MeasurementTrackerEvent *measurementTracker=nullptr, bool etaPhiRegion=false)
static UseMeasurementTracker intToUseMeasurementTracker(int value)
RectangularEtaPhiTrackingRegion(RectangularEtaPhiTrackingRegion const &rh)
std::vector< cacheHitPointer > cacheHits
SeedingLayerSetsHits::Hits Hits
string const
Definition: compareJSON.py:14
GloballyPositioned< float >::GlobalVector GlobalVector
Definition: MagVolume.h:21
#define private
Definition: FWFileEntry.h:17
std::pair< ContainerIterator, ContainerIterator > Range
static UseMeasurementTracker doubleToUseMeasurementTracker(double 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
const Range & etaRange() const
allowed eta range [eta_min, eta_max] interval
Unlimited (trivial) bounds.