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

#include <ConversionForwardEstimator.h>

Inheritance diagram for ConversionForwardEstimator:
MeasurementEstimator

Public Member Functions

virtual
ConversionForwardEstimator
clone () const
 
 ConversionForwardEstimator ()
 
 ConversionForwardEstimator (float phiRangeMin, float phiRangeMax, float dr, double nSigma=3.)
 
virtual std::pair< bool, double > estimate (const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const
 
virtual bool estimate (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
 
virtual Local2DVector maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
 
double nSigmaCut () const
 
- Public Member Functions inherited from MeasurementEstimator
virtual ~MeasurementEstimator ()
 

Private Attributes

float dr_
 
double theNSigma
 
float thePhiRangeMax
 
float thePhiRangeMin
 

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 forward

Date:
2007/05/10 13:26:08
Revision:
1.4
Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 23 of file ConversionForwardEstimator.h.

Constructor & Destructor Documentation

ConversionForwardEstimator::ConversionForwardEstimator ( )
inline

Definition at line 25 of file ConversionForwardEstimator.h.

Referenced by clone().

25 {};
ConversionForwardEstimator::ConversionForwardEstimator ( float  phiRangeMin,
float  phiRangeMax,
float  dr,
double  nSigma = 3. 
)
inline

Definition at line 26 of file ConversionForwardEstimator.h.

26  :
27  thePhiRangeMin( phiRangeMin), thePhiRangeMax( phiRangeMax), dr_(dr), theNSigma(nSigma) {
28  //std::cout << " ConversionForwardEstimator CTOR " << std::endl;
29 }

Member Function Documentation

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

Implements MeasurementEstimator.

Definition at line 36 of file ConversionForwardEstimator.h.

References ConversionForwardEstimator().

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

References dr_, TrajectoryStateOnSurface::globalParameters(), TransientTrackingRecHit::globalPosition(), TrackingRecHit::localPositionError(), LogDebug, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), pi, GlobalTrajectoryParameters::position(), funct::pow(), query::result, mathSSE::sqrt(), thePhiRangeMin, and LocalError::yy().

13  {
14  LogDebug("ConversionForwardEstimator") << "ConversionForwardEstimator::estimate( const TrajectoryStateOnSurface& ts ...) " << "\n";
15  // std::cout << "ConversionForwardEstimator::estimate( const TrajectoryStateOnSurface& ts ...) " << "\n";
16 
17  std::pair<bool,double> result;
18 
19  float tsPhi = ts.globalParameters().position().phi();
20  GlobalPoint gp = hit.globalPosition();
21  float rhPhi = gp.phi();
22  float rhR = gp.perp();
23 
24  // allow an r fudge of 1.5 * times the sigma
25  // nodt used float dr = 1.5 * hit.localPositionError().yy();
26  //std::cout << " err " << hit.globalPositionError().phierr(gp)
27  // << " " << hit.globalPositionError().rerr(gp) << std::endl;
28 
29  // not used float zLayer = ts.globalParameters().position().z();
30  float rLayer = ts.globalParameters().position().perp();
31 
32  float newdr = sqrt(pow(dr_,2)+4.*hit.localPositionError().yy());
33  float rMin = rLayer - newdr;
34  float rMax = rLayer + newdr;
35  float phiDiff = tsPhi - rhPhi;
36  if (phiDiff > pi) phiDiff -= twopi;
37  if (phiDiff < -pi) phiDiff += twopi;
38 
39  //std::cout << " ConversionForwardEstimator: RecHit at " << gp << "\n";
40  //std::cout << " rMin = " << rMin << ", rMax = " << rMax << ", rHit = " << rhR << "\n";
41  //std::cout << " thePhiRangeMin = " << thePhiRangeMin << ", thePhiRangeMax = " << thePhiRangeMax << ", phiDiff = " << phiDiff << "\n";
42 
43 
44  if ( phiDiff < thePhiRangeMax && phiDiff > thePhiRangeMin &&
45  rhR < rMax && rhR > rMin) {
46 
47 
48  // std::cout << " estimator returns 1 with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
49  // << thePhiRangeMax << " and rhR " << rMin << " < " << rhR << " < " << rMax << "\n";
50  //std::cout << " YES " << phiDiff << " " <<rLayer-rhR << "\n";
51  //std::cout << " => RECHIT ACCEPTED " << "\n";
52 
53  result.first= true;
54  result.second=phiDiff;
55  } else {
56  /*
57  cout << " estimator returns 0 with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
58  << thePhiRangeMax << " and rhR " << rMin << " < " << rhR << " < " << rMax << endl;
59  */
60  result.first= false;
61  result.second=0;
62 
63  }
64 
65  return result;
66 
67 }
#define LogDebug(id)
T perp() const
Definition: PV3DBase.h:71
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
const Double_t pi
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:46
tuple result
Definition: query.py:137
const GlobalTrajectoryParameters & globalParameters() const
virtual LocalError localPositionError() const =0
virtual GlobalPoint globalPosition() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
bool ConversionForwardEstimator::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 69 of file ConversionForwardEstimator.cc.

References funct::true.

70  {
71 
72  // std::cout << "ConversionForwardEstimator::estimate( const TrajectoryStateOnSurface& ts, const BoundPlane& plane) always TRUE " << "\n";
73  // this method should return one if a detector ring is close enough
74  // to the hit, zero otherwise.
75  // Now time is wasted looking for hits in the rings which are anyhow
76  // too far from the prediction
77  return true ;
78 
79 }
MeasurementEstimator::Local2DVector ConversionForwardEstimator::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 84 of file ConversionForwardEstimator.cc.

86 {
87 
88  /*
89  if ( ts.hasError() ) {
90  LocalError le = ts.localError().positionError();
91  std::cout << " ConversionForwardEstimator::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;
92  return Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut());
93 
94  }
95  else return Local2DVector(99999,99999);
96  */
97 
98  return Local2DVector(99999,99999);
99 
100 }
Vector2DBase< float, LocalTag > Local2DVector
double ConversionForwardEstimator::nSigmaCut ( ) const
inline

Definition at line 43 of file ConversionForwardEstimator.h.

References theNSigma.

Member Data Documentation

float ConversionForwardEstimator::dr_
private

Definition at line 49 of file ConversionForwardEstimator.h.

Referenced by estimate().

double ConversionForwardEstimator::theNSigma
private

Definition at line 50 of file ConversionForwardEstimator.h.

Referenced by nSigmaCut().

float ConversionForwardEstimator::thePhiRangeMax
private

Definition at line 48 of file ConversionForwardEstimator.h.

float ConversionForwardEstimator::thePhiRangeMin
private

Definition at line 47 of file ConversionForwardEstimator.h.

Referenced by estimate().