CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
RectangularEtaPhiTrackingRegion Class Reference

#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
using ctfHits = ctfseeding::SeedingLayer::Hits
 
typedef
SeedingLayerSetsHits::ConstRecHitPointer 
Hit
 
typedef SeedingLayerSetsHits::Hits Hits
 
typedef PixelRecoRange< float > Range
 

Public Member Functions

virtual 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
 
virtual
RectangularEtaPhiTrackingRegion
clone () const
 
const RangeetaRange () const
 allowed eta range [eta_min, eta_max] interval More...
 
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 More...
 
bool isPrecise () const
 is precise error calculation switched on More...
 
virtual std::string name () const
 
RectangularEtaPhiTrackingRegionoperator= (RectangularEtaPhiTrackingRegion const &)=delete
 
RectangularEtaPhiTrackingRegionoperator= (RectangularEtaPhiTrackingRegion &&)=default
 
const MarginphiMargin () const
 
virtual std::string print () const
 
 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)
 
- 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)
 

Private Types

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

Private Member Functions

HitRZCompatibilitycheckRZOld (const DetLayer *layer, const TrackingRecHit *outerHit, const edm::EventSetup &iSetup) const
 
OuterEstimatorestimator (const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
 
OuterEstimatorestimator (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
 
const UseMeasurementTracker theMeasurementTrackerUsage
 
Margin thePhiMargin
 
bool thePrecise
 
bool theUseEtaPhi
 

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 29 of file RectangularEtaPhiTrackingRegion.h.

Member Typedef Documentation

Definition at line 203 of file RectangularEtaPhiTrackingRegion.h.

Definition at line 204 of file RectangularEtaPhiTrackingRegion.h.

Definition at line 64 of file RectangularEtaPhiTrackingRegion.h.

Member Enumeration Documentation

Enumerator
kNever 
kForSiStrips 
kAlways 

Definition at line 31 of file RectangularEtaPhiTrackingRegion.h.

31  {
32  kNever = -1,
33  kForSiStrips = 0,
34  kAlways = 1
35  };

Constructor & Destructor Documentation

RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( RectangularEtaPhiTrackingRegion const &  rh)
inline

Definition at line 49 of file RectangularEtaPhiTrackingRegion.h.

Referenced by clone().

49  :
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) {}
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 91 of file RectangularEtaPhiTrackingRegion.h.

99  : RectangularEtaPhiTrackingRegion(dir, vertexPos, Range( -1/ptMin, 1/ptMin), rVertex, zVertex,
102  whereToUseMeasurementTracker, precise,
103  measurementTracker, etaPhiRegion)
104  {}
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 112 of file RectangularEtaPhiTrackingRegion.h.

121  : RectangularEtaPhiTrackingRegion(dir, vertexPos, Range( -1/ptMin, 1/ptMin), rVertex, zVertex,
122  etaMargin, phiMargin,
123  whereToUseMeasurementTracker, precise,
124  measurementTracker, etaPhiRegion)
125  {}
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 
)
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 131 of file RectangularEtaPhiTrackingRegion.h.

References initEtaRange().

141  : TrackingRegionBase( dir, vertexPos, invPtRange, rVertex, zVertex),
142  thePhiMargin( phiMargin), theMeasurementTrackerUsage(whereToUseMeasurementTracker), thePrecise(precise),theUseEtaPhi(etaPhiRegion),
143  theMeasurementTracker(measurementTracker)
144  { initEtaRange(dir, etaMargin); }
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

virtual 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
inlinevirtual

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

Implements TrackingRegion.

Definition at line 162 of file RectangularEtaPhiTrackingRegion.h.

References checkRZOld().

167  { return checkRZOld(layer,outerHit->hit(),iSetup); }
HitRZCompatibility * checkRZOld(const DetLayer *layer, const TrackingRecHit *outerHit, const edm::EventSetup &iSetup) const
HitRZCompatibility * RectangularEtaPhiTrackingRegion::checkRZOld ( const DetLayer layer,
const TrackingRecHit outerHit,
const edm::EventSetup iSetup 
) const
private

