CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/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 KalmanAlignmentUserVariables : public AlignmentUserVariables
00016 {
00017 
00018 public:
00019 
00022   KalmanAlignmentUserVariables( Alignable* parent,
00023                                 int frequency = 100 );
00024 
00025   KalmanAlignmentUserVariables( void ) :
00026     theParentAlignable( 0 ),
00027     theNumberOfHits( 0 ),
00028     theNumberOfUpdates( 0 ),
00029     theUpdateFrequency( 0 ),
00030     theFirstUpdate( false ),
00031     theAlignmentFlag( false )
00032   {}
00033 
00034   virtual ~KalmanAlignmentUserVariables( void ) {}
00035 
00036   virtual KalmanAlignmentUserVariables* clone( void ) const { return new KalmanAlignmentUserVariables( *this ); }
00037 
00039   inline int numberOfHits( void ) const { return theNumberOfHits; }
00041   inline void hit( void ) { ++theNumberOfHits; }
00042 
00044   inline int numberOfUpdates( void ) const { return theNumberOfUpdates; }
00046   void update( bool enforceUpdate = false );
00048   void update( const AlignmentParameters* param );
00050   void histogramParameters( std::string histoNamePrefix );
00051 
00052   inline const std::string identifier( void ) const { return theIdentifier; }
00053 
00054   inline void setAlignmentFlag( bool flag ) { theAlignmentFlag = flag; }
00055   inline bool isAligned( void ) const { return theAlignmentFlag; }
00056 
00057   void fixAlignable( void );
00058   void unfixAlignable( void );
00059 
00060 protected:
00061 
00062   const AlgebraicVector extractTrueParameters( void ) const;
00063 
00064   const std::string selectedParameter( const int& selected ) const;
00065   const float selectedScaling( const int& selected ) const;
00066 
00067   const std::string toString( const int& i ) const;
00068 
00069   Alignable* theParentAlignable;
00070 
00071   int theNumberOfHits;
00072   int theNumberOfUpdates;
00073   int theUpdateFrequency;
00074 
00075   bool theFirstUpdate;
00076   bool theAlignmentFlag;
00077 
00078   std::string theIdentifier;
00079   std::string theTypeAndLayer;
00080 
00081   static const TrackerAlignableId* theAlignableId;
00082   static const AlignableObjectId* theObjectId;
00083 
00084 };
00085 
00086 
00087 #endif