CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Member Functions

KalmanAlignmentUpdator Class Reference

#include <KalmanAlignmentUpdator.h>

Inheritance diagram for KalmanAlignmentUpdator:
DummyUpdator SingleTrajectoryUpdator

List of all members.

Public Types

typedef
ReferenceTrajectoryBase::ReferenceTrajectoryPtr 
ReferenceTrajectoryPtr

Public Member Functions

virtual KalmanAlignmentUpdatorclone (void) const =0
 KalmanAlignmentUpdator (const edm::ParameterSet &config)
virtual void process (const ReferenceTrajectoryPtr &trajectory, AlignmentParameterStore *store, AlignableNavigator *navigator, KalmanAlignmentMetricsUpdator *metrics, const MagneticField *magField=0)=0
virtual ~KalmanAlignmentUpdator (void)

Protected Member Functions

virtual const std::vector
< Alignable * > 
alignablesFromAlignableDets (std::vector< AlignableDetOrUnitPtr > &alignableDets, AlignmentParameterStore *store) const
unsigned int nDifferentAlignables (const std::vector< Alignable * > &ali) const
void updateUserVariables (const std::vector< Alignable * > &alignables) const
 Update the AlignmentUserVariables, given that the Alignables hold KalmanAlignmentUserVariables.

Detailed Description

Definition at line 15 of file KalmanAlignmentUpdator.h.


Member Typedef Documentation

Definition at line 20 of file KalmanAlignmentUpdator.h.


Constructor & Destructor Documentation

KalmanAlignmentUpdator::KalmanAlignmentUpdator ( const edm::ParameterSet config) [inline]

Definition at line 22 of file KalmanAlignmentUpdator.h.

{}
virtual KalmanAlignmentUpdator::~KalmanAlignmentUpdator ( void  ) [inline, virtual]

Definition at line 23 of file KalmanAlignmentUpdator.h.

{}

Member Function Documentation

const std::vector< Alignable * > KalmanAlignmentUpdator::alignablesFromAlignableDets ( std::vector< AlignableDetOrUnitPtr > &  alignableDets,
AlignmentParameterStore store 
) const [protected, virtual]

Returns the Alignables associated with the AlignableDets. If two or more AlignableDets are assiocated to the same Alignable, the Alignable is returned only once.

Definition at line 32 of file KalmanAlignmentUpdator.cc.

References AlignmentParameterStore::alignableFromAlignableDet().

Referenced by SingleTrajectoryUpdator::process().

{
  std::vector< Alignable* > alignables;

  std::vector< AlignableDetOrUnitPtr >::const_iterator itAD;
  for ( itAD = alignableDets.begin(); itAD != alignableDets.end(); ++itAD )
  {
    Alignable* ali = store->alignableFromAlignableDet( *itAD );
    alignables.push_back( ali );
  }

  return alignables;
}
virtual KalmanAlignmentUpdator* KalmanAlignmentUpdator::clone ( void  ) const [pure virtual]

Implemented in DummyUpdator, and SingleTrajectoryUpdator.

unsigned int KalmanAlignmentUpdator::nDifferentAlignables ( const std::vector< Alignable * > &  ali) const [protected]

Definition at line 49 of file KalmanAlignmentUpdator.cc.

References list().

Referenced by SingleTrajectoryUpdator::process().

{
  std::set< Alignable* > list;
  list.insert( ali.begin(), ali.end() );
  unsigned int ndiff = list.size();
  return ndiff;
}
virtual void KalmanAlignmentUpdator::process ( const ReferenceTrajectoryPtr trajectory,
AlignmentParameterStore store,
AlignableNavigator navigator,
KalmanAlignmentMetricsUpdator metrics,
const MagneticField magField = 0 
) [pure virtual]

Process some kind of reference trajectory, for instance a single- or two-particle-trajectory, and calculate an improved estimate on the alignment parameters.

Implemented in DummyUpdator, and SingleTrajectoryUpdator.

void KalmanAlignmentUpdator::updateUserVariables ( const std::vector< Alignable * > &  alignables) const [protected]

Update the AlignmentUserVariables, given that the Alignables hold KalmanAlignmentUserVariables.

Definition at line 7 of file KalmanAlignmentUpdator.cc.

References spr::find(), KalmanAlignmentUserVariables::update(), and AlignmentParameters::userVariables().

Referenced by SingleTrajectoryUpdator::process().

{
  std::vector< Alignable* > updated;
  std::vector< Alignable* >::const_iterator itAlignable = alignables.begin();

  while ( itAlignable != alignables.end() )
  {
    AlignmentParameters* alignmentParameters = ( *itAlignable )->alignmentParameters();

    if ( std::find(updated.begin(),updated.end(),*itAlignable) == updated.end() && alignmentParameters != 0 )
    {
      KalmanAlignmentUserVariables* userVariables =
        dynamic_cast< KalmanAlignmentUserVariables* >( alignmentParameters->userVariables() );

      if ( userVariables != 0 ) userVariables->update();

      updated.push_back( *itAlignable );
    }

    ++itAlignable;
  }
}