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"
11 
12 
13 
14 
15  // zero value indicates incompatible ts - hit pair
17  const TransientTrackingRecHit& hit) const {
18  LogDebug("ConversionForwardEstimator") << "ConversionForwardEstimator::estimate( const TrajectoryStateOnSurface& ts ...) " << "\n";
19  // std::cout << "ConversionForwardEstimator::estimate( const TrajectoryStateOnSurface& ts ...) " << "\n";
20 
21  std::pair<bool,double> result;
22 
23  float tsPhi = ts.globalParameters().position().phi();
24  GlobalPoint gp = hit.globalPosition();
25  float rhPhi = gp.phi();
26  float rhR = gp.perp();
27 
28  // allow an r fudge of 1.5 * times the sigma
29  // nodt used float dr = 1.5 * hit.localPositionError().yy();
30  //std::cout << " err " << hit.globalPositionError().phierr(gp)
31  // << " " << hit.globalPositionError().rerr(gp) << std::endl;
32 
33  // not used float zLayer = ts.globalParameters().position().z();
34  float rLayer = ts.globalParameters().position().perp();
35 
36  float newdr = sqrt(pow(dr_,2)+4.*hit.localPositionError().yy());
37  float rMin = rLayer - newdr;
38  float rMax = rLayer + newdr;
39  float phiDiff = tsPhi - rhPhi;
40  if (phiDiff > pi) phiDiff -= twopi;
41  if (phiDiff < -pi) phiDiff += twopi;
42 
43  //std::cout << " ConversionForwardEstimator: RecHit at " << gp << "\n";
44  //std::cout << " rMin = " << rMin << ", rMax = " << rMax << ", rHit = " << rhR << "\n";
45  //std::cout << " thePhiRangeMin = " << thePhiRangeMin << ", thePhiRangeMax = " << thePhiRangeMax << ", phiDiff = " << phiDiff << "\n";
46 
47 
48  if ( phiDiff < thePhiRangeMax && phiDiff > thePhiRangeMin &&
49  rhR < rMax && rhR > rMin) {
50 
51 
52  // std::cout << " estimator returns 1 with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
53  // << thePhiRangeMax << " and rhR " << rMin << " < " << rhR << " < " << rMax << "\n";
54  //std::cout << " YES " << phiDiff << " " <<rLayer-rhR << "\n";
55  //std::cout << " => RECHIT ACCEPTED " << "\n";
56 
57  result.first= true;
58  result.second=phiDiff;
59  } else {
60  /*
61  cout << " estimator returns 0 with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
62  << thePhiRangeMax << " and rhR " << rMin << " < " << rhR << " < " << rMax << endl;
63  */
64  result.first= false;
65  result.second=0;
66 
67  }
68 
69  return result;
70 
71 }
72 
74  const BoundPlane& plane) const {
75 
76  // std::cout << "ConversionForwardEstimator::estimate( const TrajectoryStateOnSurface& ts, const BoundPlane& plane) always TRUE " << "\n";
77  // this method should return one if a detector ring is close enough
78  // to the hit, zero otherwise.
79  // Now time is wasted looking for hits in the rings which are anyhow
80  // too far from the prediction
81  return true ;
82 
83 }
84 
85 
86 
89  const BoundPlane& plane) const
90 {
91 
92  /*
93  if ( ts.hasError() ) {
94  LocalError le = ts.localError().positionError();
95  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;
96  return Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut());
97 
98  }
99  else return Local2DVector(99999,99999);
100  */
101 
102  return Local2DVector(99999,99999);
103 
104 }
105 
106 
#define LogDebug(id)
Vector2DBase< float, LocalTag > Local2DVector
T perp() const
Definition: PV3DBase.h:66
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:63
float yy() const
Definition: LocalError.h:21
T sqrt(T t)
Definition: SSEVec.h:28
tuple result
Definition: query.py:137
const GlobalTrajectoryParameters & globalParameters() const
virtual LocalError localPositionError() const =0
virtual GlobalPoint globalPosition() const
double pi
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40