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
ConversionBarrelEstimator Class Reference

#include <ConversionBarrelEstimator.h>

Inheritance diagram for ConversionBarrelEstimator:
MeasurementEstimator

Public Member Functions

virtual ConversionBarrelEstimatorclone () const
 
 ConversionBarrelEstimator ()
 
 ConversionBarrelEstimator (float phiRangeMin, float phiRangeMax, float zRangeMin, float zRangeMax, double nSigma=3.)
 
virtual std::pair< bool, double > estimate (const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const
 
virtual bool estimate (const TrajectoryStateOnSurface &ts, const Plane &plane) const
 
virtual Local2DVector maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const Plane &plane) const
 
double nSigmaCut () const
 
- Public Member Functions inherited from MeasurementEstimator
virtual bool preFilter (const TrajectoryStateOnSurface &, OpaquePayload const &) const
 
virtual ~MeasurementEstimator ()
 

Private Attributes

double theNSigma
 
float thePhiRangeMax
 
float thePhiRangeMin
 
float theZRangeMax
 
float theZRangeMin
 

Additional Inherited Members

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

Detailed Description

Defines the search area in the barrel

Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 19 of file ConversionBarrelEstimator.h.

Constructor & Destructor Documentation

ConversionBarrelEstimator::ConversionBarrelEstimator ( )
inline

Definition at line 22 of file ConversionBarrelEstimator.h.

Referenced by clone().

22 {};
ConversionBarrelEstimator::ConversionBarrelEstimator ( float  phiRangeMin,
float  phiRangeMax,
float  zRangeMin,
float  zRangeMax,
double  nSigma = 3. 
)
inline

Definition at line 23 of file ConversionBarrelEstimator.h.

24  :
25  thePhiRangeMin( phiRangeMin), thePhiRangeMax( phiRangeMax),
26  theZRangeMin( zRangeMin), theZRangeMax( zRangeMax), theNSigma(nSigma) {
27  // std::cout << " ConversionBarrelEstimator CTOR " << std::endl;
28 }

Member Function Documentation

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

Implements MeasurementEstimator.

Definition at line 35 of file ConversionBarrelEstimator.h.

References ConversionBarrelEstimator().

35  {
36  return new ConversionBarrelEstimator(*this);
37  }
std::pair< bool, double > ConversionBarrelEstimator::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 12 of file ConversionBarrelEstimator.cc.

References TrajectoryStateOnSurface::globalParameters(), TrackingRecHit::globalPosition(), TrackingRecHit::localPositionError(), PV3DBase< T, PVType, FrameType >::phi(), pi, GlobalTrajectoryParameters::position(), query::result, mathSSE::sqrt(), thePhiRangeMin, theZRangeMax, LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

