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 | Private Member Functions | Private Attributes
RectangularEtaPhiTrackingRegion Class Reference

#include <RectangularEtaPhiTrackingRegion.h>

Inheritance diagram for RectangularEtaPhiTrackingRegion:
TrackingRegionBase TrackingRegion

Public Types

typedef
TkTrackingRegionsMargin< float > 
Margin
 
- Public Types inherited from TrackingRegion
typedef
TransientTrackingRecHit::ConstRecHitPointer 
Hit
 
typedef std::vector< HitHits
 
typedef PixelRecoRange< float > Range
 

Public Member Functions

virtual HitRZCompatibilitycheckRZ (const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup) const
 
virtual
RectangularEtaPhiTrackingRegion
clone () const
 clone region More...
 
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 ctfseeding::SeedingLayer *layer) const
 get hits from layer compatible with region constraints More...
 
bool isPrecise () const
 is precise error calculation switched on More...
 
virtual std::string name () const
 
const MarginphiMargin () const
 
virtual std::string print () const
 
 RectangularEtaPhiTrackingRegion ()
 dummy constructor More...
 
 RectangularEtaPhiTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, float whereToUseMeasurementTracker=0., bool precise=true, const std::string &measurementTrackerName="", bool etaPhiRegion=false)
 
 RectangularEtaPhiTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, Margin etaMargin, Margin phiMargin, float whereToUseMeasurementTracker=0., bool precise=true, const std::string &measurementTrackerName="", bool etaPhiRegion=false)
 
 RectangularEtaPhiTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, Range invPtRange, float rVertex, float zVertex, Margin etaMargin, Margin phiMargin, float whereToUseMeasurementTracker=0., bool precise=true, const std::string &measurementTrackerName="", bool etaPhiRegion=false)
 
- Public Member Functions inherited from TrackingRegionBase
virtual GlobalVector direction () const
 the direction around which region is constructed More...
 
virtual Range invPtRange () const
 inverse pt range More...
 
virtual GlobalPoint origin () const
 
virtual float originRBound () const
 bounds the particle vertex in the transverse plane More...
 
virtual float originZBound () const
 bounds the particle vertex in the longitudinal plane More...
 
virtual float ptMin () const
 minimal pt of interest More...
 
virtual TrackingRegionBaserestrictedRegion (const GlobalPoint &originPos, const float &originRBound, const float &originZBound) const
 clone region with new vertex position More...
 
virtual void setDirection (const GlobalVector &dir)
 
 TrackingRegionBase (const GlobalVector &direction, const GlobalPoint &originPos, const Range &invPtRange, const float &originRBound, const float &originZBound)
 
 TrackingRegionBase ()
 
virtual ~TrackingRegionBase ()
 
- Public Member Functions inherited from TrackingRegion
virtual ~TrackingRegion ()
 

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

Range theEtaRange
 
std::string theMeasurementTrackerName
 
double 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 21 of file RectangularEtaPhiTrackingRegion.h.

Member Typedef Documentation

Definition at line 24 of file RectangularEtaPhiTrackingRegion.h.

Constructor & Destructor Documentation

RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( )
inline

dummy constructor

Definition at line 27 of file RectangularEtaPhiTrackingRegion.h.

Referenced by clone().

27 { }
RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
float  ptMin,
float  rVertex,
float  zVertex,
float  deltaEta,
float  deltaPhi,
float  whereToUseMeasurementTracker = 0.,
bool  precise = true,
const std::string &  measurementTrackerName = "",
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 54 of file RectangularEtaPhiTrackingRegion.h.

References initEtaRange().

62  : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin),
63  rVertex, zVertex),
64  thePhiMargin( Margin( fabs(deltaPhi),fabs(deltaPhi))),
66  theUseEtaPhi(etaPhiRegion)
67  { initEtaRange(dir, Margin( fabs(deltaEta),fabs(deltaEta))); }
void initEtaRange(const GlobalVector &dir, const Margin &margin)
PixelRecoRange< float > Range
virtual float ptMin() const
minimal pt of interest
TkTrackingRegionsMargin< float > Margin
RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
float  ptMin,
float  rVertex,
float  zVertex,
Margin  etaMargin,
Margin  phiMargin,
float  whereToUseMeasurementTracker = 0.,
bool  precise = true,
const std::string &  measurementTrackerName = "",
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 75 of file RectangularEtaPhiTrackingRegion.h.

References initEtaRange().

