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 TransientTrackingRecHit &hit) const
 
virtual std::pair< bool, double > estimate (const TrajectoryStateOnSurface &ts, GlobalPoint &gp) const
 
virtual std::pair< bool, double > estimate (const GlobalPoint &vprim, const TrajectoryStateOnSurface &ts, 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
 
virtual ~MeasurementEstimator ()
 

Private Attributes

float thePhiMax
 
float thePhiMin
 
float theZMax
 
float theZMin
 

Additional Inherited Members

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

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 TransientTrackingRecHit 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 28 of file BarrelMeasurementEstimator.cc.

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

29  {
30  LocalPoint lp = hit.localPosition();
31  GlobalPoint gp = hit.det()->surface().toGlobal( lp);
32  return this->estimate(ts,gp);
33 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
virtual const GeomDet * det() const =0
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const
virtual LocalPoint localPosition() const =0
std::pair< bool, double > BarrelMeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
GlobalPoint gp 
) const
virtual

Definition at line 36 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().

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

Definition at line 73 of file BarrelMeasurementEstimator.cc.

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

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

Definition at line 104 of file BarrelMeasurementEstimator.cc.

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

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

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

140  {
141  float nSigmaCut = 3. ;
142  if ( ts.hasError())
143  {
145  return Local2DVector( sqrt(le.xx())*nSigmaCut, sqrt(le.yy())*nSigmaCut) ;
146  }
147  else return Local2DVector(99999,99999) ;
148  }
float xx() const
Definition: LocalError.h:24
Vector2DBase< float, LocalTag > Local2DVector
LocalError positionError() const
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:48
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().