13  {
14  std::pair<bool,double> result;
15 
16  //std::cout << " ConversionBarrelEstimator::estimate( const TrajectoryStateOnSurface& ts, const TransientTrackingRecHit& hit) " << std::endl;
17 
18  float tsPhi = ts.globalParameters().position().phi();
19  GlobalPoint gp = hit.globalPosition();
20  float rhPhi = gp.phi();
21 
22  // allow a z fudge of 2 sigma
23  float dz = 2. * sqrt(hit.localPositionError().yy()) ;
24  float zDiff = ts.globalParameters().position().z() - gp.z();
25  float phiDiff = tsPhi - rhPhi;
26  if (phiDiff > pi) phiDiff -= twopi;
27  if (phiDiff < -pi) phiDiff += twopi;
28 
29  // add the errors on the window and the point in quadrature
30  float zrange = sqrt(theZRangeMax*theZRangeMax + dz*dz);
31 
32  /*
33  std::cout << " BarrelEstimator ts local error " <<ts.localError().positionError() << " hit local error " << hit.localPositionError() << std::endl;
34  std::cout << " BarrelEstimator: RecHit at " << gp << " phi " << rhPhi << " eta " << gp.eta() << std::endl;
35  std::cout << " BarrelEstimator: ts at " << ts.globalParameters().position() << " phi " <<ts.globalParameters().position().phi() << " eta " << ts.globalParameters().position().eta()<< std::endl;
36  std::cout << " zrange = +/-" << zrange << ", zDiff = " << zDiff << std::endl;
37  std::cout << " thePhiRangeMin = " << thePhiRangeMin << ", thePhiRangeMax = " << thePhiRangeMax << ", phiDiff = " << phiDiff << std::endl;
38  */
39 
40 
41 
42  if ( phiDiff < thePhiRangeMax && phiDiff > thePhiRangeMin &&
43  zDiff < zrange && zDiff > -zrange) {
44 
45  // std::cout << " estimator returns 1 with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
46  // << thePhiRangeMax << " and zDiff " << zDiff << " < " << zrange << std::endl;
47  // std::cout << " YES " << phiDiff << " " << zDiff << std::endl;
48  // std::cout << " => RECHIT ACCEPTED " << std::endl;
49 
50  result.first=true;
51  result.second=phiDiff;
52  } else {
53 
54  // std::cout << " estimator returns NOT ACCEPTED with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
55  //<< thePhiRangeMax << " and zDiff " << zDiff << " < " << theZRangeMax+dz << std::endl;
56 
57  result.first=false;
58  result.second=0;
59 
60  }
61 
62  return result;
63 
64 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
virtual GlobalPoint globalPosition() const
const Double_t pi
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
tuple result
Definition: query.py:137
const GlobalTrajectoryParameters & globalParameters() const
virtual LocalError localPositionError() const =0
virtual bool ConversionBarrelEstimator::estimate ( const TrajectoryStateOnSurface ts,
const Plane plane 
) const
virtual

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

Implements MeasurementEstimator.

MeasurementEstimator::Local2DVector ConversionBarrelEstimator::maximalLocalDisplacement ( const TrajectoryStateOnSurface ts,
const Plane 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 Plane which is entirely outside of the compatibility region defined by maximalLocalDisplacement().

Reimplemented from MeasurementEstimator.

Definition at line 99 of file ConversionBarrelEstimator.cc.

101 {
102 
103 
104 
105  /*
106  if ( ts.hasError() ) {
107  LocalError le = ts.localError().positionError();
108  std::cout << " ConversionBarrelEstimator::maximalLocalDisplacent local error " << sqrt(le.xx()) << " " << sqrt(le.yy()) << " nSigma " << nSigmaCut() << " sqrt(le.xx())*nSigmaCut() " << sqrt(le.xx())*nSigmaCut() << " sqrt(le.yy())*nSigmaCut() " << sqrt(le.yy())*nSigmaCut() << std::endl;
109  return Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut());
110  }
111 
112  else return Local2DVector(9999,9999);
113  */
114 return Local2DVector(9999,9999);
115 
116 }
Vector2DBase< float, LocalTag > Local2DVector
double ConversionBarrelEstimator::nSigmaCut ( ) const
inline

Definition at line 46 of file ConversionBarrelEstimator.h.

References theNSigma.

Member Data Documentation

double ConversionBarrelEstimator::theNSigma
private

Definition at line 54 of file ConversionBarrelEstimator.h.

Referenced by nSigmaCut().

float ConversionBarrelEstimator::thePhiRangeMax
private

Definition at line 51 of file ConversionBarrelEstimator.h.

float ConversionBarrelEstimator::thePhiRangeMin
private

Definition at line 50 of file ConversionBarrelEstimator.h.

Referenced by estimate().

float ConversionBarrelEstimator::theZRangeMax
private

Definition at line 53 of file ConversionBarrelEstimator.h.

Referenced by estimate().

float ConversionBarrelEstimator::theZRangeMin
private

Definition at line 52 of file ConversionBarrelEstimator.h.