CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
AlignmentParameterSelector Class Reference

#include <AlignmentParameterSelector.h>

Classes

struct  PXBDetIdRanges
 
struct  PXFDetIdRanges
 
struct  TECDetIdRanges
 
struct  TIBDetIdRanges
 
struct  TIDDetIdRanges
 
struct  TOBDetIdRanges
 

Public Member Functions

unsigned int addSelection (const std::string &name, const std::vector< char > &paramSel)
 
unsigned int addSelection (const std::string &name, const std::vector< char > &paramSel, const edm::ParameterSet &pSet)
 as addSelection with one argument, but overwriting geometrical restrictions More...
 
unsigned int addSelections (const edm::ParameterSet &pSet)
 
 AlignmentParameterSelector (AlignableTracker *aliTracker, AlignableMuon *aliMuon=nullptr, AlignableExtras *aliExtras=nullptr)
 Constructor from tracker only or from tracker and muon. More...
 
void clear ()
 remove all selected Alignables and geometrical restrictions More...
 
void clearGeometryCuts ()
 remove all geometrical restrictions More...
 
std::vector< char > convertParamSel (const std::string &selString) const
 Converting std::string into std::vector<char> More...
 
std::vector< std::string > decompose (const std::string &s, std::string::value_type delimiter) const
 Decomposing input string 's' into parts separated by 'delimiter'. More...
 
bool detUnitDeselected (const Alignable *alignable) const
 true if alignable is DetUnit deselected by Unit<Rphi/Stereo> selection More...
 
template<typename T >
bool insideRanges (T value, const std::vector< T > &ranges, bool isPhi=false) const
 
template<>
bool insideRanges (int value, const std::vector< int > &ranges, bool isPhi) const
 
template<>
bool insideRanges (int value, const std::vector< int > &ranges, bool) const
 
bool isMemberOfVector (int value, const std::vector< int > &values) const
 true if value is member of vector of values More...
 
bool layerDeselected (const Alignable *alignable) const
 true if layer is deselected via "Layers<N><M>" or "DS/SS" More...
 
bool outsideDetIdRanges (const Alignable *alignable) const
 true if DetId restrictions are not satisfied More...
 
bool outsideGeometricalRanges (const Alignable *alignable) const
 true if geometrical restrictions in eta, phi, r, x, y, z not satisfied More...
 
const align::AlignablesselectedAlignables () const
 vector of alignables selected so far More...
 
const std::vector< std::vector< char > > & selectedParameters () const
 vector of selection 'strings' for alignables, parallel to selectedAlignables() More...
 
void setGeometryCuts (const edm::ParameterSet &pSet)
 
virtual ~AlignmentParameterSelector ()
 Destructor. More...
 

Protected Member Functions

unsigned int add (const align::Alignables &alignables, const std::vector< char > &paramSel)
 adding alignables which fulfil geometrical restrictions and special switches More...
 
unsigned int addAllAlignables (const std::vector< char > &paramSel)
 
unsigned int addAllDets (const std::vector< char > &paramSel)
 some helper methods More...
 
unsigned int addAllLayers (const std::vector< char > &paramSel)
 
unsigned int addAllRods (const std::vector< char > &paramSel)
 
const AlignableTrackeralignableTracker () const
 
void setPXBDetIdCuts (const edm::ParameterSet &pSet)
 
void setPXFDetIdCuts (const edm::ParameterSet &pSet)
 
void setTECDetIdCuts (const edm::ParameterSet &pSet)
 
void setTIBDetIdCuts (const edm::ParameterSet &pSet)
 
void setTIDDetIdCuts (const edm::ParameterSet &pSet)
 
void setTOBDetIdCuts (const edm::ParameterSet &pSet)
 

Private Types

enum  RphiOrStereoDetUnit { Stereo, Both, Rphi }
 

Private Member Functions

std::string setSpecials (const std::string &name)
 

Private Attributes

std::vector< int > theDetIdRanges
 
std::vector< int > theDetIds
 DetId restrictions in eta, phi, r, x, y, z to be applied for next addSelection. More...
 
std::vector< int > theExcludedDetIdRanges
 
std::vector< int > theExcludedDetIds
 
AlignableExtrastheExtras
 
int theMaxLayer
 
int theMinLayer
 
AlignableMuontheMuon
 
bool theOnlyDS
 
bool theOnlySS
 
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
 
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
 
std::vector< double > theRangesEta
 geometrical restrictions in eta, phi, r, x, y, z to be applied for next addSelection More...
 
std::vector< double > theRangesPhi
 
std::vector< double > theRangesR
 
std::vector< double > theRangesX
 
std::vector< double > theRangesY
 
std::vector< double > theRangesZ
 
RphiOrStereoDetUnit theRphiOrStereoDetUnit
 
align::Alignables theSelectedAlignables
 
std::vector< std::vector< char > > theSelectedParameters
 
bool theSelLayers
 
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
 
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
 
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
 
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
 
AlignableTrackertheTracker
 

Detailed Description

Author
Gero Flucke (selection by strings taken from AlignableParameterBuilder)

Selecting Alignable's of the tracker by predefined strings, additional constraints on eta, phi, r, x, y or z are possible. Furthermore stores the 'selection' of selected AlignmentParameters.

Date
2010/11/22 08:40:08
Revision
1.10

(last update by

Author
mussgill

)

Definition at line 26 of file AlignmentParameterSelector.h.

Member Enumeration Documentation

