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, AlignableMuon *aliMuon = nullptr,
30  AlignableExtras *aliExtras = nullptr);
31 
34 
36  const align::Alignables& selectedAlignables() const { return theSelectedAlignables; }
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  }
130  } thePXBDetIdRanges;
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  }
142  } thePXFDetIdRanges;
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  }
152  } theTIBDetIdRanges;
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  }
162  } theTIDDetIdRanges;
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  }
172  } theTOBDetIdRanges;
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  }
184  } theTECDetIdRanges;
185 
186  // further switches used in add(...)
187  bool theOnlyDS;
188  bool theOnlySS;
201  std::string setSpecials(const std::string &name);
202 
203 };
204 
205 template<> bool
206 AlignmentParameterSelector::insideRanges<int>(int value, const std::vector<int> &ranges,
207  bool isPhi) const;
208 
209 #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:78
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:31
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