84  : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin),
85  rVertex, zVertex), thePhiMargin( phiMargin), theMeasurementTrackerUsage(whereToUseMeasurementTracker), thePrecise(precise),
87  theUseEtaPhi(etaPhiRegion)
88  { initEtaRange(dir, etaMargin); }
void initEtaRange(const GlobalVector &dir, const Margin &margin)
PixelRecoRange< float > Range
virtual float ptMin() const
minimal pt of interest
RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
Range  invPtRange,
float  rVertex,
float  zVertex,
Margin  etaMargin,
Margin  phiMargin,
float  whereToUseMeasurementTracker = 0.,
bool  precise = true,
const std::string &  measurementTrackerName = "",
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 94 of file RectangularEtaPhiTrackingRegion.h.

References initEtaRange().

104  : TrackingRegionBase( dir, vertexPos, invPtRange, rVertex, zVertex),
105  thePhiMargin( phiMargin), theMeasurementTrackerUsage(whereToUseMeasurementTracker), thePrecise(precise),
107  theUseEtaPhi(etaPhiRegion)
108  { initEtaRange(dir, etaMargin); }
virtual Range invPtRange() const
inverse pt range
void initEtaRange(const GlobalVector &dir, const Margin &margin)

Member Function Documentation

virtual HitRZCompatibility* RectangularEtaPhiTrackingRegion::checkRZ ( const DetLayer layer,
const Hit outerHit,
const edm::EventSetup iSetup 
) const
inlinevirtual

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

Implements TrackingRegionBase.

Definition at line 126 of file RectangularEtaPhiTrackingRegion.h.

References checkRZOld().

