File indexing completed on 2024-04-06 11:56:08
0001 #ifndef ALIGNMENTPARAMETERSELECTOR_H
0002 #define ALIGNMENTPARAMETERSELECTOR_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "Alignment/CommonAlignment/interface/Utilities.h"
0017
0018 class AlignableExtras;
0019 class AlignableTracker;
0020 class AlignableMuon;
0021
0022 namespace edm {
0023 class ParameterSet;
0024 }
0025
0026 class AlignmentParameterSelector {
0027 public:
0028
0029 explicit AlignmentParameterSelector(AlignableTracker *aliTracker,
0030 AlignableMuon *aliMuon = nullptr,
0031 AlignableExtras *aliExtras = nullptr);
0032
0033
0034 virtual ~AlignmentParameterSelector() {}
0035
0036
0037 const align::Alignables &selectedAlignables() const { return theSelectedAlignables; }
0038
0039 const std::vector<std::vector<char> > &selectedParameters() const { return theSelectedParameters; }
0040
0041 void clear();
0042
0043 void clearGeometryCuts();
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 unsigned int addSelections(const edm::ParameterSet &pSet);
0054
0055
0056
0057 void setGeometryCuts(const edm::ParameterSet &pSet);
0058
0059
0060 unsigned int addSelection(const std::string &name, const std::vector<char> ¶mSel);
0061
0062 unsigned int addSelection(const std::string &name, const std::vector<char> ¶mSel, const edm::ParameterSet &pSet);
0063
0064 bool layerDeselected(const Alignable *alignable) const;
0065
0066 bool detUnitDeselected(const Alignable *alignable) const;
0067
0068 bool outsideGeometricalRanges(const Alignable *alignable) const;
0069
0070 bool outsideDetIdRanges(const Alignable *alignable) const;
0071
0072
0073
0074
0075 template <typename T>
0076 bool insideRanges(T value, const std::vector<T> &ranges, bool isPhi = false) const;
0077
0078 bool isMemberOfVector(int value, const std::vector<int> &values) const;
0079
0080 std::vector<std::string> decompose(const std::string &s, std::string::value_type delimiter) const;
0081
0082 std::vector<char> convertParamSel(const std::string &selString) const;
0083
0084 protected:
0085
0086 unsigned int add(const align::Alignables &alignables, const std::vector<char> ¶mSel);
0087
0088 unsigned int addAllDets(const std::vector<char> ¶mSel);
0089 unsigned int addAllRods(const std::vector<char> ¶mSel);
0090 unsigned int addAllLayers(const std::vector<char> ¶mSel);
0091 unsigned int addAllAlignables(const std::vector<char> ¶mSel);
0092
0093 void setPXBDetIdCuts(const edm::ParameterSet &pSet);
0094 void setPXFDetIdCuts(const edm::ParameterSet &pSet);
0095 void setTIBDetIdCuts(const edm::ParameterSet &pSet);
0096 void setTIDDetIdCuts(const edm::ParameterSet &pSet);
0097 void setTOBDetIdCuts(const edm::ParameterSet &pSet);
0098 void setTECDetIdCuts(const edm::ParameterSet &pSet);
0099
0100 const AlignableTracker *alignableTracker() const;
0101
0102 private:
0103 AlignableTracker *theTracker;
0104 AlignableMuon *theMuon;
0105 AlignableExtras *theExtras;
0106 align::Alignables theSelectedAlignables;
0107 std::vector<std::vector<char> > theSelectedParameters;
0108
0109
0110 std::vector<double> theRangesEta;
0111 std::vector<double> theRangesPhi;
0112 std::vector<double> theRangesR;
0113 std::vector<double> theRangesX;
0114 std::vector<double> theRangesY;
0115 std::vector<double> theRangesZ;
0116
0117
0118 std::vector<int> theDetIds;
0119 std::vector<int> theDetIdRanges;
0120 std::vector<int> theExcludedDetIds;
0121 std::vector<int> theExcludedDetIdRanges;
0122 struct PXBDetIdRanges {
0123 std::vector<int> theLadderRanges;
0124 std::vector<int> theLayerRanges;
0125 std::vector<int> theModuleRanges;
0126 void clear() {
0127 theLadderRanges.clear();
0128 theLayerRanges.clear();
0129 theModuleRanges.clear();
0130 }
0131 } thePXBDetIdRanges;
0132 struct PXFDetIdRanges {
0133 std::vector<int> theBladeRanges;
0134 std::vector<int> theDiskRanges;
0135 std::vector<int> theModuleRanges;
0136 std::vector<int> thePanelRanges;
0137 std::vector<int> theSideRanges;
0138 void clear() {
0139 theBladeRanges.clear();
0140 theDiskRanges.clear();
0141 theModuleRanges.clear();
0142 thePanelRanges.clear();
0143 theSideRanges.clear();
0144 }
0145 } thePXFDetIdRanges;
0146 struct TIBDetIdRanges {
0147 std::vector<int> theLayerRanges;
0148 std::vector<int> theModuleRanges;
0149 std::vector<int> theStringRanges;
0150 std::vector<int> theSideRanges;
0151 void clear() {
0152 theLayerRanges.clear();
0153 theModuleRanges.clear();
0154 theSideRanges.clear();
0155 theStringRanges.clear();
0156 }
0157 } theTIBDetIdRanges;
0158 struct TIDDetIdRanges {
0159 std::vector<int> theDiskRanges;
0160 std::vector<int> theModuleRanges;
0161 std::vector<int> theRingRanges;
0162 std::vector<int> theSideRanges;
0163 void clear() {
0164 theDiskRanges.clear();
0165 theModuleRanges.clear();
0166 theRingRanges.clear();
0167 theSideRanges.clear();
0168 }
0169 } theTIDDetIdRanges;
0170 struct TOBDetIdRanges {
0171 std::vector<int> theLayerRanges;
0172 std::vector<int> theModuleRanges;
0173 std::vector<int> theRodRanges;
0174 std::vector<int> theSideRanges;
0175 void clear() {
0176 theLayerRanges.clear();
0177 theModuleRanges.clear();
0178 theRodRanges.clear();
0179 theSideRanges.clear();
0180 }
0181 } theTOBDetIdRanges;
0182 struct TECDetIdRanges {
0183 std::vector<int> theWheelRanges;
0184 std::vector<int> thePetalRanges;
0185 std::vector<int> theModuleRanges;
0186 std::vector<int> theRingRanges;
0187 std::vector<int> theSideRanges;
0188 void clear() {
0189 theWheelRanges.clear();
0190 thePetalRanges.clear();
0191 theModuleRanges.clear();
0192 theRingRanges.clear();
0193 theSideRanges.clear();
0194 }
0195 } theTECDetIdRanges;
0196
0197
0198 bool theOnlyDS;
0199 bool theOnlySS;
0200 bool theSelLayers;
0201 int theMinLayer;
0202 int theMaxLayer;
0203 enum RphiOrStereoDetUnit { Stereo, Both, Rphi };
0204 RphiOrStereoDetUnit theRphiOrStereoDetUnit;
0205
0206
0207
0208
0209
0210
0211
0212 std::string setSpecials(const std::string &name);
0213 };
0214
0215 template <>
0216 bool AlignmentParameterSelector::insideRanges<int>(int value, const std::vector<int> &ranges, bool isPhi) const;
0217
0218 #endif