CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
RectangularEtaPhiTrackingRegion Class Referencefinal

#include <RectangularEtaPhiTrackingRegion.h>

Inheritance diagram for RectangularEtaPhiTrackingRegion:
TrackingRegion

Public Types

typedef TkTrackingRegionsMargin< float > Margin
 
enum  UseMeasurementTracker { UseMeasurementTracker::kNever = -1, UseMeasurementTracker::kForSiStrips = 0, UseMeasurementTracker::kAlways = 1 }
 
- Public Types inherited from TrackingRegion
typedef SeedingLayerSetsHits::ConstRecHitPointer Hit
 
typedef SeedingLayerSetsHits::Hits Hits
 
typedef PixelRecoRange< float > Range
 

Public Member Functions

HitRZCompatibilitycheckRZ (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
 
RectangularEtaPhiTrackingRegionclone () const override
 
const RangeetaRange () const
 allowed eta range [eta_min, eta_max] interval More...
 
TrackingRegion::Hits hits (const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const override
 get hits from layer compatible with region constraints More...
 
bool isPrecise () const
 is precise error calculation switched on More...
 
std::string name () const override
 
RectangularEtaPhiTrackingRegionoperator= (RectangularEtaPhiTrackingRegion const &)=delete
 
RectangularEtaPhiTrackingRegionoperator= (RectangularEtaPhiTrackingRegion &&)=delete
 
const MarginphiMargin () const
 
std::string print () const override
 
 RectangularEtaPhiTrackingRegion (RectangularEtaPhiTrackingRegion const &rh)
 
 RectangularEtaPhiTrackingRegion (RectangularEtaPhiTrackingRegion &&)=default
 
 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, 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, 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)
 
const RangetanLambdaRange () const
 
- Public Member Functions inherited from TrackingRegion
GlobalVector const & direction () const
 the direction around which region is constructed More...
 
Range invPtRange () const
 inverse pt range More...
 
GlobalPoint const & origin () const
 
float originRBound () const
 bounds the particle vertex in the transverse plane More...
 
float originZBound () const
 bounds the particle vertex in the longitudinal plane More...
 
float phiDirection () const
 
float ptMin () const
 minimal pt of interest More...
 
TrackingRegionrestrictedRegion (const GlobalPoint &originPos, const float &originRBound, const float &originZBound) const
 clone region with new vertex position More...
 
 TrackingRegion (const GlobalVector &direction, const GlobalPoint &originPos, const Range &invPtRange, const float &originRBound, const float &originZBound)
 
GlobalVector const & unitDirection () const
 
virtual ~TrackingRegion ()
 

Static Public Member Functions

static UseMeasurementTracker doubleToUseMeasurementTracker (double value)
 
static UseMeasurementTracker intToUseMeasurementTracker (int value)
 
static UseMeasurementTracker stringToUseMeasurementTracker (const std::string &name)
 

Private Types

using cacheHitPointer = mayown_ptr< BaseTrackerRecHit >
 
using cacheHits = std::vector< cacheHitPointer >
 

Private Member Functions

HitRZCompatibilitycheckRZOld (const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer) const
 
std::unique_ptr< MeasurementEstimatorestimator (const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
 
std::unique_ptr< MeasurementEstimatorestimator (const ForwardDetLayer *layer, const edm::EventSetup &iSetup) const
 
void initEtaRange (const GlobalVector &dir, const Margin &margin)
 
OuterHitPhiPrediction phiWindow (const edm::EventSetup &iSetup) const
 
HitRZConstraint rzConstraint () const
 

Private Attributes

cacheHits cache
 
Range theEtaRange
 
Range theLambdaRange
 
float theMeanLambda
 
const MeasurementTrackerEventtheMeasurementTracker = 0
 
const UseMeasurementTracker theMeasurementTrackerUsage = UseMeasurementTracker::kNever
 
Margin thePhiMargin
 
bool thePrecise = false
 
bool theUseEtaPhi = false
 
bool theUseMS = false
 

Detailed Description

A concrete implementation of TrackingRegion. Apart of vertex constraint from TrackingRegion in this implementation the region of interest is further constrainted in phi and eta around the direction of the region

Definition at line 25 of file RectangularEtaPhiTrackingRegion.h.

Member Typedef Documentation

Definition at line 221 of file RectangularEtaPhiTrackingRegion.h.

Definition at line 222 of file RectangularEtaPhiTrackingRegion.h.

Definition at line 60 of file RectangularEtaPhiTrackingRegion.h.

Member Enumeration Documentation

Enumerator
kNever 
kForSiStrips 
kAlways 

Definition at line 27 of file RectangularEtaPhiTrackingRegion.h.

27 { kNever = -1, kForSiStrips = 0, kAlways = 1 };

Constructor & Destructor Documentation

RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( RectangularEtaPhiTrackingRegion const &  rh)
inline

Definition at line 45 of file RectangularEtaPhiTrackingRegion.h.

References operator=().

Referenced by clone().

46  : TrackingRegion(rh),
47  theEtaRange(rh.theEtaRange),
48  theLambdaRange(rh.theLambdaRange),
49  thePhiMargin(rh.thePhiMargin),
50  theMeanLambda(rh.theMeanLambda),
51  theMeasurementTrackerUsage(rh.theMeasurementTrackerUsage),
52  thePrecise(rh.thePrecise),
53  theUseEtaPhi(rh.theUseEtaPhi),
54  theMeasurementTracker(rh.theMeasurementTracker) {}
const UseMeasurementTracker theMeasurementTrackerUsage
TrackingRegion(const GlobalVector &direction, const GlobalPoint &originPos, const Range &invPtRange, const float &originRBound, const float &originZBound)
const MeasurementTrackerEvent * theMeasurementTracker
RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( RectangularEtaPhiTrackingRegion &&  )
default
RectangularEtaPhiTrackingRegion::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 
)
inline

constructor (symmetric eta and phi margins).
dir - the direction around which region is constructed
the initial direction of the momentum of the particle should be in the range
phi of dir +- deltaPhi
eta of dir +- deltaEta

vertexPos - the position of the vertex (origin) of the of the region.
It is a centre of cylinder constraind with rVertex, zVertex. The track of the particle should cross the cylinder
WARNING: in the current implementaion the vertexPos is supposed to be placed on the beam line, i.e. to be of the form (0,0,float)

ptMin - minimal pt of interest
rVertex - radius of the cylinder around beam line where the tracks of interest should point to.
zVertex - half height of the cylinder around the beam line where the tracks of interest should point to.
deltaEta - allowed deviation of the initial direction of particle in eta in respect to direction of the region
deltaPhi - allowed deviation of the initial direction of particle in phi in respect to direction of the region whereToUseMeasurementTracker: 1=everywhere, 0=outside pixles, -1=nowhere

Definition at line 87 of file RectangularEtaPhiTrackingRegion.h.

99  vertexPos,
100  Range(-1 / ptMin, 1 / ptMin),
101  rVertex,
102  zVertex,
106  precise,
107  measurementTracker,
108  etaPhiRegion) {}
static const double deltaEta
Definition: CaloConstants.h:8
PixelRecoRange< float > Range
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float ptMin() const
minimal pt of interest
RectangularEtaPhiTrackingRegion(RectangularEtaPhiTrackingRegion const &rh)
TkTrackingRegionsMargin< float > Margin
RectangularEtaPhiTrackingRegion::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 
)
inline

