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

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

Referenced by clone().

Member Function Documentation

◆ clone()

MRHChi2MeasurementEstimator* MRHChi2MeasurementEstimator::clone ( void  ) const
inlineoverridevirtual

Implements MeasurementEstimator.

Definition at line 23 of file MRHChi2MeasurementEstimator.h.

23 { return new MRHChi2MeasurementEstimator(*this); }

References MRHChi2MeasurementEstimator().

◆ estimate() [1/2]

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 35 of file MRHChi2MeasurementEstimator.cc.

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

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

◆ estimate() [2/2]

std::pair< bool, double > MRHChi2MeasurementEstimator::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 Chi2MeasurementEstimatorBase.

Definition at line 11 of file MRHChi2MeasurementEstimator.cc.

12  {
13  switch (aRecHit.dimension()) {
14  case 1:
15  return estimate<1>(tsos, aRecHit);
16  case 2:
17  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() << ", type is " << typeid(aRecHit).name() << "\n";
31 }

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

Chi2MeasurementEstimatorBase::returnIt
std::pair< bool, double > returnIt(double est) const
Definition: Chi2MeasurementEstimatorBase.h:40
AlgebraicROOTObject::SymMatrix
ROOT::Math::SMatrix< double, D1, D1, ROOT::Math::MatRepSym< double, D1 > > SymMatrix
Definition: AlgebraicROOTObjects.h:68
SiTrackerMultiRecHit::recHits
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
Definition: SiTrackerMultiRecHit.cc:59
beam_dqm_sourceclient-live_cfg.maxChi2
maxChi2
Definition: beam_dqm_sourceclient-live_cfg.py:152
DDAxes::x
MeasurementEstimator::HitReturnType
std::pair< bool, double > HitReturnType
Definition: MeasurementEstimator.h:34
MRHChi2MeasurementEstimator::MRHChi2MeasurementEstimator
MRHChi2MeasurementEstimator(double maxChi2, double nSigma=3.)
Definition: MRHChi2MeasurementEstimator.h:16
SiTrackerMultiRecHit::weight
float weight(unsigned int i) const
Definition: SiTrackerMultiRecHit.h:52
Chi2MeasurementEstimatorBase::Chi2MeasurementEstimatorBase
Chi2MeasurementEstimatorBase(double maxChi2, double nSigma=3., float maxDisp=std::numeric_limits< float >::max())
Definition: Chi2MeasurementEstimatorBase.h:21
SiTrackerMultiRecHit::getAnnealingFactor
virtual double getAnnealingFactor() const
Definition: SiTrackerMultiRecHit.h:56
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
cms::cuda::V
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t V
Definition: HistoContainer.h:51
invertPosDefMatrix
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
Definition: invertPosDefMatrix.h:10
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlgebraicVector5
ROOT::Math::SVector< double, 5 > AlgebraicVector5
Definition: AlgebraicROOTObjects.h:14
KfComponentsHolder
Definition: KfComponentsHolder.h:13
alignCSCRings.r
r
Definition: alignCSCRings.py:93
gen::C
C
Definition: PomwigHadronizer.cc:78
packedPFCandidateRefMixer_cfi.pf
pf
Definition: packedPFCandidateRefMixer_cfi.py:4
makeMuonMisalignmentScenario.components
string components
Definition: makeMuonMisalignmentScenario.py:58
Exception
Definition: hltDiff.cc:245
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
SiTrackerMultiRecHit
Definition: SiTrackerMultiRecHit.h:13
AlgebraicROOTObject::Vector
ROOT::Math::SVector< double, D1 > Vector
Definition: AlgebraicROOTObjects.h:67
ProjectMatrix
Definition: ProjectMatrix.h:8
HLTSiStripMonitoring_cff.nSigma
nSigma
Definition: HLTSiStripMonitoring_cff.py:151