CMS 3D CMS Logo

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

#include <BarrelMeasurementEstimator.h>

Inheritance diagram for BarrelMeasurementEstimator:
MeasurementEstimator

Public Member Functions

 BarrelMeasurementEstimator ()
 
 BarrelMeasurementEstimator (float phiMin, float phiMax, float zMin, float zMax)
 
virtual
BarrelMeasurementEstimator
clone () const
 
virtual std::pair< bool, double > estimate (const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const
 
virtual std::pair< bool, double > estimate (const TrajectoryStateOnSurface &ts, const GlobalPoint &gp) const
 
virtual std::pair< bool, double > estimate (const GlobalPoint &vprim, const TrajectoryStateOnSurface &ts, const GlobalPoint &gp) const
 
virtual bool estimate (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
 
MeasurementEstimator::Local2DVector maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
 
void setPhiRange (float dummyphiMin, float dummyphiMax)
 
void setZRange (float zmin, float zmax)
 
- Public Member Functions inherited from MeasurementEstimator
virtual SurfaceReturnType estimate (const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
 
virtual Local2DVector maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
 
float maxSagitta () const
 
 MeasurementEstimator ()
 
 MeasurementEstimator (float maxSag, float minToll, float mpt)
 
float minPt2ForHitRecoveryInGluedDet () const
 
float minTolerance2 () const
 
virtual bool preFilter (const TrajectoryStateOnSurface &, OpaquePayload const &) const
 
virtual ~MeasurementEstimator ()
 

Private Attributes

float thePhiMax
 
float thePhiMin
 
float theZMax
 
float theZMin
 

Additional Inherited Members

- Public Types inherited from MeasurementEstimator
using HitReturnType = std::pair< bool, double >
 
using Local2DVector = Vector2DBase< float, LocalTag >
 
using SurfaceReturnType = bool
 

Detailed Description

Definition at line 31 of file BarrelMeasurementEstimator.h.

Constructor & Destructor Documentation

BarrelMeasurementEstimator::BarrelMeasurementEstimator ( )
inline

Definition at line 35 of file BarrelMeasurementEstimator.h.

Referenced by clone().

36  {}
BarrelMeasurementEstimator::BarrelMeasurementEstimator ( float  phiMin,
float  phiMax,
float  zMin,
float  zMax 
)
inline

Member Function Documentation

virtual BarrelMeasurementEstimator* BarrelMeasurementEstimator::clone ( void  ) const
inlinevirtual

Implements MeasurementEstimator.

Definition at line 52 of file BarrelMeasurementEstimator.h.

References BarrelMeasurementEstimator().

std::pair< bool, double > BarrelMeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const TrackingRecHit hit 
) const
virtual

Returns pair( true, value) if the TrajectoryStateOnSurface is compatible with the RecHit, and pair( false, value) if it is not compatible. The TrajectoryStateOnSurface must be on the same Surface as the RecHit. For an estimator where there is no value computed, e.g. fixed window estimator, only the first(bool) part is of interest.

Implements MeasurementEstimator.

Definition at line 27 of file BarrelMeasurementEstimator.cc.

References TrackingRecHit::det(), TrackingRecHit::localPosition(), GeomDet::surface(), and Surface::toGlobal().

28  {
29  LocalPoint lp = hit.localPosition();
30  GlobalPoint gp = hit.det()->surface().toGlobal( lp);
31  return this->estimate(ts,gp);
32 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
const GeomDet * det() const
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const
virtual LocalPoint localPosition() const =0
std::pair< bool, double > BarrelMeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const GlobalPoint gp 
) const
virtual

Definition at line 35 of file BarrelMeasurementEstimator.cc.

References funct::abs(), TrajectoryStateOnSurface::globalParameters(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), pi, GlobalTrajectoryParameters::position(), thePhiMin, theZMax, theZMin, and PV3DBase< T, PVType, FrameType >::z().

36  {
37 
38  float myZ = gp.z();
39  float myR = gp.perp();
40  float zDiff = ts.globalParameters().position().z() - myZ;
41 
42  float myZmax = theZMax;
43  float myZmin = theZMin;
44 
45  if(std::abs(myZ)<30. && myR>8.) {
46  myZmax = 0.09;
47  myZmin = -0.09;
48  }
49 
50  if( zDiff >= myZmax || zDiff <= myZmin ) return std::pair<bool,double>(false,0.);
51 
52  float tsPhi = ts.globalParameters().position().phi();
53 
54  float rhPhi = gp.phi();
55 
56  float phiDiff = tsPhi - rhPhi;
57  if (phiDiff > pi) phiDiff -= twopi;
58  if (phiDiff < -pi) phiDiff += twopi;
59 
60  if ( phiDiff < thePhiMax && phiDiff > thePhiMin ) {
61 
62  return std::pair<bool,double>(true,1.);
63  } else {
64 
65  return std::pair<bool,double>(false,0.);
66  }
67 }
T perp() const
Definition: PV3DBase.h:72
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const Double_t pi
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const GlobalTrajectoryParameters & globalParameters() const
std::pair< bool, double > BarrelMeasurementEstimator::estimate ( const GlobalPoint vprim,
const TrajectoryStateOnSurface ts,
const GlobalPoint gp 
) const
virtual

Definition at line 71 of file BarrelMeasurementEstimator.cc.

References funct::abs(), PV3DBase< T, PVType, FrameType >::barePhi(), f, TrajectoryStateOnSurface::globalParameters(), normalized_phi(), PV3DBase< T, PVType, FrameType >::perp(), GlobalTrajectoryParameters::position(), and PV3DBase< T, PVType, FrameType >::z().

74  {
75  GlobalVector ts = absolute_ts.globalParameters().position() - vprim ;
76  GlobalVector gp = absolute_gp - vprim ;
77 
78  float myR = gp.perp();
79  float myZ = gp.z();
80  float zDiff = myZ -ts.z() ;
81  float myZmax = theZMax;
82  float myZmin = theZMin;
83  if( (std::abs(myZ)<30.f) & (myR>8.f) )
84  {
85  myZmax = 0.09f;
86  myZmin = -0.09f;
87  }
88 
89 
90  if( zDiff >= myZmax || zDiff <= myZmin ) return std::pair<bool,double>(false,0.);
91 
92  float rhPhi = gp.barePhi() ;
93  float tsPhi = ts.barePhi();
94  float phiDiff = normalized_phi(rhPhi-tsPhi) ;
95 
96  if ( (phiDiff < thePhiMax) & (phiDiff > thePhiMin) )
97  { return std::pair<bool,double>(true,1.) ; }
98  else
99  { return std::pair<bool,double>(false,0.) ; }
100  }
T perp() const
Definition: PV3DBase.h:72
T barePhi() const
Definition: PV3DBase.h:68
RealType normalized_phi(RealType phi)
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
const GlobalTrajectoryParameters & globalParameters() const
bool BarrelMeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const BoundPlane plane 
) const
virtual

Definition at line 103 of file BarrelMeasurementEstimator.cc.

References funct::abs(), edm::false, TrajectoryStateOnSurface::globalParameters(), GlobalTrajectoryParameters::position(), and rangesIntersect().

105  {
106  typedef std::pair<float,float> Range;
107 
108 
109  GlobalPoint trajPos(ts.globalParameters().position());
110 
111  Range trajZRange(trajPos.z() - std::abs(theZMin), trajPos.z() + std::abs(theZMax));
112  Range trajPhiRange(trajPos.phi() - std::abs(thePhiMin), trajPos.phi() + std::abs(thePhiMax));
113 
114  if(rangesIntersect(trajZRange, plane.zSpan()) &&
115  rangesIntersect(trajPhiRange, plane.phiSpan(), PhiLess()))
116  {
117  return true;
118  }
119  else
120  {
121  // cout <<cout<<" barrel boundpl est returns false!!"<<endl;
122  // cout<<"BarrelMeasurementEstimator(estimate) :thePhiMin,thePhiMax, theZMin,theZMax "<<thePhiMin<<" "<<thePhiMax<<" "<< theZMin<<" "<<theZMax<<endl;
123  // cout<<" trajZRange "<<trajZRange.first<<" "<<trajZRange.second<<endl;
124  // cout<<" trajPhiRange "<<trajPhiRange.first<<" "<<trajPhiRange.second<<endl;
125  // cout<<" detZRange "<<detRange.zRange().first<<" "<<detRange.zRange().second<<endl;
126  // cout<<" detPhiRange "<<detRange.phiRange().first<<" "<<detRange.phiRange().second<<endl;
127  // cout<<" intersect z: "<<rangesIntersect(trajZRange, detRange.zRange())<<endl;
128  // cout<<" intersect phi: "<<rangesIntersect(trajPhiRange, detRange.phiRange(), PhiLess())<<endl;
129  return false ;
130  }
131 
132  }
PixelRecoRange< float > Range
bool rangesIntersect(const Range &a, const Range &b)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const GlobalTrajectoryParameters & globalParameters() const
volatile std::atomic< bool > shutdown_flag false
MeasurementEstimator::Local2DVector BarrelMeasurementEstimator::maximalLocalDisplacement ( const TrajectoryStateOnSurface ts,
const BoundPlane plane 
) const

Definition at line 136 of file BarrelMeasurementEstimator.cc.

References TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::localError(), LocalTrajectoryError::positionError(), mathSSE::sqrt(), LocalError::xx(), and LocalError::yy().

138  {
139  float nSigmaCut = 3. ;
140  if ( ts.hasError())
141  {
142  LocalError le = ts.localError().positionError() ;
143  return Local2DVector( std::sqrt(le.xx())*nSigmaCut, std::sqrt(le.yy())*nSigmaCut) ;
144  }
145  else return Local2DVector(99999,99999) ;
146  }
float xx() const
Definition: LocalError.h:24
LocalError positionError() const
float yy() const
Definition: LocalError.h:26
Vector2DBase< float, LocalTag > Local2DVector
T sqrt(T t)
Definition: SSEVec.h:18
const LocalTrajectoryError & localError() const
void BarrelMeasurementEstimator::setPhiRange ( float  dummyphiMin,
float  dummyphiMax 
)
inline

Definition at line 41 of file BarrelMeasurementEstimator.h.

References thePhiMax, and thePhiMin.

void BarrelMeasurementEstimator::setZRange ( float  zmin,
float  zmax 
)
inline

Member Data Documentation

float BarrelMeasurementEstimator::thePhiMax
private

Definition at line 61 of file BarrelMeasurementEstimator.h.

Referenced by setPhiRange().

float BarrelMeasurementEstimator::thePhiMin
private

Definition at line 60 of file BarrelMeasurementEstimator.h.

Referenced by estimate(), and setPhiRange().

float BarrelMeasurementEstimator::theZMax
private

Definition at line 63 of file BarrelMeasurementEstimator.h.

Referenced by estimate(), and setZRange().

float BarrelMeasurementEstimator::theZMin
private

Definition at line 62 of file BarrelMeasurementEstimator.h.

Referenced by estimate(), and setZRange().