CMS 3D CMS Logo

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