CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConversionForwardEstimator.cc
Go to the documentation of this file.
1 #include "CLHEP/Units/GlobalPhysicalConstants.h"
7 
8 
9 
10 
11  // zero value indicates incompatible ts - hit pair
13  const TransientTrackingRecHit& hit) const {
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 }
68 
70  const BoundPlane& plane) const {
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 }
80 
81 
82 
85  const BoundPlane& plane) const
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 }
101 
102 
#define LogDebug(id)
Vector2DBase< float, LocalTag > Local2DVector
T perp() const
Definition: PV3DBase.h:71
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
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