Definition at line 54 of file RectangularEtaPhiTrackingRegion.cc.

References funct::abs(), GeomDetEnumerators::barrel, SimpleLineRZ::cotLine(), f, TrackingRecHit::geographicalId(), edm::EventSetup::get(), GeomDetEnumerators::isBarrel(), TrackingRecHit::localPosition(), DetLayer::location(), bookConverter::max, min(), SurfaceOrientation::outer, PtMinSelector_cfg::ptMin, funct::sqr(), mathSSE::sqrt(), patCandidatesForDimuonsSequences_cff::tracker, vtxMean(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PixelRecoPointRZ::z(), PV3DBase< T, PVType, FrameType >::z(), and PixelRecoLineRZ::zAtR().

Referenced by checkRZ().

55 {
57  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
58 
59  bool isBarrel = (layer->location() == GeomDetEnumerators::barrel);
60  GlobalPoint ohit = tracker->idToDet(outerHit->geographicalId())->surface().toGlobal(outerHit->localPosition());
61  float outerred_r = sqrt( sqr(ohit.x()-origin().x())+sqr(ohit.y()-origin().y()) );
62  //PixelRecoPointRZ outer(ohit.perp(), ohit.z());
63  PixelRecoPointRZ outer(outerred_r, ohit.z());
64 
65  float zMinOrigin = origin().z() - originZBound();
66  float zMaxOrigin = origin().z() + originZBound();
67 
68  if (!thePrecise) {
69  float vcotMin = (outer.z() > zMaxOrigin) ?
70  (outer.z()-zMaxOrigin)/(outer.r()+originRBound())
71  : (outer.z()-zMaxOrigin)/(outer.r()-originRBound());
72  float vcotMax = (outer.z() > zMinOrigin) ?
73  (outer.z()-zMinOrigin)/(outer.r()-originRBound())
74  : (outer.z()-zMinOrigin)/(outer.r()+originRBound());
75  float cotRight = std::max(vcotMin,theLambdaRange.min());
76  float cotLeft = std::min(vcotMax, theLambdaRange.max());
77  return new HitEtaCheck( isBarrel, outer, cotLeft, cotRight);
78  }
79  float hitZErr = 0.;
80  float hitRErr = 0.;
81 
82  PixelRecoPointRZ outerL, outerR;
83  if (layer->location() == GeomDetEnumerators::barrel) {
84  outerL = PixelRecoPointRZ(outer.r(), outer.z()-hitZErr);
85  outerR = PixelRecoPointRZ(outer.r(), outer.z()+hitZErr);
86  } else if (outer.z() > 0) {
87  outerL = PixelRecoPointRZ(outer.r()+hitRErr, outer.z());
88  outerR = PixelRecoPointRZ(outer.r()-hitRErr, outer.z());
89  } else {
90  outerL = PixelRecoPointRZ(outer.r()-hitRErr, outer.z());
91  outerR = PixelRecoPointRZ(outer.r()+hitRErr, outer.z());
92  }
93  //CHECK
94  MultipleScatteringParametrisation oSigma(layer,iSetup);
95  float cotThetaOuter = theMeanLambda;
96  float sinThetaOuter = 1/std::sqrt(1+sqr(cotThetaOuter));
97  float outerZscatt = 3.f*oSigma(ptMin(),cotThetaOuter) / sinThetaOuter;
98 
99  PixelRecoLineRZ boundL(outerL, theLambdaRange.max());
100  PixelRecoLineRZ boundR(outerR, theLambdaRange.min());
101  float zMinLine = boundL.zAtR(0.)-outerZscatt;
102  float zMaxLine = boundR.zAtR(0.)+outerZscatt;
103  PixelRecoPointRZ vtxL(0.,max(zMinLine, zMinOrigin));
104  PixelRecoPointRZ vtxR(0.,min(zMaxLine, zMaxOrigin));
105  PixelRecoPointRZ vtxMean(0.,(vtxL.z()+vtxR.z())*0.5f);
106  //CHECK
107  MultipleScatteringParametrisation iSigma(layer,iSetup);
108  float innerScatt = 3.f * iSigma(ptMin(),vtxMean, outer);
109 
110  SimpleLineRZ leftLine( vtxL, outerL);
111  SimpleLineRZ rightLine( vtxR, outerR);
112 
113  HitRZConstraint rzConstraint(leftLine, rightLine);
114  float cotTheta = std::abs(leftLine.cotLine()+rightLine.cotLine())*0.5f;
115 
116 // float bendR = longitudinalBendingCorrection(outer.r(),ptMin());
117 
118  // std::cout << "RectangularEtaPhiTrackingRegion " << outer.r()<<','<< outer.z() << " " << innerScatt << " " << cotTheta << " " << hitZErr << std::endl;
119 
120  if (isBarrel) {
121  float sinTheta = 1/std::sqrt(1+sqr(cotTheta));
122  float corrZ = innerScatt/sinTheta + hitZErr;
123  return new HitZCheck(rzConstraint, HitZCheck::Margin(corrZ,corrZ));
124  } else {
125  float cosTheta = 1/std::sqrt(1+sqr(1/cotTheta));
126  float corrR = innerScatt/cosTheta + hitRErr;
127  return new HitRCheck( rzConstraint, HitRCheck::Margin(corrR,corrR));
128  }
129 }
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)
bool isBarrel(GeomDetEnumerators::SubDetector m)
T y() const
Definition: PV3DBase.h:63
T min() const
float zAtR(float r) const
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
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
const T & get() const
Definition: EventSetup.h:55
float ptMin() const
minimal pt of interest
Square< F >::type sqr(const F &f)
Definition: Square.h:13
DetId geographicalId() const
T x() const
Definition: PV3DBase.h:62
virtual LocalPoint localPosition() const =0
virtual RectangularEtaPhiTrackingRegion* RectangularEtaPhiTrackingRegion::clone ( void  ) const
inlinevirtual

