CMS 3D CMS Logo

Public Member Functions

MRHChi2MeasurementEstimator Class Reference

#include <MRHChi2MeasurementEstimator.h>

Inheritance diagram for MRHChi2MeasurementEstimator:
Chi2MeasurementEstimatorBase MeasurementEstimator

List of all members.

Public Member Functions

virtual
MRHChi2MeasurementEstimator
clone () const
virtual std::pair< bool, double > estimate (const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
 MRHChi2MeasurementEstimator (double maxChi2, double nSigma=3.)

Detailed Description

Definition at line 8 of file MRHChi2MeasurementEstimator.h.


Constructor & Destructor Documentation

MRHChi2MeasurementEstimator::MRHChi2MeasurementEstimator ( double  maxChi2,
double  nSigma = 3. 
) [inline, explicit]

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 BoundPlane and maximalLocalDisplacement.

Definition at line 17 of file MRHChi2MeasurementEstimator.h.

Referenced by clone().

                                                                           : 
    Chi2MeasurementEstimatorBase( maxChi2, nSigma) {}

Member Function Documentation

virtual MRHChi2MeasurementEstimator* MRHChi2MeasurementEstimator::clone ( void  ) const [inline, virtual]

Implements MeasurementEstimator.

Definition at line 23 of file MRHChi2MeasurementEstimator.h.

References MRHChi2MeasurementEstimator().

                                                     {
    return new MRHChi2MeasurementEstimator(*this);
  }
std::pair< bool, double > MRHChi2MeasurementEstimator::estimate ( const TrajectoryStateOnSurface ts,
const TransientTrackingRecHit 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 10 of file MRHChi2MeasurementEstimator.cc.

References makeMuonMisalignmentScenario::components, Exception, invertPosDefMatrix(), TrackingRecHit::isValid(), LogDebug, MeasurementExtractor::measuredError(), MeasurementExtractor::measuredParameters(), dttmaxenums::R, alignCSCRings::r, Chi2MeasurementEstimatorBase::returnIt(), and TransientTrackingRecHit::transientHits().

                                                                                 {
  if (!aRecHit.isValid()) {
        throw cms::Exception("MRHChi2MeasurementEstimator") << "Invalid RecHit passed to the MRHChi2MeasurementEstimator ";
  }

  typedef AlgebraicROOTObject<2>::Vector Vec;
  typedef AlgebraicROOTObject<2>::SymMatrix Mat;

  //better be a multihit...
  TSiTrackerMultiRecHit const & mHit = dynamic_cast<TSiTrackerMultiRecHit const &>(aRecHit);  
  MeasurementExtractor me(tsos);
  double est=0;
  double annealing = mHit.getAnnealingFactor();
  LogDebug("MRHChi2MeasurementEstimator") << "Current annealing factor is " << annealing;               
  TransientTrackingRecHit::ConstRecHitContainer components = aRecHit.transientHits();
  LogDebug("MRHChi2MeasurementEstimator") << "this hit has " << components.size() << " components";     
  for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator iter = components.begin(); iter != components.end(); iter++){              
        Vec r = asSVector<2>((*iter)->parameters()) - me.measuredParameters<2>(**iter);
        Mat R = asSMatrix<2>((*iter)->parametersError())*annealing + me.measuredError<2>(**iter);
        //int ierr = ! R.Invert(); // if (ierr != 0) throw exception; // 
        invertPosDefMatrix(R);
        LogDebug("MRHChi2MeasurementEstimator") << "Hit with weight " << (*iter)->weight(); 
        est += ROOT::Math::Similarity(r, R)*((*iter)->weight());
  }     
  return returnIt(est);
}