CMS 3D CMS Logo

AlignmentParameterSelector.cc
Go to the documentation of this file.
1 
14 
16 #include "DataFormats/SiStripDetId/interface/SiStripDetId.h" // for enums TID/TIB/etc.
18 
22 
23 //________________________________________________________________________________
25  AlignableMuon *aliMuon,
26  AlignableExtras *aliExtras)
27  : theTracker(aliTracker),
28  theMuon(aliMuon),
29  theExtras(aliExtras),
30  theSelectedAlignables(),
31  theRangesEta(),
32  theRangesPhi(),
33  theRangesR(),
34  theRangesX(),
35  theRangesY(),
36  theRangesZ() {
37  this->setSpecials(""); // init theOnlyDS, theOnlySS, theSelLayers, theMinLayer, theMaxLayer, theRphiOrStereoDetUnit
38 }
39 
40 //________________________________________________________________________________
42  theSelectedAlignables.clear();
43  theSelectedParameters.clear();
44  this->clearGeometryCuts();
45 }
46 
47 //________________________________________________________________________________
49  theRangesEta.clear();
50  theRangesPhi.clear();
51  theRangesR.clear();
52  theRangesX.clear();
53  theRangesY.clear();
54  theRangesZ.clear();
55 
62 }
63 
65 
66 //__________________________________________________________________________________________________
68  const std::vector<std::string> selections = pSet.getParameter<std::vector<std::string> >("alignParams");
69 
70  unsigned int addedSets = 0;
71 
72  for (unsigned int iSel = 0; iSel < selections.size(); ++iSel) {
73  std::vector<std::string> decompSel(this->decompose(selections[iSel], ','));
74  if (decompSel.empty())
75  continue; // edm::LogError or even cms::Exception??
76 
77  if (decompSel.size() < 2) {
78  throw cms::Exception("BadConfig") << "@SUB=AlignmentParameterSelector::addSelections" << selections[iSel]
79  << " from alignableParamSelector: "
80  << " should have at least 2 ','-separated parts";
81  } else if (decompSel.size() > 2) {
82  const edm::ParameterSet geoSel(pSet.getParameter<edm::ParameterSet>(decompSel[2].c_str()));
83  this->addSelection(decompSel[0], this->convertParamSel(decompSel[1]), geoSel);
84  } else {
85  this->clearGeometryCuts();
86  this->addSelection(decompSel[0], this->convertParamSel(decompSel[1]));
87  }
88 
89  ++addedSets;
90  }
91 
92  return addedSets;
93 }
94 
95 //________________________________________________________________________________
97  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
98  // but take care that nothing unknown is configured (to fetch typos!).
99 
100  this->clearGeometryCuts();
101  const std::vector<std::string> parameterNames(pSet.getParameterNames());
102  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
103  iParam != iEnd;
104  ++iParam) {
105  // Calling swap is more efficient than assignment:
106  if (*iParam == "etaRanges") {
107  pSet.getParameter<std::vector<double> >(*iParam).swap(theRangesEta);
108  } else if (*iParam == "phiRanges") {
109  pSet.getParameter<std::vector<double> >(*iParam).swap(theRangesPhi);
110  } else if (*iParam == "rRanges") {
111  pSet.getParameter<std::vector<double> >(*iParam).swap(theRangesR);
112  } else if (*iParam == "xRanges") {
113  pSet.getParameter<std::vector<double> >(*iParam).swap(theRangesX);
114  } else if (*iParam == "yRanges") {
115  pSet.getParameter<std::vector<double> >(*iParam).swap(theRangesY);
116  } else if (*iParam == "zRanges") {
117  pSet.getParameter<std::vector<double> >(*iParam).swap(theRangesZ);
118  } else if (*iParam == "detIds") {
119  pSet.getParameter<std::vector<int> >(*iParam).swap(theDetIds);
120  } else if (*iParam == "detIdRanges") {
121  pSet.getParameter<std::vector<int> >(*iParam).swap(theDetIdRanges);
122  } else if (*iParam == "excludedDetIds") {
123  pSet.getParameter<std::vector<int> >(*iParam).swap(theExcludedDetIds);
124  } else if (*iParam == "excludedDetIdRanges") {
125  pSet.getParameter<std::vector<int> >(*iParam).swap(theExcludedDetIdRanges);
126  } else if (*iParam == "pxbDetId") {
127  const edm::ParameterSet &pxbDetIdPSet = pSet.getParameterSet(*iParam);
128  this->setPXBDetIdCuts(pxbDetIdPSet);
129  } else if (*iParam == "pxfDetId") {
130  const edm::ParameterSet &pxfDetIdPSet = pSet.getParameterSet(*iParam);
131  this->setPXFDetIdCuts(pxfDetIdPSet);
132  } else if (*iParam == "tibDetId") {
133  const edm::ParameterSet &tibDetIdPSet = pSet.getParameterSet(*iParam);
134  this->setTIBDetIdCuts(tibDetIdPSet);
135  } else if (*iParam == "tidDetId") {
136  const edm::ParameterSet &tidDetIdPSet = pSet.getParameterSet(*iParam);
137  this->setTIDDetIdCuts(tidDetIdPSet);
138  } else if (*iParam == "tobDetId") {
139  const edm::ParameterSet &tobDetIdPSet = pSet.getParameterSet(*iParam);
140  this->setTOBDetIdCuts(tobDetIdPSet);
141  } else if (*iParam == "tecDetId") {
142  const edm::ParameterSet &tecDetIdPSet = pSet.getParameterSet(*iParam);
143  this->setTECDetIdCuts(tecDetIdPSet);
144  } else {
145  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setGeometryCuts] "
146  << "Unknown parameter '" << *iParam << "'.\n";
147  }
148  }
149 }
150 
151 //________________________________________________________________________________
153  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
154  // but take care that nothing unknown is configured (to fetch typos!).
155 
156  const std::vector<std::string> parameterNames(pSet.getParameterNames());
157  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
158  iParam != iEnd;
159  ++iParam) {
160  // Calling swap is more efficient than assignment:
161  if (*iParam == "ladderRanges") {
162  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXBDetIdRanges.theLadderRanges);
163  } else if (*iParam == "layerRanges") {
164  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXBDetIdRanges.theLayerRanges);
165  } else if (*iParam == "moduleRanges") {
166  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXBDetIdRanges.theModuleRanges);
167  } else {
168  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setPXBDetIdCuts] "
169  << "Unknown parameter '" << *iParam << "'.\n";
170  }
171  }
172 }
173 
174 //________________________________________________________________________________
176  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
177  // but take care that nothing unknown is configured (to fetch typos!).
178 
179  const std::vector<std::string> parameterNames(pSet.getParameterNames());
180  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
181  iParam != iEnd;
182  ++iParam) {
183  // Calling swap is more efficient than assignment:
184  if (*iParam == "bladeRanges") {
185  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXFDetIdRanges.theBladeRanges);
186  } else if (*iParam == "diskRanges") {
187  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXFDetIdRanges.theDiskRanges);
188  } else if (*iParam == "moduleRanges") {
189  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXFDetIdRanges.theModuleRanges);
190  } else if (*iParam == "panelRanges") {
191  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXFDetIdRanges.thePanelRanges);
192  } else if (*iParam == "sideRanges") {
193  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXFDetIdRanges.theSideRanges);
194  } else {
195  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setPXFDetIdCuts] "
196  << "Unknown parameter '" << *iParam << "'.\n";
197  }
198  }
199 }
200 
201 //________________________________________________________________________________
203  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
204  // but take care that nothing unknown is configured (to fetch typos!).
205 
206  const std::vector<std::string> parameterNames(pSet.getParameterNames());
207  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
208  iParam != iEnd;
209  ++iParam) {
210  // Calling swap is more efficient than assignment:
211  if (*iParam == "layerRanges") {
212  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIBDetIdRanges.theLayerRanges);
213  } else if (*iParam == "moduleRanges") {
214  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIBDetIdRanges.theModuleRanges);
215  } else if (*iParam == "stringRanges") {
216  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIBDetIdRanges.theStringRanges);
217  } else if (*iParam == "sideRanges") {
218  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIBDetIdRanges.theSideRanges);
219  } else {
220  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setTIBDetIdCuts] "
221  << "Unknown parameter '" << *iParam << "'.\n";
222  }
223  }
224 }
225 
226 //________________________________________________________________________________
228  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
229  // but take care that nothing unknown is configured (to fetch typos!).
230 
231  const std::vector<std::string> parameterNames(pSet.getParameterNames());
232  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
233  iParam != iEnd;
234  ++iParam) {
235  // Calling swap is more efficient than assignment:
236  if (*iParam == "diskRanges") {
237  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIDDetIdRanges.theDiskRanges);
238  } else if (*iParam == "moduleRanges") {
239  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIDDetIdRanges.theModuleRanges);
240  } else if (*iParam == "ringRanges") {
241  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIDDetIdRanges.theRingRanges);
242  } else if (*iParam == "sideRanges") {
243  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIDDetIdRanges.theSideRanges);
244  } else {
245  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setTIDDetIdCuts] "
246  << "Unknown parameter '" << *iParam << "'.\n";
247  }
248  }
249 }
250 
251 //________________________________________________________________________________
253  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
254  // but take care that nothing unknown is configured (to fetch typos!).
255 
256  const std::vector<std::string> parameterNames(pSet.getParameterNames());
257  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
258  iParam != iEnd;
259  ++iParam) {
260  // Calling swap is more efficient than assignment:
261  if (*iParam == "layerRanges") {
262  pSet.getParameter<std::vector<int> >(*iParam).swap(theTOBDetIdRanges.theLayerRanges);
263  } else if (*iParam == "moduleRanges") {
264  pSet.getParameter<std::vector<int> >(*iParam).swap(theTOBDetIdRanges.theModuleRanges);
265  } else if (*iParam == "sideRanges") {
266  pSet.getParameter<std::vector<int> >(*iParam).swap(theTOBDetIdRanges.theSideRanges);
267  } else if (*iParam == "rodRanges") {
268  pSet.getParameter<std::vector<int> >(*iParam).swap(theTOBDetIdRanges.theRodRanges);
269  } else {
270  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setTOBDetIdCuts] "
271  << "Unknown parameter '" << *iParam << "'.\n";
272  }
273  }
274 }
275 
276 //________________________________________________________________________________
278  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
279  // but take care that nothing unknown is configured (to fetch typos!).
280 
281  const std::vector<std::string> parameterNames(pSet.getParameterNames());
282  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(), iEnd = parameterNames.end();
283  iParam != iEnd;
284  ++iParam) {
285  // Calling swap is more efficient than assignment:
286  if (*iParam == "wheelRanges") {
287  pSet.getParameter<std::vector<int> >(*iParam).swap(theTECDetIdRanges.theWheelRanges);
288  } else if (*iParam == "petalRanges") {
289  pSet.getParameter<std::vector<int> >(*iParam).swap(theTECDetIdRanges.thePetalRanges);
290  } else if (*iParam == "moduleRanges") {
291  pSet.getParameter<std::vector<int> >(*iParam).swap(theTECDetIdRanges.theModuleRanges);
292  } else if (*iParam == "ringRanges") {
293  pSet.getParameter<std::vector<int> >(*iParam).swap(theTECDetIdRanges.theRingRanges);
294  } else if (*iParam == "sideRanges") {
295  pSet.getParameter<std::vector<int> >(*iParam).swap(theTECDetIdRanges.theSideRanges);
296  } else {
297  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setTECDetIdCuts] "
298  << "Unknown parameter '" << *iParam << "'.\n";
299  }
300  }
301 }
302 
303 //________________________________________________________________________________
305  const std::vector<char> &paramSel,
306  const edm::ParameterSet &pSet) {
307  this->setGeometryCuts(pSet);
308  return this->addSelection(name, paramSel);
309 }
310 
311 //________________________________________________________________________________
312 unsigned int AlignmentParameterSelector::addSelection(const std::string &nameInput, const std::vector<char> &paramSel) {
313  const std::string name(this->setSpecials(nameInput)); // possibly changing name
314 
315  unsigned int numAli = 0;
316 
318  // Generic Tracker Section
320  if (name.find("Tracker") == 0) { // string starts with "Tracker"
321  if (!theTracker) {
322  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::addSelection] "
323  << "Configuration requires access to AlignableTracker"
324  << " (for " << name << ") that is not initialized";
325  }
326  const std::string substructName(name, 7); // erase "Tracker" at the beginning
327  numAli += this->add(theTracker->subStructures(substructName), paramSel);
328  }
330  // Old hardcoded, but geometry-independent tracker section (NOTE: no check on theTracker != 0)
332  else if (name == "AllDets")
333  numAli += this->addAllDets(paramSel);
334  else if (name == "AllRods")
335  numAli += this->addAllRods(paramSel);
336  else if (name == "AllLayers")
337  numAli += this->addAllLayers(paramSel);
338  else if (name == "AllComponents")
339  numAli += this->add(theTracker->components(), paramSel);
340  else if (name == "AllAlignables")
341  numAli += this->addAllAlignables(paramSel);
342  //
343  // TIB+TOB
344  //
345  else if (name == "BarrelRods")
346  numAli += this->add(theTracker->barrelRods(), paramSel);
347  else if (name == "BarrelDets")
348  numAli += this->add(theTracker->barrelGeomDets(), paramSel);
349  else if (name == "BarrelLayers")
350  numAli += this->add(theTracker->barrelLayers(), paramSel);
351  else if (name == "TOBDets")
352  numAli += this->add(theTracker->outerBarrelGeomDets(), paramSel);
353  else if (name == "TOBRods")
354  numAli += this->add(theTracker->outerBarrelRods(), paramSel);
355  else if (name == "TOBLayers")
356  numAli += this->add(theTracker->outerBarrelLayers(), paramSel);
357  else if (name == "TOBHalfBarrels")
358  numAli += this->add(theTracker->outerHalfBarrels(), paramSel);
359  else if (name == "TIBDets")
360  numAli += this->add(theTracker->innerBarrelGeomDets(), paramSel);
361  else if (name == "TIBRods")
362  numAli += this->add(theTracker->innerBarrelRods(), paramSel);
363  else if (name == "TIBLayers")
364  numAli += this->add(theTracker->innerBarrelLayers(), paramSel);
365  else if (name == "TIBHalfBarrels")
366  numAli += this->add(theTracker->innerHalfBarrels(), paramSel);
367  //
368  // PXBarrel
369  //
370  else if (name == "PixelHalfBarrelDets") {
371  numAli += this->add(theTracker->pixelHalfBarrelGeomDets(), paramSel);
372  } else if (name == "PixelHalfBarrelLadders") {
373  numAli += this->add(theTracker->pixelHalfBarrelLadders(), paramSel);
374  } else if (name == "PixelHalfBarrelLayers") {
375  numAli += this->add(theTracker->pixelHalfBarrelLayers(), paramSel);
376  } else if (name == "PixelHalfBarrels") {
377  numAli += this->add(theTracker->pixelHalfBarrels(), paramSel);
378  }
379  //
380  // PXEndcap
381  //
382  else if (name == "PXECDets")
383  numAli += this->add(theTracker->pixelEndcapGeomDets(), paramSel);
384  else if (name == "PXECPetals")
385  numAli += this->add(theTracker->pixelEndcapPetals(), paramSel);
386  else if (name == "PXECLayers")
387  numAli += this->add(theTracker->pixelEndcapLayers(), paramSel);
388  else if (name == "PXECHalfCylinders")
389  numAli += this->add(theTracker->pixelEndcapHalfCylinders(), paramSel);
390  else if (name == "PXEndCaps")
391  numAli += this->add(theTracker->pixelEndCaps(), paramSel);
392  //
393  // Pixel Barrel+endcap
394  //
395  else if (name == "PixelDets") {
396  numAli += this->add(theTracker->pixelHalfBarrelGeomDets(), paramSel);
397  numAli += this->add(theTracker->pixelEndcapGeomDets(), paramSel);
398  } else if (name == "PixelRods") {
399  numAli += this->add(theTracker->pixelHalfBarrelLadders(), paramSel);
400  numAli += this->add(theTracker->pixelEndcapPetals(), paramSel);
401  } else if (name == "PixelLayers") {
402  numAli += this->add(theTracker->pixelHalfBarrelLayers(), paramSel);
403  numAli += this->add(theTracker->pixelEndcapLayers(), paramSel);
404  }
405  //
406  // TID
407  //
408  else if (name == "TIDs")
409  numAli += this->add(theTracker->TIDs(), paramSel);
410  else if (name == "TIDLayers")
411  numAli += this->add(theTracker->TIDLayers(), paramSel);
412  else if (name == "TIDRings")
413  numAli += this->add(theTracker->TIDRings(), paramSel);
414  else if (name == "TIDDets")
415  numAli += this->add(theTracker->TIDGeomDets(), paramSel);
416  //
417  // TEC
418  //
419  else if (name == "TECDets")
420  numAli += this->add(theTracker->endcapGeomDets(), paramSel);
421  else if (name == "TECPetals")
422  numAli += this->add(theTracker->endcapPetals(), paramSel);
423  else if (name == "TECLayers")
424  numAli += this->add(theTracker->endcapLayers(), paramSel);
425  else if (name == "TECs")
426  numAli += this->add(theTracker->endCaps(), paramSel);
427  //
428  // StripEndcap (TID+TEC)
429  //
430  else if (name == "EndcapDets") {
431  numAli += this->add(theTracker->TIDGeomDets(), paramSel);
432  numAli += this->add(theTracker->endcapGeomDets(), paramSel);
433  } else if (name == "EndcapPetals") {
434  numAli += this->add(theTracker->TIDRings(), paramSel);
435  numAli += this->add(theTracker->endcapPetals(), paramSel);
436  } else if (name == "EndcapLayers") {
437  numAli += this->add(theTracker->TIDLayers(), paramSel);
438  numAli += this->add(theTracker->endcapLayers(), paramSel);
439  }
440  //
441  // Strip Barrel+endcap
442  //
443  else if (name == "StripDets") {
444  numAli += this->add(theTracker->barrelGeomDets(), paramSel);
445  numAli += this->add(theTracker->TIDGeomDets(), paramSel);
446  numAli += this->add(theTracker->endcapGeomDets(), paramSel);
447  } else if (name == "StripRods") {
448  numAli += this->add(theTracker->barrelRods(), paramSel);
449  numAli += this->add(theTracker->TIDRings(), paramSel);
450  numAli += this->add(theTracker->endcapPetals(), paramSel);
451  } else if (name == "StripLayers") {
452  numAli += this->add(theTracker->barrelLayers(), paramSel);
453  numAli += this->add(theTracker->TIDLayers(), paramSel);
454  numAli += this->add(theTracker->endcapLayers(), paramSel);
455  }
457  // Muon selection
459  // Check if name contains muon and react if alignable muon not initialized
460  else if (name.find("Muon") != std::string::npos) {
461  if (!theMuon) {
462  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::addSelection] "
463  << "Configuration requires access to AlignableMuon"
464  << " which is not initialized";
465  } else if (name == "MuonDTLayers")
466  add(theMuon->DTLayers(), paramSel);
467  else if (name == "MuonDTSuperLayers")
468  add(theMuon->DTSuperLayers(), paramSel);
469  else if (name == "MuonDTChambers")
470  add(theMuon->DTChambers(), paramSel);
471  else if (name == "MuonDTStations")
472  add(theMuon->DTStations(), paramSel);
473  else if (name == "MuonDTWheels")
474  add(theMuon->DTWheels(), paramSel);
475  else if (name == "MuonBarrel")
476  add(theMuon->DTBarrel(), paramSel);
477  else if (name == "MuonCSCLayers")
478  add(theMuon->CSCLayers(), paramSel);
479  else if (name == "MuonCSCRings")
480  add(theMuon->CSCRings(), paramSel);
481  else if (name == "MuonCSCChambers")
482  add(theMuon->CSCChambers(), paramSel);
483  else if (name == "MuonCSCStations")
484  add(theMuon->CSCStations(), paramSel);
485  else if (name == "MuonEndcaps")
486  add(theMuon->CSCEndcaps(), paramSel);
487 
489  // not found, but Muon
491  else {
492  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::addSelection]"
493  << ": Selection '" << name << "' invalid!";
494  }
495  }
496 
498  // Generic Extra Alignable Section
500  else if (name.find("Extras") == 0) { // string starts with "Extras"
501  if (!theExtras) {
502  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::addSelection] "
503  << "Configuration requires access to AlignableExtras"
504  << " (for " << name << ") that is not initialized";
505  }
506  const std::string substructName(name, 6); // erase "Extras" at the beginning
507  numAli += this->add(theExtras->subStructures(substructName), paramSel);
508  }
509  // end of "name.find("Extras") != std::string::npos"
510 
511  else {
512  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::addSelection]"
513  << ": Selection '" << name << "' invalid!";
514  }
515 
516  this->setSpecials(""); // reset
517 
518  return numAli;
519 }
520 
521 //________________________________________________________________________________
522 unsigned int AlignmentParameterSelector::add(const align::Alignables &alignables, const std::vector<char> &paramSel) {
523  unsigned int numAli = 0;
524 
525  // loop on Alignable objects
526  for (align::Alignables::const_iterator iAli = alignables.begin(); iAli != alignables.end(); ++iAli) {
527  if (!this->layerDeselected(*iAli) // check layers
528  && !this->detUnitDeselected(*iAli) // check detunit selection
529  && !this->outsideGeometricalRanges(*iAli) // check geometrical ranges
530  && !this->outsideDetIdRanges(*iAli)) { // check DetId ranges
531  // all fine, so add to output arrays
532  theSelectedAlignables.push_back(*iAli);
533  theSelectedParameters.push_back(paramSel);
534  ++numAli;
535  }
536  }
537 
538  return numAli;
539 }
540 
541 //_________________________________________________________________________
543  if (theOnlySS || theOnlyDS || theSelLayers) {
544  TrackerAlignableId idProvider;
545  std::pair<int, int> typeLayer = idProvider.typeAndLayerFromDetId(ali->id(), alignableTracker()->trackerTopology());
546  int type = typeLayer.first;
547  int layer = typeLayer.second;
548 
549  // select on single/double sided barrel layers in TIB/TOB
550  if (theOnlySS // only single sided
551  && (std::abs(type) == SiStripDetId::TIB || std::abs(type) == SiStripDetId::TOB) && layer <= 2) {
552  return true;
553  }
554  if (theOnlyDS // only double sided
555  && (std::abs(type) == SiStripDetId::TIB || std::abs(type) == SiStripDetId::TOB) && layer > 2) {
556  return true;
557  }
558 
559  // reject layers
560  if (theSelLayers && (layer < theMinLayer || layer > theMaxLayer)) {
561  return true;
562  }
563  }
564 
565  return false; // do not deselect...
566 }
567 
568 //_________________________________________________________________________
571  const SiStripDetId detId(ali->geomDetId()); // do not know yet whether right type...
572  if (detId.det() == DetId::Tracker &&
573  (detId.subdetId() == SiStripDetId::TIB || detId.subdetId() == SiStripDetId::TID ||
574  detId.subdetId() == SiStripDetId::TOB || detId.subdetId() == SiStripDetId::TEC)) {
575  // We have a DetUnit in strip, so check for a selection of stereo/rphi (DetUnits in 1D layers are rphi):
576  if ((theRphiOrStereoDetUnit == Stereo && !detId.stereo()) || (theRphiOrStereoDetUnit == Rphi && detId.stereo())) {
577  return true;
578  }
579  }
580  }
581 
582  return false; // do not deselect...
583 }
584 
585 //_________________________________________________________________________
587  const align::PositionType &position(alignable->globalPosition());
588 
589  if (!theRangesEta.empty() && !this->insideRanges<double>((position.eta()), theRangesEta))
590  return true;
591  if (!theRangesPhi.empty() && !this->insideRanges<double>((position.phi()), theRangesPhi, true))
592  return true;
593  if (!theRangesR.empty() && !this->insideRanges<double>((position.perp()), theRangesR))
594  return true;
595  if (!theRangesX.empty() && !this->insideRanges<double>((position.x()), theRangesX))
596  return true;
597  if (!theRangesY.empty() && !this->insideRanges<double>((position.y()), theRangesY))
598  return true;
599  if (!theRangesZ.empty() && !this->insideRanges<double>((position.z()), theRangesZ))
600  return true;
601 
602  return false;
603 }
604 
605 //_________________________________________________________________________
607  //const DetId detId(alignable->geomDetId());
608  const DetId detId(alignable->id());
609  const int subdetId = detId.subdetId();
610 
611  if (alignableTracker()) {
613 
614  if (!theDetIds.empty() && !this->isMemberOfVector((detId.rawId()), theDetIds))
615  return true;
616  if (!theDetIdRanges.empty() && !this->insideRanges<int>((detId.rawId()), theDetIdRanges))
617  return true;
618  if (!theExcludedDetIds.empty() && this->isMemberOfVector((detId.rawId()), theExcludedDetIds))
619  return true;
620  if (!theExcludedDetIdRanges.empty() && this->insideRanges<int>((detId.rawId()), theExcludedDetIdRanges))
621  return true;
622 
623  if (detId.det() == DetId::Tracker) {
624  if (subdetId == static_cast<int>(PixelSubdetector::PixelBarrel)) {
625  if (!thePXBDetIdRanges.theLadderRanges.empty() &&
626  !this->insideRanges<int>(tTopo->pxbLadder(detId), thePXBDetIdRanges.theLadderRanges))
627  return true;
628  if (!thePXBDetIdRanges.theLayerRanges.empty() &&
629  !this->insideRanges<int>(tTopo->pxbLayer(detId), thePXBDetIdRanges.theLayerRanges))
630  return true;
631  if (!thePXBDetIdRanges.theModuleRanges.empty() &&
632  !this->insideRanges<int>(tTopo->pxbModule(detId), thePXBDetIdRanges.theModuleRanges))
633  return true;
634  }
635 
636  if (subdetId == static_cast<int>(PixelSubdetector::PixelEndcap)) {
637  if (!thePXFDetIdRanges.theBladeRanges.empty() &&
638  !this->insideRanges<int>(tTopo->pxfBlade(detId), thePXFDetIdRanges.theBladeRanges))
639  return true;
640  if (!thePXFDetIdRanges.theDiskRanges.empty() &&
641  !this->insideRanges<int>(tTopo->pxfDisk(detId), thePXFDetIdRanges.theDiskRanges))
642  return true;
643  if (!thePXFDetIdRanges.theModuleRanges.empty() &&
644  !this->insideRanges<int>(tTopo->pxfModule(detId), thePXFDetIdRanges.theModuleRanges))
645  return true;
646  if (!thePXFDetIdRanges.thePanelRanges.empty() &&
647  !this->insideRanges<int>(tTopo->pxfPanel(detId), thePXFDetIdRanges.thePanelRanges))
648  return true;
649  if (!thePXFDetIdRanges.theSideRanges.empty() &&
650  !this->insideRanges<int>(tTopo->pxfSide(detId), thePXFDetIdRanges.theSideRanges))
651  return true;
652  }
653 
654  if (subdetId == static_cast<int>(SiStripDetId::TIB)) {
655  if (!theTIBDetIdRanges.theLayerRanges.empty() &&
656  !this->insideRanges<int>(tTopo->tibLayer(detId), theTIBDetIdRanges.theLayerRanges))
657  return true;
658  if (!theTIBDetIdRanges.theModuleRanges.empty() &&
659  !this->insideRanges<int>(tTopo->tibModule(detId), theTIBDetIdRanges.theModuleRanges))
660  return true;
661  if (!theTIBDetIdRanges.theSideRanges.empty() &&
662  !this->insideRanges<int>(tTopo->tibSide(detId), theTIBDetIdRanges.theSideRanges))
663  return true;
664  if (!theTIBDetIdRanges.theStringRanges.empty() &&
665  !this->insideRanges<int>(tTopo->tibString(detId), theTIBDetIdRanges.theStringRanges))
666  return true;
667  }
668 
669  if (subdetId == static_cast<int>(SiStripDetId::TID)) {
670  if (!theTIDDetIdRanges.theDiskRanges.empty() &&
671  !this->insideRanges<int>(tTopo->tidWheel(detId), theTIDDetIdRanges.theDiskRanges))
672  return true;
673  if (!theTIDDetIdRanges.theModuleRanges.empty() &&
674  !this->insideRanges<int>(tTopo->tidModule(detId), theTIDDetIdRanges.theModuleRanges))
675  return true;
676  if (!theTIDDetIdRanges.theRingRanges.empty() &&
677  !this->insideRanges<int>(tTopo->tidRing(detId), theTIDDetIdRanges.theRingRanges))
678  return true;
679  if (!theTIDDetIdRanges.theSideRanges.empty() &&
680  !this->insideRanges<int>(tTopo->tidSide(detId), theTIDDetIdRanges.theSideRanges))
681  return true;
682  }
683 
684  if (subdetId == static_cast<int>(SiStripDetId::TOB)) {
685  if (!theTOBDetIdRanges.theLayerRanges.empty() &&
686  !this->insideRanges<int>(tTopo->tobLayer(detId), theTOBDetIdRanges.theLayerRanges))
687  return true;
688  if (!theTOBDetIdRanges.theModuleRanges.empty() &&
689  !this->insideRanges<int>(tTopo->tobModule(detId), theTOBDetIdRanges.theModuleRanges))
690  return true;
691  if (!theTOBDetIdRanges.theRodRanges.empty() &&
692  !this->insideRanges<int>(tTopo->tobRod(detId), theTOBDetIdRanges.theRodRanges))
693  return true;
694  if (!theTOBDetIdRanges.theSideRanges.empty() &&
695  !this->insideRanges<int>(tTopo->tobSide(detId), theTOBDetIdRanges.theSideRanges))
696  return true;
697  }
698 
699  if (subdetId == static_cast<int>(SiStripDetId::TEC)) {
700  if (!theTECDetIdRanges.theWheelRanges.empty() &&
701  !this->insideRanges<int>(tTopo->tecWheel(detId), theTECDetIdRanges.theWheelRanges))
702  return true;
703  if (!theTECDetIdRanges.thePetalRanges.empty() &&
704  !this->insideRanges<int>(tTopo->tecPetalNumber(detId), theTECDetIdRanges.thePetalRanges))
705  return true;
706  if (!theTECDetIdRanges.theModuleRanges.empty() &&
707  !this->insideRanges<int>(tTopo->tecModule(detId), theTECDetIdRanges.theModuleRanges))
708  return true;
709  if (!theTECDetIdRanges.theRingRanges.empty() &&
710  !this->insideRanges<int>(tTopo->tecRing(detId), theTECDetIdRanges.theRingRanges))
711  return true;
712  if (!theTECDetIdRanges.theSideRanges.empty() &&
713  !this->insideRanges<int>(tTopo->tecSide(detId), theTECDetIdRanges.theSideRanges))
714  return true;
715  }
716  }
717  }
718 
719  return false;
720 }
721 
722 //_________________________________________________________________________
723 template <typename T>
724 bool AlignmentParameterSelector::insideRanges(T value, const std::vector<T> &ranges, bool isPhi) const {
725  // might become templated on <double> ?
726 
727  if (ranges.size() % 2 != 0) {
728  cms::Exception("BadConfig") << "@SUB=AlignmentParameterSelector::insideRanges"
729  << " need even number of entries in ranges instead of " << ranges.size();
730  return false;
731  }
732 
733  for (unsigned int i = 0; i < ranges.size(); i += 2) {
734  if (isPhi) { // mapping into (-pi,+pi] and checking for range including sign flip area
735  Geom::Phi<double> rangePhi1(ranges[i]);
736  Geom::Phi<double> rangePhi2(ranges[i + 1]);
737  Geom::Phi<double> valuePhi(value);
738  if (rangePhi1 <= valuePhi && valuePhi < rangePhi2) { // 'normal'
739  return true;
740  }
741  if (rangePhi2 < rangePhi1 && (rangePhi1 <= valuePhi || valuePhi < rangePhi2)) { // 'sign flip'
742  return true;
743  }
744  } else if (ranges[i] <= value && value < ranges[i + 1]) {
745  return true;
746  }
747  }
748 
749  return false;
750 }
751 
752 //_________________________________________________________________________
753 template <>
754 bool AlignmentParameterSelector::insideRanges<int>(int value, const std::vector<int> &ranges, bool /*isPhi*/) const {
755  if (ranges.size() % 2 != 0) {
756  cms::Exception("BadConfig") << "@SUB=AlignmentParameterSelector::insideRanges"
757  << " need even number of entries in ranges instead of " << ranges.size();
758  return false;
759  }
760 
761  for (unsigned int i = 0; i < ranges.size(); i += 2) {
762  if (ranges[i] <= value && value <= ranges[i + 1])
763  return true;
764  }
765 
766  return false;
767 }
768 
769 bool AlignmentParameterSelector::isMemberOfVector(int value, const std::vector<int> &values) const {
770  if (std::find(values.begin(), values.end(), value) != values.end())
771  return true;
772  return false;
773 }
774 
775 //__________________________________________________________________________________________________
776 std::vector<std::string> AlignmentParameterSelector::decompose(const std::string &s,
778  std::vector<std::string> result;
779 
780  std::string::size_type previousPos = 0;
781  while (true) {
782  const std::string::size_type delimiterPos = s.find(delimiter, previousPos);
783  if (delimiterPos == std::string::npos) {
784  result.push_back(s.substr(previousPos)); // until end
785  break;
786  }
787  result.push_back(s.substr(previousPos, delimiterPos - previousPos));
788  previousPos = delimiterPos + 1; // +1: skip delimiter
789  }
790 
791  return result;
792 }
793 
794 //__________________________________________________________________________________________________
795 std::vector<char> AlignmentParameterSelector::convertParamSel(const std::string &selString) const {
796  // Convert selString into vector<char> of same length.
797  // Note: Old implementation in AlignmentParameterBuilder was rigid in length,
798  // expecting RigidBodyAlignmentParameters::N_PARAM.
799  // But I prefer to be more general and allow other Alignables. It will throw anyway if
800  // RigidBodyAlignmentParameters are build with wrong selection length.
801  std::vector<char> result(selString.size());
802 
803  for (std::string::size_type pos = 0; pos < selString.size(); ++pos) {
804  result[pos] = selString[pos];
805  }
806 
807  return result;
808 }
809 
810 //________________________________________________________________________________
812  // Use new string only, although direct erasing of found indicator causes problems for 'DSS',
813  // but 'DSS' makes absolutely no sense!
815 
816  const std::string::size_type ss = newName.rfind("SS");
817  if (ss != std::string::npos) {
818  newName.erase(ss, 2); // 2: length of 'SS'
819  theOnlySS = true;
820  } else {
821  theOnlySS = false;
822  }
823 
824  const std::string::size_type ds = newName.rfind("DS");
825  if (ds != std::string::npos) {
826  newName.erase(ds, 2); // 2: length of 'DS'
827  theOnlyDS = true;
828  } else {
829  theOnlyDS = false;
830  }
831 
832  const std::string::size_type size = newName.size();
833  const std::string::size_type layers = newName.rfind("Layers");
834  if (layers != std::string::npos && size - layers - 2 == 6 // 2 digits, 6: length of 'Layers'
835  && isdigit(newName[size - 1]) && isdigit(newName[size - 2])) {
836  theSelLayers = true;
837  theMinLayer = newName[size - 2] - '0';
838  theMaxLayer = newName[size - 1] - '0';
839  newName.erase(layers);
840  } else {
841  theSelLayers = false;
842  theMinLayer = -1;
843  theMaxLayer = 99999;
844  }
845 
847  if (newName.rfind("Unit") != std::string::npos) {
848  const std::string::size_type uRph = newName.rfind("UnitRphi");
849  if (uRph != std::string::npos) {
850  newName.erase(uRph + 4, 4); // keep 'Unit' (4) and erase 'Rphi' (4)
852  }
853  const std::string::size_type uSte = newName.rfind("UnitStereo");
854  if (uSte != std::string::npos) {
855  newName.erase(uSte + 4, 6); // keep 'Unit' (4) and erase 'Stereo' (6)
857  }
858  }
859 
860  if (newName != name) {
861  LogDebug("Alignment") << "@SUB=AlignmentParameterSelector::setSpecials" << name << " becomes " << newName
862  << ", makes theOnlySS " << theOnlySS << ", theOnlyDS " << theOnlyDS << ", theSelLayers "
863  << theSelLayers << ", theMinLayer " << theMinLayer << ", theMaxLayer " << theMaxLayer
864  << ", theRphiOrStereoDetUnit " << theRphiOrStereoDetUnit;
865  }
866 
867  return newName;
868 }
869 
870 //________________________________________________________________________________
871 unsigned int AlignmentParameterSelector::addAllDets(const std::vector<char> &paramSel) {
872  unsigned int numAli = 0;
873 
874  numAli += this->add(theTracker->barrelGeomDets(), paramSel); // TIB+TOB
875  numAli += this->add(theTracker->endcapGeomDets(), paramSel); // TEC
876  numAli += this->add(theTracker->TIDGeomDets(), paramSel); // TID
877  numAli += this->add(theTracker->pixelHalfBarrelGeomDets(), paramSel); // PixelBarrel
878  numAli += this->add(theTracker->pixelEndcapGeomDets(), paramSel); // PixelEndcap
879 
880  return numAli;
881 }
882 
883 //________________________________________________________________________________
884 unsigned int AlignmentParameterSelector::addAllRods(const std::vector<char> &paramSel) {
885  unsigned int numAli = 0;
886 
887  numAli += this->add(theTracker->barrelRods(), paramSel); // TIB+TOB
888  numAli += this->add(theTracker->pixelHalfBarrelLadders(), paramSel); // PixelBarrel
889  numAli += this->add(theTracker->endcapPetals(), paramSel); // TEC
890  numAli += this->add(theTracker->TIDRings(), paramSel); // TID
891  numAli += this->add(theTracker->pixelEndcapPetals(), paramSel); // PixelEndcap
892 
893  return numAli;
894 }
895 
896 //________________________________________________________________________________
897 unsigned int AlignmentParameterSelector::addAllLayers(const std::vector<char> &paramSel) {
898  unsigned int numAli = 0;
899 
900  numAli += this->add(theTracker->barrelLayers(), paramSel); // TIB+TOB
901  numAli += this->add(theTracker->pixelHalfBarrelLayers(), paramSel); // PixelBarrel
902  numAli += this->add(theTracker->endcapLayers(), paramSel); // TEC
903  numAli += this->add(theTracker->TIDLayers(), paramSel); // TID
904  numAli += this->add(theTracker->pixelEndcapLayers(), paramSel); // PixelEndcap
905 
906  return numAli;
907 }
908 
909 //________________________________________________________________________________
910 unsigned int AlignmentParameterSelector::addAllAlignables(const std::vector<char> &paramSel) {
911  unsigned int numAli = 0;
912 
913  numAli += this->addAllDets(paramSel);
914  numAli += this->addAllRods(paramSel);
915  numAli += this->addAllLayers(paramSel);
916  numAli += this->add(theTracker->components(), paramSel);
917 
918  return numAli;
919 }
diffTwoXMLs.ranges
string ranges
Definition: diffTwoXMLs.py:79
AlignableTracker::outerBarrelGeomDets
Alignables & outerBarrelGeomDets()
Return outer barrel GeomDets.
Definition: AlignableTracker.h:57
AlignableTracker::TIDLayers
Alignables & TIDLayers()
Return TID layers.
Definition: AlignableTracker.h:93
AlignmentParameterSelector::add
unsigned int add(const align::Alignables &alignables, const std::vector< char > &paramSel)
adding alignables which fulfil geometrical restrictions and special switches
Definition: AlignmentParameterSelector.cc:522
AlignmentParameterSelector::TOBDetIdRanges::theRodRanges
std::vector< int > theRodRanges
Definition: AlignmentParameterSelector.h:173
AlignableTracker::pixelEndCaps
Alignables & pixelEndCaps()
Return TPEs.
Definition: AlignableTracker.h:42
mps_fire.i
i
Definition: mps_fire.py:355
AlignmentParameterSelector::decompose
std::vector< std::string > decompose(const std::string &s, std::string::value_type delimiter) const
Decomposing input string 's' into parts separated by 'delimiter'.
Definition: AlignmentParameterSelector.cc:776
PixelSubdetector.h
MessageLogger.h
AlignmentParameterSelector::addAllAlignables
unsigned int addAllAlignables(const std::vector< char > &paramSel)
Definition: AlignmentParameterSelector.cc:910
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
AlignableTracker::trackerTopology
const TrackerTopology * trackerTopology() const
Return tracker topology used to build AlignableTracker.
Definition: AlignableTracker.h:104
TrackerTopology::pxfSide
unsigned int pxfSide(const DetId &id) const
Definition: TrackerTopology.h:192
AlignmentParameterSelector::PXFDetIdRanges::clear
void clear()
Definition: AlignmentParameterSelector.h:138
AlignmentParameterSelector::Rphi
Definition: AlignmentParameterSelector.h:203
AlignmentParameterSelector::theExcludedDetIdRanges
std::vector< int > theExcludedDetIdRanges
Definition: AlignmentParameterSelector.h:121
makeHLTPrescaleTable.delimiter
delimiter
Definition: makeHLTPrescaleTable.py:181
AlignableComposite::components
const Alignables & components() const override
Return vector of direct components.
Definition: AlignableComposite.h:45
AlignmentParameterSelector::Stereo
Definition: AlignmentParameterSelector.h:203
AlignmentParameterSelector.h
AlignmentParameterSelector::theSelLayers
bool theSelLayers
Definition: AlignmentParameterSelector.h:200
AlignmentParameterSelector::theOnlyDS
bool theOnlyDS
Definition: AlignmentParameterSelector.h:198
TrackerTopology
Definition: TrackerTopology.h:16
AlignmentParameterSelector::addAllRods
unsigned int addAllRods(const std::vector< char > &paramSel)
Definition: AlignmentParameterSelector.cc:884
AlignableTracker::innerHalfBarrels
Alignables & innerHalfBarrels()
Return TIB half barrels.
Definition: AlignableTracker.h:36
AlignableMuon::CSCLayers
align::Alignables CSCLayers()
Definition: AlignableMuon.cc:333
TrackerTopology::pxbLadder
unsigned int pxbLadder(const DetId &id) const
Definition: TrackerTopology.h:155
Alignable
Definition: Alignable.h:27
pos
Definition: PixelAliasList.h:18
AlignmentParameterSelector::theOnlySS
bool theOnlySS
Definition: AlignmentParameterSelector.h:199
AlignmentParameterSelector::PXFDetIdRanges::theBladeRanges
std::vector< int > theBladeRanges
Definition: AlignmentParameterSelector.h:133
AlignmentParameterSelector::TECDetIdRanges::theModuleRanges
std::vector< int > theModuleRanges
Definition: AlignmentParameterSelector.h:185
AlignableExtras.h
AlignableTracker::innerBarrelGeomDets
Alignables & innerBarrelGeomDets()
Return inner barrel GeomDets.
Definition: AlignableTracker.h:55
AlignmentParameterSelector::PXBDetIdRanges::theLadderRanges
std::vector< int > theLadderRanges
Definition: AlignmentParameterSelector.h:123
AlignmentParameterSelector::TIBDetIdRanges::theLayerRanges
std::vector< int > theLayerRanges
Definition: AlignmentParameterSelector.h:147
AlignmentParameterSelector::theExtras
AlignableExtras * theExtras
Definition: AlignmentParameterSelector.h:105
AlignmentParameterSelector::TIBDetIdRanges::clear
void clear()
Definition: AlignmentParameterSelector.h:151
SiStripDetId.h
AlignableTracker::endCaps
Alignables & endCaps()
Return TECs.
Definition: AlignableTracker.h:40
AlignableTracker::pixelEndcapLayers
Alignables & pixelEndcapLayers()
Return pixel endcap layers.
Definition: AlignableTracker.h:95
AlignmentParameterSelector::PXBDetIdRanges::clear
void clear()
Definition: AlignmentParameterSelector.h:126
AlignmentParameterSelector::TOBDetIdRanges::theModuleRanges
std::vector< int > theModuleRanges
Definition: AlignmentParameterSelector.h:172
AlignmentParameterSelector::theExcludedDetIds
std::vector< int > theExcludedDetIds
Definition: AlignmentParameterSelector.h:120
AlignableMuon::CSCChambers
align::Alignables CSCChambers()
Definition: AlignableMuon.cc:348
AlignableTracker::innerBarrelRods
Alignables & innerBarrelRods()
Return inner barrel rods.
Definition: AlignableTracker.h:70
AlignmentParameterSelector::TIDDetIdRanges::theDiskRanges
std::vector< int > theDiskRanges
Definition: AlignmentParameterSelector.h:159
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
AlignmentParameterSelector::theDetIdRanges
std::vector< int > theDetIdRanges
Definition: AlignmentParameterSelector.h:119
TrackerTopology::tidModule
unsigned int tidModule(const DetId &id) const
Definition: TrackerTopology.h:175
AlignmentParameterSelector::theMuon
AlignableMuon * theMuon
Definition: AlignmentParameterSelector.h:104
AlignmentParameterSelector::thePXFDetIdRanges
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
AlignableMuon::CSCStations
align::Alignables CSCStations()
Definition: AlignableMuon.cc:362
AlignmentParameterSelector::Both
Definition: AlignmentParameterSelector.h:203
TrackerTopology::tidRing
unsigned int tidRing(const DetId &id) const
Definition: TrackerTopology.h:218
AlignableTracker::barrelRods
Alignables barrelRods()
Return inner and outer barrel rods.
Definition: AlignableTracker.h:68
AlignableTracker::pixelHalfBarrelGeomDets
Alignables & pixelHalfBarrelGeomDets()
Return pixel barrel GeomDets.
Definition: AlignableTracker.h:59
AlignableTracker::outerBarrelLayers
Alignables & outerBarrelLayers()
Return outer barrel layers.
Definition: AlignableTracker.h:87
TrackerTopology::tobRod
unsigned int tobRod(const DetId &id) const
Definition: TrackerTopology.h:195
AlignableTracker::outerBarrelRods
Alignables & outerBarrelRods()
Return outer barrel rods.
Definition: AlignableTracker.h:72
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
AlignmentParameterSelector::PXFDetIdRanges::theSideRanges
std::vector< int > theSideRanges
Definition: AlignmentParameterSelector.h:137
AlignmentParameterSelector::setTECDetIdCuts
void setTECDetIdCuts(const edm::ParameterSet &pSet)
Definition: AlignmentParameterSelector.cc:277
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
TrackerTopology::tibSide
unsigned int tibSide(const DetId &id) const
Definition: TrackerTopology.h:186
TrackerTopology::pxfPanel
unsigned int pxfPanel(const DetId &id) const
Definition: TrackerTopology.h:450
AlignableTracker::endcapGeomDets
Alignables & endcapGeomDets()
Return endcap GeomDets.
Definition: AlignableTracker.h:61
AlignmentParameterSelector::TECDetIdRanges::theRingRanges
std::vector< int > theRingRanges
Definition: AlignmentParameterSelector.h:186
AlignmentParameterSelector::theMaxLayer
int theMaxLayer
Definition: AlignmentParameterSelector.h:202
AlignmentParameterSelector::outsideGeometricalRanges
bool outsideGeometricalRanges(const Alignable *alignable) const
true if geometrical restrictions in eta, phi, r, x, y, z not satisfied
Definition: AlignmentParameterSelector.cc:586
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
DetId
Definition: DetId.h:17
TrackerTopology.h
AlignmentParameterSelector::setPXFDetIdCuts
void setPXFDetIdCuts(const edm::ParameterSet &pSet)
Definition: AlignmentParameterSelector.cc:175
AlignableMuon::DTChambers
align::Alignables DTChambers()
Definition: AlignableMuon.cc:305
alignCSCRings.s
s
Definition: alignCSCRings.py:92
AlignmentParameterSelector::convertParamSel
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector<char>
Definition: AlignmentParameterSelector.cc:795
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
AlignmentParameterSelector::isMemberOfVector
bool isMemberOfVector(int value, const std::vector< int > &values) const
true if value is member of vector of values
Definition: AlignmentParameterSelector.cc:769
AlignmentParameterSelector::TOBDetIdRanges::theLayerRanges
std::vector< int > theLayerRanges
Definition: AlignmentParameterSelector.h:171
AlignmentParameterSelector::setSpecials
std::string setSpecials(const std::string &name)
Definition: AlignmentParameterSelector.cc:811
AlignmentParameterSelector::TOBDetIdRanges::clear
void clear()
Definition: AlignmentParameterSelector.h:175
AlignmentParameterSelector::TECDetIdRanges::theSideRanges
std::vector< int > theSideRanges
Definition: AlignmentParameterSelector.h:187
Alignable::alignableObjectId
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
AlignmentParameterSelector::PXBDetIdRanges::theLayerRanges
std::vector< int > theLayerRanges
Definition: AlignmentParameterSelector.h:124
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
AlignableTracker::innerBarrelLayers
Alignables & innerBarrelLayers()
Return inner barrel layers.
Definition: AlignableTracker.h:85
AlignableMuon::DTSuperLayers
align::Alignables DTSuperLayers()
Definition: AlignableMuon.cc:289
AlignmentParameterSelector::TIBDetIdRanges::theModuleRanges
std::vector< int > theModuleRanges
Definition: AlignmentParameterSelector.h:148
AlignableMuon::DTLayers
align::Alignables DTLayers()
Methods to return specific of components.
Definition: AlignableMuon.cc:270
AlignmentParameterSelector::thePXBDetIdRanges
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
AlignableTracker::pixelHalfBarrels
Alignables & pixelHalfBarrels()
Return Pixel half barrels.
Definition: AlignableTracker.h:38
AlignmentParameterSelector::TIBDetIdRanges::theSideRanges
std::vector< int > theSideRanges
Definition: AlignmentParameterSelector.h:150
AlignableTracker
Definition: AlignableTracker.h:17
AlignableTracker::TIDRings
Alignables & TIDRings()
Return TID rings.
Definition: AlignableTracker.h:78
AlignmentParameterSelector::clear
void clear()
remove all selected Alignables and geometrical restrictions
Definition: AlignmentParameterSelector.cc:41
AlignableTracker::subStructures
Alignables & subStructures(const std::string &subStructName)
Definition: AlignableTracker.h:27
AlignableExtras
Definition: AlignableExtras.h:19
Point3DBase< Scalar, GlobalTag >
AlignableMuon::DTBarrel
align::Alignables DTBarrel()
Definition: AlignableMuon.cc:326
AlignableTracker::pixelHalfBarrelLadders
Alignables & pixelHalfBarrelLadders()
Return pixel half barrel ladders (implemented as AlignableRods)
Definition: AlignableTracker.h:74
AlignableTracker::pixelHalfBarrelLayers
Alignables & pixelHalfBarrelLayers()
Return pixel half barrel layers.
Definition: AlignableTracker.h:89
AlignmentParameterSelector::TIDDetIdRanges::clear
void clear()
Definition: AlignmentParameterSelector.h:163
SiStripDetId::TEC
static constexpr auto TEC
Definition: SiStripDetId.h:40
AlignmentParameterSelector::PXFDetIdRanges::theModuleRanges
std::vector< int > theModuleRanges
Definition: AlignmentParameterSelector.h:135
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
TrackerAlignableId::typeAndLayerFromDetId
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId, const TrackerTopology *tTopo) const
Definition: TrackerAlignableId.cc:17
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
AlignmentParameterSelector::PXBDetIdRanges::theModuleRanges
std::vector< int > theModuleRanges
Definition: AlignmentParameterSelector.h:125
AlignmentParameterSelector::TECDetIdRanges::thePetalRanges
std::vector< int > thePetalRanges
Definition: AlignmentParameterSelector.h:184
AlignmentParameterSelector::theSelectedAlignables
align::Alignables theSelectedAlignables
Definition: AlignmentParameterSelector.h:106
AlignmentParameterSelector::theTECDetIdRanges
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
AlignmentParameterSelector::theTOBDetIdRanges
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
TrackerTopology::tibString
unsigned int tibString(const DetId &id) const
Definition: TrackerTopology.h:419
AlignmentParameterSelector::theRphiOrStereoDetUnit
RphiOrStereoDetUnit theRphiOrStereoDetUnit
Definition: AlignmentParameterSelector.h:204
align::AlignableDetUnit
Definition: StructureType.h:19
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
AlignmentParameterSelector::theTIDDetIdRanges
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
DetId::Tracker
Definition: DetId.h:25
AlignmentParameterSelector::layerDeselected
bool layerDeselected(const Alignable *alignable) const
true if layer is deselected via "Layers<N><M>" or "DS/SS"
Definition: AlignmentParameterSelector.cc:542
TrackerTopology::tecPetalNumber
unsigned int tecPetalNumber(const DetId &id) const
Definition: TrackerTopology.h:221
AlignableMuon.h
AlignmentParameterSelector::alignableTracker
const AlignableTracker * alignableTracker() const
Definition: AlignmentParameterSelector.cc:64
AlignableTracker::endcapLayers
Alignables & endcapLayers()
Return endcap layers.
Definition: AlignableTracker.h:91
AlignableMuon::DTWheels
align::Alignables DTWheels()
Definition: AlignableMuon.cc:319
AlignableTracker::pixelEndcapHalfCylinders
Alignables & pixelEndcapHalfCylinders()
Return pixel endcap half cylinders.
Definition: AlignableTracker.h:46
Alignable::id
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
Definition: Alignable.h:180
edm::ParameterSet::getParameterNames
std::vector< std::string > getParameterNames() const
Definition: ParameterSet.cc:656
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:33
TrackerTopology::tibModule
unsigned int tibModule(const DetId &id) const
Definition: TrackerTopology.h:172
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
AlignableTracker::barrelGeomDets
Alignables barrelGeomDets()
Return inner and outer barrel GeomDets together.
Definition: AlignableTracker.h:51
TrackerTopology::tecRing
unsigned int tecRing(const DetId &id) const
ring id
Definition: TrackerTopology.h:217
TrackerTopology::pxfModule
unsigned int pxfModule(const DetId &id) const
Definition: TrackerTopology.h:163
value
Definition: value.py:1
AlignmentParameterSelector::detUnitDeselected
bool detUnitDeselected(const Alignable *alignable) const
true if alignable is DetUnit deselected by Unit<Rphi/Stereo> selection
Definition: AlignmentParameterSelector.cc:569
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
Alignable::geomDetId
const DetId & geomDetId() const
Definition: Alignable.h:177
AlignableTracker::endcapPetals
Alignables & endcapPetals()
Return encap petals.
Definition: AlignableTracker.h:76
AlignableTracker::outerHalfBarrels
Alignables & outerHalfBarrels()
Return TOB half barrels.
Definition: AlignableTracker.h:34
AlignmentParameterSelector::theMinLayer
int theMinLayer
Definition: AlignmentParameterSelector.h:201
Geom::Phi
Definition: Phi.h:52
SiStripDetId::TOB
static constexpr auto TOB
Definition: SiStripDetId.h:39
AlignmentParameterSelector::theRangesEta
std::vector< double > theRangesEta
geometrical restrictions in eta, phi, r, x, y, z to be applied for next addSelection
Definition: AlignmentParameterSelector.h:110
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
AlignmentParameterSelector::theRangesX
std::vector< double > theRangesX
Definition: AlignmentParameterSelector.h:113
AlignmentParameterSelector::theRangesZ
std::vector< double > theRangesZ
Definition: AlignmentParameterSelector.h:115
AlignmentParameterSelector::addSelection
unsigned int addSelection(const std::string &name, const std::vector< char > &paramSel)
Definition: AlignmentParameterSelector.cc:312
AlignableMuon::CSCRings
align::Alignables CSCRings()
Definition: AlignableMuon.cc:355
AlignmentParameterSelector::TIDDetIdRanges::theModuleRanges
std::vector< int > theModuleRanges
Definition: AlignmentParameterSelector.h:160
mps_merge.newName
string newName
Definition: mps_merge.py:86
AlignmentParameterSelector::setGeometryCuts
void setGeometryCuts(const edm::ParameterSet &pSet)
Definition: AlignmentParameterSelector.cc:96
AlignmentParameterSelector::theRangesY
std::vector< double > theRangesY
Definition: AlignmentParameterSelector.h:114
SiStripDetId::TID
static constexpr auto TID
Definition: SiStripDetId.h:38
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
AlignmentParameterSelector::TIDDetIdRanges::theRingRanges
std::vector< int > theRingRanges
Definition: AlignmentParameterSelector.h:161
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
AlignableMuon::CSCEndcaps
align::Alignables CSCEndcaps()
Definition: AlignableMuon.cc:369
type
type
Definition: HCALResponse.h:21
TrackerAlignableId
Definition: TrackerAlignableId.h:22
AlignmentParameterSelector::theTIBDetIdRanges
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
AlignmentParameterSelector::TECDetIdRanges::theWheelRanges
std::vector< int > theWheelRanges
Definition: AlignmentParameterSelector.h:183
AlignmentParameterSelector::addSelections
unsigned int addSelections(const edm::ParameterSet &pSet)
Definition: AlignmentParameterSelector.cc:67
AlignableMuon::DTStations
align::Alignables DTStations()
Definition: AlignableMuon.cc:312
TrackerTopology::tobModule
unsigned int tobModule(const DetId &id) const
Definition: TrackerTopology.h:166
AlignableExtras::subStructures
Alignables & subStructures(const std::string &subStructName)
Return alignables determined by name.
Definition: AlignableExtras.h:27
TrackerTopology::pxbModule
unsigned int pxbModule(const DetId &id) const
Definition: TrackerTopology.h:160
AlignmentParameterSelector::theRangesR
std::vector< double > theRangesR
Definition: AlignmentParameterSelector.h:112
T
long double T
Definition: Basic3DVectorLD.h:48
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:246
AlignmentParameterSelector::TIDDetIdRanges::theSideRanges
std::vector< int > theSideRanges
Definition: AlignmentParameterSelector.h:162
AlignmentParameterSelector::TOBDetIdRanges::theSideRanges
std::vector< int > theSideRanges
Definition: AlignmentParameterSelector.h:174
AlignmentParameterSelector::theSelectedParameters
std::vector< std::vector< char > > theSelectedParameters
Definition: AlignmentParameterSelector.h:107
AlignmentParameterSelector::addAllDets
unsigned int addAllDets(const std::vector< char > &paramSel)
some helper methods
Definition: AlignmentParameterSelector.cc:871
AlignmentParameterSelector::PXFDetIdRanges::theDiskRanges
std::vector< int > theDiskRanges
Definition: AlignmentParameterSelector.h:134
SiStripDetId::TIB
static constexpr auto TIB
Definition: SiStripDetId.h:37
AlignmentParameterSelector::clearGeometryCuts
void clearGeometryCuts()
remove all geometrical restrictions
Definition: AlignmentParameterSelector.cc:48
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
AlignmentParameterSelector::setTOBDetIdCuts
void setTOBDetIdCuts(const edm::ParameterSet &pSet)
Definition: AlignmentParameterSelector.cc:252
AlignmentParameterSelector::PXFDetIdRanges::thePanelRanges
std::vector< int > thePanelRanges
Definition: AlignmentParameterSelector.h:136
AlignableTracker::pixelEndcapPetals
Alignables & pixelEndcapPetals()
Return pixel endcap petals.
Definition: AlignableTracker.h:80
Exception.h
AlignableTracker::TIDGeomDets
Alignables & TIDGeomDets()
Return TID GeomDets.
Definition: AlignableTracker.h:63
TrackerTopology::tecModule
unsigned int tecModule(const DetId &id) const
Definition: TrackerTopology.h:169
AlignmentParameterSelector::addAllLayers
unsigned int addAllLayers(const std::vector< char > &paramSel)
Definition: AlignmentParameterSelector.cc:897
clusterbigeventsdebugger_cfi.selections
selections
Definition: clusterbigeventsdebugger_cfi.py:10
AlignmentParameterSelector::setPXBDetIdCuts
void setPXBDetIdCuts(const edm::ParameterSet &pSet)
Definition: AlignmentParameterSelector.cc:152
AlignmentParameterSelector::TIBDetIdRanges::theStringRanges
std::vector< int > theStringRanges
Definition: AlignmentParameterSelector.h:149
AlignmentParameterSelector::theRangesPhi
std::vector< double > theRangesPhi
Definition: AlignmentParameterSelector.h:111
TrackerTopology::pxfBlade
unsigned int pxfBlade(const DetId &id) const
Definition: TrackerTopology.h:447
mps_fire.result
result
Definition: mps_fire.py:303
AlignableTracker.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ParameterSet.h
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
Alignable::globalPosition
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
AlignmentParameterSelector::theDetIds
std::vector< int > theDetIds
DetId restrictions in eta, phi, r, x, y, z to be applied for next addSelection.
Definition: AlignmentParameterSelector.h:118
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
AlignmentParameterSelector::TECDetIdRanges::clear
void clear()
Definition: AlignmentParameterSelector.h:188
AlignmentParameterSelector::theTracker
AlignableTracker * theTracker
Definition: AlignmentParameterSelector.h:103
AlignmentParameterSelector::AlignmentParameterSelector
AlignmentParameterSelector(AlignableTracker *aliTracker, AlignableMuon *aliMuon=nullptr, AlignableExtras *aliExtras=nullptr)
Constructor from tracker only or from tracker and muon.
Definition: AlignmentParameterSelector.cc:24
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
AlignableTracker::barrelLayers
Alignables barrelLayers()
Return inner and outer barrel layers.
Definition: AlignableTracker.h:83
AlignmentParameterSelector::setTIBDetIdCuts
void setTIBDetIdCuts(const edm::ParameterSet &pSet)
Definition: AlignmentParameterSelector.cc:202
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2121
TrackerTopology::tobSide
unsigned int tobSide(const DetId &id) const
Definition: TrackerTopology.h:180
AlignableTracker::TIDs
Alignables & TIDs()
Return TIDs.
Definition: AlignableTracker.h:44
AlignableTracker::pixelEndcapGeomDets
Alignables & pixelEndcapGeomDets()
Return pixel endcap GeomDets.
Definition: AlignableTracker.h:65
AlignmentParameterSelector::insideRanges
bool insideRanges(T value, const std::vector< T > &ranges, bool isPhi=false) const
Definition: AlignmentParameterSelector.cc:724
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
AlignmentParameterSelector::outsideDetIdRanges
bool outsideDetIdRanges(const Alignable *alignable) const
true if DetId restrictions are not satisfied
Definition: AlignmentParameterSelector.cc:606
AlignmentParameterSelector::setTIDDetIdCuts
void setTIDDetIdCuts(const edm::ParameterSet &pSet)
Definition: AlignmentParameterSelector.cc:227
TrackerAlignableId.h
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184