Implements TrackingRegion.

Definition at line 169 of file RectangularEtaPhiTrackingRegion.h.

References RectangularEtaPhiTrackingRegion().

169  {
170  return new RectangularEtaPhiTrackingRegion(*this);
171  }
RectangularEtaPhiTrackingRegion(RectangularEtaPhiTrackingRegion const &rh)
static UseMeasurementTracker RectangularEtaPhiTrackingRegion::doubleToUseMeasurementTracker ( double  value)
inlinestatic
OuterEstimator * RectangularEtaPhiTrackingRegion::estimator ( const BarrelDetLayer layer,
const edm::EventSetup iSetup 
) const
private

Definition at line 132 of file RectangularEtaPhiTrackingRegion.cc.

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

133 {
134 
135  // det dimensions
136  float halfLength = 0.5f*layer->surface().bounds().length();
137  float halfThickness = 0.5f*layer->surface().bounds().thickness();
138  float z0 = layer->position().z();
139  float radius = layer->specificSurface().radius();
140 
141  // det ranges
142  Range detRWindow (radius-halfThickness, radius+halfThickness);
143  Range detZWindow(z0-halfLength,z0+halfLength);
144 
145  // z prediction, skip if not intersection
146  HitZCheck zPrediction(rzConstraint());
147  Range hitZWindow = zPrediction.range(detRWindow.min()).
148  intersection(detZWindow);
149  if (hitZWindow.empty()) return 0;
150 
151  // phi prediction
152  OuterHitPhiPrediction phiPrediction = phiWindow(iSetup);
153 
154  //
155  // optional corrections for tolerance (mult.scatt, error, bending)
156  //
158  if (thePrecise) {
159  float cotTheta = (hitZWindow.mean()-origin().z()) / radius;
160  float sinTheta = 1/std::sqrt(1+sqr(cotTheta));
161  MultipleScatteringParametrisation msSigma(layer,iSetup);
162  float scatt = 3.f * msSigma(ptMin(), cotTheta);
163  float bendR = longitudinalBendingCorrection(radius,ptMin(),iSetup);
164 
165  float hitErrRPhi = 0.;
166  float hitErrZ = 0.;
167  float corrPhi = (scatt+ hitErrRPhi)/radius;
168  float corrZ = scatt/sinTheta + bendR*std::abs(cotTheta) + hitErrZ;
169 
170  phiPrediction.setTolerance(OuterHitPhiPrediction::Margin(corrPhi,corrPhi));
171  zPrediction.setTolerance(HitZCheck::Margin(corrZ,corrZ));
172 
173  //
174  // hit ranges in det
175  //
176  OuterHitPhiPrediction::Range phi1 = phiPrediction(detRWindow.min());
177  OuterHitPhiPrediction::Range phi2 = phiPrediction(detRWindow.max());
178  phiRange = Range( std::min(phi1.min(),phi2.min()), std::max(phi1.max(),phi2.max()));
179  Range w1 = zPrediction.range(detRWindow.min());
180  Range w2 = zPrediction.range(detRWindow.max());
181  hitZWindow = Range(std::min(w1.min(),w2.min()), std::max(w1.max(),w2.max())).intersection(detZWindow);
182  }
183  else {
184  phiRange = phiPrediction(detRWindow.mean());
185  }
186 
187  return new OuterEstimator(
188  OuterDetCompatibility( layer, phiRange, detRWindow, hitZWindow),
189  OuterHitCompatibility( phiPrediction, zPrediction ),
190  iSetup);
191 }
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:128
T min() const
virtual float thickness() const =0
PixelRecoRange< float > Range
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
virtual const BoundSurface & surface() const
GeometricSearchDet interface.
double longitudinalBendingCorrection(double radius, double pt, const edm::EventSetup &iSetup)
virtual const Surface::PositionType & position() const
Returns position of the surface.
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
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:13
void setTolerance(const Margin &tolerance)
OuterEstimator * RectangularEtaPhiTrackingRegion::estimator ( const ForwardDetLayer layer,
const edm::EventSetup iSetup 
) const
private

