Go to the documentation of this file.00001 #ifndef Alignment_KalmanAlignmentAlgorithm_KalmanAlignmentMetricsCalculator_h
00002 #define Alignment_KalmanAlignmentAlgorithm_KalmanAlignmentMetricsCalculator_h
00003
00007
00008 #include "Alignment/CommonAlignment/interface/Alignable.h"
00009
00010 #include "Alignment/CommonAlignment/interface/StructureType.h"
00011 #include "CondFormats/Alignment/interface/Definitions.h"
00012
00013 #include "TTree.h"
00014 #include "TFile.h"
00015
00016
00017 class KalmanAlignmentMetricsCalculator
00018 {
00019
00020 public:
00021
00022 typedef std::map< Alignable*, short int > SingleDistancesList;
00023 typedef std::map< Alignable*, SingleDistancesList* > FullDistancesList;
00024
00025 KalmanAlignmentMetricsCalculator( void );
00026 ~KalmanAlignmentMetricsCalculator( void );
00027
00029 void updateDistances( const std::vector< Alignable* >& alignables );
00030
00033 const SingleDistancesList& getDistances( Alignable* i ) const;
00034
00037 short int operator() ( Alignable* i, Alignable* j ) const;
00038
00040 inline void setMaxDistance( short int maxDistance ) { theMaxDistance = maxDistance; }
00041
00043 unsigned int nDistances( void ) const;
00044
00046 void clear( void );
00047
00049 const std::vector< Alignable* > alignables( void ) const;
00050
00051 void writeDistances( std::string filename );
00052 void readDistances( std::string filename );
00053
00054 private:
00055
00056 void clearDistances( FullDistancesList& dist );
00057
00060 void updateList( SingleDistancesList* thisList, SingleDistancesList* otherList );
00061
00063 void insertUpdatedDistances( FullDistancesList& updated );
00064
00066 void insertPropagatedDistances( FullDistancesList& propagated );
00067
00069 void extractPropagatedDistances( FullDistancesList& changes, Alignable* alignable,
00070 SingleDistancesList* oldList, SingleDistancesList* newList );
00071
00074 void connect( FullDistancesList& changes, SingleDistancesList* connection,
00075 Alignable* alignable, short int value );
00076
00077 void insertDistance( FullDistancesList& dist, Alignable* i, Alignable* j, short int value );
00078 void insertDistance( SingleDistancesList* distList, Alignable* j, short int value );
00079
00080 FullDistancesList theDistances;
00081 short int theMaxDistance;
00082
00083 SingleDistancesList theDefaultReturnList;
00084
00085
00086
00087 void createBranches( TTree* tree );
00088 void setBranchAddresses( TTree* tree );
00089
00090 align::ID theAli1Id, theAli2Id;
00091 align::StructureType theAli1ObjId, theAli2ObjId;
00092 int theDist;
00093 };
00094
00095
00096 #endif