File indexing completed on 2024-04-06 11:58:32
0001
0002
0003
0004
0005
0006 #ifndef CalibPPS_AlignmentRelative_AlignmentTask_h
0007 #define CalibPPS_AlignmentRelative_AlignmentTask_h
0008
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010
0011 #include "CalibPPS/AlignmentRelative/interface/AlignmentGeometry.h"
0012 class AlignmentConstraint;
0013 class CTPPSGeometry;
0014
0015 #include <vector>
0016
0017
0018
0019
0020 class AlignmentTask {
0021 public:
0022
0023
0024
0025 bool resolveShR;
0026
0027
0028 bool resolveShZ;
0029
0030
0031 bool resolveRotZ;
0032
0033
0034 bool oneRotZPerPot;
0035
0036
0037 bool useEqualMeanUMeanVRotZConstraints;
0038
0039
0040 edm::ParameterSet fixedDetectorsConstraints;
0041
0042
0043 edm::ParameterSet standardConstraints;
0044
0045
0046
0047
0048 AlignmentGeometry geometry;
0049
0050
0051 static void buildGeometry(const std::vector<unsigned int> &rpDecIds,
0052 const std::vector<unsigned int> &excludedSensors,
0053 const CTPPSGeometry *,
0054 double z0,
0055 AlignmentGeometry &geometry);
0056
0057
0058
0059
0060 enum QuantityClass {
0061 qcShR1,
0062 qcShR2,
0063 qcShZ,
0064 qcRotZ,
0065 };
0066
0067
0068 std::vector<QuantityClass> quantityClasses;
0069
0070
0071 std::string quantityClassTag(QuantityClass) const;
0072
0073 struct DetIdDirIdxPair {
0074 unsigned int detId;
0075 unsigned int dirIdx;
0076
0077 bool operator<(const DetIdDirIdxPair &other) const {
0078 if (detId < other.detId)
0079 return true;
0080 if (detId > other.detId)
0081 return false;
0082 if (dirIdx < other.dirIdx)
0083 return true;
0084
0085 return false;
0086 }
0087 };
0088
0089
0090 std::map<QuantityClass, std::map<DetIdDirIdxPair, unsigned int>> mapMeasurementIndeces;
0091
0092
0093 std::map<QuantityClass, std::map<unsigned int, unsigned int>> mapQuantityIndeces;
0094
0095
0096 void buildIndexMaps();
0097
0098
0099 unsigned int measurementsOfClass(QuantityClass) const;
0100
0101
0102 unsigned int quantitiesOfClass(QuantityClass) const;
0103
0104
0105 signed int getMeasurementIndex(QuantityClass cl, unsigned int detId, unsigned int dirIdx) const;
0106
0107
0108 signed int getQuantityIndex(QuantityClass cl, unsigned int detId) const;
0109
0110
0111
0112
0113 void buildFixedDetectorsConstraints(std::vector<AlignmentConstraint> &) const;
0114
0115
0116 void buildStandardConstraints(std::vector<AlignmentConstraint> &) const;
0117
0118
0119 void buildOneRotZPerPotConstraints(std::vector<AlignmentConstraint> &) const;
0120
0121
0122 void buildEqualMeanUMeanVRotZConstraints(std::vector<AlignmentConstraint> &constraints) const;
0123
0124
0125
0126
0127 AlignmentTask() {}
0128
0129
0130 AlignmentTask(const edm::ParameterSet &ps);
0131 };
0132
0133 #endif