Definition at line 194 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(), GeometricSearchDet::position(), PtMinSelector_cfg::ptMin, OuterHitPhiPrediction::setTolerance(), ForwardDetLayer::specificSurface(), funct::sqr(), mathSSE::sqrt(), ForwardDetLayer::surface(), Bounds::thickness(), w2, and PV3DBase< T, PVType, FrameType >::z().

195 {
196 
197  // det dimensions, ranges
198  float halfThickness = 0.5f*layer->surface().bounds().thickness();
199  float zLayer = layer->position().z() ;
200  Range detZWindow( zLayer-halfThickness, zLayer+halfThickness);
201  Range detRWindow( layer->specificSurface().innerRadius(),
202  layer->specificSurface().outerRadius());
203 
204  // r prediction, skip if not intersection
205  HitRCheck rPrediction(rzConstraint());
206  Range hitRWindow = rPrediction.range(zLayer).intersection(detRWindow);
207  if (hitRWindow.empty()) return 0;
208 
209  // phi prediction
210  OuterHitPhiPrediction phiPrediction = phiWindow(iSetup);
211  OuterHitPhiPrediction::Range phiRange = phiPrediction(detRWindow.max());
212 
213  //
214  // optional corrections for tolerance (mult.scatt, error, bending)
215  //
216  if (thePrecise) {
217  float cotTheta = (detZWindow.mean()-origin().z())/hitRWindow.mean();
218  float cosTheta = cotTheta/std::sqrt(1+sqr(cotTheta));
219  MultipleScatteringParametrisation msSigma(layer,iSetup);
220  float scatt = 3.f * msSigma(ptMin(),cotTheta);
221  float bendR = longitudinalBendingCorrection(hitRWindow.max(),ptMin(),iSetup);
222  float hitErrRPhi = 0.;
223  float hitErrR = 0.;
224  float corrPhi = (scatt+hitErrRPhi)/detRWindow.min();
225  float corrR = scatt/std::abs(cosTheta) + bendR + hitErrR;
226 
227  phiPrediction.setTolerance(OuterHitPhiPrediction::Margin(corrPhi,corrPhi));
228  rPrediction.setTolerance(HitRCheck::Margin(corrR,corrR));
229 
230  //
231  // hit ranges in det
232  //
233  Range w1,w2;
234  if (zLayer > 0) {
235  w1 = rPrediction.range(detZWindow.min());
236  w2 = rPrediction.range(detZWindow.max());
237  } else {
238  w1 = rPrediction.range(detZWindow.max());
239  w2 = rPrediction.range(detZWindow.min());
240  }
241  hitRWindow = Range(w1.min(),w2.max()).intersection(detRWindow);
242  }
243 
244  return new OuterEstimator(
245  OuterDetCompatibility( layer, phiRange, hitRWindow, detZWindow),
246  OuterHitCompatibility( phiPrediction, rPrediction),iSetup );
247 }
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
GlobalPoint const & origin() const
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
const Bounds & bounds() const
Definition: Surface.h:128
virtual float thickness() const =0
PixelRecoRange< float > Range
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
virtual const BoundDisk & specificSurface() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
double longitudinalBendingCorrection(double radius, double pt, const edm::EventSetup &iSetup)
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:13
void setTolerance(const Margin &tolerance)
const Range& RectangularEtaPhiTrackingRegion::etaRange ( ) const
inline
TrackingRegion::Hits RectangularEtaPhiTrackingRegion::hits ( const edm::Event ev,
const edm::EventSetup es,
const SeedingLayerSetsHits::SeedingLayer layer 
) const
overridevirtual

