CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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, AlignableMuon *aliMuon = 0,
30  AlignableExtras *aliExtras = 0);
31 
34 
38  const std::vector<std::vector<char> >& selectedParameters() const { return theSelectedParameters; }
40  void clear();
42  void clearGeometryCuts();
43 
52  unsigned int addSelections(const edm::ParameterSet &pSet);
56  void setGeometryCuts(const edm::ParameterSet &pSet);
59  unsigned int addSelection(const std::string &name, const std::vector<char> &paramSel);
61  unsigned int addSelection(const std::string &name, const std::vector<char> &paramSel,
62  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> bool insideRanges(T value, const std::vector<T> &ranges,
76  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(); theLayerRanges.clear();
128  theModuleRanges.clear();
129  }
131  struct PXFDetIdRanges {
132  std::vector<int> theBladeRanges;
133  std::vector<int> theDiskRanges;
134  std::vector<int> theModuleRanges;
135  std::vector<int> thePanelRanges;
136  std::vector<int> theSideRanges;
137  void clear() {
138  theBladeRanges.clear(); theDiskRanges.clear();
139  theModuleRanges.clear(); thePanelRanges.clear();
140  theSideRanges.clear();
141  }
143  struct TIBDetIdRanges {
144  std::vector<int> theLayerRanges;
145  std::vector<int> theModuleRanges;
146  std::vector<int> theStringRanges;
147  std::vector<int> theSideRanges;
148  void clear() {
149  theLayerRanges.clear(); theModuleRanges.clear();
150  theSideRanges.clear(); theStringRanges.clear();
151  }
153  struct TIDDetIdRanges {
154  std::vector<int> theDiskRanges;
155  std::vector<int> theModuleRanges;
156  std::vector<int> theRingRanges;
157  std::vector<int> theSideRanges;
158  void clear() {
159  theDiskRanges.clear(); theModuleRanges.clear();
160  theRingRanges.clear(); theSideRanges.clear();
161  }
163  struct TOBDetIdRanges {
164  std::vector<int> theLayerRanges;
165  std::vector<int> theModuleRanges;
166  std::vector<int> theRodRanges;
167  std::vector<int> theSideRanges;
168  void clear() {
169  theLayerRanges.clear(); theModuleRanges.clear();
170  theRodRanges.clear(); theSideRanges.clear();
171  }
173  struct TECDetIdRanges {
174  std::vector<int> theWheelRanges;
175  std::vector<int> thePetalRanges;
176  std::vector<int> theModuleRanges;
177  std::vector<int> theRingRanges;
178  std::vector<int> theSideRanges;
179  void clear() {
180  theWheelRanges.clear(); thePetalRanges.clear();
181  theModuleRanges.clear(); theRingRanges.clear();
182  theSideRanges.clear();
183  }
185 
186  // further switches used in add(...)
187  bool theOnlyDS;
188  bool theOnlySS;
202 
203 };
204 
205 template<> bool
206 AlignmentParameterSelector::insideRanges<int>(int value, const std::vector<int> &ranges,
207  bool isPhi) const;
208 
209 #endif
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)
unsigned int addAllAlignables(const std::vector< char > &paramSel)
AlignmentParameterSelector(AlignableTracker *aliTracker, AlignableMuon *aliMuon=0, AlignableExtras *aliExtras=0)
Constructor from tracker only or from tracker and muon.
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::PXFDetIdRanges thePXFDetIdRanges
void setGeometryCuts(const edm::ParameterSet &pSet)
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)
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
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)
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;.
Container::value_type value_type
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
string ranges
Definition: diffTwoXMLs.py:78
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:28
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
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:36
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
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)