◆ RphiOrStereoDetUnit

Constructor & Destructor Documentation

◆ AlignmentParameterSelector()

AlignmentParameterSelector::AlignmentParameterSelector ( AlignableTracker aliTracker,
AlignableMuon aliMuon = nullptr,
AlignableExtras aliExtras = nullptr 
)
explicit

Constructor from tracker only or from tracker and muon.

Definition at line 24 of file AlignmentParameterSelector.cc.

References setSpecials().

27  : theTracker(aliTracker),
28  theMuon(aliMuon),
29  theExtras(aliExtras),
31  theRangesEta(),
32  theRangesPhi(),
33  theRangesR(),
34  theRangesX(),
35  theRangesY(),
36  theRangesZ() {
37  this->setSpecials(""); // init theOnlyDS, theOnlySS, theSelLayers, theMinLayer, theMaxLayer, theRphiOrStereoDetUnit
38 }
std::vector< double > theRangesEta
geometrical restrictions in eta, phi, r, x, y, z to be applied for next addSelection ...
std::string setSpecials(const std::string &name)

◆ ~AlignmentParameterSelector()

virtual AlignmentParameterSelector::~AlignmentParameterSelector ( )
inlinevirtual

Destructor.

Definition at line 34 of file AlignmentParameterSelector.h.

34 {}

Member Function Documentation

◆ add()

unsigned int AlignmentParameterSelector::add ( const align::Alignables alignables,
const std::vector< char > &  paramSel 
)
protected

adding alignables which fulfil geometrical restrictions and special switches

Definition at line 522 of file AlignmentParameterSelector.cc.

References detUnitDeselected(), layerDeselected(), outsideDetIdRanges(), outsideGeometricalRanges(), theSelectedAlignables, and theSelectedParameters.

Referenced by addAllAlignables(), addAllDets(), addAllLayers(), addAllRods(), addSelection(), counter.Counter::register(), SequenceTypes._TaskBase::remove(), and SequenceTypes._TaskBase::replace().

522  {
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 }
bool outsideGeometricalRanges(const Alignable *alignable) const
true if geometrical restrictions in eta, phi, r, x, y, z not satisfied
std::vector< std::vector< char > > theSelectedParameters
bool layerDeselected(const Alignable *alignable) const
true if layer is deselected via "Layers<N><M>" or "DS/SS"
bool detUnitDeselected(const Alignable *alignable) const
true if alignable is DetUnit deselected by Unit<Rphi/Stereo> selection
bool outsideDetIdRanges(const Alignable *alignable) const
true if DetId restrictions are not satisfied

◆ addAllAlignables()

unsigned int AlignmentParameterSelector::addAllAlignables ( const std::vector< char > &  paramSel)
protected

Definition at line 910 of file AlignmentParameterSelector.cc.

References add(), addAllDets(), addAllLayers(), addAllRods(), AlignableComposite::components(), and theTracker.

Referenced by addSelection().

910  {
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 }
const Alignables & components() const override
Return vector of direct components.
unsigned int addAllDets(const std::vector< char > &paramSel)
some helper methods
unsigned int addAllLayers(const std::vector< char > &paramSel)
unsigned int addAllRods(const std::vector< char > &paramSel)
unsigned int add(const align::Alignables &alignables, const std::vector< char > &paramSel)
adding alignables which fulfil geometrical restrictions and special switches

◆ addAllDets()

unsigned int AlignmentParameterSelector::addAllDets ( const std::vector< char > &  paramSel)
protected

some helper methods

Definition at line 871 of file AlignmentParameterSelector.cc.

References add(), AlignableTracker::barrelGeomDets(), AlignableTracker::endcapGeomDets(), AlignableTracker::pixelEndcapGeomDets(), AlignableTracker::pixelHalfBarrelGeomDets(), theTracker, and AlignableTracker::TIDGeomDets().

Referenced by addAllAlignables(), and addSelection().

871  {
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 }
Alignables & pixelHalfBarrelGeomDets()
Return pixel barrel GeomDets.
Alignables barrelGeomDets()
Return inner and outer barrel GeomDets together.
Alignables & TIDGeomDets()
Return TID GeomDets.
Alignables & endcapGeomDets()
Return endcap GeomDets.
Alignables & pixelEndcapGeomDets()
Return pixel endcap GeomDets.
unsigned int add(const align::Alignables &alignables, const std::vector< char > &paramSel)
adding alignables which fulfil geometrical restrictions and special switches

◆ addAllLayers()

unsigned int AlignmentParameterSelector::addAllLayers ( const std::vector< char > &  paramSel)
protected

Definition at line 897 of file AlignmentParameterSelector.cc.

References add(), AlignableTracker::barrelLayers(), AlignableTracker::endcapLayers(), AlignableTracker::pixelEndcapLayers(), AlignableTracker::pixelHalfBarrelLayers(), theTracker, and AlignableTracker::TIDLayers().

Referenced by addAllAlignables(), and addSelection().

897  {
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 }
Alignables & pixelHalfBarrelLayers()
Return pixel half barrel layers.
Alignables barrelLayers()
Return inner and outer barrel layers.
Alignables & TIDLayers()
Return TID layers.
unsigned int add(const align::Alignables &alignables, const std::vector< char > &paramSel)
adding alignables which fulfil geometrical restrictions and special switches
Alignables & endcapLayers()
Return endcap layers.
Alignables & pixelEndcapLayers()
Return pixel endcap layers.