get hits from layer compatible with region constraints

Implements TrackingRegion.

Definition at line 286 of file RectangularEtaPhiTrackingRegion.cc.

References alongMomentum, GeomDetEnumerators::barrel, newFWLiteAna::build, funct::cos(), SeedingLayerSetsHits::SeedingLayer::detLayer(), dir, GeomDetEnumerators::endcap, HLT_25ns14e33_v1_cff::estimator, f, edm::EventSetup::get(), h, OuterEstimator::hitCompatibility(), SeedingLayerSetsHits::SeedingLayer::hits(), DetLayer::location(), LogDebug, eostools::move(), phi, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, edm::ESHandle< class >::product(), LayerMeasurements::recHits(), query::result, makeMuonMisalignmentScenario::rot, funct::sin(), and DetLayer::subDetector().

289  {
291 
292  //ESTIMATOR
293 
294  const DetLayer * detLayer = layer.detLayer();
295  OuterEstimator * est = 0;
296 
297  bool measurementMethod = false;
298  if(theMeasurementTrackerUsage == UseMeasurementTracker::kAlways) measurementMethod = true;
300  !(detLayer->subDetector() == GeomDetEnumerators::PixelBarrel ||
301  detLayer->subDetector() == GeomDetEnumerators::PixelEndcap) ) measurementMethod = true;
302 
303  if(measurementMethod) {
305  es.get<IdealMagneticFieldRecord>().get(field);
306  const MagneticField * magField = field.product();
307 
308  const GlobalPoint vtx = origin();
310 
312  const BarrelDetLayer& bl = dynamic_cast<const BarrelDetLayer&>(*detLayer);
313  est = estimator(&bl,es);
314  } else if (detLayer->subDetector() == GeomDetEnumerators::PixelEndcap || (!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,
321  MeasurementEstimator * findDetAndHits = &etaPhiEstimator;
322  if (est){
323  LogDebug("RectangularEtaPhiTrackingRegion")<<"use pixel specific estimator.";
324  findDetAndHits = est;
325  }
326  else{
327  LogDebug("RectangularEtaPhiTrackingRegion")<<"use generic etat phi estimator.";
328  }
329 
330  // TSOS
331  float phi = phiDirection();
332  // std::cout << "dir " << direction().x()/direction().perp() <<','<< direction().y()/direction().perp() << " " << sin(phi) <<','<<cos(phi)<< std::endl;
333  Surface::RotationType rot( sin(phi), -cos(phi), 0,
334  0, 0, -1,
335  cos(phi), sin(phi), 0);
336 
337  Plane::PlanePointer surface = Plane::build(GlobalPoint(0.,0.,0.), rot);
338  //TrajectoryStateOnSurface tsos(lpar, *surface, magField);
339 
340  FreeTrajectoryState fts( GlobalTrajectoryParameters(vtx, dir, 1, magField) );
341  TrajectoryStateOnSurface tsos(fts, *surface);
342 
343  // propagator
344  StraightLinePropagator prop( magField, alongMomentum);
345 
347 
349  lm.recHits(hits,*detLayer, tsos, prop, *findDetAndHits);
350  /*
351  { // old code
352  vector<TrajectoryMeasurement> meas = lm.measurements(*detLayer, tsos, prop, *findDetAndHits);
353  auto n=0UL;
354  for (auto const & im : meas)
355  if(im.recHit()->isValid()) ++n;
356  assert(n==hits.size());
357  // std::cout << "old/new " << n <<'/'<<hits.size() << std::endl;
358  }
359  */
360 
361  result.reserve(hits.size());
362  for (auto h : hits) {
363  cache.emplace_back(h);
364  result.emplace_back(h);
365  }
366 
367  LogDebug("RectangularEtaPhiTrackingRegion")<<" found "<< hits.size()<<" minus one measurements on layer: "<<detLayer->subDetector();
368  // std::cout << "RectangularEtaPhiTrackingRegion" <<" found "<< meas.size()<<" minus one measurements on layer: "<<detLayer->subDetector() << std::endl;
369 
370  } else {
371  //
372  // temporary solution
373  //
374  if (detLayer->location() == GeomDetEnumerators::barrel) {
375  const BarrelDetLayer& bl = dynamic_cast<const BarrelDetLayer&>(*detLayer);
376  est = estimator(&bl,es);
377  } else {
378  const ForwardDetLayer& fl = dynamic_cast<const ForwardDetLayer&>(*detLayer);
379  est = estimator(&fl,es);
380  }
381  if (!est) return result;
382 
383  auto layerHits = layer.hits();
384  result.reserve(layerHits.size());
385  for (auto && ih : layerHits) {
386  if ( est->hitCompatibility()(*ih) ) {
387  result.emplace_back( std::move(ih) );
388  }
389  }
390  }
391 
392  // std::cout << "RectangularEtaPhiTrackingRegion hits " << result.size() << std::endl;
393  delete est;
394 
395  return result;
396 }
#define LogDebug(id)
OuterEstimator * estimator(const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
GlobalPoint const & origin() const
virtual Location location() const =0
Which part of the detector (barrel, endcap)
const OuterHitCompatibility & hitCompatibility() const
std::vector< BaseTrackerRecHit * > SimpleHitContainer
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
const UseMeasurementTracker theMeasurementTrackerUsage
GlobalVector const & direction() const
the direction around which region is constructed
const MeasurementTrackerEvent * theMeasurementTracker
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
tuple result
Definition: query.py:137
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
def move
Definition: eostools.py:508
double f[11][100]
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
float phiDirection() const
SeedingLayerSetsHits::Hits Hits
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
const DetLayer * detLayer() const
dbl *** dir
Definition: mlp_gen.cc:35
Definition: DDAxes.h:10
void RectangularEtaPhiTrackingRegion::initEtaRange ( const GlobalVector dir,
const Margin margin 
)
private
static UseMeasurementTracker RectangularEtaPhiTrackingRegion::intToUseMeasurementTracker ( int  value)
inlinestatic

Definition at line 37 of file RectangularEtaPhiTrackingRegion.h.

References assert(), and relativeConstraints::value.

Referenced by SeedFilter::SeedFilter().

37  {
38  assert(value >= -1 && value <= 1);
39  return static_cast<UseMeasurementTracker>(value);
40  }
assert(m_qm.get())
bool RectangularEtaPhiTrackingRegion::isPrecise ( ) const
inline

is precise error calculation switched on

Definition at line 155 of file RectangularEtaPhiTrackingRegion.h.

References thePrecise.

virtual std::string RectangularEtaPhiTrackingRegion::name ( void  ) const
inlinevirtual
RectangularEtaPhiTrackingRegion& RectangularEtaPhiTrackingRegion::operator= ( RectangularEtaPhiTrackingRegion const &  )
delete
RectangularEtaPhiTrackingRegion& RectangularEtaPhiTrackingRegion::operator= ( RectangularEtaPhiTrackingRegion &&  )
default
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 152 of file RectangularEtaPhiTrackingRegion.h.

References thePhiMargin.

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

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

Definition at line 252 of file RectangularEtaPhiTrackingRegion.cc.

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

253 {
254  float phi0 = phiDirection();
255  return OuterHitPhiPrediction(
257  phi0+thePhiMargin.right()),
259  curvature(invPtRange().max(),iSetup)),
260  originRBound());
261 }
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
virtual

