test
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
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

double theNSigma
 
float thePhiRangeMax
 
float thePhiRangeMin
 
float theZRangeMax
 
float theZRangeMin
 

Additional Inherited Members

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

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 11 of file ConversionBarrelEstimator.cc.

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

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

Implements MeasurementEstimator.

Definition at line 97 of file ConversionBarrelEstimator.cc.

99 {
100 
101 
102 
103  /*
104  if ( ts.hasError() ) {
105  LocalError le = ts.localError().positionError();
106  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;
107  return Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut());
108  }
109 
110  else return Local2DVector(9999,9999);
111  */
112 return Local2DVector(9999,9999);
113 
114 }
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.