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 ~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 32 of file BarrelMeasurementEstimator.h.

Constructor & Destructor Documentation

BarrelMeasurementEstimator::BarrelMeasurementEstimator ( )
inline

Definition at line 36 of file BarrelMeasurementEstimator.h.

Referenced by clone().

37  {}
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 53 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 29 of file BarrelMeasurementEstimator.cc.

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

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

Definition at line 37 of file BarrelMeasurementEstimator.cc.

References 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().

38  {
39  float tsPhi = ts.globalParameters().position().phi();
40  float myR = gp.perp();
41  float myZ = gp.z();
42 
43  float myZmax = theZMax;
44  float myZmin = theZMin;
45 
46  if(std::abs(myZ)<30. && myR>8.)
47  {
48  myZmax = 0.09;
49  myZmin = -0.09;
50  }
51 
52  float rhPhi = gp.phi();
53 
54  float zDiff = ts.globalParameters().position().z() - gp.z();
55  float phiDiff = tsPhi - rhPhi;
56  if (phiDiff > pi) phiDiff -= twopi;
57  if (phiDiff < -pi) phiDiff += twopi;
58 
59 
60 
61 
62  if ( phiDiff < thePhiMax && phiDiff > thePhiMin &&
63  zDiff < myZmax && zDiff > myZmin) {
64 
65  return std::pair<bool,double>(true,1.);
66  } else {
67 
68  return std::pair<bool,double>(false,0.);
69  }
70 }
T perp() const
Definition: PV3DBase.h:71
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
#define abs(x)
Definition: mlp_lapack.h:159
T z() const
Definition: PV3DBase.h:63
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 74 of file BarrelMeasurementEstimator.cc.

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

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

Returns true if the TrajectoryStateOnSurface is compatible with the BoundPlane, false otherwise. The TrajectoryStateOnSurface must be on the plane.

Implements MeasurementEstimator.

Definition at line 105 of file BarrelMeasurementEstimator.cc.

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

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

Returns the size of the compatibility region around the local position of the TrajectoryStateOnSurface along the directions of local x and y axis. The TrajectoryStateOnSurface must be on the plane. This method allows to limit the search for compatible detectors or RecHits. The MeasurementEstimator should not return "true" for any RecHit or BoundPlane which is entirely outside of the compatibility region defined by maximalLocalDisplacement().

Reimplemented from MeasurementEstimator.

Definition at line 139 of file BarrelMeasurementEstimator.cc.

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

141  {
142  float nSigmaCut = 3. ;
143  if ( ts.hasError())
144  {
146  return Local2DVector( sqrt(le.xx())*nSigmaCut, sqrt(le.yy())*nSigmaCut) ;
147  }
148  else return Local2DVector(99999,99999) ;
149  }
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:46
const LocalTrajectoryError & localError() const
void BarrelMeasurementEstimator::setPhiRange ( float  dummyphiMin,
float  dummyphiMax 
)
inline

Definition at line 42 of file BarrelMeasurementEstimator.h.

References thePhiMax, and thePhiMin.

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

Definition at line 44 of file BarrelMeasurementEstimator.h.

References theZMax, and theZMin.

Member Data Documentation

float BarrelMeasurementEstimator::thePhiMax
private

Definition at line 62 of file BarrelMeasurementEstimator.h.

Referenced by setPhiRange().

float BarrelMeasurementEstimator::thePhiMin
private

Definition at line 61 of file BarrelMeasurementEstimator.h.

Referenced by estimate(), and setPhiRange().

float BarrelMeasurementEstimator::theZMax
private

Definition at line 64 of file BarrelMeasurementEstimator.h.

Referenced by estimate(), and setZRange().

float BarrelMeasurementEstimator::theZMin
private

Definition at line 63 of file BarrelMeasurementEstimator.h.

Referenced by estimate(), and setZRange().