Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:08

0001 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentCorrelationsStore_h
0002 #define Alignment_CommonAlignmentAlgorithm_AlignmentCorrelationsStore_h
0003 
0004 /// This class manages the storage and retrieval of correlations between Alignables
0005 /// for the AlignmentParameterStore. This basic implementation simply stores the
0006 /// off diagonal entries of the "big covariance matrix". ATTENTION: Definition of
0007 /// data structure "Correlations" differs from definition in AlignmentParameterStore,
0008 /// but is used only internally.
0009 
0010 #include <map>
0011 
0012 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0013 
0014 class Alignable;
0015 
0016 class AlignmentCorrelationsStore {
0017 public:
0018   typedef std::map<Alignable*, AlgebraicMatrix> CorrelationsTable;
0019   typedef std::map<Alignable*, CorrelationsTable*> Correlations;
0020 
0021   AlignmentCorrelationsStore(void);
0022 
0023   virtual ~AlignmentCorrelationsStore(void) {}
0024 
0025   /// Write correlations directly to the covariance matrix starting at the
0026   /// given position. Indices are assumed to start from 0.
0027   virtual void correlations(Alignable* ap1, Alignable* ap2, AlgebraicSymMatrix& cov, int row, int col) const;
0028 
0029   /// Get correlations directly from the given position of the covariance
0030   /// matrix and store them. Indices are assumed to start from 0.
0031   virtual void setCorrelations(Alignable* ap1, Alignable* ap2, const AlgebraicSymMatrix& cov, int row, int col);
0032 
0033   /// Set correlations.
0034   virtual void setCorrelations(Alignable* ap1, Alignable* ap2, AlgebraicMatrix& mat);
0035 
0036   /// Check whether correlations are stored for a given pair of alignables.
0037   virtual bool correlationsAvailable(Alignable* ap1, Alignable* ap2) const;
0038 
0039   /// Reset correlations.
0040   virtual void resetCorrelations(void);
0041 
0042   /// Get number of stored correlations.
0043   virtual unsigned int size(void) const;
0044 
0045 private:
0046   void fillCorrelationsTable(Alignable* ap1,
0047                              Alignable* ap2,
0048                              CorrelationsTable* table,
0049                              const AlgebraicSymMatrix& cov,
0050                              int row,
0051                              int col,
0052                              bool transpose);
0053 
0054   void fillCovariance(
0055       Alignable* ap1, Alignable* ap2, const AlgebraicMatrix& entry, AlgebraicSymMatrix& cov, int row, int col) const;
0056 
0057   void fillCovarianceT(
0058       Alignable* ap1, Alignable* ap2, const AlgebraicMatrix& entry, AlgebraicSymMatrix& cov, int row, int col) const;
0059 
0060   void readFromCovariance(
0061       Alignable* ap1, Alignable* ap2, AlgebraicMatrix& entry, const AlgebraicSymMatrix& cov, int row, int col);
0062 
0063   void readFromCovarianceT(
0064       Alignable* ap1, Alignable* ap2, AlgebraicMatrix& entry, const AlgebraicSymMatrix& cov, int row, int col);
0065 
0066   Correlations theCorrelations;
0067 };
0068 
0069 #endif