129  { 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 49 of file RectangularEtaPhiTrackingRegion.cc.

References GeomDetEnumerators::barrel, PixelRecoLineRZ::cotLine(), TrackingRecHit::geographicalId(), edm::EventSetup::get(), TrackingRecHit::localPosition(), DetLayer::location(), 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().

50 {
52  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
53 
54  bool isBarrel = (layer->location() == GeomDetEnumerators::barrel);
55  GlobalPoint ohit = tracker->idToDet(outerHit->geographicalId())->surface().toGlobal(outerHit->localPosition());
56  float outerred_r = sqrt( sqr(ohit.x()-origin().x())+sqr(ohit.y()-origin().y()) );
57  //PixelRecoPointRZ outer(ohit.perp(), ohit.z());
58  PixelRecoPointRZ outer(outerred_r, ohit.z());
59 
60  float zMinOrigin = origin().z() - originZBound();
61  float zMaxOrigin = origin().z() + originZBound();
62 
63  if (!thePrecise) {
64  double vcotMin = (outer.z() > zMaxOrigin) ?
65  (outer.z()-zMaxOrigin)/(outer.r()+originRBound())
66  : (outer.z()-zMaxOrigin)/(outer.r()-originRBound());
67  double vcotMax = (outer.z() > zMinOrigin) ?
68  (outer.z()-zMinOrigin)/(outer.r()-originRBound())
69  : (outer.z()-zMinOrigin)/(outer.r()+originRBound());
70  float cotRight = max(vcotMin,(double) sinh(theEtaRange.min()));
71  float cotLeft = min(vcotMax, (double) sinh(theEtaRange.max()));
72  return new HitEtaCheck( isBarrel, outer, cotLeft, cotRight);
73  }
74  float hitZErr = 0.;
75  float hitRErr = 0.;
76 
77  PixelRecoPointRZ outerL, outerR;
78  if (layer->location() == GeomDetEnumerators::barrel) {
79  outerL = PixelRecoPointRZ(outer.r(), outer.z()-hitZErr);
80  outerR = PixelRecoPointRZ(outer.r(), outer.z()+hitZErr);
81  } else if (outer.z() > 0) {
82  outerL = PixelRecoPointRZ(outer.r()+hitRErr, outer.z());
83  outerR = PixelRecoPointRZ(outer.r()-hitRErr, outer.z());
84  } else {
85  outerL = PixelRecoPointRZ(outer.r()-hitRErr, outer.z());
86  outerR = PixelRecoPointRZ(outer.r()+hitRErr, outer.z());
87  }
88  //CHECK
89  MultipleScatteringParametrisation oSigma(layer,iSetup);
90  float cotThetaOuter = sinh(theEtaRange.mean());
91  float sinThetaOuter = 1/sqrt(1+sqr(cotThetaOuter));
92  float outerZscatt = 3*oSigma(ptMin(),cotThetaOuter) / sinThetaOuter;
93 
94  PixelRecoLineRZ boundL(outerL, sinh(theEtaRange.max()));
95  PixelRecoLineRZ boundR(outerR, sinh(theEtaRange.min()));
96  float zMinLine = boundL.zAtR(0.)-outerZscatt;
97  float zMaxLine = boundR.zAtR(0.)+outerZscatt;
98  PixelRecoPointRZ vtxL(0.,max(zMinLine, zMinOrigin));
99  PixelRecoPointRZ vtxR(0.,min(zMaxLine, zMaxOrigin));
100  PixelRecoPointRZ vtxMean(0.,(vtxL.z()+vtxR.z())/2.);
101  //CHECK
102  MultipleScatteringParametrisation iSigma(layer,iSetup);
103  float innerScatt = 3 * iSigma(ptMin(),vtxMean, outer);
104 
105  PixelRecoLineRZ leftLine( vtxL, outerL);
106  PixelRecoLineRZ rightLine( vtxR, outerR);
107 
108  HitRZConstraint rzConstraint(leftLine, rightLine);
109  float cotTheta = fabs(leftLine.cotLine()+rightLine.cotLine())/2;
110 
111 // float bendR = longitudinalBendingCorrection(outer.r(),ptMin());
112 
113  if (isBarrel) {
114  float sinTheta = 1/sqrt(1+sqr(cotTheta));
115  float corrZ = innerScatt/sinTheta + hitZErr;
116  return new HitZCheck(rzConstraint, HitZCheck::Margin(corrZ,corrZ));
117  } else {
118  float cosTheta = 1/sqrt(1+sqr(1/cotTheta));
119  float corrR = innerScatt/cosTheta + hitRErr;
120  return new HitRCheck( rzConstraint, HitRCheck::Margin(corrR,corrR));
121  }
122 }
T max() const
virtual Location location() const =0
Which part of the detector (barrel, endcap)
virtual GlobalPoint origin() const
T y() const
Definition: PV3DBase.h:62
#define min(a, b)
Definition: mlp_lapack.h:161
T min() const
const T & max(const T &a, const T &b)
virtual float ptMin() const
minimal pt of interest
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
static GlobalPoint vtxMean(const GlobalPoint &p1, const GlobalError &e1, const GlobalPoint &p2, const GlobalError &e2)
T mean() const
const T & get() const
Definition: EventSetup.h:55
Square< F >::type sqr(const F &f)
Definition: Square.h:13
DetId geographicalId() const
T x() const
Definition: PV3DBase.h:61
virtual LocalPoint localPosition() const =0
virtual float originZBound() const
bounds the particle vertex in the longitudinal plane
virtual float originRBound() const
bounds the particle vertex in the transverse plane
virtual RectangularEtaPhiTrackingRegion* RectangularEtaPhiTrackingRegion::clone ( ) const
inlinevirtual

clone region

Implements TrackingRegionBase.

Definition at line 131 of file RectangularEtaPhiTrackingRegion.h.

References RectangularEtaPhiTrackingRegion().

131  {
132  return new RectangularEtaPhiTrackingRegion(*this);
133  }
OuterEstimator * RectangularEtaPhiTrackingRegion::estimator ( const BarrelDetLayer layer,
const edm::EventSetup iSetup 
) const
private

Definition at line 125 of file RectangularEtaPhiTrackingRegion.cc.

References BoundSurface::bounds(), PixelRecoRange< T >::empty(), reco::helper::VirtualJetProducerHelper::intersection(), PixelRecoRange< T >::intersection(), Bounds::length(), PixelRecoUtilities::longitudinalBendingCorrection(), max(), PixelRecoRange< T >::max(), PixelRecoRange< T >::mean(), PixelRecoRange< T >::min(), min, GeometricSearchDet::position(), PtMinSelector_cfg::ptMin, Cylinder::radius(), 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().

126 {
127 
128  // det dimensions
129  float halfLength = layer->surface().bounds().length()/2;
130  float halfThickness = layer->surface().bounds().thickness()/2;
131  float z0 = layer->position().z();
132  float radius = layer->specificSurface().radius();
133 
134  // det ranges
135  Range detRWindow (radius-halfThickness, radius+halfThickness);
136  Range detZWindow(z0-halfLength,z0+halfLength);
137 
138  // z prediction, skip if not intersection
139  HitZCheck zPrediction(rzConstraint());
140  Range hitZWindow = zPrediction.range(detRWindow.min()).
141  intersection(detZWindow);
142  if (hitZWindow.empty()) return 0;
143 
144  // phi prediction
145  OuterHitPhiPrediction phiPrediction = phiWindow(iSetup);
146 
147  //
148  // optional corrections for tolerance (mult.scatt, error, bending)
149  //
151  if (thePrecise) {
152  float cotTheta = (hitZWindow.mean()-origin().z()) / radius;
153  float sinTheta = 1/sqrt(1+sqr(cotTheta));
154  MultipleScatteringParametrisation msSigma(layer,iSetup);
155  float scatt = 3 * msSigma(ptMin(), cotTheta);
156  float bendR = longitudinalBendingCorrection(radius,ptMin(),iSetup);
157 
158  float hitErrRPhi = 0.;
159  float hitErrZ = 0.;
160  float corrPhi = (scatt+ hitErrRPhi)/radius;
161  float corrZ = scatt/sinTheta + bendR*fabs(cotTheta) + hitErrZ;
162 
163  phiPrediction.setTolerance(OuterHitPhiPrediction::Margin(corrPhi,corrPhi));
164  zPrediction.setTolerance(HitZCheck::Margin(corrZ,corrZ));
165 
166  //
167  // hit ranges in det
168  //
169  OuterHitPhiPrediction::Range phi1 = phiPrediction(detRWindow.min());
170  OuterHitPhiPrediction::Range phi2 = phiPrediction(detRWindow.max());
171  phiRange = Range( min(phi1.min(),phi2.min()), max(phi1.max(),phi2.max()));
172  Range w1 = zPrediction.range(detRWindow.min());
173  Range w2 = zPrediction.range(detRWindow.max());
174  hitZWindow = Range(
175  min(w1.min(),w2.min()), max(w1.max(),w2.max())).intersection(detZWindow);
176  }
177  else {
178  phiRange = phiPrediction(detRWindow.mean());
179  }
180 
181  return new OuterEstimator(
182  OuterDetCompatibility( layer, phiRange, detRWindow, hitZWindow),
183  OuterHitCompatibility( phiPrediction, zPrediction ),
184  iSetup);
185 }
virtual float length() const =0
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
T max() const
virtual GlobalPoint origin() const
#define min(a, b)
Definition: mlp_lapack.h:161
T min() const
virtual float thickness() const =0
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:55
const T & max(const T &a, const T &b)
PixelRecoRange< float > Range
virtual float ptMin() const
minimal pt of interest
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
const Bounds & bounds() const
Definition: BoundSurface.h:89
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.
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 188 of file RectangularEtaPhiTrackingRegion.cc.

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

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

get hits from layer compatible with region constraints

Implements TrackingRegion.

Definition at line 280 of file RectangularEtaPhiTrackingRegion.cc.

References alongMomentum, GeomDetEnumerators::barrel, Plane::build(), funct::cos(), ctfseeding::SeedingLayer::detLayer(), dir, GeomDetEnumerators::endcap, edm::EventSetup::get(), OuterEstimator::hitCompatibility(), ctfseeding::SeedingLayer::hits(), DetLayer::location(), LogDebug, LayerMeasurements::measurements(), MeasurementTrackerESProducer_cfi::MeasurementTracker, phi, PV3DBase< T, PVType, FrameType >::phi(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, edm::ESHandle< class >::product(), query::result, makeMuonMisalignmentScenario::rot, funct::sin(), and DetLayer::subDetector().

284 {
285 
286 
287  //ESTIMATOR
289 
290  const DetLayer * detLayer = layer->detLayer();
291  OuterEstimator * est = 0;
292 
293  bool measurementMethod = false;
294  if ( theMeasurementTrackerUsage > 0.5) measurementMethod = true;
295  if ( theMeasurementTrackerUsage > -0.5 &&
296  !(detLayer->subDetector() == GeomDetEnumerators::PixelBarrel ||
297  detLayer->subDetector() == GeomDetEnumerators::PixelEndcap) ) measurementMethod = true;
298 
299  if(measurementMethod) {
301  es.get<IdealMagneticFieldRecord>().get(field);
302  const MagneticField * magField = field.product();
303 
304  const GlobalPoint vtx = origin();
306 
308  const BarrelDetLayer& bl = dynamic_cast<const BarrelDetLayer&>(*detLayer);
309  est = estimator(&bl,es);
310  } else if (detLayer->subDetector() == GeomDetEnumerators::PixelEndcap || (!theUseEtaPhi && detLayer->location() == GeomDetEnumerators::endcap)) {
311  const ForwardDetLayer& fl = dynamic_cast<const ForwardDetLayer&>(*detLayer);
312  est = estimator(&fl,es);
313  }
314 
315  EtaPhiMeasurementEstimator etaPhiEstimator ((theEtaRange.second-theEtaRange.first)/2.,
317  MeasurementEstimator & findDetAndHits = etaPhiEstimator;
318  if (est){
319  LogDebug("RectangularEtaPhiTrackingRegion")<<"use pixel specific estimator.";
320  findDetAndHits =*est;
321  }
322  else{
323  LogDebug("RectangularEtaPhiTrackingRegion")<<"use generic etat phi estimator.";
324  }
325 
326  // TSOS
327  float phi = dir.phi();
328  Surface::RotationType rot( sin(phi), -cos(phi), 0,
329  0, 0, -1,
330  cos(phi), sin(phi), 0);
331 
332  Plane::PlanePointer surface = Plane::build(GlobalPoint(0.,0.,0.), rot);
333  //TrajectoryStateOnSurface tsos(lpar, *surface, magField);
334 
335  FreeTrajectoryState fts( GlobalTrajectoryParameters(vtx, dir, 1, magField) );
336  TrajectoryStateOnSurface tsos(fts, *surface);
337 
338  // propagator
339  StraightLinePropagator prop( magField, alongMomentum);
340 
341  edm::ESHandle<MeasurementTracker> measurementTrackerESH;
342  es.get<CkfComponentsRecord>().get(theMeasurementTrackerName, measurementTrackerESH);
343  const MeasurementTracker * measurementTracker = measurementTrackerESH.product();
344  measurementTracker->update(ev);
345 
346  LayerMeasurements lm(measurementTracker);
347 
348  vector<TrajectoryMeasurement> meas = lm.measurements(*detLayer, tsos, prop, findDetAndHits);
349  typedef vector<TrajectoryMeasurement>::const_iterator IM;
350  for (IM im = meas.begin(); im != meas.end(); im++) {
351  TrajectoryMeasurement::ConstRecHitPointer ptrHit = im->recHit();
352  if (ptrHit->isValid()) result.push_back( ptrHit );
353  }
354 
355  LogDebug("RectangularEtaPhiTrackingRegion")<<" found "<< meas.size()<<" minus one measurements on layer: "<<detLayer->subDetector();
356 
357  } else {
358  //
359  // temporary solution
360  //
361  if (detLayer->location() == GeomDetEnumerators::barrel) {
362  const BarrelDetLayer& bl = dynamic_cast<const BarrelDetLayer&>(*detLayer);
363  est = estimator(&bl,es);
364  } else {
365  const ForwardDetLayer& fl = dynamic_cast<const ForwardDetLayer&>(*detLayer);
366  est = estimator(&fl,es);
367  }
368  if (!est) return result;
369 
370  TrackingRegion::Hits layerHits = layer->hits(ev,es);
371  for (TrackingRegion::Hits::const_iterator ih= layerHits.begin(); ih != layerHits.end(); ih++) {
372  if ( est->hitCompatibility()(ih->get()) ) {
373  result.push_back( *ih );
374  }
375  }
376  }
377 
378  delete est;
379  return result;
380 }
#define LogDebug(id)
OuterEstimator * estimator(const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
virtual Location location() const =0
Which part of the detector (barrel, endcap)
const OuterHitCompatibility & hitCompatibility() const
const DetLayer * detLayer() const
Definition: SeedingLayer.cc:80
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual GlobalPoint origin() const
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
virtual GlobalVector direction() const
the direction around which region is constructed
static PlanePointer build(const PositionType &pos, const RotationType &rot, MediumProperties *mp=0)
Definition: Plane.h:25
tuple result
Definition: query.py:137
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void hits(const edm::Event &ev, const edm::EventSetup &es, Hits &) const
std::vector< Hit > Hits
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
dbl *** dir
Definition: mlp_gen.cc:35
Definition: DDAxes.h:10
void RectangularEtaPhiTrackingRegion::initEtaRange ( const GlobalVector dir,
const Margin margin 
)
private

Definition at line 42 of file RectangularEtaPhiTrackingRegion.cc.

References PV3DBase< T, PVType, FrameType >::eta(), eta(), TkTrackingRegionsMargin< T >::left(), and TkTrackingRegionsMargin< T >::right().

Referenced by RectangularEtaPhiTrackingRegion().

43 {
44  float eta = dir.eta();
45  theEtaRange = Range(eta-margin.left(), eta+margin.right());
46 }
T eta() const
PixelRecoRange< float > Range
Double_t margin
T eta() const
Definition: PV3DBase.h:75
bool RectangularEtaPhiTrackingRegion::isPrecise ( ) const
inline

is precise error calculation switched on

Definition at line 119 of file RectangularEtaPhiTrackingRegion.h.

References thePrecise.

virtual std::string RectangularEtaPhiTrackingRegion::name ( void  ) const
inlinevirtual

Reimplemented from TrackingRegion.

Definition at line 135 of file RectangularEtaPhiTrackingRegion.h.

135 { return "RectangularEtaPhiTrackingRegion"; }
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 116 of file RectangularEtaPhiTrackingRegion.h.

References thePhiMargin.

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

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

Definition at line 246 of file RectangularEtaPhiTrackingRegion.cc.

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

247 {
248  float phi0 = direction().phi();
249  return OuterHitPhiPrediction(
251  phi0+thePhiMargin.left()),
253  curvature(invPtRange().max(),iSetup)),
254  originRBound());
255 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
virtual GlobalVector direction() const
the direction around which region is constructed
#define min(a, b)
Definition: mlp_lapack.h:161
virtual Range invPtRange() const
inverse pt range
T curvature(T InversePt, const edm::EventSetup &iSetup)
const T & max(const T &a, const T &b)
virtual float originRBound() const
bounds the particle vertex in the transverse plane
std::string RectangularEtaPhiTrackingRegion::print ( void  ) const
virtual

Reimplemented from TrackingRegionBase.

Definition at line 382 of file RectangularEtaPhiTrackingRegion.cc.

References TrackingRegionBase::print().

382  {
383  std::ostringstream str;
384  str << TrackingRegionBase::print()
385  <<" eta: "<<theEtaRange<<" phi:"<<thePhiMargin
386  << "precise: "<<thePrecise;
387  return str.str();
388 }
virtual std::string print() const
HitRZConstraint RectangularEtaPhiTrackingRegion::rzConstraint ( ) const
private

Definition at line 259 of file RectangularEtaPhiTrackingRegion.cc.

References PixelRecoPointRZ::z().

260 {
261  HitRZConstraint::LineOrigin pLeft,pRight;
262  float zMin = origin().z() - originZBound();
263  float zMax = origin().z() + originZBound();
264  float rMin = -originRBound();
265  float rMax = originRBound();
266  if(theEtaRange.max() > 0) {
267  pRight = HitRZConstraint::LineOrigin(rMin,zMax);
268  } else {
269  pRight = HitRZConstraint::LineOrigin(rMax,zMax);
270  }
271  if (theEtaRange.min() > 0.) {
272  pLeft = HitRZConstraint::LineOrigin(rMax, zMin);
273  } else {
274  pLeft = HitRZConstraint::LineOrigin(rMin, zMin);
275  }
276  return HitRZConstraint(pLeft, sinh(theEtaRange.min()),
277  pRight, sinh(theEtaRange.max()) );
278 }
T max() const
virtual GlobalPoint origin() const
PixelRecoLineRZ::LineOrigin LineOrigin
T min() const
T z() const
Definition: PV3DBase.h:63
virtual float originZBound() const
bounds the particle vertex in the longitudinal plane
virtual float originRBound() const
bounds the particle vertex in the transverse plane

Member Data Documentation

Range RectangularEtaPhiTrackingRegion::theEtaRange
private

Definition at line 154 of file RectangularEtaPhiTrackingRegion.h.

Referenced by etaRange().

std::string RectangularEtaPhiTrackingRegion::theMeasurementTrackerName
private

Definition at line 158 of file RectangularEtaPhiTrackingRegion.h.

double RectangularEtaPhiTrackingRegion::theMeasurementTrackerUsage
private

Definition at line 156 of file RectangularEtaPhiTrackingRegion.h.

Margin RectangularEtaPhiTrackingRegion::thePhiMargin
private

Definition at line 155 of file RectangularEtaPhiTrackingRegion.h.

Referenced by phiMargin().

bool RectangularEtaPhiTrackingRegion::thePrecise
private

Definition at line 157 of file RectangularEtaPhiTrackingRegion.h.

Referenced by isPrecise().

bool RectangularEtaPhiTrackingRegion::theUseEtaPhi
private

Definition at line 159 of file RectangularEtaPhiTrackingRegion.h.