◆ addAllRods()

unsigned int AlignmentParameterSelector::addAllRods ( const std::vector< char > &  paramSel)
protected

Definition at line 884 of file AlignmentParameterSelector.cc.

References add(), AlignableTracker::barrelRods(), AlignableTracker::endcapPetals(), AlignableTracker::pixelEndcapPetals(), AlignableTracker::pixelHalfBarrelLadders(), theTracker, and AlignableTracker::TIDRings().

Referenced by addAllAlignables(), and addSelection().

884  {
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 }
Alignables barrelRods()
Return inner and outer barrel rods.
Alignables & pixelEndcapPetals()
Return pixel endcap petals.
Alignables & TIDRings()
Return TID rings.
unsigned int add(const align::Alignables &alignables, const std::vector< char > &paramSel)
adding alignables which fulfil geometrical restrictions and special switches
Alignables & pixelHalfBarrelLadders()
Return pixel half barrel ladders (implemented as AlignableRods)
Alignables & endcapPetals()
Return encap petals.

◆ addSelection() [1/2]

unsigned int AlignmentParameterSelector::addSelection ( const std::string &  name,
const std::vector< char > &  paramSel 
)

add Alignables corresponding to predefined name, taking into account geometrical restrictions as defined in setSpecials, returns number of added alignables

Definition at line 312 of file AlignmentParameterSelector.cc.

References add(), addAllAlignables(), addAllDets(), addAllLayers(), addAllRods(), AlignableTracker::barrelGeomDets(), AlignableTracker::barrelLayers(), AlignableTracker::barrelRods(), AlignableComposite::components(), AlignableMuon::CSCChambers(), AlignableMuon::CSCEndcaps(), AlignableMuon::CSCLayers(), AlignableMuon::CSCRings(), AlignableMuon::CSCStations(), AlignableMuon::DTBarrel(), AlignableMuon::DTChambers(), AlignableMuon::DTLayers(), AlignableMuon::DTStations(), AlignableMuon::DTSuperLayers(), AlignableMuon::DTWheels(), AlignableTracker::endcapGeomDets(), AlignableTracker::endcapLayers(), AlignableTracker::endcapPetals(), AlignableTracker::endCaps(), Exception, AlignableTracker::innerBarrelGeomDets(), AlignableTracker::innerBarrelLayers(), AlignableTracker::innerBarrelRods(), AlignableTracker::innerHalfBarrels(), Skims_PA_cff::name, AlignableTracker::outerBarrelGeomDets(), AlignableTracker::outerBarrelLayers(), AlignableTracker::outerBarrelRods(), AlignableTracker::outerHalfBarrels(), AlignableTracker::pixelEndcapGeomDets(), AlignableTracker::pixelEndcapHalfCylinders(), AlignableTracker::pixelEndcapLayers(), AlignableTracker::pixelEndcapPetals(), AlignableTracker::pixelEndCaps(), AlignableTracker::pixelHalfBarrelGeomDets(), AlignableTracker::pixelHalfBarrelLadders(), AlignableTracker::pixelHalfBarrelLayers(), AlignableTracker::pixelHalfBarrels(), setSpecials(), AlCaHLTBitMon_QueryRunRegistry::string, AlignableTracker::subStructures(), AlignableExtras::subStructures(), theExtras, theMuon, theTracker, AlignableTracker::TIDGeomDets(), AlignableTracker::TIDLayers(), AlignableTracker::TIDRings(), and AlignableTracker::TIDs().

Referenced by addSelection(), addSelections(), MomentumDependentPedeLabeler::buildMomentumDependencyMap(), and RunRangeDependentPedeLabeler::buildRunRangeDependencyMap().

312  {
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 }
Alignables & pixelHalfBarrelGeomDets()
Return pixel barrel GeomDets.
align::Alignables DTLayers()
Methods to return specific of components.
unsigned int addAllAlignables(const std::vector< char > &paramSel)
align::Alignables CSCChambers()
align::Alignables DTBarrel()
align::Alignables CSCStations()
Alignables & pixelHalfBarrelLayers()
Return pixel half barrel layers.
const Alignables & components() const override
Return vector of direct components.
align::Alignables DTStations()
Alignables barrelGeomDets()
Return inner and outer barrel GeomDets together.
align::Alignables CSCEndcaps()
align::Alignables DTChambers()
Alignables & innerBarrelGeomDets()
Return inner barrel GeomDets.
Alignables & subStructures(const std::string &subStructName)
Return alignables determined by name.
align::Alignables DTWheels()
Alignables & endCaps()
Return TECs.
unsigned int addAllDets(const std::vector< char > &paramSel)
some helper methods
Alignables & TIDGeomDets()
Return TID GeomDets.
unsigned int addAllLayers(const std::vector< char > &paramSel)
Alignables & outerBarrelRods()
Return outer barrel rods.
Alignables barrelRods()
Return inner and outer barrel rods.
Alignables & pixelEndcapPetals()
Return pixel endcap petals.
Alignables barrelLayers()
Return inner and outer barrel layers.
Alignables & endcapGeomDets()
Return endcap GeomDets.
Alignables & pixelEndcapGeomDets()
Return pixel endcap GeomDets.
align::Alignables CSCLayers()
Alignables & TIDs()
Return TIDs.
unsigned int addAllRods(const std::vector< char > &paramSel)
Alignables & outerBarrelLayers()
Return outer barrel layers.
Alignables & outerBarrelGeomDets()
Return outer barrel GeomDets.
Alignables & TIDLayers()
Return TID layers.
Alignables & TIDRings()
Return TID rings.
Alignables & pixelHalfBarrels()
Return Pixel half barrels.
Alignables & pixelEndCaps()
Return TPEs.
align::Alignables DTSuperLayers()
Alignables & subStructures(const std::string &subStructName)
Alignables & innerBarrelLayers()
Return inner barrel layers.
align::Alignables CSCRings()
unsigned int add(const align::Alignables &alignables, const std::vector< char > &paramSel)
adding alignables which fulfil geometrical restrictions and special switches
Alignables & pixelHalfBarrelLadders()
Return pixel half barrel ladders (implemented as AlignableRods)
Alignables & endcapPetals()
Return encap petals.
Alignables & innerHalfBarrels()
Return TIB half barrels.
Alignables & endcapLayers()
Return endcap layers.
Alignables & pixelEndcapHalfCylinders()
Return pixel endcap half cylinders.
Alignables & pixelEndcapLayers()
Return pixel endcap layers.
Alignables & outerHalfBarrels()
Return TOB half barrels.
Alignables & innerBarrelRods()
Return inner barrel rods.
std::string setSpecials(const std::string &name)

