Go to the documentation of this file.00001 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentParameterStore_h
00002 #define Alignment_CommonAlignmentAlgorithm_AlignmentParameterStore_h
00003
00004 #include "Alignment/CommonAlignment/interface/Utilities.h"
00005 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignableData.h"
00006 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentCorrelationsStore.h"
00007 #include "Alignment/CommonAlignmentParametrization/interface/CompositeAlignmentParameters.h"
00008
00016
00017 namespace edm { class ParameterSet; }
00018 class AlignmentUserVariables;
00019 class TrackerTopology;
00020
00021 class AlignmentParameterStore
00022 {
00023
00024 public:
00025
00026 typedef std::vector<AlignmentParameters*> Parameters;
00027 typedef std::map< std::pair<Alignable*,Alignable*>,AlgebraicMatrix > Correlations;
00028 typedef std::vector<unsigned int> DetIds;
00029
00031 AlignmentParameterStore( const align::Alignables &alis, const edm::ParameterSet& config );
00032
00034 virtual ~AlignmentParameterStore();
00035
00038 CompositeAlignmentParameters
00039 selectParameters( const std::vector <AlignableDet*>& alignabledets ) const;
00041 CompositeAlignmentParameters
00042 selectParameters( const std::vector <AlignableDetOrUnitPtr>& alignabledets ) const;
00044 CompositeAlignmentParameters
00045 selectParameters( const std::vector <Alignable*>& alignables ) const;
00046
00048 void updateParameters(const CompositeAlignmentParameters& aap, bool updateCorrelations = true);
00049
00051 const align::Alignables& alignables(void) const { return theAlignables; }
00052
00054 align::Alignables validAlignables(void) const;
00055
00057 int numObjects(void) const { return theAlignables.size(); }
00058
00060 AlignmentCorrelationsStore* correlationsStore( void ) const { return theCorrelationsStore; }
00061
00063 const unsigned int numCorrelations( void ) const { return theCorrelationsStore->size(); }
00064
00066
00067
00069 Alignable* alignableFromAlignableDet( AlignableDetOrUnitPtr alignableDet ) const;
00070
00072
00073
00075 void applyParameters(void);
00076
00078 void applyParameters(Alignable* alignable);
00079
00081 void resetParameters(void);
00082
00084 void resetParameters(Alignable* ali);
00085
00087 void cacheTransformations(void);
00088
00090 void restoreCachedTransformations(void);
00091
00094 void acquireRelativeParameters(void);
00095
00097 void applyAlignableAbsolutePositions( const align::Alignables& alis,
00098 const AlignablePositions& newpos, int& ierr );
00099
00101 void applyAlignableRelativePositions( const align::Alignables& alivec,
00102 const AlignableShifts& shifts, int& ierr );
00103
00105 void attachAlignmentParameters( const align::Alignables& alivec, const Parameters& parvec, int& ierr );
00106
00108 void attachAlignmentParameters(const Parameters& parvec, int& ierr);
00109
00111 void attachCorrelations( const align::Alignables& alivec, const Correlations& cormap,
00112 bool overwrite, int& ierr );
00113
00115 void attachCorrelations( const Correlations& cormap, bool overwrite, int& ierr );
00116
00118 void attachUserVariables( const align::Alignables& alivec,
00119 const std::vector<AlignmentUserVariables*>& uvarvec, int& ierr);
00120
00122 void setAlignmentPositionError( const align::Alignables& alivec, double valshift, double valrot );
00123
00125 std::pair<int,int> typeAndLayer( const Alignable* ali, const TrackerTopology* tTopo ) const;
00126
00128 typedef std::pair<Alignable*, unsigned int> ParameterId;
00144 bool hierarchyConstraints(const Alignable *aliMaster, const align::Alignables &aliComps,
00145 std::vector<std::vector<ParameterId> > ¶mIdsVecOut,
00146 std::vector<std::vector<double> > &factorsVecOut,
00147 bool all, double epsilon) const;
00148
00149 protected:
00150
00151
00152 AlignmentCorrelationsStore* theCorrelationsStore;
00153
00154 private:
00155
00156
00158 align::Alignables theAlignables;
00159
00160 };
00161
00162 #endif