CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
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  }
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  }
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  }
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  }
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  }
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  }
196 
197  // further switches used in add(...)
198  bool theOnlyDS;
199  bool theOnlySS;
213 };
214 
215 template <>
216 bool AlignmentParameterSelector::insideRanges<int>(int value, const std::vector<int> &ranges, bool isPhi) const;
217 
218 #endif
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
bool outsideGeometricalRanges(const Alignable *alignable) const
true if geometrical restrictions in eta, phi, r, x, y, z not satisfied
void setTIDDetIdCuts(const edm::ParameterSet &pSet)
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
AlignmentParameterSelector(AlignableTracker *aliTracker, AlignableMuon *aliMuon=nullptr, AlignableExtras *aliExtras=nullptr)
Constructor from tracker only or from tracker and muon.
unsigned int addAllAlignables(const std::vector< char > &paramSel)
bool insideRanges(T value, const std::vector< T > &ranges, bool isPhi=false) const
void clearGeometryCuts()
remove all geometrical restrictions
std::vector< std::vector< char > > theSelectedParameters
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
void setGeometryCuts(const edm::ParameterSet &pSet)
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
void clear()
remove all selected Alignables and geometrical restrictions
std::vector< int > theDetIds
DetId restrictions in eta, phi, r, x, y, z to be applied for next addSelection.
void setPXBDetIdCuts(const edm::ParameterSet &pSet)
unsigned int addAllDets(const std::vector< char > &paramSel)
some helper methods
void setTECDetIdCuts(const edm::ParameterSet &pSet)
unsigned int addAllLayers(const std::vector< char > &paramSel)
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
std::vector< std::string > decompose(const std::string &s, std::string::value_type delimiter) const
Decomposing input string &#39;s&#39; into parts separated by &#39;delimiter&#39;.
string ranges
Definition: diffTwoXMLs.py:79
unsigned int addAllRods(const std::vector< char > &paramSel)
const align::Alignables & selectedAlignables() const
vector of alignables selected so far
void setPXFDetIdCuts(const edm::ParameterSet &pSet)
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:31
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
unsigned int addSelection(const std::string &name, const std::vector< char > &paramSel)
void setTOBDetIdCuts(const edm::ParameterSet &pSet)
virtual ~AlignmentParameterSelector()
Destructor.
unsigned int add(const align::Alignables &alignables, const std::vector< char > &paramSel)
adding alignables which fulfil geometrical restrictions and special switches
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector&lt;char&gt;
unsigned int addSelections(const edm::ParameterSet &pSet)
bool outsideDetIdRanges(const Alignable *alignable) const
true if DetId restrictions are not satisfied
bool isMemberOfVector(int value, const std::vector< int > &values) const
true if value is member of vector of values
const std::vector< std::vector< char > > & selectedParameters() const
vector of selection &#39;strings&#39; for alignables, parallel to selectedAlignables()
const AlignableTracker * alignableTracker() const
long double T
Constructor of the full muon geometry.
Definition: AlignableMuon.h:38
bool layerDeselected(const Alignable *alignable) const
true if layer is deselected via &quot;Layers&lt;N&gt;&lt;M&gt;&quot; or &quot;DS/SS&quot;
bool detUnitDeselected(const Alignable *alignable) const
true if alignable is DetUnit deselected by Unit&lt;Rphi/Stereo&gt; selection
std::string setSpecials(const std::string &name)
void setTIBDetIdCuts(const edm::ParameterSet &pSet)