File indexing completed on 2024-04-06 11:56:08
0001 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentParameterStore_h
0002 #define Alignment_CommonAlignmentAlgorithm_AlignmentParameterStore_h
0003
0004 #include "Alignment/CommonAlignment/interface/Utilities.h"
0005 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignableData.h"
0006 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentCorrelationsStore.h"
0007 #include "Alignment/CommonAlignmentParametrization/interface/CompositeAlignmentParameters.h"
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 namespace edm {
0018 class ParameterSet;
0019 }
0020 class AlignmentUserVariables;
0021 class TrackerTopology;
0022
0023 class AlignmentParameterStore {
0024 public:
0025 typedef std::vector<AlignmentParameters*> Parameters;
0026 typedef std::map<std::pair<Alignable*, Alignable*>, AlgebraicMatrix> Correlations;
0027 typedef std::vector<unsigned int> DetIds;
0028
0029
0030 AlignmentParameterStore(const align::Alignables& alis, const edm::ParameterSet& config);
0031
0032
0033 virtual ~AlignmentParameterStore();
0034
0035
0036
0037 CompositeAlignmentParameters selectParameters(const std::vector<AlignableDet*>& alignabledets) const;
0038
0039 CompositeAlignmentParameters selectParameters(const std::vector<AlignableDetOrUnitPtr>& alignabledets) const;
0040
0041 CompositeAlignmentParameters selectParameters(const align::Alignables&) const;
0042
0043
0044 void updateParameters(const CompositeAlignmentParameters& aap, bool updateCorrelations = true);
0045
0046
0047 const align::Alignables& alignables(void) const { return theAlignables; }
0048
0049
0050 align::Alignables validAlignables(void) const;
0051
0052
0053 int numObjects(void) const { return theAlignables.size(); }
0054
0055
0056 AlignmentCorrelationsStore* correlationsStore(void) const { return theCorrelationsStore; }
0057
0058
0059 const unsigned int numCorrelations(void) const { return theCorrelationsStore->size(); }
0060
0061
0062
0063
0064
0065 Alignable* alignableFromAlignableDet(const AlignableDetOrUnitPtr& alignableDet) const;
0066
0067
0068
0069
0070
0071 void applyParameters(void);
0072
0073
0074 void applyParameters(Alignable* alignable);
0075
0076
0077 void resetParameters(void);
0078
0079
0080 void resetParameters(Alignable* ali);
0081
0082
0083 void cacheTransformations(void);
0084
0085
0086 void cacheTransformations(const align::RunNumber&);
0087
0088
0089 void restoreCachedTransformations(void);
0090
0091
0092 void restoreCachedTransformations(const align::RunNumber&);
0093
0094
0095
0096 void acquireRelativeParameters(void);
0097
0098
0099 void applyAlignableAbsolutePositions(const align::Alignables& alis, const AlignablePositions& newpos, int& ierr);
0100
0101
0102 void applyAlignableRelativePositions(const align::Alignables& alivec, const AlignableShifts& shifts, int& ierr);
0103
0104
0105 void attachAlignmentParameters(const align::Alignables& alivec, const Parameters& parvec, int& ierr);
0106
0107
0108 void attachAlignmentParameters(const Parameters& parvec, int& ierr);
0109
0110
0111 void attachCorrelations(const align::Alignables& alivec, const Correlations& cormap, bool overwrite, int& ierr);
0112
0113
0114 void attachCorrelations(const Correlations& cormap, bool overwrite, int& ierr);
0115
0116
0117 void attachUserVariables(const align::Alignables& alivec,
0118 const std::vector<AlignmentUserVariables*>& uvarvec,
0119 int& ierr);
0120
0121
0122 void setAlignmentPositionError(const align::Alignables& alivec, double valshift, double valrot);
0123
0124
0125 std::pair<int, int> typeAndLayer(const Alignable* ali, const TrackerTopology* tTopo) const;
0126
0127
0128 typedef std::pair<Alignable*, unsigned int> ParameterId;
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144 bool hierarchyConstraints(const Alignable* aliMaster,
0145 const align::Alignables& aliComps,
0146 std::vector<std::vector<ParameterId> >& paramIdsVecOut,
0147 std::vector<std::vector<double> >& factorsVecOut,
0148 bool all,
0149 double epsilon) const;
0150
0151 protected:
0152
0153 AlignmentCorrelationsStore* theCorrelationsStore;
0154
0155 private:
0156 enum TypeOfConstraints { NONE, HIERARCHY_CONSTRAINTS, APPROX_AVERAGING_CONSTRAINTS };
0157
0158
0159
0160
0161 align::Alignables theAlignables;
0162
0163
0164 TypeOfConstraints theTypeOfConstraints;
0165 };
0166
0167 #endif