Reimplemented from TrackingRegion.

Definition at line 398 of file RectangularEtaPhiTrackingRegion.cc.

References TrackingRegion::print().

398  {
399  std::ostringstream str;
400  str << TrackingRegionBase::print()
401  <<" eta: "<<theEtaRange<<" phi:"<<thePhiMargin
402  << "precise: "<<thePrecise;
403  return str.str();
404 }
virtual std::string print() const
HitRZConstraint RectangularEtaPhiTrackingRegion::rzConstraint ( ) const
private

Definition at line 265 of file RectangularEtaPhiTrackingRegion.cc.

References PixelRecoPointRZ::z().

265  {
266  HitRZConstraint::Point pLeft,pRight;
267  float zMin = origin().z() - originZBound();
268  float zMax = origin().z() + originZBound();
269  float rMin = -originRBound();
270  float rMax = originRBound();
271  if(theEtaRange.max() > 0) {
272  pRight = HitRZConstraint::Point(rMin,zMax);
273  } else {
274  pRight = HitRZConstraint::Point(rMax,zMax);
275  }
276  if (theEtaRange.min() > 0.) {
277  pLeft = HitRZConstraint::Point(rMax, zMin);
278  } else {
279  pLeft = HitRZConstraint::Point(rMin, zMin);
280  }
281  return HitRZConstraint(pLeft, theLambdaRange.min(),
282  pRight,theLambdaRange.max()
283  );
284 }
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:64
float originZBound() const
bounds the particle vertex in the longitudinal plane
SimpleLineRZ::Point Point