constructor (asymmetrinc eta and phi margins).
non equal left-right eta and phi bounds around direction are possible. The ranges are defined using Margin. the meaning of other arguments is the same as in the case of symmetring bounds to direction of the region.

Definition at line 116 of file RectangularEtaPhiTrackingRegion.h.

128  vertexPos,
129  Range(-1 / ptMin, 1 / ptMin),
130  rVertex,
131  zVertex,
132  etaMargin,
133  phiMargin,
135  precise,
136  measurementTracker,
137  etaPhiRegion) {}
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest
RectangularEtaPhiTrackingRegion(RectangularEtaPhiTrackingRegion const &rh)
RectangularEtaPhiTrackingRegion::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 
)
inline

constructor (explicit pt range, asymmetrinc eta and phi margins).
the meaning of other arguments is the same as in the case of symmetring bounds to direction of the region.

Definition at line 143 of file RectangularEtaPhiTrackingRegion.h.

References initEtaRange().

155  : TrackingRegionBase(dir, vertexPos, invPtRange, rVertex, zVertex),
159  theUseMS(useMS),
160  theUseEtaPhi(etaPhiRegion),
161  theMeasurementTracker(measurementTracker) {
162  initEtaRange(dir, etaMargin);
163  }
const UseMeasurementTracker theMeasurementTrackerUsage
const MeasurementTrackerEvent * theMeasurementTracker
void initEtaRange(const GlobalVector &dir, const Margin &margin)
Range invPtRange() const
inverse pt range
TrackingRegion TrackingRegionBase

Member Function Documentation

HitRZCompatibility* RectangularEtaPhiTrackingRegion::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
inlineoverridevirtual

utility to check eta/theta hit compatibility with region constraints and outer hit constraint

Implements TrackingRegion.

Definition at line 178 of file RectangularEtaPhiTrackingRegion.h.

References checkRZOld().

185  {
186  return checkRZOld(layer, outerHit, iSetup, outerlayer);
187  }
HitRZCompatibility * checkRZOld(const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer) const
HitRZCompatibility * RectangularEtaPhiTrackingRegion::checkRZOld ( const DetLayer layer,
const Hit outerHit,
const edm::EventSetup iSetup,
const DetLayer outerlayer 
) const
private

