CMS 3D CMS Logo

MRHChi2MeasurementEstimator.cc
Go to the documentation of this file.
11 
13  const TrackingRecHit& aRecHit) const {
14  switch (aRecHit.dimension()) {
15  case 1:
16  return estimate<1>(tsos, aRecHit);
17  case 2:
18  return estimate<2>(tsos, aRecHit);
19  //avoid the not-(1D or 2D) hit due to the final sum
20  //supposing all the hits inside of a MRH have the same dimension
21  case 3:
22  case 4:
23  case 5: {
24  LogDebug("MRHChi2MeasurementEstimator") << "WARNING:The hit is not 1D either 2D:"
25  << " does not count in the MRH Chi2 estimation.";
26  double est = 0.0;
27  return HitReturnType(false, est);
28  }
29  }
30  throw cms::Exception("Rec hit of invalid dimension (not 1,2,3,4,5)")
31  << "The value was " << aRecHit.dimension() << ", type is " << typeid(aRecHit).name() << "\n";
32 }
33 
34 //---------------------------------------------------------------------------------------------------------------
35 template <unsigned int N>
37  const TrackingRecHit& aRecHit) const {
38  LogDebug("MRHChi2MeasurementEstimator") << "Calling MRHChi2MeasurementEstimator";
39  SiTrackerMultiRecHit const& mHit = dynamic_cast<SiTrackerMultiRecHit const&>(aRecHit);
40  double est = 0;
41 
42  double annealing = mHit.getAnnealingFactor();
43  LogDebug("MRHChi2MeasurementEstimator") << "Current annealing factor is " << annealing;
44 
45  std::vector<const TrackingRecHit*> components = mHit.recHits();
46  LogDebug("MRHChi2MeasurementEstimator") << "this hit has " << components.size() << " components";
47 
48  int iComp = 0;
49  for (std::vector<const TrackingRecHit*>::const_iterator iter = components.begin(); iter != components.end();
50  iter++, iComp++) {
51  // define variables that will be used to setup the KfComponentsHolder
53  typename AlgebraicROOTObject<N>::Vector r, rMeas;
56  const AlgebraicSymMatrix55& C = (tsos.localError().matrix());
57 
58  // setup the holder with the correct dimensions and get the values
59  KfComponentsHolder holder;
60  holder.template setup<N>(&r, &V, &pf, &rMeas, &VMeas, x, C);
61  (**iter).getKfComponents(holder);
62 
63  r -= rMeas;
64  V = V * annealing + VMeas;
65  bool ierr = invertPosDefMatrix(V);
66  if (!ierr) {
67  edm::LogError("SiTrackerMultiRecHitUpdator")
68  << "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  return returnIt(est);
76 }
KfComponentsHolder.h
cms::cuda::V
cudaStream_t T uint32_t const T *__restrict__ const uint32_t *__restrict__ uint32_t int cudaStream_t V
Definition: HistoContainer.h:99
TrajectoryStateOnSurface.h
MessageLogger.h
ProjectMatrix.h
Chi2MeasurementEstimatorBase::returnIt
std::pair< bool, double > returnIt(double est) const
Definition: Chi2MeasurementEstimatorBase.h:40
MeasurementExtractor.h
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
LocalTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: LocalTrajectoryError.h:60
DDAxes::x
MeasurementEstimator::HitReturnType
std::pair< bool, double > HitReturnType
Definition: MeasurementEstimator.h:34
Plane.h
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
SiTrackerMultiRecHit.h
SiTrackerMultiRecHit::weight
float weight(unsigned int i) const
Definition: SiTrackerMultiRecHit.h:52
LocalTrajectoryParameters::vector
AlgebraicVector5 vector() const
Definition: LocalTrajectoryParameters.h:120
TrajectoryStateOnSurface::localParameters
const LocalTrajectoryParameters & localParameters() const
Definition: TrajectoryStateOnSurface.h:73
MRHChi2MeasurementEstimator::estimate
std::pair< bool, double > estimate(const TrajectoryStateOnSurface &tsos, const TrackingRecHit &aRecHit) const override
Definition: MRHChi2MeasurementEstimator.cc:12
SiTrackerMultiRecHit::getAnnealingFactor
virtual double getAnnealingFactor() const
Definition: SiTrackerMultiRecHit.h:56
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
invertPosDefMatrix
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
Definition: invertPosDefMatrix.h:10
AlgebraicVector5
ROOT::Math::SVector< double, 5 > AlgebraicVector5
Definition: AlgebraicROOTObjects.h:14
KfComponentsHolder
Definition: KfComponentsHolder.h:13
TrackingRecHit
Definition: TrackingRecHit.h:21
alignCSCRings.r
r
Definition: alignCSCRings.py:93
gen::C
C
Definition: PomwigHadronizer.cc:76
MRHChi2MeasurementEstimator.h
TrackingRecHit::dimension
virtual int dimension() const =0
packedPFCandidateRefMixer_cfi.pf
pf
Definition: packedPFCandidateRefMixer_cfi.py:4
makeMuonMisalignmentScenario.components
string components
Definition: makeMuonMisalignmentScenario.py:58
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
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
invertPosDefMatrix.h
SiTrackerMultiRecHitUpdator.h