CMS 3D CMS Logo

AlignmentParameterSelector.h
Go to the documentation of this file.
1 #ifndef ALIGNMENTPARAMETERSELECTOR_H
2 #define ALIGNMENTPARAMETERSELECTOR_H
3 
17 
18 class AlignableExtras;
19 class AlignableTracker;
20 class AlignableMuon;
21 
22 namespace edm {
23  class ParameterSet;
24 }
25 
27 public:
29  explicit AlignmentParameterSelector(AlignableTracker *aliTracker,
30  AlignableMuon *aliMuon = nullptr,
31  AlignableExtras *aliExtras = nullptr);
32 
35 
37  const align::Alignables &selectedAlignables() const { return theSelectedAlignables; }
39  const std::vector<std::vector<char> > &selectedParameters() const { return theSelectedParameters; }
41  void clear();
43  void clearGeometryCuts();
44 
53  unsigned int addSelections(const edm::ParameterSet &pSet);
57  void setGeometryCuts(const edm::ParameterSet &pSet);
60  unsigned int addSelection(const std::string &name, const std::vector<char> &paramSel);
62  unsigned int addSelection(const std::string &name, const std::vector<char> &paramSel, const edm::ParameterSet &pSet);
64  bool layerDeselected(const Alignable *alignable) const;
66  bool detUnitDeselected(const Alignable *alignable) const;
68  bool outsideGeometricalRanges(const Alignable *alignable) const;
70  bool outsideDetIdRanges(const Alignable *alignable) const;
75  template <typename T>
76  bool insideRanges(T value, const std::vector<T> &ranges, bool isPhi = false) const;
78  bool isMemberOfVector(int value, const std::vector<int> &values) const;
80  std::vector<std::string> decompose(const std::string &s, std::string::value_type delimiter) const;
82  std::vector<char> convertParamSel(const std::string &selString) const;
83 
84 protected:
86  unsigned int add(const align::Alignables &alignables, const std::vector<char> &paramSel);
88  unsigned int addAllDets(const std::vector<char> &paramSel);
89  unsigned int addAllRods(const std::vector<char> &paramSel);
90  unsigned int addAllLayers(const std::vector<char> &paramSel);
91  unsigned int addAllAlignables(const std::vector<char> &paramSel);
92 
93  void setPXBDetIdCuts(const edm::ParameterSet &pSet);
94  void setPXFDetIdCuts(const edm::ParameterSet &pSet);
95  void setTIBDetIdCuts(const edm::ParameterSet &pSet);
96  void setTIDDetIdCuts(const edm::ParameterSet &pSet);
97  void setTOBDetIdCuts(const edm::ParameterSet &pSet);
98  void setTECDetIdCuts(const edm::ParameterSet &pSet);
99 
100  const AlignableTracker *alignableTracker() const;
101 
102 private:
107  std::vector<std::vector<char> > theSelectedParameters;
108 
110  std::vector<double> theRangesEta;
111  std::vector<double> theRangesPhi;
112  std::vector<double> theRangesR;
113  std::vector<double> theRangesX;
114  std::vector<double> theRangesY;
115  std::vector<double> theRangesZ;
116 
118  std::vector<int> theDetIds;
119  std::vector<int> theDetIdRanges;
120  std::vector<int> theExcludedDetIds;
121  std::vector<int> theExcludedDetIdRanges;
122  struct PXBDetIdRanges {
123  std::vector<int> theLadderRanges;
124  std::vector<int> theLayerRanges;
125  std::vector<int> theModuleRanges;
126  void clear() {
127  theLadderRanges.clear();
128  theLayerRanges.clear();
129  theModuleRanges.clear();
130  }
131  } thePXBDetIdRanges;
132  struct PXFDetIdRanges {
133  std::vector<int> theBladeRanges;
134  std::vector<int> theDiskRanges;
135  std::vector<int> theModuleRanges;
136  std::vector<int> thePanelRanges;
137  std::vector<int> theSideRanges;
138  void clear() {
139  theBladeRanges.clear();
140  theDiskRanges.clear();
141  theModuleRanges.clear();
142  thePanelRanges.clear();
143  theSideRanges.clear();
144  }
145  } thePXFDetIdRanges;
146  struct TIBDetIdRanges {
147  std::vector<int> theLayerRanges;
148  std::vector<int> theModuleRanges;
149  std::vector<int> theStringRanges;
150  std::vector<int> theSideRanges;
151  void clear() {
152  theLayerRanges.clear();
153  theModuleRanges.clear();
154  theSideRanges.clear();
155  theStringRanges.clear();
156  }
157  } theTIBDetIdRanges;
158  struct TIDDetIdRanges {
159  std::vector<int> theDiskRanges;
160  std::vector<int> theModuleRanges;
161  std::vector<int> theRingRanges;
162  std::vector<int> theSideRanges;
163  void clear() {
164  theDiskRanges.clear();
165  theModuleRanges.clear();
166  theRingRanges.clear();
167  theSideRanges.clear();
168  }
169  } theTIDDetIdRanges;
170  struct TOBDetIdRanges {
171  std::vector<int> theLayerRanges;
172  std::vector<int> theModuleRanges;
173  std::vector<int> theRodRanges;
174  std::vector<int> theSideRanges;
175  void clear() {
176  theLayerRanges.clear();
177  theModuleRanges.clear();
178  theRodRanges.clear();
179  theSideRanges.clear();
180  }
181  } theTOBDetIdRanges;
182  struct TECDetIdRanges {
183  std::vector<int> theWheelRanges;
184  std::vector<int> thePetalRanges;
185  std::vector<int> theModuleRanges;
186  std::vector<int> theRingRanges;
187  std::vector<int> theSideRanges;
188  void clear() {
189  theWheelRanges.clear();
190  thePetalRanges.clear();
191  theModuleRanges.clear();
192  theRingRanges.clear();
193  theSideRanges.clear();
194  }
195  } theTECDetIdRanges;
196 
197  // further switches used in add(...)
198  bool theOnlyDS;
199  bool theOnlySS;
203  enum RphiOrStereoDetUnit { Stereo, Both, Rphi };
212  std::string setSpecials(const std::string &name);
213 };
214 
215 template <>
216 bool AlignmentParameterSelector::insideRanges<int>(int value, const std::vector<int> &ranges, bool isPhi) const;
217 
218 #endif
std::vector< std::vector< char > > theSelectedParameters
std::vector< int > theDetIds
DetId restrictions in eta, phi, r, x, y, z to be applied for next addSelection.
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:167
Definition: value.py:1
string ranges
Definition: diffTwoXMLs.py:79
const align::Alignables & selectedAlignables() const
vector of alignables selected so far
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
std::vector< double > theRangesEta
geometrical restrictions in eta, phi, r, x, y, z to be applied for next addSelection ...
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
HLT enums.
virtual ~AlignmentParameterSelector()
Destructor.
const std::vector< std::vector< char > > & selectedParameters() const
vector of selection &#39;strings&#39; for alignables, parallel to selectedAlignables()
long double T
Constructor of the full muon geometry.
Definition: AlignableMuon.h:37