CMS 3D CMS Logo

List of all members | Public Member Functions
MRHChi2MeasurementEstimator Class Referencefinal

#include <MRHChi2MeasurementEstimator.h>

Inheritance diagram for MRHChi2MeasurementEstimator:
Chi2MeasurementEstimatorBase MeasurementEstimator

Public Member Functions

virtual MRHChi2MeasurementEstimatorclone () const
 
std::pair< bool, double > estimate (const TrajectoryStateOnSurface &tsos, const TrackingRecHit &aRecHit) const
 
template<unsigned int N>
std::pair< bool, double > estimate (const TrajectoryStateOnSurface &tsos, const TrackingRecHit &aRecHit) const
 
 MRHChi2MeasurementEstimator (double maxChi2, double nSigma=3.)
 
- Public Member Functions inherited from Chi2MeasurementEstimatorBase
 Chi2MeasurementEstimatorBase (double maxChi2, double nSigma=3., float maxDisp=std::numeric_limits< float >::max())
 
template<typename... Args>
 Chi2MeasurementEstimatorBase (double maxChi2, double nSigma, float maxDisp, Args &&...args)
 
double chiSquaredCut () const
 
virtual bool estimate (const TrajectoryStateOnSurface &ts, const Plane &plane) const final
 
virtual Local2DVector maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const Plane &plane) const final
 
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 ()
 

Additional Inherited Members

- Public Types inherited from MeasurementEstimator
using HitReturnType = std::pair< bool, double >
 
using Local2DVector = Vector2DBase< float, LocalTag >
 
using SurfaceReturnType = bool
 
- Protected Member Functions inherited from Chi2MeasurementEstimatorBase
std::pair< bool, double > returnIt (double est) const
 

Detailed Description

Definition at line 8 of file MRHChi2MeasurementEstimator.h.

Constructor & Destructor Documentation

MRHChi2MeasurementEstimator::MRHChi2MeasurementEstimator ( double  maxChi2,
double  nSigma = 3. 
)
inlineexplicit

Construct with cuts on chi2 and nSigma. The cut on Chi2 is used to define the acceptance of RecHits. The errors of the trajectory state are multiplied by nSigma to define acceptance of Plane and maximalLocalDisplacement.

Definition at line 17 of file MRHChi2MeasurementEstimator.h.

References estimate().

Referenced by clone().

17  :
Chi2MeasurementEstimatorBase(double maxChi2, double nSigma=3., float maxDisp=std::numeric_limits< float >::max())

Member Function Documentation

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

Implements MeasurementEstimator.

Definition at line 27 of file MRHChi2MeasurementEstimator.h.

References MRHChi2MeasurementEstimator().

27  {
28  return new MRHChi2MeasurementEstimator(*this);
29  }
MRHChi2MeasurementEstimator(double maxChi2, double nSigma=3.)
std::pair< bool, double > MRHChi2MeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const TrackingRecHit 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 Chi2MeasurementEstimatorBase.

Definition at line 12 of file MRHChi2MeasurementEstimator.cc.

References TrackingRecHit::dimension(), Exception, LogDebug, and dataset::name.

Referenced by MRHChi2MeasurementEstimator().

13  {
14 
15  switch (aRecHit.dimension()) {
16  case 1: return estimate<1>(tsos,aRecHit);
17  case 2: return estimate<2>(tsos,aRecHit);
18  //avoid the not-(1D or 2D) hit due to the final sum
19  //supposing all the hits inside of a MRH have the same dimension
20  case 3:
21  case 4:
22  case 5:{
23  LogDebug("MRHChi2MeasurementEstimator") << "WARNING:The hit is not 1D either 2D:"
24  << " does not count in the MRH Chi2 estimation." ;
25  double est = 0.0;
26  return HitReturnType(false, est);
27  }
28  }
29  throw cms::Exception("Rec hit of invalid dimension (not 1,2,3,4,5)") <<
30  "The value was " << aRecHit.dimension() <<
31  ", type is " << typeid(aRecHit).name() << "\n";
32 }
#define LogDebug(id)
std::pair< bool, double > HitReturnType
template<unsigned int N>
std::pair< bool, double > MRHChi2MeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const TrackingRecHit 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 Chi2MeasurementEstimatorBase.

Definition at line 36 of file MRHChi2MeasurementEstimator.cc.

References patCaloMETCorrections_cff::C, makeMuonMisalignmentScenario::components, SiTrackerMultiRecHit::getAnnealingFactor(), invertPosDefMatrix(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), LogDebug, LocalTrajectoryError::matrix(), packedPFCandidateRefMixer_cfi::pf, alignCSCRings::r, SiTrackerMultiRecHit::recHits(), Chi2MeasurementEstimatorBase::returnIt(), LocalTrajectoryParameters::vector(), SiTrackerMultiRecHit::weight(), and x.

37  {
38 
39  LogDebug("MRHChi2MeasurementEstimator") << "Calling MRHChi2MeasurementEstimator" ;
40  SiTrackerMultiRecHit const & mHit = dynamic_cast<SiTrackerMultiRecHit const &>(aRecHit);
41  double est=0;
42 
43  double annealing = mHit.getAnnealingFactor();
44  LogDebug("MRHChi2MeasurementEstimator") << "Current annealing factor is " << annealing;
45 
46  std::vector<const TrackingRecHit*> components = mHit.recHits();
47  LogDebug("MRHChi2MeasurementEstimator") << "this hit has " << components.size() << " components";
48 
49  int iComp = 0;
50  for(std::vector<const TrackingRecHit*>::const_iterator iter = components.begin(); iter != components.end(); iter++, iComp++){
51 
52  // define variables that will be used to setup the KfComponentsHolder
54  typename AlgebraicROOTObject<N>::Vector r, rMeas;
55  typename AlgebraicROOTObject<N,N>::SymMatrix V, VMeas;
56  AlgebraicVector5 x = tsos.localParameters().vector();
57  const AlgebraicSymMatrix55 &C = (tsos.localError().matrix());
58 
59  // setup the holder with the correct dimensions and get the values
60  KfComponentsHolder holder;
61  holder.template setup<N>(&r, &V, &pf, &rMeas, &VMeas, x, C);
62  (**iter).getKfComponents(holder);
63 
64  r -= rMeas;
65  V = V*annealing + VMeas;
66  bool ierr = invertPosDefMatrix(V);
67  if( !ierr ) {
68  edm::LogError("SiTrackerMultiRecHitUpdator")<<"SiTrackerMultiRecHitUpdator::ComputeParameters2dim: W not valid!"<<std::endl;
69  }
70 
71  LogDebug("MRHChi2MeasurementEstimator") << "Hit with weight " << mHit.weight(iComp);
72  est += ROOT::Math::Similarity(r, V)*mHit.weight(iComp);
73 
74  }
75 
76  return returnIt(est);
77 
78 }
#define LogDebug(id)
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
std::pair< bool, double > returnIt(double est) const
virtual double getAnnealingFactor() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
float weight(unsigned int i) const
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
ROOT::Math::SVector< double, D1 > Vector
ROOT::Math::SVector< double, 5 > AlgebraicVector5