Definition at line 71 of file RectangularEtaPhiTrackingRegion.cc.

References funct::abs(), GeomDetEnumerators::barrel, corr, SimpleLineRZ::cotLine(), f, PixelPluginsPhase0_cfi::isBarrel, DetLayer::location(), SiStripPI::max, min(), SurfaceOrientation::outer, ptMin, DetLayer::seqNum(), funct::sqr(), mathSSE::sqrt(), vtxMean(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PixelRecoPointRZ::z(), PV3DBase< T, PVType, FrameType >::z(), and PixelRecoLineRZ::zAtR().

Referenced by checkRZ(), and name().

74  {
75  bool isBarrel = (layer->location() == GeomDetEnumerators::barrel);
76  GlobalPoint ohit = outerHit->globalPosition();
77  float outerred_r = std::sqrt(sqr(ohit.x() - origin().x()) + sqr(ohit.y() - origin().y()));
78  PixelRecoPointRZ outer(outerred_r, ohit.z());
79 
80  float zMinOrigin = origin().z() - originZBound();
81  float zMaxOrigin = origin().z() + originZBound();
82 
83  if (!thePrecise) {
84  float vcotMin = (outer.z() > zMaxOrigin) ? (outer.z() - zMaxOrigin) / (outer.r() + originRBound())
85  : (outer.z() - zMaxOrigin) / (outer.r() - originRBound());
86  float vcotMax = (outer.z() > zMinOrigin) ? (outer.z() - zMinOrigin) / (outer.r() - originRBound())
87  : (outer.z() - zMinOrigin) / (outer.r() + originRBound());
88  float cotRight = std::max(vcotMin, theLambdaRange.min());
89  float cotLeft = std::min(vcotMax, theLambdaRange.max());
90  return new HitEtaCheck(isBarrel, outer, cotLeft, cotRight);
91  }
92 
93  float outerZscatt = 0;
94  float innerScatt = 0;
95  //CHECK
96  if (theUseMS) {
97  MultipleScatteringParametrisation oSigma(layer, iSetup);
98  float cotThetaOuter = theMeanLambda;
99  float sinThetaOuterInv = std::sqrt(1.f + sqr(cotThetaOuter));
100  outerZscatt = 3.f * oSigma(ptMin(), cotThetaOuter) * sinThetaOuterInv;
101  }
102 
105  float zMinLine = boundL.zAtR(0.) - outerZscatt;
106  float zMaxLine = boundR.zAtR(0.) + outerZscatt;
107  PixelRecoPointRZ vtxL(0., max(zMinLine, zMinOrigin));
108  PixelRecoPointRZ vtxR(0., min(zMaxLine, zMaxOrigin));
109  PixelRecoPointRZ vtxMean(0., (vtxL.z() + vtxR.z()) * 0.5f);
110  //CHECK
111 
112  if (theUseMS) {
113  MultipleScatteringParametrisation iSigma(layer, iSetup);
114 
115  innerScatt =
116  3.f * (outerlayer ? iSigma(ptMin(), vtxMean, outer, outerlayer->seqNum()) : iSigma(ptMin(), vtxMean, outer));
117 
118  // innerScatt = 3.f *iSigma( ptMin(), vtxMean, outer);
119  }
120 
121  SimpleLineRZ leftLine(vtxL, outer);
122  SimpleLineRZ rightLine(vtxR, outer);
123 
124  HitRZConstraint rzConstraint(leftLine, rightLine);
125  auto cotTheta = std::abs(leftLine.cotLine() + rightLine.cotLine()) * 0.5f;
126 
127  // std::cout << "RectangularEtaPhiTrackingRegion " << outer.r()<<','<< outer.z() << " " << innerScatt << " " << cotTheta << " " << hitZErr << std::endl;
128 
129  if (isBarrel) {
130  auto sinThetaInv = std::sqrt(1.f + sqr(cotTheta));
131  auto corr = innerScatt * sinThetaInv;
133  } else {
134  auto cosThetaInv = std::sqrt(1.f + sqr(1.f / cotTheta));
135  auto corr = innerScatt * cosThetaInv;
137  }
138 }
float originRBound() const
bounds the particle vertex in the transverse plane
GlobalPoint const & origin() const
T max() const
virtual Location location() const =0
Which part of the detector (barrel, endcap)
T y() const
Definition: PV3DBase.h:60
T min() const
float zAtR(float r) const
int seqNum() const
Definition: DetLayer.h:35
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static GlobalPoint vtxMean(const GlobalPoint &p1, const GlobalError &e1, const GlobalPoint &p2, const GlobalError &e2)
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
float originZBound() const
bounds the particle vertex in the longitudinal plane
JetCorrectorParameters corr
Definition: classes.h:5
float ptMin() const
minimal pt of interest
Square< F >::type sqr(const F &f)
Definition: Square.h:14
T x() const
Definition: PV3DBase.h:59
RectangularEtaPhiTrackingRegion* RectangularEtaPhiTrackingRegion::clone ( void  ) const
inlineoverridevirtual

Implements TrackingRegion.

Definition at line 189 of file RectangularEtaPhiTrackingRegion.h.

References RectangularEtaPhiTrackingRegion().

189 { return new RectangularEtaPhiTrackingRegion(*this); }
RectangularEtaPhiTrackingRegion(RectangularEtaPhiTrackingRegion const &rh)
static UseMeasurementTracker RectangularEtaPhiTrackingRegion::doubleToUseMeasurementTracker ( double  value)
inlinestatic
std::unique_ptr< MeasurementEstimator > RectangularEtaPhiTrackingRegion::estimator ( const BarrelDetLayer layer,
const edm::EventSetup iSetup 
) const
private

Definition at line 140 of file RectangularEtaPhiTrackingRegion.cc.

References funct::abs(), Surface::bounds(), PixelRecoRange< T >::empty(), f, reco::helper::VirtualJetProducerHelper::intersection(), PixelRecoRange< T >::intersection(), Bounds::length(), PixelRecoUtilities::longitudinalBendingCorrection(), PixelRecoRange< T >::max(), SiStripPI::max, PixelRecoRange< T >::mean(), PixelRecoRange< T >::min(), min(), trackingPOGFilters_cfi::phiWindow, GeometricSearchDet::position(), ptMin, CosmicsPD_Skims::radius, HitZCheck::range(), OuterHitPhiPrediction::setTolerance(), HitZCheck::setTolerance(), BarrelDetLayer::specificSurface(), funct::sqr(), mathSSE::sqrt(), BarrelDetLayer::surface(), Bounds::thickness(), w2, PV3DBase< T, PVType, FrameType >::z(), and HLTMuonOfflineAnalyzer_cfi::z0.

Referenced by name().

141  {
142  using Algo = HitZCheck;
143 
144  // det dimensions
145  float halfLength = 0.5f * layer->surface().bounds().length();
146  float halfThickness = 0.5f * layer->surface().bounds().thickness();
147  float z0 = layer->position().z();
148  float radius = layer->specificSurface().radius();
149 
150  // det ranges
151  Range detRWindow(radius - halfThickness, radius + halfThickness);
152  Range detZWindow(z0 - halfLength, z0 + halfLength);
153 
154  // z prediction, skip if not intersection
155  HitZCheck zPrediction(rzConstraint());
156  Range hitZWindow = zPrediction.range(detRWindow.min()).intersection(detZWindow);
157  if (hitZWindow.empty())
158  return nullptr;
159 
160  // phi prediction
161  OuterHitPhiPrediction phiPrediction = phiWindow(iSetup);
162 
163  //
164  // optional corrections for tolerance (mult.scatt, error, bending)
165  //
167  if (thePrecise) {
168  auto invR = 1.f / radius;
169  auto cotTheta = (hitZWindow.mean() - origin().z()) * invR;
170  auto sinThetaInv = std::sqrt(1.f + sqr(cotTheta));
171  MultipleScatteringParametrisation msSigma(layer, iSetup);
172  auto scatt = 3.f * msSigma(ptMin(), cotTheta);
173  auto bendR = longitudinalBendingCorrection(radius, ptMin(), iSetup);
174 
175  float hitErrRPhi = 0.;
176  float hitErrZ = 0.;
177  float corrPhi = (scatt + hitErrRPhi) * invR;
178  float corrZ = scatt * sinThetaInv + bendR * std::abs(cotTheta) + hitErrZ;
179 
180  phiPrediction.setTolerance(corrPhi);
181  zPrediction.setTolerance(HitZCheck::Margin(corrZ, corrZ));
182 
183  //
184  // hit ranges in det
185  //
186  OuterHitPhiPrediction::Range phi1 = phiPrediction(detRWindow.min());
187  OuterHitPhiPrediction::Range phi2 = phiPrediction(detRWindow.max());
188  phiRange = Range(std::min(phi1.min(), phi2.min()), std::max(phi1.max(), phi2.max()));
189  Range w1 = zPrediction.range(detRWindow.min());
190  Range w2 = zPrediction.range(detRWindow.max());
191  hitZWindow = Range(std::min(w1.min(), w2.min()), std::max(w1.max(), w2.max())).intersection(detZWindow);
192  } else {
193  phiRange = phiPrediction(detRWindow.mean());
194  }
195 
196  return std::make_unique<OuterEstimator<Algo>>(OuterDetCompatibility(layer, phiRange, detRWindow, hitZWindow),
197  OuterHitCompatibility<Algo>(phiPrediction, zPrediction),
198  iSetup);
199 }
void setTolerance(float tolerance)
virtual float length() const =0
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
GlobalPoint const & origin() const
T max() const
const Bounds & bounds() const
Definition: Surface.h:89
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
T min() const
PixelRecoRange< float > Range
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
double longitudinalBendingCorrection(double radius, double pt, const edm::EventSetup &iSetup)
virtual float thickness() const =0
virtual const Surface::PositionType & position() const
Returns position of the surface.
float ptMin() const
minimal pt of interest
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
Definition: Square.h:14
const BoundSurface & surface() const final
GeometricSearchDet interface.
Definition: fakeMenu.h:6
std::unique_ptr< MeasurementEstimator > RectangularEtaPhiTrackingRegion::estimator ( const ForwardDetLayer layer,
const edm::EventSetup iSetup 
) const
private

Definition at line 201 of file RectangularEtaPhiTrackingRegion.cc.

References funct::abs(), Surface::bounds(), PixelRecoRange< T >::empty(), reco::helper::VirtualJetProducerHelper::intersection(), PixelRecoRange< T >::intersection(), PixelRecoUtilities::longitudinalBendingCorrection(), PixelRecoRange< T >::max(), PixelRecoRange< T >::mean(), PixelRecoRange< T >::min(), trackingPOGFilters_cfi::phiWindow, GeometricSearchDet::position(), ptMin, OuterHitPhiPrediction::setTolerance(), ForwardDetLayer::specificSurface(), funct::sqr(), mathSSE::sqrt(), ForwardDetLayer::surface(), Bounds::thickness(), w2, and PV3DBase< T, PVType, FrameType >::z().

202  {
203  using Algo = HitRCheck;
204  // det dimensions, ranges
205  float halfThickness = 0.5f * layer->surface().bounds().thickness();
206  float zLayer = layer->position().z();
207  Range detZWindow(zLayer - halfThickness, zLayer + halfThickness);
208  Range detRWindow(layer->specificSurface().innerRadius(), layer->specificSurface().outerRadius());
209 
210  // r prediction, skip if not intersection
211  HitRCheck rPrediction(rzConstraint());
212  Range hitRWindow = rPrediction.range(zLayer).intersection(detRWindow);
213  if (hitRWindow.empty())
214  return nullptr;
215 
216  // phi prediction
217  OuterHitPhiPrediction phiPrediction = phiWindow(iSetup);
218  OuterHitPhiPrediction::Range phiRange = phiPrediction(detRWindow.max());
219 
220  //
221  // optional corrections for tolerance (mult.scatt, error, bending)
222  //
223  if (thePrecise) {
224  float cotTheta = (detZWindow.mean() - origin().z()) / hitRWindow.mean();
225  float cosThetaInv = std::sqrt(1 + sqr(cotTheta)) / cotTheta;
226  MultipleScatteringParametrisation msSigma(layer, iSetup);
227  float scatt = 3.f * msSigma(ptMin(), cotTheta);
228  float bendR = longitudinalBendingCorrection(hitRWindow.max(), ptMin(), iSetup);
229  float hitErrRPhi = 0.;
230  float hitErrR = 0.;
231  float corrPhi = (scatt + hitErrRPhi) / detRWindow.min();
232  float corrR = scatt * std::abs(cosThetaInv) + bendR + hitErrR;
233 
234  phiPrediction.setTolerance(corrPhi);
235  rPrediction.setTolerance(HitRCheck::Margin(corrR, corrR));
236 
237  //
238  // hit ranges in det
239  //
240  Range w1, w2;
241  if (zLayer > 0) {
242  w1 = rPrediction.range(detZWindow.min());
243  w2 = rPrediction.range(detZWindow.max());
244  } else {
245  w1 = rPrediction.range(detZWindow.max());
246  w2 = rPrediction.range(detZWindow.min());
247  }
248  hitRWindow = Range(w1.min(), w2.max()).intersection(detRWindow);
249  }
250 
251  return std::make_unique<OuterEstimator<Algo>>(OuterDetCompatibility(layer, phiRange, hitRWindow, detZWindow),
252  OuterHitCompatibility<Algo>(phiPrediction, rPrediction),
253  iSetup);
254 }
void setTolerance(float tolerance)
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
GlobalPoint const & origin() const
const Bounds & bounds() const
Definition: Surface.h:89
PixelRecoRange< float > Range
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
virtual const BoundDisk & specificSurface() const final
double longitudinalBendingCorrection(double radius, double pt, const edm::EventSetup &iSetup)
virtual float thickness() const =0
virtual const Surface::PositionType & position() const
Returns position of the surface.
float ptMin() const
minimal pt of interest
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
Definition: Square.h:14
Definition: fakeMenu.h:6
const Range& RectangularEtaPhiTrackingRegion::etaRange ( ) const
inline

allowed eta range [eta_min, eta_max] interval

Definition at line 166 of file RectangularEtaPhiTrackingRegion.h.

References theEtaRange.

Referenced by FastTSGFromL2Muon::clean(), FastTSGFromIOHit::clean(), and TrackerSeedCleaner::clean().

TrackingRegion::Hits RectangularEtaPhiTrackingRegion::hits ( const edm::EventSetup es,
const SeedingLayerSetsHits::SeedingLayer layer 
) const
overridevirtual

get hits from layer compatible with region constraints

Implements TrackingRegion.

Definition at line 283 of file RectangularEtaPhiTrackingRegion.cc.

References alongMomentum, GeomDetEnumerators::barrel, Plane::build(), utilities::cache(), watchdog::const, funct::cos(), SeedingLayerSetsHits::SeedingLayer::detLayer(), DeadROC_duringRun::dir, GeomDetEnumerators::endcap, f, edm::EventSetup::get(), h, hfClusterShapes_cfi::hits, SeedingLayerSetsHits::SeedingLayer::hits(), GeomDetEnumerators::isBarrel(), GeomDetEnumerators::isEndcap(), GeomDetEnumerators::isTrackerPixel(), GeomDetEnumerators::isTrackerStrip(), DetLayer::location(), LogDebug, eostools::move(), edm::ESHandle< T >::product(), mps_fire::result, makeMuonMisalignmentScenario::rot, funct::sin(), DetLayer::subDetector(), and badGlobalMuonTaggersAOD_cff::vtx.

Referenced by isPrecise().

284  {
286 
287  //ESTIMATOR
288 
289  const DetLayer* detLayer = layer.detLayer();
290 
291  bool measurementMethod = false;
293  measurementMethod = true;
296  measurementMethod = true;
297 
298  if (measurementMethod) {
300  es.get<IdealMagneticFieldRecord>().get(field);
301  const MagneticField* magField = field.product();
302 
303  const GlobalPoint vtx = origin();
305 
306  std::unique_ptr<MeasurementEstimator> est;
309  (!theUseEtaPhi && detLayer->location() == GeomDetEnumerators::barrel)) {
310  const BarrelDetLayer& bl = dynamic_cast<const BarrelDetLayer&>(*detLayer);
311  est = estimator(&bl, es);
312  } else if ((GeomDetEnumerators::isTrackerPixel(detLayer->subDetector()) &&
314  (!theUseEtaPhi && detLayer->location() == GeomDetEnumerators::endcap)) {
315  const ForwardDetLayer& fl = dynamic_cast<const ForwardDetLayer&>(*detLayer);
316  est = estimator(&fl, es);
317  }
318 
319  EtaPhiMeasurementEstimator etaPhiEstimator((theEtaRange.second - theEtaRange.first) * 0.5f,
320  (thePhiMargin.left() + thePhiMargin.right()) * 0.5f);
321  MeasurementEstimator* findDetAndHits = &etaPhiEstimator;
322  if (est) {
323  LogDebug("RectangularEtaPhiTrackingRegion") << "use pixel specific estimator.";
324  findDetAndHits = est.get();
325  } else {
326  LogDebug("RectangularEtaPhiTrackingRegion") << "use generic etat phi estimator.";
327  }
328 
329  // TSOS
330  float phi = phiDirection();
331  // std::cout << "dir " << direction().x()/direction().perp() <<','<< direction().y()/direction().perp() << " " << sin(phi) <<','<<cos(phi)<< std::endl;
332  Surface::RotationType rot(sin(phi), -cos(phi), 0, 0, 0, -1, cos(phi), sin(phi), 0);
333 
334  Plane::PlanePointer surface = Plane::build(GlobalPoint(0., 0., 0.), rot);
335  //TrajectoryStateOnSurface tsos(lpar, *surface, magField);
336 
337  FreeTrajectoryState fts(GlobalTrajectoryParameters(vtx, dir, 1, magField));
338  TrajectoryStateOnSurface tsos(fts, *surface);
339 
340  // propagator
341  StraightLinePropagator prop(magField, alongMomentum);
342 
344 
345  auto hits = lm.recHits(*detLayer, tsos, prop, *findDetAndHits);
346 
347  result.reserve(hits.size());
348  for (auto h : hits) {
349  cache.emplace_back(h);
350  result.emplace_back(h);
351  }
352 
353  LogDebug("RectangularEtaPhiTrackingRegion")
354  << " found " << hits.size() << " minus one measurements on layer: " << detLayer->subDetector();
355  // std::cout << "RectangularEtaPhiTrackingRegion" <<" found "<< meas.size()<<" minus one measurements on layer: "<<detLayer->subDetector() << std::endl;
356 
357  } else {
358  //
359  // temporary solution (actually heavily used for Pixels....)
360  //
361  if (detLayer->location() == GeomDetEnumerators::barrel) {
362  const BarrelDetLayer& bl = dynamic_cast<const BarrelDetLayer&>(*detLayer);
363  auto est = estimator(&bl, es);
364  if (!est)
365  return result;
366  using Algo = HitZCheck;
367  auto const& hitComp = (reinterpret_cast<OuterEstimator<Algo> const&>(*est)).hitCompatibility();
368  auto layerHits = layer.hits();
369  result.reserve(layerHits.size());
370  for (auto&& ih : layerHits) {
371  if (hitComp(*ih))
372  result.emplace_back(std::move(ih));
373  }
374 
375  } else {
376  const ForwardDetLayer& fl = dynamic_cast<const ForwardDetLayer&>(*detLayer);
377  auto est = estimator(&fl, es);
378  if (!est)
379  return result;
380  using Algo = HitRCheck;
381  auto const& hitComp = (reinterpret_cast<OuterEstimator<Algo> const&>(*est)).hitCompatibility();
382  auto layerHits = layer.hits();
383  result.reserve(layerHits.size());
384  for (auto&& ih : layerHits) {
385  if (hitComp(*ih))
386  result.emplace_back(std::move(ih));
387  }
388  }
389  }
390 
391  // std::cout << "RectangularEtaPhiTrackingRegion hits " << result.size() << std::endl;
392 
393  return result;
394 }
#define LogDebug(id)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
GlobalPoint const & origin() const
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
bool isBarrel(GeomDetEnumerators::SubDetector m)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual Location location() const =0
Which part of the detector (barrel, endcap)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const UseMeasurementTracker theMeasurementTrackerUsage
TrackingRegion::Hits hits(const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const override
get hits from layer compatible with region constraints
std::unique_ptr< MeasurementEstimator > estimator(const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
GlobalVector const & direction() const
the direction around which region is constructed
const MeasurementTrackerEvent * theMeasurementTracker
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double f[11][100]
float phiDirection() const
bool isEndcap(GeomDetEnumerators::SubDetector m)
bool isTrackerStrip(GeomDetEnumerators::SubDetector m)
SeedingLayerSetsHits::Hits Hits
const DetLayer * detLayer() const
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
Definition: fakeMenu.h:6
def move(src, dest)
Definition: eostools.py:511
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
void RectangularEtaPhiTrackingRegion::initEtaRange ( const GlobalVector dir,
const Margin margin 
)
private
static UseMeasurementTracker RectangularEtaPhiTrackingRegion::intToUseMeasurementTracker ( int  value)
inlinestatic
bool RectangularEtaPhiTrackingRegion::isPrecise ( ) const
inline

is precise error calculation switched on

Definition at line 174 of file RectangularEtaPhiTrackingRegion.h.

References hits(), and thePrecise.

std::string RectangularEtaPhiTrackingRegion::name ( void  ) const
inlineoverridevirtual
RectangularEtaPhiTrackingRegion& RectangularEtaPhiTrackingRegion::operator= ( RectangularEtaPhiTrackingRegion const &  )
delete
RectangularEtaPhiTrackingRegion& RectangularEtaPhiTrackingRegion::operator= ( RectangularEtaPhiTrackingRegion &&  )
delete
const Margin& RectangularEtaPhiTrackingRegion::phiMargin ( ) const
inline

defined phi range around phi0, margin is [phi_left,phi_right]. region is defined in a range: [phi0-phi_left, phi0+phi_right]

Definition at line 171 of file RectangularEtaPhiTrackingRegion.h.

References thePhiMargin.

Referenced by FastTSGFromL2Muon::clean(), FastTSGFromIOHit::clean(), TrackerSeedCleaner::clean(), and SeedFromConsecutiveHitsCreator::makeSeed().

OuterHitPhiPrediction RectangularEtaPhiTrackingRegion::phiWindow ( const edm::EventSetup iSetup) const
private

Definition at line 256 of file RectangularEtaPhiTrackingRegion.cc.

References PixelRecoUtilities::curvature(), SiStripPI::max, and min().

Referenced by name().

256  {
257  auto phi0 = phiDirection();
258  return OuterHitPhiPrediction(
261  originRBound());
262 }
float originRBound() const
bounds the particle vertex in the transverse plane
T curvature(T InversePt, const edm::EventSetup &iSetup)
T min(T a, T b)
Definition: MathUtil.h:58
float phiDirection() const
Range invPtRange() const
inverse pt range
std::string RectangularEtaPhiTrackingRegion::print ( void  ) const
overridevirtual

Reimplemented from TrackingRegion.

Definition at line 396 of file RectangularEtaPhiTrackingRegion.cc.

References TrackingRegion::print(), and str.

Referenced by name().

396  {
397  std::ostringstream str;
398  str << TrackingRegionBase::print() << " eta: " << theEtaRange << " phi:" << thePhiMargin << "precise: " << thePrecise;
399  return str.str();
400 }
virtual std::string print() const
#define str(s)
HitRZConstraint RectangularEtaPhiTrackingRegion::rzConstraint ( ) const
private

Definition at line 264 of file RectangularEtaPhiTrackingRegion.cc.

References photonAnalyzer_cfi::rMax, photonAnalyzer_cfi::rMin, photonAnalyzer_cfi::zMax, and photonAnalyzer_cfi::zMin.

Referenced by name().

264  {
265  HitRZConstraint::Point pLeft, pRight;
266  float zMin = origin().z() - originZBound();
267  float zMax = origin().z() + originZBound();
268  float rMin = -originRBound();
269  float rMax = originRBound();
270  if (theEtaRange.max() > 0) {
271  pRight = HitRZConstraint::Point(rMin, zMax);
272  } else {
273  pRight = HitRZConstraint::Point(rMax, zMax);
274  }
275  if (theEtaRange.min() > 0.) {
276  pLeft = HitRZConstraint::Point(rMax, zMin);
277  } else {
278  pLeft = HitRZConstraint::Point(rMin, zMin);
279  }
280  return HitRZConstraint(pLeft, theLambdaRange.min(), pRight, theLambdaRange.max());
281 }
float originRBound() const
bounds the particle vertex in the transverse plane
GlobalPoint const & origin() const
T max() const
T min() const
T z() const
Definition: PV3DBase.h:61
float originZBound() const
bounds the particle vertex in the longitudinal plane
SimpleLineRZ::Point Point
RectangularEtaPhiTrackingRegion::UseMeasurementTracker RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker ( const std::string &  name)
static

Definition at line 50 of file RectangularEtaPhiTrackingRegion.cc.

References Exception, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, createJobs::tmp, and HcalDetIdTransform::transform().

Referenced by AreaSeededTrackingRegionsBuilder::AreaSeededTrackingRegionsBuilder(), CandidatePointSeededTrackingRegionsProducer::CandidatePointSeededTrackingRegionsProducer(), CandidateSeededTrackingRegionsProducer::CandidateSeededTrackingRegionsProducer(), doubleToUseMeasurementTracker(), L3MumuTrackingRegion::L3MumuTrackingRegion(), PointSeededTrackingRegionsProducer::PointSeededTrackingRegionsProducer(), TauRegionalPixelSeedGenerator::TauRegionalPixelSeedGenerator(), and TrackingRegionsFromBeamSpotAndL2Tau::TrackingRegionsFromBeamSpotAndL2Tau().

51  {
53  std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower);
54  if (tmp == "never")
56  if (tmp == "forsistrips")
58  if (tmp == "always")
60  throw cms::Exception("Configuration") << "Got invalid string '" << name
61  << "', valid values are 'Never', 'ForSiStrips', 'Always' (case insensitive)";
62 }
tmp
align.sh
Definition: createJobs.py:716
unsigned transform(const HcalDetId &id, unsigned transformCode)
const Range& RectangularEtaPhiTrackingRegion::tanLambdaRange ( ) const
inline

Member Data Documentation

cacheHits RectangularEtaPhiTrackingRegion::cache
mutableprivate

Definition at line 228 of file RectangularEtaPhiTrackingRegion.h.

Range RectangularEtaPhiTrackingRegion::theEtaRange
private

Definition at line 211 of file RectangularEtaPhiTrackingRegion.h.

Referenced by etaRange().

Range RectangularEtaPhiTrackingRegion::theLambdaRange
private

Definition at line 212 of file RectangularEtaPhiTrackingRegion.h.

Referenced by tanLambdaRange().

float RectangularEtaPhiTrackingRegion::theMeanLambda
private

Definition at line 214 of file RectangularEtaPhiTrackingRegion.h.

const MeasurementTrackerEvent* RectangularEtaPhiTrackingRegion::theMeasurementTracker = 0
private

Definition at line 219 of file RectangularEtaPhiTrackingRegion.h.

const UseMeasurementTracker RectangularEtaPhiTrackingRegion::theMeasurementTrackerUsage = UseMeasurementTracker::kNever
private

Definition at line 215 of file RectangularEtaPhiTrackingRegion.h.

Margin RectangularEtaPhiTrackingRegion::thePhiMargin
private

Definition at line 213 of file RectangularEtaPhiTrackingRegion.h.

Referenced by phiMargin().

bool RectangularEtaPhiTrackingRegion::thePrecise = false
private

Definition at line 216 of file RectangularEtaPhiTrackingRegion.h.

Referenced by isPrecise().

bool RectangularEtaPhiTrackingRegion::theUseEtaPhi = false
private

Definition at line 218 of file RectangularEtaPhiTrackingRegion.h.

bool RectangularEtaPhiTrackingRegion::theUseMS = false
private

Definition at line 217 of file RectangularEtaPhiTrackingRegion.h.