◆ addSelection() [2/2]

unsigned int AlignmentParameterSelector::addSelection ( const std::string &  name,
const std::vector< char > &  paramSel,
const edm::ParameterSet pSet 
)

as addSelection with one argument, but overwriting geometrical restrictions

Definition at line 304 of file AlignmentParameterSelector.cc.

References addSelection(), and setGeometryCuts().

306  {
307  this->setGeometryCuts(pSet);
308  return this->addSelection(name, paramSel);
309 }
void setGeometryCuts(const edm::ParameterSet &pSet)
unsigned int addSelection(const std::string &name, const std::vector< char > &paramSel)

◆ addSelections()

unsigned int AlignmentParameterSelector::addSelections ( const edm::ParameterSet pSet)

Add several selections defined by the PSet which must contain a vstring like e.g. vstring alignParams = { "PixelHalfBarrelLadders,111000,pixelSelection", "BarrelDSRods,111ff0", "BarrelSSRods,101ff0"} The e.g. '111ff0' is decoded into vector<char> and stored. Returns number of added selections or -1 if problems (then also an error is logged) If a string contains a third, comma separated part (e.g. ',pixelSelection'), a further PSet of that name is expected to select eta/phi/r/x/y/z-ranges.

Definition at line 67 of file AlignmentParameterSelector.cc.

References addSelection(), clearGeometryCuts(), convertParamSel(), decompose(), Exception, edm::ParameterSet::getParameter(), and clusterbigeventsdebugger_cfi::selections.

Referenced by AlignmentParameterBuilder::addSelections(), TkModuleGroupSelector::createModuleGroups(), HIPAlignmentAlgorithm::initialize(), and PedeSteerer::presigmas().

