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

References TrackingRecHit::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
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
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 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 
39  float myZ = gp.z();
40  float myR = gp.perp();
41  float zDiff = ts.globalParameters().position().z() - myZ;
42 
43  float myZmax = theZMax;
44  float myZmin = theZMin;
45 
46  if(std::abs(myZ)<30. && myR>8.) {
47  myZmax = 0.09;
48  myZmin = -0.09;
49  }
50 
51  if( zDiff >= myZmax || zDiff <= myZmin ) return std::pair<bool,double>(false,0.);
52 
53  float tsPhi = ts.globalParameters().position().phi();
54 
55  float rhPhi = gp.phi();
56 
57  float phiDiff = tsPhi - rhPhi;
58  if (phiDiff > pi) phiDiff -= twopi;
59  if (phiDiff < -pi) phiDiff += twopi;
60 
61  if ( phiDiff < thePhiMax && phiDiff > thePhiMin ) {
62 
63  return std::pair<bool,double>(true,1.);
64  } else {
65 
66  return std::pair<bool,double>(false,0.);
67  }
68 }
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 72 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().

75  {
76  GlobalVector ts = absolute_ts.globalParameters().position() - vprim ;
77  GlobalVector gp = absolute_gp - vprim ;
78 
79  float myR = gp.perp();
80  float myZ = gp.z();
81  float zDiff = myZ -ts.z() ;
82  float myZmax = theZMax;
83  float myZmin = theZMin;
84  if(std::abs(myZ)<30. && myR>8.)
85  {
86  myZmax = 0.09;
87  myZmin = -0.09;
88  }
89 
90 
91  if( zDiff >= myZmax || zDiff <= myZmin ) return std::pair<bool,double>(false,0.);
92 
93  float rhPhi = gp.phi() ;
94  float tsPhi = ts.phi();
95  float phiDiff = normalized_phi(rhPhi-tsPhi) ;
96 
97  if ( phiDiff < thePhiMax && phiDiff > thePhiMin )
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().