CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CurrentAlignmentKFUpdator Class Reference

#include <CurrentAlignmentKFUpdator.h>

Inheritance diagram for CurrentAlignmentKFUpdator:
TrajectoryStateUpdator

List of all members.

Public Member Functions

virtual CurrentAlignmentKFUpdatorclone (void) const
 CurrentAlignmentKFUpdator (AlignableNavigator *navigator)
 CurrentAlignmentKFUpdator (void)
template<unsigned int D>
TrajectoryStateOnSurface update (const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
TrajectoryStateOnSurface update (const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
 ~CurrentAlignmentKFUpdator (void)

Private Member Functions

AlignmentParametersgetAlignmentParameters (const AlignableDetOrUnitPtr alignableDet) const
AlignmentParametersgetHigherLevelParameters (const Alignable *aAlignable) const
template<unsigned int D>
void includeCurrentAlignmentEstimate (const TransientTrackingRecHit &aRecHit, const TrajectoryStateOnSurface &tsos, typename AlgebraicROOTObject< D >::Vector &vecR, typename AlgebraicROOTObject< D >::SymMatrix &matV) const

Private Attributes

AlignableNavigatortheAlignableNavigator

Detailed Description

Definition at line 14 of file CurrentAlignmentKFUpdator.h.


Constructor & Destructor Documentation

CurrentAlignmentKFUpdator::CurrentAlignmentKFUpdator ( void  ) [inline]

Definition at line 19 of file CurrentAlignmentKFUpdator.h.

Referenced by clone().

CurrentAlignmentKFUpdator::CurrentAlignmentKFUpdator ( AlignableNavigator navigator) [inline]

Definition at line 20 of file CurrentAlignmentKFUpdator.h.

: theAlignableNavigator( navigator ) {}
CurrentAlignmentKFUpdator::~CurrentAlignmentKFUpdator ( void  ) [inline]

Definition at line 21 of file CurrentAlignmentKFUpdator.h.

{}

Member Function Documentation

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

Implements TrajectoryStateUpdator.

Definition at line 28 of file CurrentAlignmentKFUpdator.h.

References CurrentAlignmentKFUpdator().

{ return new CurrentAlignmentKFUpdator( *this ); }
AlignmentParameters * CurrentAlignmentKFUpdator::getAlignmentParameters ( const AlignableDetOrUnitPtr  alignableDet) const [private]

Definition at line 122 of file CurrentAlignmentKFUpdator.cc.

References getHigherLevelParameters().

Referenced by includeCurrentAlignmentEstimate().

{
  // Get alignment parameters from AlignableDet ...
  AlignmentParameters* alignmentParameters = alignableDet->alignmentParameters();
  // ... or any higher level alignable.
  if ( !alignmentParameters ) alignmentParameters = getHigherLevelParameters( alignableDet );
  return alignmentParameters;
}
AlignmentParameters * CurrentAlignmentKFUpdator::getHigherLevelParameters ( const Alignable aAlignable) const [private]

Definition at line 132 of file CurrentAlignmentKFUpdator.cc.

References Alignable::alignmentParameters(), and Alignable::mother().

Referenced by getAlignmentParameters().

{
  Alignable* higherLevelAlignable = aAlignable->mother();
  // Alignable has no mother ... most probably the alignable is already the full tracker.
  if ( !higherLevelAlignable ) return 0;
  AlignmentParameters* higherLevelParameters = higherLevelAlignable->alignmentParameters();
  // Found alignment parameters? If not, go one level higher in the hierarchy.
  return higherLevelParameters ? higherLevelParameters : getHigherLevelParameters( higherLevelAlignable );
}
template<unsigned int D>
void CurrentAlignmentKFUpdator::includeCurrentAlignmentEstimate ( const TransientTrackingRecHit aRecHit,
const TrajectoryStateOnSurface tsos,
typename AlgebraicROOTObject< D >::Vector vecR,
typename AlgebraicROOTObject< D >::SymMatrix &  matV 
) const [private]

Definition at line 80 of file CurrentAlignmentKFUpdator.cc.

References AlignableNavigator::alignableFromGeomDet(), gather_cfg::cout, funct::D, deltaR(), TransientTrackingRecHit::det(), getAlignmentParameters(), AlignableDetOrUnitPtr::isNull(), AlignmentParameters::selectedCovariance(), AlignmentParameters::selectedDerivatives(), AlignmentParameters::selectedParameters(), and theAlignableNavigator.

{
  const GeomDet* det = aRecHit.det();
  if ( !det ) return;

  AlignableDetOrUnitPtr alignableDet = theAlignableNavigator->alignableFromGeomDet( det );
  if ( alignableDet.isNull() )
  {
    //std::cout << "[CurrentAlignmentKFUpdator::includeCurrentAlignmentEstimate] No AlignableDet associated with RecHit." << std::endl;
    return;
  }

  AlignmentParameters* alignmentParameters = getAlignmentParameters( alignableDet );

  if ( alignmentParameters )
  {
    AlgebraicMatrix selectedDerivatives = alignmentParameters->selectedDerivatives( tsos, alignableDet );
    AlgebraicVector selectedParameters = alignmentParameters->selectedParameters();
    AlgebraicSymMatrix selectedCovariance = alignmentParameters->selectedCovariance();

    AlgebraicSymMatrix deltaV = selectedCovariance.similarityT( selectedDerivatives );
    AlgebraicVector deltaR = selectedDerivatives.T()*selectedParameters;

    //AlignmentUserVariables* auv = alignmentParameters->userVariables();
    //if ( !auv ) std::cout << "[CurrentAlignmentKFUpdator::includeCurrentAlignmentEstimate] No AlignmentUserVariables associated with AlignableDet." << std::endl;
    //if ( theAnnealing ) matV *= (*theAnnealing)( auv );

    if ( deltaR.num_row() == D )
    {
      vecR += asSVector<D>(deltaR);
      matV += asSMatrix<D>(deltaV);
    }
    else std::cout << "[CurrentAlignmentKFUpdator::includeCurrentAlignmentEstimate] Predicted state and misalignment correction not compatible." << std::endl;
  } else std::cout << "[CurrentAlignmentKFUpdator::includeCurrentAlignmentEstimate] No AlignmentParameters associated with AlignableDet." << std::endl;

  return;
}
template<unsigned int D>
TrajectoryStateOnSurface CurrentAlignmentKFUpdator::update ( const TrajectoryStateOnSurface tsos,
const TransientTrackingRecHit aRecHit 
) const [virtual]

Implements TrajectoryStateUpdator.

Definition at line 11 of file CurrentAlignmentKFUpdator.cc.

References TrackingRecHit::dimension(), and Exception.

{
    switch (aRecHit.dimension()) {
        case 1: return update<1>(tsos,aRecHit);
        case 2: return update<2>(tsos,aRecHit);
        case 3: return update<3>(tsos,aRecHit);
        case 4: return update<4>(tsos,aRecHit);
        case 5: return update<5>(tsos,aRecHit);
    }
    throw cms::Exception("Rec hit of invalid dimension (not 1,2,3,4,5)");
}
TrajectoryStateOnSurface CurrentAlignmentKFUpdator::update ( const TrajectoryStateOnSurface ,
const TransientTrackingRecHit  
) const [virtual]

Member Data Documentation

Definition at line 41 of file CurrentAlignmentKFUpdator.h.

Referenced by includeCurrentAlignmentEstimate().