CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ConversionBarrelEstimator Class Reference

#include <ConversionBarrelEstimator.h>

Inheritance diagram for ConversionBarrelEstimator:
MeasurementEstimator

Public Member Functions

ConversionBarrelEstimatorclone () const override
 
 ConversionBarrelEstimator ()
 
 ConversionBarrelEstimator (float phiRangeMin, float phiRangeMax, float zRangeMin, float zRangeMax, double nSigma=3.)
 
std::pair< bool, double > estimate (const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const override
 
bool estimate (const TrajectoryStateOnSurface &ts, const Plane &plane) const override
 
Local2DVector maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const Plane &plane) const override
 
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 18 of file ConversionBarrelEstimator.h.

Constructor & Destructor Documentation

◆ ConversionBarrelEstimator() [1/2]

ConversionBarrelEstimator::ConversionBarrelEstimator ( )
inline

Definition at line 20 of file ConversionBarrelEstimator.h.

Referenced by clone().

20 {};

◆ ConversionBarrelEstimator() [2/2]

ConversionBarrelEstimator::ConversionBarrelEstimator ( float  phiRangeMin,
float  phiRangeMax,
float  zRangeMin,
float  zRangeMax,
double  nSigma = 3. 
)
inline

Definition at line 21 of file ConversionBarrelEstimator.h.

22  : thePhiRangeMin(phiRangeMin),
23  thePhiRangeMax(phiRangeMax),
24  theZRangeMin(zRangeMin),
25  theZRangeMax(zRangeMax),
26  theNSigma(nSigma) {
27  // std::cout << " ConversionBarrelEstimator CTOR " << std::endl;
28  }

Member Function Documentation

◆ clone()

ConversionBarrelEstimator* ConversionBarrelEstimator::clone ( void  ) const
inlineoverridevirtual

Implements MeasurementEstimator.

Definition at line 33 of file ConversionBarrelEstimator.h.

References ConversionBarrelEstimator().

◆ estimate() [1/2]

std::pair< bool, double > ConversionBarrelEstimator::estimate ( const TrajectoryStateOnSurface ts,
const TrackingRecHit hit 
) const
overridevirtual

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

References PVValHelper::dz, TrajectoryStateOnSurface::globalParameters(), runTauDisplay::gp, PV3DBase< T, PVType, FrameType >::phi(), pi, GlobalTrajectoryParameters::position(), mps_fire::result, mathSSE::sqrt(), thePhiRangeMin, theZRangeMax, PV3DBase< T, PVType, FrameType >::z(), and TkClusParameters_cff::zrange.

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

◆ estimate() [2/2]

bool ConversionBarrelEstimator::estimate ( const TrajectoryStateOnSurface ts,
const Plane plane 
) const
overridevirtual

Returns true if the TrajectoryStateOnSurface is compatible with the Plane, false otherwise. The TrajectoryStateOnSurface must be on the plane.

Implements MeasurementEstimator.

◆ maximalLocalDisplacement()

MeasurementEstimator::Local2DVector ConversionBarrelEstimator::maximalLocalDisplacement ( const TrajectoryStateOnSurface ts,
const Plane plane 
) const
overridevirtual

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

79  {
80  /*
81  if ( ts.hasError() ) {
82  LocalError le = ts.localError().positionError();
83  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;
84  return Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut());
85  }
86 
87  else return Local2DVector(9999,9999);
88  */
89  return Local2DVector(9999, 9999);
90 }
Vector2DBase< float, LocalTag > Local2DVector

◆ nSigmaCut()

double ConversionBarrelEstimator::nSigmaCut ( ) const
inline

Definition at line 37 of file ConversionBarrelEstimator.h.

References theNSigma.

Member Data Documentation

◆ theNSigma

double ConversionBarrelEstimator::theNSigma
private

Definition at line 44 of file ConversionBarrelEstimator.h.

Referenced by nSigmaCut().

◆ thePhiRangeMax

float ConversionBarrelEstimator::thePhiRangeMax
private

Definition at line 41 of file ConversionBarrelEstimator.h.

◆ thePhiRangeMin

float ConversionBarrelEstimator::thePhiRangeMin
private

Definition at line 40 of file ConversionBarrelEstimator.h.

Referenced by estimate().

◆ theZRangeMax

float ConversionBarrelEstimator::theZRangeMax
private

Definition at line 43 of file ConversionBarrelEstimator.h.

Referenced by estimate().

◆ theZRangeMin

float ConversionBarrelEstimator::theZRangeMin
private

Definition at line 42 of file ConversionBarrelEstimator.h.