Member Data Documentation

cacheHits RectangularEtaPhiTrackingRegion::cache
mutableprivate

Definition at line 212 of file RectangularEtaPhiTrackingRegion.h.

Range RectangularEtaPhiTrackingRegion::theEtaRange
private

Definition at line 192 of file RectangularEtaPhiTrackingRegion.h.

Referenced by etaRange().

Range RectangularEtaPhiTrackingRegion::theLambdaRange
private

Definition at line 193 of file RectangularEtaPhiTrackingRegion.h.

float RectangularEtaPhiTrackingRegion::theMeanLambda
private

Definition at line 195 of file RectangularEtaPhiTrackingRegion.h.

const MeasurementTrackerEvent* RectangularEtaPhiTrackingRegion::theMeasurementTracker
private

Definition at line 199 of file RectangularEtaPhiTrackingRegion.h.

const UseMeasurementTracker RectangularEtaPhiTrackingRegion::theMeasurementTrackerUsage
private

Definition at line 196 of file RectangularEtaPhiTrackingRegion.h.

Margin RectangularEtaPhiTrackingRegion::thePhiMargin
private

Definition at line 194 of file RectangularEtaPhiTrackingRegion.h.

Referenced by phiMargin().

bool RectangularEtaPhiTrackingRegion::thePrecise
private

Definition at line 197 of file RectangularEtaPhiTrackingRegion.h.

Referenced by isPrecise().

bool RectangularEtaPhiTrackingRegion::theUseEtaPhi
private

Definition at line 198 of file RectangularEtaPhiTrackingRegion.h.