67  {
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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void clearGeometryCuts()
remove all geometrical restrictions
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector<char>
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;.
unsigned int addSelection(const std::string &name, const std::vector< char > &paramSel)

◆ alignableTracker()

const AlignableTracker * AlignmentParameterSelector::alignableTracker ( ) const
protected

Definition at line 64 of file AlignmentParameterSelector.cc.

References theTracker.

Referenced by layerDeselected(), and outsideDetIdRanges().

64 { return theTracker; }

◆ clear()

void AlignmentParameterSelector::clear ( )

◆ clearGeometryCuts()

void AlignmentParameterSelector::clearGeometryCuts ( )

remove all geometrical restrictions

Definition at line 48 of file AlignmentParameterSelector.cc.

References AlignmentParameterSelector::PXBDetIdRanges::clear(), AlignmentParameterSelector::PXFDetIdRanges::clear(), AlignmentParameterSelector::TIBDetIdRanges::clear(), AlignmentParameterSelector::TIDDetIdRanges::clear(), AlignmentParameterSelector::TOBDetIdRanges::clear(), AlignmentParameterSelector::TECDetIdRanges::clear(), thePXBDetIdRanges, thePXFDetIdRanges, theRangesEta, theRangesPhi, theRangesR, theRangesX, theRangesY, theRangesZ, theTECDetIdRanges, theTIBDetIdRanges, theTIDDetIdRanges, and theTOBDetIdRanges.

Referenced by addSelections(), clear(), and setGeometryCuts().

48  {
49  theRangesEta.clear();
50  theRangesPhi.clear();
51  theRangesR.clear();
52  theRangesX.clear();
53  theRangesY.clear();
54  theRangesZ.clear();
55 
62 }
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
std::vector< double > theRangesEta
geometrical restrictions in eta, phi, r, x, y, z to be applied for next addSelection ...
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges

◆ convertParamSel()

std::vector< char > AlignmentParameterSelector::convertParamSel ( const std::string &  selString) const

Converting std::string into std::vector<char>

Definition at line 795 of file AlignmentParameterSelector.cc.

References mps_fire::result.

Referenced by addSelections(), and AlignmentProducerBase::simpleMisalignment().

795  {
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 }
uint16_t size_type

◆ decompose()

std::vector< std::string > AlignmentParameterSelector::decompose ( const std::string &  s,
std::string::value_type  delimiter 
) const

Decomposing input string 's' into parts separated by 'delimiter'.

Definition at line 776 of file AlignmentParameterSelector.cc.

References makeHLTPrescaleTable::delimiter, mps_fire::result, and alignCSCRings::s.

Referenced by AlignmentParameterBuilder::addAllSelections(), and addSelections().

777  {
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 }
uint16_t size_type

◆ detUnitDeselected()

bool AlignmentParameterSelector::detUnitDeselected ( const Alignable alignable) const

true if alignable is DetUnit deselected by Unit<Rphi/Stereo> selection

Definition at line 569 of file AlignmentParameterSelector.cc.

References align::AlignableDetUnit, Alignable::alignableObjectId(), Both, Alignable::geomDetId(), Rphi, Stereo, SiStripDetId::TEC, theRphiOrStereoDetUnit, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, and DetId::Tracker.

Referenced by add().

569  {
570  if (theRphiOrStereoDetUnit != Both && ali->alignableObjectId() == align::AlignableDetUnit) {
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 }
static constexpr auto TID
Definition: SiStripDetId.h:38
static constexpr auto TOB
Definition: SiStripDetId.h:39
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
static constexpr auto TIB
Definition: SiStripDetId.h:37
static constexpr auto TEC
Definition: SiStripDetId.h:40

◆ insideRanges() [1/3]

template<typename T >
bool AlignmentParameterSelector::insideRanges ( T  value,
const std::vector< T > &  ranges,
bool  isPhi = false 
) const

true if ranges.size() is even and ranges[i] <= value < ranges[i+1] for any even i ( => false if ranges.empty() == true), if(isPhi==true) takes into account phi periodicity for the integer specialized method, true is returned for ranges[i] <= value <= ranges[i+1] and isPhi is ignored

Definition at line 724 of file AlignmentParameterSelector.cc.

References Exception, mps_fire::i, and diffTwoXMLs::ranges.

724  {
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 }
Definition: value.py:1
string ranges
Definition: diffTwoXMLs.py:79
Definition: Phi.h:52

◆ insideRanges() [2/3]

template<>
bool AlignmentParameterSelector::insideRanges ( int  value,
const std::vector< int > &  ranges,
bool  isPhi 
) const

◆ insideRanges() [3/3]

template<>
bool AlignmentParameterSelector::insideRanges ( int  value,
const std::vector< int > &  ranges,
bool   
) const

Definition at line 754 of file AlignmentParameterSelector.cc.

References Exception, mps_fire::i, and diffTwoXMLs::ranges.

754  {
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 }
Definition: value.py:1
string ranges
Definition: diffTwoXMLs.py:79

◆ isMemberOfVector()

bool AlignmentParameterSelector::isMemberOfVector ( int  value,
const std::vector< int > &  values 
) const

true if value is member of vector of values

Definition at line 769 of file AlignmentParameterSelector.cc.

References spr::find(), relativeConstraints::value, and contentValuesCheck::values.

Referenced by outsideDetIdRanges().

769  {
770  if (std::find(values.begin(), values.end(), value) != values.end())
771  return true;
772  return false;
773 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ layerDeselected()

bool AlignmentParameterSelector::layerDeselected ( const Alignable alignable) const

true if layer is deselected via "Layers<N><M>" or "DS/SS"

Definition at line 542 of file AlignmentParameterSelector.cc.

References funct::abs(), alignableTracker(), Alignable::id(), phase1PixelTopology::layer, theMaxLayer, theOnlyDS, theOnlySS, theSelLayers, SiStripDetId::TIB, SiStripDetId::TOB, AlignableTracker::trackerTopology(), and TrackerAlignableId::typeAndLayerFromDetId().

Referenced by add().

542  {
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
552  return true;
553  }
554  if (theOnlyDS // only double sided
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 }
constexpr std::array< uint8_t, layerIndexSize > layer
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr auto TOB
Definition: SiStripDetId.h:39
static constexpr auto TIB
Definition: SiStripDetId.h:37
const TrackerTopology * trackerTopology() const
Return tracker topology used to build AlignableTracker.
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId, const TrackerTopology *tTopo) const
const AlignableTracker * alignableTracker() const

◆ outsideDetIdRanges()

bool AlignmentParameterSelector::outsideDetIdRanges ( const Alignable alignable) const

true if DetId restrictions are not satisfied

Definition at line 606 of file AlignmentParameterSelector.cc.

References alignableTracker(), Alignable::id(), isMemberOfVector(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), TrackerTopology::pxbModule(), TrackerTopology::pxfBlade(), TrackerTopology::pxfDisk(), TrackerTopology::pxfModule(), TrackerTopology::pxfPanel(), TrackerTopology::pxfSide(), DetId::subdetId(), SiStripDetId::TEC, TrackerTopology::tecModule(), TrackerTopology::tecPetalNumber(), TrackerTopology::tecRing(), TrackerTopology::tecSide(), TrackerTopology::tecWheel(), AlignmentParameterSelector::PXFDetIdRanges::theBladeRanges, theDetIdRanges, theDetIds, AlignmentParameterSelector::PXFDetIdRanges::theDiskRanges, AlignmentParameterSelector::TIDDetIdRanges::theDiskRanges, theExcludedDetIdRanges, theExcludedDetIds, AlignmentParameterSelector::PXBDetIdRanges::theLadderRanges, AlignmentParameterSelector::PXBDetIdRanges::theLayerRanges, AlignmentParameterSelector::TIBDetIdRanges::theLayerRanges, AlignmentParameterSelector::TOBDetIdRanges::theLayerRanges, AlignmentParameterSelector::PXBDetIdRanges::theModuleRanges, AlignmentParameterSelector::PXFDetIdRanges::theModuleRanges, AlignmentParameterSelector::TIBDetIdRanges::theModuleRanges, AlignmentParameterSelector::TIDDetIdRanges::theModuleRanges, AlignmentParameterSelector::TOBDetIdRanges::theModuleRanges, AlignmentParameterSelector::TECDetIdRanges::theModuleRanges, AlignmentParameterSelector::PXFDetIdRanges::thePanelRanges, AlignmentParameterSelector::TECDetIdRanges::thePetalRanges, thePXBDetIdRanges, thePXFDetIdRanges, AlignmentParameterSelector::TIDDetIdRanges::theRingRanges, AlignmentParameterSelector::TECDetIdRanges::theRingRanges, AlignmentParameterSelector::TOBDetIdRanges::theRodRanges, AlignmentParameterSelector::PXFDetIdRanges::theSideRanges, AlignmentParameterSelector::TIBDetIdRanges::theSideRanges, AlignmentParameterSelector::TIDDetIdRanges::theSideRanges, AlignmentParameterSelector::TOBDetIdRanges::theSideRanges, AlignmentParameterSelector::TECDetIdRanges::theSideRanges, AlignmentParameterSelector::TIBDetIdRanges::theStringRanges, theTECDetIdRanges, theTIBDetIdRanges, theTIDDetIdRanges, theTOBDetIdRanges, AlignmentParameterSelector::TECDetIdRanges::theWheelRanges, SiStripDetId::TIB, TrackerTopology::tibLayer(), TrackerTopology::tibModule(), TrackerTopology::tibSide(), TrackerTopology::tibString(), SiStripDetId::TID, TrackerTopology::tidModule(), TrackerTopology::tidRing(), TrackerTopology::tidSide(), TrackerTopology::tidWheel(), SiStripDetId::TOB, TrackerTopology::tobLayer(), TrackerTopology::tobModule(), TrackerTopology::tobRod(), TrackerTopology::tobSide(), DetId::Tracker, and AlignableTracker::trackerTopology().

Referenced by add().

606  {
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 }
unsigned int tecPetalNumber(const DetId &id) const
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
unsigned int tobLayer(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
unsigned int tibSide(const DetId &id) const
unsigned int tobSide(const DetId &id) const
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
unsigned int pxfBlade(const DetId &id) const
static constexpr auto TID
Definition: SiStripDetId.h:38
unsigned int tibModule(const DetId &id) const
unsigned int tidSide(const DetId &id) const
unsigned int pxfModule(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
unsigned int tibString(const DetId &id) const
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
unsigned int pxbLadder(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
unsigned int tidModule(const DetId &id) const
unsigned int tecModule(const DetId &id) const
std::vector< int > theDetIds
DetId restrictions in eta, phi, r, x, y, z to be applied for next addSelection.
unsigned int tecSide(const DetId &id) const
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
unsigned int pxfDisk(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
Definition: SiStripDetId.h:39
unsigned int pxfPanel(const DetId &id) const
Definition: DetId.h:17
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:180
unsigned int pxfSide(const DetId &id) const
unsigned int tobRod(const DetId &id) const
static constexpr auto TIB
Definition: SiStripDetId.h:37
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
const TrackerTopology * trackerTopology() const
Return tracker topology used to build AlignableTracker.
unsigned int tidRing(const DetId &id) const
const AlignableTracker * alignableTracker() const
unsigned int tibLayer(const DetId &id) const
bool isMemberOfVector(int value, const std::vector< int > &values) const
true if value is member of vector of values
unsigned int tobModule(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
static constexpr auto TEC
Definition: SiStripDetId.h:40

◆ outsideGeometricalRanges()

bool AlignmentParameterSelector::outsideGeometricalRanges ( const Alignable alignable) const

true if geometrical restrictions in eta, phi, r, x, y, z not satisfied

Definition at line 586 of file AlignmentParameterSelector.cc.

References Alignable::globalPosition(), position, theRangesEta, theRangesPhi, theRangesR, theRangesX, theRangesY, and theRangesZ.

Referenced by add().

586  {
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 }
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
std::vector< double > theRangesEta
geometrical restrictions in eta, phi, r, x, y, z to be applied for next addSelection ...
static int position[264][3]
Definition: ReadPGInfo.cc:289

◆ selectedAlignables()

const align::Alignables& AlignmentParameterSelector::selectedAlignables ( ) const
inline

◆ selectedParameters()

const std::vector<std::vector<char> >& AlignmentParameterSelector::selectedParameters ( void  ) const
inline

vector of selection 'strings' for alignables, parallel to selectedAlignables()

Definition at line 39 of file AlignmentParameterSelector.h.

References theSelectedParameters.

Referenced by AlignmentParameterBuilder::addSelections(), and PedeSteerer::presigmas().

39 { return theSelectedParameters; }
std::vector< std::vector< char > > theSelectedParameters

◆ setGeometryCuts()

void AlignmentParameterSelector::setGeometryCuts ( const edm::ParameterSet pSet)

set geometrical restrictions to be applied on all following selections (slices defined by vdouble 'etaRanges', 'phiRanges', 'xRanges', 'yRanges', 'zRanges' and 'rRanges', empty array means no restriction)

Definition at line 96 of file AlignmentParameterSelector.cc.

References clearGeometryCuts(), Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), edm::ParameterSet::getParameterSet(), setPXBDetIdCuts(), setPXFDetIdCuts(), setTECDetIdCuts(), setTIBDetIdCuts(), setTIDDetIdCuts(), setTOBDetIdCuts(), theDetIdRanges, theDetIds, theExcludedDetIdRanges, theExcludedDetIds, theRangesEta, theRangesPhi, theRangesR, theRangesX, theRangesY, and theRangesZ.

Referenced by addSelection().

96  {
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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void setTIDDetIdCuts(const edm::ParameterSet &pSet)
void clearGeometryCuts()
remove all geometrical restrictions
ParameterSet const & getParameterSet(std::string const &) const
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)
void setTECDetIdCuts(const edm::ParameterSet &pSet)
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 ...
void setTOBDetIdCuts(const edm::ParameterSet &pSet)
std::vector< std::string > getParameterNames() const
void setTIBDetIdCuts(const edm::ParameterSet &pSet)

◆ setPXBDetIdCuts()

void AlignmentParameterSelector::setPXBDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 152 of file AlignmentParameterSelector.cc.

References Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), AlignmentParameterSelector::PXBDetIdRanges::theLadderRanges, AlignmentParameterSelector::PXBDetIdRanges::theLayerRanges, AlignmentParameterSelector::PXBDetIdRanges::theModuleRanges, and thePXBDetIdRanges.

Referenced by setGeometryCuts().

152  {
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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
std::vector< std::string > getParameterNames() const

◆ setPXFDetIdCuts()

void AlignmentParameterSelector::setPXFDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 175 of file AlignmentParameterSelector.cc.

References Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), AlignmentParameterSelector::PXFDetIdRanges::theBladeRanges, AlignmentParameterSelector::PXFDetIdRanges::theDiskRanges, AlignmentParameterSelector::PXFDetIdRanges::theModuleRanges, AlignmentParameterSelector::PXFDetIdRanges::thePanelRanges, thePXFDetIdRanges, and AlignmentParameterSelector::PXFDetIdRanges::theSideRanges.

Referenced by setGeometryCuts().

175  {
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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
std::vector< std::string > getParameterNames() const

◆ setSpecials()

std::string AlignmentParameterSelector::setSpecials ( const std::string &  name)
private

Setting the special switches and returning input string, but after removing the 'special indicators' from it. Known specials are: "SS" anywhere in name: in TIB/TOB restrict to single sided Dets/Rods/Layers "DS" anywhere in name: in TIB/TOB restrict to double sided Dets/Rods/Layers "Layers14" at end of name: in tracker restrict to layers/disks 1 to 4, similar for other digits "UnitStereo" and "UnitRphi" anywhere in name: for a DetUnit in strip select only if stereo or rphi module (keep 'Unit' in name!)

Definition at line 811 of file AlignmentParameterSelector.cc.

References Both, hgcalTopologyTester_cfi::layers, LogDebug, Skims_PA_cff::name, mps_merge::newName, Rphi, findQualityFiles::size, contentValuesCheck::ss, Stereo, AlCaHLTBitMon_QueryRunRegistry::string, theMaxLayer, theMinLayer, theOnlyDS, theOnlySS, theRphiOrStereoDetUnit, and theSelLayers.

Referenced by addSelection(), and AlignmentParameterSelector().

811  {
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 }
size
Write out results.
string newName
Definition: mps_merge.py:86
uint16_t size_type
#define LogDebug(id)

◆ setTECDetIdCuts()

void AlignmentParameterSelector::setTECDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 277 of file AlignmentParameterSelector.cc.

References Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), AlignmentParameterSelector::TECDetIdRanges::theModuleRanges, AlignmentParameterSelector::TECDetIdRanges::thePetalRanges, AlignmentParameterSelector::TECDetIdRanges::theRingRanges, AlignmentParameterSelector::TECDetIdRanges::theSideRanges, theTECDetIdRanges, and AlignmentParameterSelector::TECDetIdRanges::theWheelRanges.

Referenced by setGeometryCuts().

277  {
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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
std::vector< std::string > getParameterNames() const

◆ setTIBDetIdCuts()

void AlignmentParameterSelector::setTIBDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 202 of file AlignmentParameterSelector.cc.

References Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), AlignmentParameterSelector::TIBDetIdRanges::theLayerRanges, AlignmentParameterSelector::TIBDetIdRanges::theModuleRanges, AlignmentParameterSelector::TIBDetIdRanges::theSideRanges, AlignmentParameterSelector::TIBDetIdRanges::theStringRanges, and theTIBDetIdRanges.

Referenced by setGeometryCuts().

202  {
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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
std::vector< std::string > getParameterNames() const

◆ setTIDDetIdCuts()

void AlignmentParameterSelector::setTIDDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 227 of file AlignmentParameterSelector.cc.

References Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), AlignmentParameterSelector::TIDDetIdRanges::theDiskRanges, AlignmentParameterSelector::TIDDetIdRanges::theModuleRanges, AlignmentParameterSelector::TIDDetIdRanges::theRingRanges, AlignmentParameterSelector::TIDDetIdRanges::theSideRanges, and theTIDDetIdRanges.

Referenced by setGeometryCuts().

227  {
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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
std::vector< std::string > getParameterNames() const

◆ setTOBDetIdCuts()

void AlignmentParameterSelector::setTOBDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 252 of file AlignmentParameterSelector.cc.

References Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), AlignmentParameterSelector::TOBDetIdRanges::theLayerRanges, AlignmentParameterSelector::TOBDetIdRanges::theModuleRanges, AlignmentParameterSelector::TOBDetIdRanges::theRodRanges, AlignmentParameterSelector::TOBDetIdRanges::theSideRanges, and theTOBDetIdRanges.

Referenced by setGeometryCuts().

252  {
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 }
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< std::string > getParameterNames() const

Member Data Documentation

◆ theDetIdRanges

std::vector<int> AlignmentParameterSelector::theDetIdRanges
private

Definition at line 119 of file AlignmentParameterSelector.h.

Referenced by outsideDetIdRanges(), and setGeometryCuts().

◆ theDetIds

std::vector<int> AlignmentParameterSelector::theDetIds
private

DetId restrictions in eta, phi, r, x, y, z to be applied for next addSelection.

Definition at line 118 of file AlignmentParameterSelector.h.

Referenced by outsideDetIdRanges(), and setGeometryCuts().

◆ theExcludedDetIdRanges

std::vector<int> AlignmentParameterSelector::theExcludedDetIdRanges
private

Definition at line 121 of file AlignmentParameterSelector.h.

Referenced by outsideDetIdRanges(), and setGeometryCuts().

◆ theExcludedDetIds

std::vector<int> AlignmentParameterSelector::theExcludedDetIds
private

Definition at line 120 of file AlignmentParameterSelector.h.

Referenced by outsideDetIdRanges(), and setGeometryCuts().

◆ theExtras

AlignableExtras* AlignmentParameterSelector::theExtras
private

Definition at line 105 of file AlignmentParameterSelector.h.

Referenced by addSelection().

◆ theMaxLayer

int AlignmentParameterSelector::theMaxLayer
private

Definition at line 202 of file AlignmentParameterSelector.h.

Referenced by layerDeselected(), and setSpecials().

◆ theMinLayer

int AlignmentParameterSelector::theMinLayer
private

Definition at line 201 of file AlignmentParameterSelector.h.

Referenced by setSpecials().

◆ theMuon

AlignableMuon* AlignmentParameterSelector::theMuon
private

Definition at line 104 of file AlignmentParameterSelector.h.

Referenced by addSelection().

◆ theOnlyDS

bool AlignmentParameterSelector::theOnlyDS
private

Definition at line 198 of file AlignmentParameterSelector.h.

Referenced by layerDeselected(), and setSpecials().

◆ theOnlySS

bool AlignmentParameterSelector::theOnlySS
private

Definition at line 199 of file AlignmentParameterSelector.h.

Referenced by layerDeselected(), and setSpecials().

◆ thePXBDetIdRanges

struct AlignmentParameterSelector::PXBDetIdRanges AlignmentParameterSelector::thePXBDetIdRanges
private

◆ thePXFDetIdRanges

struct AlignmentParameterSelector::PXFDetIdRanges AlignmentParameterSelector::thePXFDetIdRanges
private

◆ theRangesEta

std::vector<double> AlignmentParameterSelector::theRangesEta
private

geometrical restrictions in eta, phi, r, x, y, z to be applied for next addSelection

Definition at line 110 of file AlignmentParameterSelector.h.

Referenced by clearGeometryCuts(), outsideGeometricalRanges(), and setGeometryCuts().

◆ theRangesPhi

std::vector<double> AlignmentParameterSelector::theRangesPhi
private

◆ theRangesR

std::vector<double> AlignmentParameterSelector::theRangesR
private

◆ theRangesX

std::vector<double> AlignmentParameterSelector::theRangesX
private

◆ theRangesY

std::vector<double> AlignmentParameterSelector::theRangesY
private

◆ theRangesZ

std::vector<double> AlignmentParameterSelector::theRangesZ
private

◆ theRphiOrStereoDetUnit

RphiOrStereoDetUnit AlignmentParameterSelector::theRphiOrStereoDetUnit
private

Definition at line 204 of file AlignmentParameterSelector.h.

Referenced by detUnitDeselected(), and setSpecials().

◆ theSelectedAlignables

align::Alignables AlignmentParameterSelector::theSelectedAlignables
private

Definition at line 106 of file AlignmentParameterSelector.h.

Referenced by add(), clear(), and selectedAlignables().

◆ theSelectedParameters

std::vector<std::vector<char> > AlignmentParameterSelector::theSelectedParameters
private

Definition at line 107 of file AlignmentParameterSelector.h.

Referenced by add(), clear(), and selectedParameters().

◆ theSelLayers

bool AlignmentParameterSelector::theSelLayers
private

Definition at line 200 of file AlignmentParameterSelector.h.

Referenced by layerDeselected(), and setSpecials().

◆ theTECDetIdRanges

struct AlignmentParameterSelector::TECDetIdRanges AlignmentParameterSelector::theTECDetIdRanges
private

◆ theTIBDetIdRanges

struct AlignmentParameterSelector::TIBDetIdRanges AlignmentParameterSelector::theTIBDetIdRanges
private

◆ theTIDDetIdRanges

struct AlignmentParameterSelector::TIDDetIdRanges AlignmentParameterSelector::theTIDDetIdRanges
private

◆ theTOBDetIdRanges

struct AlignmentParameterSelector::TOBDetIdRanges AlignmentParameterSelector::theTOBDetIdRanges
private

◆ theTracker

AlignableTracker* AlignmentParameterSelector::theTracker
private