CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

BaseSiTrackerRecHit2DLocalPos Class Reference

#include <BaseSiTrackerRecHit2DLocalPos.h>

Inheritance diagram for BaseSiTrackerRecHit2DLocalPos:
RecHit2DLocalPos TrackingRecHit

List of all members.

Public Member Functions

 BaseSiTrackerRecHit2DLocalPos ()
 BaseSiTrackerRecHit2DLocalPos (const LocalPoint &p, const LocalError &e, DetId id)
virtual void getKfComponents (KfComponentsHolder &holder) const
bool hasPositionAndError () const
 to be redefined by daughter class
virtual LocalPoint localPosition () const
virtual LocalError localPositionError () const
const LocalErrorlocalPositionErrorFast () const
const LocalPointlocalPositionFast () const
 ~BaseSiTrackerRecHit2DLocalPos ()

Private Member Functions

void throwExceptionUninitialized (const char *where) const

Private Attributes

LocalError err_
LocalPoint pos_

Detailed Description

Definition at line 8 of file BaseSiTrackerRecHit2DLocalPos.h.


Constructor & Destructor Documentation

BaseSiTrackerRecHit2DLocalPos::BaseSiTrackerRecHit2DLocalPos ( ) [inline]

Definition at line 11 of file BaseSiTrackerRecHit2DLocalPos.h.

BaseSiTrackerRecHit2DLocalPos::~BaseSiTrackerRecHit2DLocalPos ( ) [inline]

Definition at line 13 of file BaseSiTrackerRecHit2DLocalPos.h.

{}
BaseSiTrackerRecHit2DLocalPos::BaseSiTrackerRecHit2DLocalPos ( const LocalPoint p,
const LocalError e,
DetId  id 
) [inline]

Definition at line 15 of file BaseSiTrackerRecHit2DLocalPos.h.

                                           :  RecHit2DLocalPos(id), pos_(p), err_(e){}

Member Function Documentation

void BaseSiTrackerRecHit2DLocalPos::getKfComponents ( KfComponentsHolder holder) const [virtual]

Reimplemented from TrackingRecHit.

Definition at line 22 of file BaseSiTrackerRecHit2DLocalPos.cc.

References KfComponentsHolder::doUseProjFunc(), err_, KfComponentsHolder::errors(), hasPositionAndError(), ProjectMatrix< T, N, D >::index, KfComponentsHolder::measuredErrors(), KfComponentsHolder::measuredParams(), KfComponentsHolder::params(), pos_, trackerHitRTTI::proj, KfComponentsHolder::projection(), KfComponentsHolder::projFunc(), throwExceptionUninitialized(), KfComponentsHolder::tsosLocalErrors(), KfComponentsHolder::tsosLocalParameters(), LocalError::xx(), LocalError::xy(), and LocalError::yy().

{
   if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents");
   //std::cout << "Call to KfComponentsHolder::genericFill should be optimized here " << std::endl;
   AlgebraicVector2 & pars = holder.params<2>();
   pars[0] = pos_.x(); 
   pars[1] = pos_.y();

   AlgebraicSymMatrix22 & errs = holder.errors<2>();
   errs(0,0) = err_.xx();
   errs(0,1) = err_.xy();
   errs(1,1) = err_.yy();

   
   AlgebraicMatrix25 & proj = holder.projection<2>();
   proj(0,3) = 1;
   proj(1,4) = 1;

   ProjectMatrix<double,5,2>  & pf = holder.projFunc<2>();
   pf.index[0] = 3;
   pf.index[1] = 4;
   holder.doUseProjFunc();

   holder.measuredParams<2>() = AlgebraicVector2( & holder.tsosLocalParameters().At(3), 2 );
   holder.measuredErrors<2>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix22>( 3, 3 );

   //std::cout << "======== MYSELF ==========" << std::endl;
   //holder.dump<2>();
   //std::cout << "======== GENERIC ==========" << std::endl;
   //holder.genericFill(*this);
   //holder.dump<2>();
}
bool BaseSiTrackerRecHit2DLocalPos::hasPositionAndError ( ) const [virtual]

to be redefined by daughter class

Reimplemented from TrackingRecHit.

Definition at line 5 of file BaseSiTrackerRecHit2DLocalPos.cc.

References err_, pos_, LocalError::xx(), LocalError::xy(), and LocalError::yy().

Referenced by getKfComponents(), localPosition(), and localPositionError().

                                                              {
    return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) ||
           (pos_.x()  != 0) || (pos_.y()  != 0) || (pos_.z()  != 0);
}
LocalPoint BaseSiTrackerRecHit2DLocalPos::localPosition ( ) const [virtual]

Implements RecHit2DLocalPos.

Definition at line 10 of file BaseSiTrackerRecHit2DLocalPos.cc.

References hasPositionAndError(), pos_, and throwExceptionUninitialized().

                                                              {
    if (!hasPositionAndError()) throwExceptionUninitialized("localPosition");
    return pos_;
}
LocalError BaseSiTrackerRecHit2DLocalPos::localPositionError ( ) const [virtual]

Implements RecHit2DLocalPos.

Definition at line 15 of file BaseSiTrackerRecHit2DLocalPos.cc.

References err_, hasPositionAndError(), and throwExceptionUninitialized().

                                                                  { 
    if (!hasPositionAndError()) throwExceptionUninitialized("localPositionError");
    return err_;
}
const LocalError& BaseSiTrackerRecHit2DLocalPos::localPositionErrorFast ( ) const [inline]

Definition at line 29 of file BaseSiTrackerRecHit2DLocalPos.h.

References err_.

{ return err_; }
const LocalPoint& BaseSiTrackerRecHit2DLocalPos::localPositionFast ( ) const [inline]

Definition at line 28 of file BaseSiTrackerRecHit2DLocalPos.h.

References pos_.

{ return pos_; }
void BaseSiTrackerRecHit2DLocalPos::throwExceptionUninitialized ( const char *  where) const [private]

Definition at line 56 of file BaseSiTrackerRecHit2DLocalPos.cc.

References Exception.

Referenced by getKfComponents(), localPosition(), and localPositionError().

{
   throw cms::Exception("BaseSiTrackerRecHit2DLocalPos") << 
     "Trying to access " << where << " for a RecHit that was read from disk, but since CMSSW_2_1_X local positions are transient.\n" <<
     "If you want to get coarse position/error estimation from disk, please set: ComputeCoarseLocalPositionFromDisk = True \n " <<
     " to the TransientTrackingRecHitBuilder you are using from RecoTracker/TransientTrackingRecHit/python/TTRHBuilders_cff.py";
}

Member Data Documentation