CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Alignment/KalmanAlignmentAlgorithm/interface/KalmanAlignmentUserVariables.h

Go to the documentation of this file.
00001 
00002 #ifndef Alignment_KalmanAlignmentAlgorithm_KalmanAlignmentUserVariables_h
00003 #define Alignment_KalmanAlignmentAlgorithm_KalmanAlignmentUserVariables_h
00004 
00005 #include "Alignment/CommonAlignment/interface/AlignmentUserVariables.h"
00006 #include "Alignment/CommonAlignment/interface/Alignable.h"
00007 #include "Alignment/CommonAlignment/interface/AlignableObjectId.h"
00008 #include "Alignment/TrackerAlignment/interface/TrackerAlignableId.h"
00009 
00010 #include <string>
00011 
00014 
00015 class TrackerTopology;
00016 
00017 class KalmanAlignmentUserVariables : public AlignmentUserVariables
00018 {
00019 
00020 public:
00021 
00024   KalmanAlignmentUserVariables( Alignable* parent,
00025                                 const TrackerTopology* tTopo,
00026                                 int frequency = 100 );
00027 
00028   KalmanAlignmentUserVariables( void ) :
00029     theParentAlignable( 0 ),
00030     theNumberOfHits( 0 ),
00031     theNumberOfUpdates( 0 ),
00032     theUpdateFrequency( 0 ),
00033     theFirstUpdate( false ),
00034     theAlignmentFlag( false )
00035   {}
00036 
00037   virtual ~KalmanAlignmentUserVariables( void ) {}
00038 
00039   virtual KalmanAlignmentUserVariables* clone( void ) const { return new KalmanAlignmentUserVariables( *this ); }
00040 
00042   inline int numberOfHits( void ) const { return theNumberOfHits; }
00044   inline void hit( void ) { ++theNumberOfHits; }
00045 
00047   inline int numberOfUpdates( void ) const { return theNumberOfUpdates; }
00049   void update( bool enforceUpdate = false );
00051   void update( const AlignmentParameters* param );
00053   void histogramParameters( std::string histoNamePrefix );
00054 
00055   inline const std::string identifier( void ) const { return theIdentifier; }
00056 
00057   inline void setAlignmentFlag( bool flag ) { theAlignmentFlag = flag; }
00058   inline bool isAligned( void ) const { return theAlignmentFlag; }
00059 
00060   void fixAlignable( void );
00061   void unfixAlignable( void );
00062 
00063 protected:
00064 
00065   const AlgebraicVector extractTrueParameters( void ) const;
00066 
00067   const std::string selectedParameter( const int& selected ) const;
00068   float selectedScaling( const int& selected ) const;
00069 
00070   const std::string toString( const int& i ) const;
00071 
00072   Alignable* theParentAlignable;
00073 
00074   int theNumberOfHits;
00075   int theNumberOfUpdates;
00076   int theUpdateFrequency;
00077 
00078   bool theFirstUpdate;
00079   bool theAlignmentFlag;
00080 
00081   std::string theIdentifier;
00082   std::string theTypeAndLayer;
00083 
00084   static const TrackerAlignableId* theAlignableId;
00085   static const AlignableObjectId* theObjectId;
00086 
00087 };
00088 
00089 
00090 #endif