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

Constructor & Destructor Documentation

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().

25  :
26  theTracker(aliTracker), theMuon(aliMuon), theExtras(aliExtras), theSelectedAlignables(),
28 {
29  this->setSpecials(""); // init theOnlyDS, theOnlySS, theSelLayers, theMinLayer, theMaxLayer, theRphiOrStereoDetUnit
30 }
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)
virtual AlignmentParameterSelector::~AlignmentParameterSelector ( )
inlinevirtual

Destructor.

Definition at line 33 of file AlignmentParameterSelector.h.

33 {}

Member Function Documentation

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 492 of file AlignmentParameterSelector.cc.

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

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

494 {
495  unsigned int numAli = 0;
496 
497  // loop on Alignable objects
498  for (align::Alignables::const_iterator iAli = alignables.begin();
499  iAli != alignables.end(); ++iAli) {
500 
501  if (!this->layerDeselected(*iAli) // check layers
502  && !this->detUnitDeselected(*iAli) // check detunit selection
503  && !this->outsideGeometricalRanges(*iAli) // check geometrical ranges
504  && !this->outsideDetIdRanges(*iAli)) { // check DetId ranges
505  // all fine, so add to output arrays
506  theSelectedAlignables.push_back(*iAli);
507  theSelectedParameters.push_back(paramSel);
508  ++numAli;
509  }
510  }
511 
512  return numAli;
513 }
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 outsideDetIdRanges(const Alignable *alignable) const
true if DetId restrictions are not satisfied
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
unsigned int AlignmentParameterSelector::addAllAlignables ( const std::vector< char > &  paramSel)
protected

Definition at line 878 of file AlignmentParameterSelector.cc.

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

Referenced by addSelection().

879 {
880  unsigned int numAli = 0;
881 
882  numAli += this->addAllDets(paramSel);
883  numAli += this->addAllRods(paramSel);
884  numAli += this->addAllLayers(paramSel);
885  numAli += this->add(theTracker->components(), paramSel);
886 
887  return numAli;
888 }
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
unsigned int AlignmentParameterSelector::addAllDets ( const std::vector< char > &  paramSel)
protected

some helper methods

Definition at line 836 of file AlignmentParameterSelector.cc.

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

Referenced by addAllAlignables(), and addSelection().

837 {
838  unsigned int numAli = 0;
839 
840  numAli += this->add(theTracker->barrelGeomDets(), paramSel); // TIB+TOB
841  numAli += this->add(theTracker->endcapGeomDets(), paramSel); // TEC
842  numAli += this->add(theTracker->TIDGeomDets(), paramSel); // TID
843  numAli += this->add(theTracker->pixelHalfBarrelGeomDets(), paramSel); // PixelBarrel
844  numAli += this->add(theTracker->pixelEndcapGeomDets(), paramSel); // PixelEndcap
845 
846  return numAli;
847 }
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
unsigned int AlignmentParameterSelector::addAllLayers ( const std::vector< char > &  paramSel)
protected

Definition at line 864 of file AlignmentParameterSelector.cc.

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

Referenced by addAllAlignables(), and addSelection().

865 {
866  unsigned int numAli = 0;
867 
868  numAli += this->add(theTracker->barrelLayers(), paramSel); // TIB+TOB
869  numAli += this->add(theTracker->pixelHalfBarrelLayers(), paramSel); // PixelBarrel
870  numAli += this->add(theTracker->endcapLayers(), paramSel); // TEC
871  numAli += this->add(theTracker->TIDLayers(), paramSel); // TID
872  numAli += this->add(theTracker->pixelEndcapLayers(), paramSel); // PixelEndcap
873 
874  return numAli;
875 }
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.
unsigned int AlignmentParameterSelector::addAllRods ( const std::vector< char > &  paramSel)
protected

Definition at line 850 of file AlignmentParameterSelector.cc.

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

Referenced by addAllAlignables(), and addSelection().

851 {
852  unsigned int numAli = 0;
853 
854  numAli += this->add(theTracker->barrelRods(), paramSel); // TIB+TOB
855  numAli += this->add(theTracker->pixelHalfBarrelLadders(), paramSel); // PixelBarrel
856  numAli += this->add(theTracker->endcapPetals(), paramSel); // TEC
857  numAli += this->add(theTracker->TIDRings(), paramSel); // TID
858  numAli += this->add(theTracker->pixelEndcapPetals(), paramSel); // PixelEndcap
859 
860  return numAli;
861 }
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.
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 319 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(), dataset::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, AlignableExtras::subStructures(), AlignableTracker::subStructures(), theExtras, theMuon, theTracker, AlignableTracker::TIDGeomDets(), AlignableTracker::TIDLayers(), AlignableTracker::TIDRings(), and AlignableTracker::TIDs().

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

321 {
322  const std::string name(this->setSpecials(nameInput)); // possibly changing name
323 
324  unsigned int numAli = 0;
325 
327  // Generic Tracker Section
329  if (name.find("Tracker") == 0) { // string starts with "Tracker"
330  if (!theTracker) {
331  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::addSelection] "
332  << "Configuration requires access to AlignableTracker"
333  << " (for " << name << ") that is not initialized";
334  }
335  const std::string substructName(name, 7); // erase "Tracker" at the beginning
336  numAli += this->add(theTracker->subStructures(substructName), paramSel);
337  }
339  // Old hardcoded, but geometry-independent tracker section (NOTE: no check on theTracker != 0)
341  else if (name == "AllDets") numAli += this->addAllDets(paramSel);
342  else if (name == "AllRods") numAli += this->addAllRods(paramSel);
343  else if (name == "AllLayers") numAli += this->addAllLayers(paramSel);
344  else if (name == "AllComponents") numAli += this->add(theTracker->components(), paramSel);
345  else if (name == "AllAlignables") numAli += this->addAllAlignables(paramSel);
346  //
347  // TIB+TOB
348  //
349  else if (name == "BarrelRods") numAli += this->add(theTracker->barrelRods(), paramSel);
350  else if (name == "BarrelDets") numAli += this->add(theTracker->barrelGeomDets(), paramSel);
351  else if (name == "BarrelLayers") numAli += this->add(theTracker->barrelLayers(), paramSel);
352  else if (name == "TOBDets") numAli += this->add(theTracker->outerBarrelGeomDets(), paramSel);
353  else if (name == "TOBRods") numAli += this->add(theTracker->outerBarrelRods(), paramSel);
354  else if (name == "TOBLayers") numAli += this->add(theTracker->outerBarrelLayers(), paramSel);
355  else if (name == "TOBHalfBarrels") numAli += this->add(theTracker->outerHalfBarrels(), paramSel);
356  else if (name == "TIBDets") numAli += this->add(theTracker->innerBarrelGeomDets(), paramSel);
357  else if (name == "TIBRods") numAli += this->add(theTracker->innerBarrelRods(), paramSel);
358  else if (name == "TIBLayers") numAli += this->add(theTracker->innerBarrelLayers(), paramSel);
359  else if (name == "TIBHalfBarrels") numAli += this->add(theTracker->innerHalfBarrels(), paramSel);
360  //
361  // PXBarrel
362  //
363  else if (name == "PixelHalfBarrelDets") {
364  numAli += this->add(theTracker->pixelHalfBarrelGeomDets(), paramSel);
365  } else if (name == "PixelHalfBarrelLadders") {
366  numAli += this->add(theTracker->pixelHalfBarrelLadders(), paramSel);
367  } else if (name == "PixelHalfBarrelLayers") {
368  numAli += this->add(theTracker->pixelHalfBarrelLayers(), paramSel);
369  } else if (name == "PixelHalfBarrels") {
370  numAli += this->add(theTracker->pixelHalfBarrels(), paramSel);
371  }
372  //
373  // PXEndcap
374  //
375  else if (name == "PXECDets") numAli += this->add(theTracker->pixelEndcapGeomDets(), paramSel);
376  else if (name == "PXECPetals") numAli += this->add(theTracker->pixelEndcapPetals(), paramSel);
377  else if (name == "PXECLayers") numAli += this->add(theTracker->pixelEndcapLayers(), paramSel);
378  else if (name == "PXECHalfCylinders") numAli += this->add(theTracker->pixelEndcapHalfCylinders(), paramSel);
379  else if (name == "PXEndCaps") numAli += this->add(theTracker->pixelEndCaps(), paramSel);
380  //
381  // Pixel Barrel+endcap
382  //
383  else if (name == "PixelDets") {
384  numAli += this->add(theTracker->pixelHalfBarrelGeomDets(), paramSel);
385  numAli += this->add(theTracker->pixelEndcapGeomDets(), paramSel);
386  } else if (name == "PixelRods") {
387  numAli += this->add(theTracker->pixelHalfBarrelLadders(), paramSel);
388  numAli += this->add(theTracker->pixelEndcapPetals(), paramSel);
389  } else if (name == "PixelLayers") {
390  numAli += this->add(theTracker->pixelHalfBarrelLayers(), paramSel);
391  numAli += this->add(theTracker->pixelEndcapLayers(), paramSel);
392  }
393  //
394  // TID
395  //
396  else if (name == "TIDs") numAli += this->add(theTracker->TIDs(), paramSel);
397  else if (name == "TIDLayers") numAli += this->add(theTracker->TIDLayers(), paramSel);
398  else if (name == "TIDRings") numAli += this->add(theTracker->TIDRings(), paramSel);
399  else if (name == "TIDDets") numAli += this->add(theTracker->TIDGeomDets(), paramSel);
400  //
401  // TEC
402  //
403  else if (name == "TECDets") numAli += this->add(theTracker->endcapGeomDets(), paramSel);
404  else if (name == "TECPetals") numAli += this->add(theTracker->endcapPetals(), paramSel);
405  else if (name == "TECLayers") numAli += this->add(theTracker->endcapLayers(), paramSel);
406  else if (name == "TECs") numAli += this->add(theTracker->endCaps(), paramSel);
407  //
408  // StripEndcap (TID+TEC)
409  //
410  else if (name == "EndcapDets") {
411  numAli += this->add(theTracker->TIDGeomDets(), paramSel);
412  numAli += this->add(theTracker->endcapGeomDets(), paramSel);
413  } else if (name == "EndcapPetals") {
414  numAli += this->add(theTracker->TIDRings(), paramSel);
415  numAli += this->add(theTracker->endcapPetals(), paramSel);
416  } else if (name == "EndcapLayers") {
417  numAli += this->add(theTracker->TIDLayers(), paramSel);
418  numAli += this->add(theTracker->endcapLayers(), paramSel);
419  }
420  //
421  // Strip Barrel+endcap
422  //
423  else if (name == "StripDets") {
424  numAli += this->add(theTracker->barrelGeomDets(), paramSel);
425  numAli += this->add(theTracker->TIDGeomDets(), paramSel);
426  numAli += this->add(theTracker->endcapGeomDets(), paramSel);
427  } else if (name == "StripRods") {
428  numAli += this->add(theTracker->barrelRods(), paramSel);
429  numAli += this->add(theTracker->TIDRings(), paramSel);
430  numAli += this->add(theTracker->endcapPetals(), paramSel);
431  } else if (name == "StripLayers") {
432  numAli += this->add(theTracker->barrelLayers(), paramSel);
433  numAli += this->add(theTracker->TIDLayers(), paramSel);
434  numAli += this->add(theTracker->endcapLayers(), paramSel);
435  }
437  // Muon selection
439  // Check if name contains muon and react if alignable muon not initialized
440  else if (name.find("Muon") != std::string::npos) {
441  if (!theMuon) {
442  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::addSelection] "
443  << "Configuration requires access to AlignableMuon"
444  << " which is not initialized";
445  }
446  else if (name == "MuonDTLayers") add(theMuon->DTLayers(), paramSel);
447  else if (name == "MuonDTSuperLayers") add(theMuon->DTSuperLayers(), paramSel);
448  else if (name == "MuonDTChambers") add(theMuon->DTChambers(), paramSel);
449  else if (name == "MuonDTStations") add(theMuon->DTStations(), paramSel);
450  else if (name == "MuonDTWheels") add(theMuon->DTWheels(), paramSel);
451  else if (name == "MuonBarrel") add(theMuon->DTBarrel(), paramSel);
452  else if (name == "MuonCSCLayers") add(theMuon->CSCLayers(), paramSel);
453  else if (name == "MuonCSCRings") add(theMuon->CSCRings(), paramSel);
454  else if (name == "MuonCSCChambers") add(theMuon->CSCChambers(), paramSel);
455  else if (name == "MuonCSCStations") add(theMuon->CSCStations(), paramSel);
456  else if (name == "MuonEndcaps") add(theMuon->CSCEndcaps(), paramSel);
457 
459  // not found, but Muon
461  else {
462  throw cms::Exception("BadConfig") <<"[AlignmentParameterSelector::addSelection]"
463  << ": Selection '" << name << "' invalid!";
464  }
465  }
466 
468  // Generic Extra Alignable Section
470  else if (name.find("Extras") == 0) { // string starts with "Extras"
471  if (!theExtras) {
472  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::addSelection] "
473  << "Configuration requires access to AlignableExtras"
474  << " (for " << name << ") that is not initialized";
475  }
476  const std::string substructName(name, 6); // erase "Extras" at the beginning
477  numAli += this->add(theExtras->subStructures(substructName), paramSel);
478  }
479  // end of "name.find("Extras") != std::string::npos"
480 
481  else {
482  throw cms::Exception("BadConfig") <<"[AlignmentParameterSelector::addSelection]"
483  << ": Selection '" << name << "' invalid!";
484  }
485 
486  this->setSpecials(""); // reset
487 
488  return numAli;
489 }
const Alignables & components() const override
Return vector of direct components.
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.
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)
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 310 of file AlignmentParameterSelector.cc.

References addSelection(), and setGeometryCuts().

313 {
314  this->setGeometryCuts(pSet);
315  return this->addSelection(name, paramSel);
316 }
void setGeometryCuts(const edm::ParameterSet &pSet)
unsigned int addSelection(const std::string &name, const std::vector< char > &paramSel)
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 64 of file AlignmentParameterSelector.cc.

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

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

65 {
66 
67  const std::vector<std::string> selections
68  = 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()) continue; // edm::LogError or even cms::Exception??
75 
76  if (decompSel.size() < 2) {
77  throw cms::Exception("BadConfig") << "@SUB=AlignmentParameterSelector::addSelections"
78  << selections[iSel]<<" from alignableParamSelector: "
79  << " should have at least 2 ','-separated parts";
80  } else if (decompSel.size() > 2) {
81  const edm::ParameterSet geoSel(pSet.getParameter<edm::ParameterSet>(decompSel[2].c_str()));
82  this->addSelection(decompSel[0], this->convertParamSel(decompSel[1]), geoSel);
83  } else {
84  this->clearGeometryCuts();
85  this->addSelection(decompSel[0], this->convertParamSel(decompSel[1]));
86  }
87 
88  ++addedSets;
89  }
90 
91  return addedSets;
92 }
T getParameter(std::string const &) const
void clearGeometryCuts()
remove all geometrical restrictions
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)
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector<char>
const AlignableTracker * AlignmentParameterSelector::alignableTracker ( ) const
protected

Definition at line 58 of file AlignmentParameterSelector.cc.

References theTracker.

Referenced by layerDeselected(), and outsideDetIdRanges().

59 {
60  return theTracker;
61 }
void AlignmentParameterSelector::clear ( )

remove all selected Alignables and geometrical restrictions

Definition at line 33 of file AlignmentParameterSelector.cc.

References clearGeometryCuts(), theSelectedAlignables, and theSelectedParameters.

Referenced by MomentumDependentPedeLabeler::buildMomentumDependencyMap(), RunRangeDependentPedeLabeler::buildRunRangeDependencyMap(), Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), TkModuleGroupSelector::createModuleGroups(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), HIPAlignmentAlgorithm::initialize(), PedeSteererWeakModeConstraints::PedeSteererWeakModeConstraints(), PedeSteerer::presigmas(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), BeautifulSoup.Tag::setString(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().

34 {
35  theSelectedAlignables.clear();
36  theSelectedParameters.clear();
37  this->clearGeometryCuts();
38 }
void clearGeometryCuts()
remove all geometrical restrictions
std::vector< std::vector< char > > theSelectedParameters
void AlignmentParameterSelector::clearGeometryCuts ( )

remove all geometrical restrictions

Definition at line 41 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().

42 {
43  theRangesEta.clear();
44  theRangesPhi.clear();
45  theRangesR.clear();
46  theRangesX.clear();
47  theRangesY.clear();
48  theRangesZ.clear();
49 
56 }
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
std::vector< double > theRangesEta
geometrical restrictions in eta, phi, r, x, y, z to be applied for next addSelection ...
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
std::vector< char > AlignmentParameterSelector::convertParamSel ( const std::string &  selString) const

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

Definition at line 755 of file AlignmentParameterSelector.cc.

References mps_fire::result.

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

756 {
757 
758  // Convert selString into vector<char> of same length.
759  // Note: Old implementation in AlignmentParameterBuilder was rigid in length,
760  // expecting RigidBodyAlignmentParameters::N_PARAM.
761  // But I prefer to be more general and allow other Alignables. It will throw anyway if
762  // RigidBodyAlignmentParameters are build with wrong selection length.
763  std::vector<char> result(selString.size());
764 
765  for (std::string::size_type pos = 0; pos < selString.size(); ++pos) {
766  result[pos] = selString[pos];
767  }
768 
769  return result;
770 }
uint16_t size_type
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 735 of file AlignmentParameterSelector.cc.

References mps_fire::result.

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

736 {
737 
738  std::vector<std::string> result;
739 
740  std::string::size_type previousPos = 0;
741  while (true) {
742  const std::string::size_type delimiterPos = s.find(delimiter, previousPos);
743  if (delimiterPos == std::string::npos) {
744  result.push_back(s.substr(previousPos)); // until end
745  break;
746  }
747  result.push_back(s.substr(previousPos, delimiterPos - previousPos));
748  previousPos = delimiterPos + 1; // +1: skip delimiter
749  }
750 
751  return result;
752 }
uint16_t size_type
bool AlignmentParameterSelector::detUnitDeselected ( const Alignable alignable) const

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

Definition at line 546 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().

547 {
548 
549  if (theRphiOrStereoDetUnit != Both && ali->alignableObjectId() == align::AlignableDetUnit) {
550  const SiStripDetId detId(ali->geomDetId()); // do not know yet whether right type...
551  if (detId.det() == DetId::Tracker
552  && (detId.subdetId() == SiStripDetId::TIB || detId.subdetId() == SiStripDetId::TID ||
553  detId.subdetId() == SiStripDetId::TOB || detId.subdetId() == SiStripDetId::TEC)) {
554  // We have a DetUnit in strip, so check for a selection of stereo/rphi (DetUnits in 1D layers are rphi):
555  if ((theRphiOrStereoDetUnit == Stereo && !detId.stereo())
556  || (theRphiOrStereoDetUnit == Rphi && detId.stereo())) {
557  return true;
558  }
559  }
560  }
561 
562  return false; // do not deselect...
563 }
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
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 676 of file AlignmentParameterSelector.cc.

References Exception, and mps_fire::i.

679 {
680  // might become templated on <double> ?
681 
682  if (ranges.size()%2 != 0) {
683  cms::Exception("BadConfig") << "@SUB=AlignmentParameterSelector::insideRanges"
684  << " need even number of entries in ranges instead of "
685  << ranges.size();
686  return false;
687  }
688 
689  for (unsigned int i = 0; i < ranges.size(); i += 2) {
690  if (isPhi) { // mapping into (-pi,+pi] and checking for range including sign flip area
691  Geom::Phi<double> rangePhi1(ranges[i]);
692  Geom::Phi<double> rangePhi2(ranges[i+1]);
693  Geom::Phi<double> valuePhi(value);
694  if (rangePhi1 <= valuePhi && valuePhi < rangePhi2) { // 'normal'
695  return true;
696  }
697  if (rangePhi2 < rangePhi1 && (rangePhi1 <= valuePhi || valuePhi < rangePhi2)) {// 'sign flip'
698  return true;
699  }
700  } else if (ranges[i] <= value && value < ranges[i+1]) {
701  return true;
702  }
703  }
704 
705  return false;
706 }
Definition: value.py:1
string ranges
Definition: diffTwoXMLs.py:78
template<>
bool AlignmentParameterSelector::insideRanges ( int  value,
const std::vector< int > &  ranges,
bool  isPhi 
) const
template<>
bool AlignmentParameterSelector::insideRanges ( int  value,
const std::vector< int > &  ranges,
bool   
) const

Definition at line 709 of file AlignmentParameterSelector.cc.

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

712 {
713  if (ranges.size()%2 != 0) {
714  cms::Exception("BadConfig") << "@SUB=AlignmentParameterSelector::insideRanges"
715  << " need even number of entries in ranges instead of "
716  << ranges.size();
717  return false;
718  }
719 
720  for (unsigned int i = 0; i < ranges.size(); i += 2) {
721  if (ranges[i] <= value && value <= ranges[i+1]) return true;
722  }
723 
724  return false;
725 }
Definition: value.py:1
string ranges
Definition: diffTwoXMLs.py:78
bool AlignmentParameterSelector::isMemberOfVector ( int  value,
const std::vector< int > &  values 
) const

true if value is member of vector of values

Definition at line 727 of file AlignmentParameterSelector.cc.

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

Referenced by outsideDetIdRanges().

728 {
729  if (std::find(values.begin(), values.end(), value)!=values.end()) return true;
730  return false;
731 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
bool AlignmentParameterSelector::layerDeselected ( const Alignable alignable) const

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

Definition at line 516 of file AlignmentParameterSelector.cc.

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

Referenced by add().

517 {
518  if (theOnlySS || theOnlyDS || theSelLayers) {
519  TrackerAlignableId idProvider;
520  std::pair<int,int> typeLayer = idProvider.typeAndLayerFromDetId(ali->id(), alignableTracker()->trackerTopology());
521  int type = typeLayer.first;
522  int layer = typeLayer.second;
523 
524  // select on single/double sided barrel layers in TIB/TOB
525  if (theOnlySS // only single sided
526  && (std::abs(type) == SiStripDetId::TIB || std::abs(type) == SiStripDetId::TOB)
527  && layer <= 2) {
528  return true;
529  }
530  if (theOnlyDS // only double sided
531  && (std::abs(type) == SiStripDetId::TIB || std::abs(type) == SiStripDetId::TOB)
532  && layer > 2) {
533  return true;
534  }
535 
536  // reject layers
537  if (theSelLayers && (layer < theMinLayer || layer > theMaxLayer)) {
538  return true;
539  }
540  }
541 
542  return false; // do not deselect...
543 }
type
Definition: HCALResponse.h:21
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId, const TrackerTopology *tTopo) const
const TrackerTopology * trackerTopology() const
Return tracker topology used to build AlignableTracker.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const AlignableTracker * alignableTracker() const
bool AlignmentParameterSelector::outsideDetIdRanges ( const Alignable alignable) const

true if DetId restrictions are not satisfied

Definition at line 581 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().

582 {
583  //const DetId detId(alignable->geomDetId());
584  const DetId detId(alignable->id());
585  const int subdetId = detId.subdetId();
586 
587  if (alignableTracker()) {
588 
590 
591  if (!theDetIds.empty() &&
592  !this->isMemberOfVector((detId.rawId()), theDetIds)) return true;
593  if (!theDetIdRanges.empty() &&
594  !this->insideRanges<int>((detId.rawId()), theDetIdRanges)) return true;
595  if (!theExcludedDetIds.empty() &&
596  this->isMemberOfVector((detId.rawId()), theExcludedDetIds)) return true;
597  if (!theExcludedDetIdRanges.empty() &&
598  this->insideRanges<int>((detId.rawId()), theExcludedDetIdRanges)) return true;
599 
600  if (detId.det()==DetId::Tracker) {
601 
602  if (subdetId==static_cast<int>(PixelSubdetector::PixelBarrel)) {
603  if (!thePXBDetIdRanges.theLadderRanges.empty() &&
604  !this->insideRanges<int>(tTopo->pxbLadder(detId), thePXBDetIdRanges.theLadderRanges)) return true;
605  if (!thePXBDetIdRanges.theLayerRanges.empty() &&
606  !this->insideRanges<int>(tTopo->pxbLayer(detId), thePXBDetIdRanges.theLayerRanges)) return true;
607  if (!thePXBDetIdRanges.theModuleRanges.empty() &&
608  !this->insideRanges<int>(tTopo->pxbModule(detId), thePXBDetIdRanges.theModuleRanges)) return true;
609  }
610 
611  if (subdetId==static_cast<int>(PixelSubdetector::PixelEndcap)) {
612  if (!thePXFDetIdRanges.theBladeRanges.empty() &&
613  !this->insideRanges<int>(tTopo->pxfBlade(detId), thePXFDetIdRanges.theBladeRanges)) return true;
614  if (!thePXFDetIdRanges.theDiskRanges.empty() &&
615  !this->insideRanges<int>(tTopo->pxfDisk(detId), thePXFDetIdRanges.theDiskRanges)) return true;
616  if (!thePXFDetIdRanges.theModuleRanges.empty() &&
617  !this->insideRanges<int>(tTopo->pxfModule(detId), thePXFDetIdRanges.theModuleRanges)) return true;
618  if (!thePXFDetIdRanges.thePanelRanges.empty() &&
619  !this->insideRanges<int>(tTopo->pxfPanel(detId), thePXFDetIdRanges.thePanelRanges)) return true;
620  if (!thePXFDetIdRanges.theSideRanges.empty() &&
621  !this->insideRanges<int>(tTopo->pxfSide(detId), thePXFDetIdRanges.theSideRanges)) return true;
622  }
623 
624  if (subdetId==static_cast<int>(SiStripDetId::TIB)) {
625  if (!theTIBDetIdRanges.theLayerRanges.empty() &&
626  !this->insideRanges<int>(tTopo->tibLayer(detId), theTIBDetIdRanges.theLayerRanges)) return true;
627  if (!theTIBDetIdRanges.theModuleRanges.empty() &&
628  !this->insideRanges<int>(tTopo->tibModule(detId), theTIBDetIdRanges.theModuleRanges)) return true;
629  if (!theTIBDetIdRanges.theSideRanges.empty() &&
630  !this->insideRanges<int>(tTopo->tibSide(detId), theTIBDetIdRanges.theSideRanges)) return true;
631  if (!theTIBDetIdRanges.theStringRanges.empty() &&
632  !this->insideRanges<int>(tTopo->tibString(detId), theTIBDetIdRanges.theStringRanges)) return true;
633  }
634 
635  if (subdetId==static_cast<int>(SiStripDetId::TID)) {
636  if (!theTIDDetIdRanges.theDiskRanges.empty() &&
637  !this->insideRanges<int>(tTopo->tidWheel(detId), theTIDDetIdRanges.theDiskRanges)) return true;
638  if (!theTIDDetIdRanges.theModuleRanges.empty() &&
639  !this->insideRanges<int>(tTopo->tidModule(detId), theTIDDetIdRanges.theModuleRanges)) return true;
640  if (!theTIDDetIdRanges.theRingRanges.empty() &&
641  !this->insideRanges<int>(tTopo->tidRing(detId), theTIDDetIdRanges.theRingRanges)) return true;
642  if (!theTIDDetIdRanges.theSideRanges.empty() &&
643  !this->insideRanges<int>(tTopo->tidSide(detId), theTIDDetIdRanges.theSideRanges)) return true;
644  }
645 
646  if (subdetId==static_cast<int>(SiStripDetId::TOB)) {
647  if (!theTOBDetIdRanges.theLayerRanges.empty() &&
648  !this->insideRanges<int>(tTopo->tobLayer(detId), theTOBDetIdRanges.theLayerRanges)) return true;
649  if (!theTOBDetIdRanges.theModuleRanges.empty() &&
650  !this->insideRanges<int>(tTopo->tobModule(detId), theTOBDetIdRanges.theModuleRanges)) return true;
651  if (!theTOBDetIdRanges.theRodRanges.empty() &&
652  !this->insideRanges<int>(tTopo->tobRod(detId), theTOBDetIdRanges.theRodRanges)) return true;
653  if (!theTOBDetIdRanges.theSideRanges.empty() &&
654  !this->insideRanges<int>(tTopo->tobSide(detId), theTOBDetIdRanges.theSideRanges)) return true;
655  }
656 
657  if (subdetId==static_cast<int>(SiStripDetId::TEC)) {
658  if (!theTECDetIdRanges.theWheelRanges.empty() &&
659  !this->insideRanges<int>(tTopo->tecWheel(detId), theTECDetIdRanges.theWheelRanges)) return true;
660  if (!theTECDetIdRanges.thePetalRanges.empty() &&
661  !this->insideRanges<int>(tTopo->tecPetalNumber(detId), theTECDetIdRanges.thePetalRanges)) return true;
662  if (!theTECDetIdRanges.theModuleRanges.empty() &&
663  !this->insideRanges<int>(tTopo->tecModule(detId), theTECDetIdRanges.theModuleRanges)) return true;
664  if (!theTECDetIdRanges.theRingRanges.empty() &&
665  !this->insideRanges<int>(tTopo->tecRing(detId), theTECDetIdRanges.theRingRanges)) return true;
666  if (!theTECDetIdRanges.theSideRanges.empty() &&
667  !this->insideRanges<int>(tTopo->tecSide(detId), theTECDetIdRanges.theSideRanges)) return true;
668  }
669  }
670  }
671 
672  return false;
673 }
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:189
unsigned int tibLayer(const DetId &id) const
unsigned int tibString(const DetId &id) const
unsigned int tidRing(const DetId &id) const
unsigned int pxfDisk(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
unsigned int pxbLadder(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
const TrackerTopology * trackerTopology() const
Return tracker topology used to build AlignableTracker.
unsigned int tibSide(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 tidSide(const DetId &id) const
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
unsigned int tidModule(const DetId &id) const
unsigned int tobSide(const DetId &id) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:38
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
unsigned int tibModule(const DetId &id) const
unsigned int pxfModule(const DetId &id) const
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges
unsigned int pxbLayer(const DetId &id) const
unsigned int tecModule(const DetId &id) const
Definition: DetId.h:18
unsigned int tobModule(const DetId &id) const
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
unsigned int pxfSide(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 tecPetalNumber(const DetId &id) const
unsigned int tobRod(const DetId &id) const
const AlignableTracker * alignableTracker() const
unsigned int tecWheel(const DetId &id) const
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
bool AlignmentParameterSelector::outsideGeometricalRanges ( const Alignable alignable) const

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

Definition at line 566 of file AlignmentParameterSelector.cc.

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

Referenced by add().

567 {
568  const align::PositionType& position(alignable->globalPosition());
569 
570  if (!theRangesEta.empty() && !this->insideRanges<double>((position.eta()), theRangesEta)) return true;
571  if (!theRangesPhi.empty() && !this->insideRanges<double>((position.phi()), theRangesPhi, true))return true;
572  if (!theRangesR.empty() && !this->insideRanges<double>((position.perp()), theRangesR)) return true;
573  if (!theRangesX.empty() && !this->insideRanges<double>((position.x()), theRangesX)) return true;
574  if (!theRangesY.empty() && !this->insideRanges<double>((position.y()), theRangesY)) return true;
575  if (!theRangesZ.empty() && !this->insideRanges<double>((position.z()), theRangesZ)) return true;
576 
577  return false;
578 }
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:509
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
const align::Alignables& AlignmentParameterSelector::selectedAlignables ( ) const
inline
const std::vector<std::vector<char> >& AlignmentParameterSelector::selectedParameters ( void  ) const
inline
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 95 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(),
103  iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
104 
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
void setTIDDetIdCuts(const edm::ParameterSet &pSet)
void clearGeometryCuts()
remove all geometrical restrictions
std::vector< int > theDetIds
DetId restrictions in eta, phi, r, x, y, z to be applied for next addSelection.
void setPXBDetIdCuts(const edm::ParameterSet &pSet)
void setTECDetIdCuts(const edm::ParameterSet &pSet)
std::vector< std::string > getParameterNames() const
void setPXFDetIdCuts(const edm::ParameterSet &pSet)
ParameterSet const & getParameterSet(std::string const &) const
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)
void setTIBDetIdCuts(const edm::ParameterSet &pSet)
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().

153 {
154  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
155  // but take care that nothing unknown is configured (to fetch typos!).
156 
157  const std::vector<std::string> parameterNames(pSet.getParameterNames());
158  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
159  iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
160 
161  // Calling swap is more efficient than assignment:
162  if (*iParam == "ladderRanges") {
163  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXBDetIdRanges.theLadderRanges);
164  } else if (*iParam == "layerRanges") {
165  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXBDetIdRanges.theLayerRanges);
166  } else if (*iParam == "moduleRanges") {
167  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXBDetIdRanges.theModuleRanges);
168  } else {
169  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setPXBDetIdCuts] "
170  << "Unknown parameter '" << *iParam << "'.\n";
171  }
172  }
173 }
T getParameter(std::string const &) const
struct AlignmentParameterSelector::PXBDetIdRanges thePXBDetIdRanges
std::vector< std::string > getParameterNames() const
void AlignmentParameterSelector::setPXFDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 176 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().

177 {
178  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
179  // but take care that nothing unknown is configured (to fetch typos!).
180 
181  const std::vector<std::string> parameterNames(pSet.getParameterNames());
182  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
183  iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
184 
185  // Calling swap is more efficient than assignment:
186  if (*iParam == "bladeRanges") {
187  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXFDetIdRanges.theBladeRanges);
188  } else if (*iParam == "diskRanges") {
189  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXFDetIdRanges.theDiskRanges);
190  } else if (*iParam == "moduleRanges") {
191  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXFDetIdRanges.theModuleRanges);
192  } else if (*iParam == "panelRanges") {
193  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXFDetIdRanges.thePanelRanges);
194  } else if (*iParam == "sideRanges") {
195  pSet.getParameter<std::vector<int> >(*iParam).swap(thePXFDetIdRanges.theSideRanges);
196  } else {
197  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setPXFDetIdCuts] "
198  << "Unknown parameter '" << *iParam << "'.\n";
199  }
200  }
201 }
T getParameter(std::string const &) const
struct AlignmentParameterSelector::PXFDetIdRanges thePXFDetIdRanges
std::vector< std::string > getParameterNames() const
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 774 of file AlignmentParameterSelector.cc.

References Both, LayerTriplets::layers(), LogDebug, mps_merge::newName, Rphi, findQualityFiles::size, Stereo, AlCaHLTBitMon_QueryRunRegistry::string, theMaxLayer, theMinLayer, theOnlyDS, theOnlySS, theRphiOrStereoDetUnit, and theSelLayers.

Referenced by addSelection(), and AlignmentParameterSelector().

775 {
776  // Use new string only, although direct erasing of found indicator causes problems for 'DSS',
777  // but 'DSS' makes absolutely no sense!
779 
780  const std::string::size_type ss = newName.rfind("SS");
781  if (ss != std::string::npos) {
782  newName.erase(ss, 2); // 2: length of 'SS'
783  theOnlySS = true;
784  } else {
785  theOnlySS = false;
786  }
787 
788  const std::string::size_type ds = newName.rfind("DS");
789  if (ds != std::string::npos) {
790  newName.erase(ds, 2); // 2: length of 'DS'
791  theOnlyDS = true;
792  } else {
793  theOnlyDS = false;
794  }
795 
796  const std::string::size_type size = newName.size();
797  const std::string::size_type layers = newName.rfind("Layers");
798  if (layers != std::string::npos && size - layers - 2 == 6 // 2 digits, 6: length of 'Layers'
799  && isdigit(newName[size-1]) && isdigit(newName[size-2])) {
800  theSelLayers = true;
801  theMinLayer = newName[size-2] - '0';
802  theMaxLayer = newName[size-1] - '0';
803  newName.erase(layers);
804  } else {
805  theSelLayers = false;
806  theMinLayer = -1;
807  theMaxLayer = 99999;
808  }
809 
811  if (newName.rfind("Unit") != std::string::npos) {
812  const std::string::size_type uRph = newName.rfind("UnitRphi");
813  if (uRph != std::string::npos) {
814  newName.erase(uRph + 4, 4); // keep 'Unit' (4) and erase 'Rphi' (4)
816  }
817  const std::string::size_type uSte = newName.rfind("UnitStereo");
818  if (uSte != std::string::npos) {
819  newName.erase(uSte + 4, 6); // keep 'Unit' (4) and erase 'Stereo' (6)
821  }
822  }
823 
824  if (newName != name) {
825  LogDebug("Alignment") << "@SUB=AlignmentParameterSelector::setSpecials"
826  << name << " becomes " << newName << ", makes theOnlySS " << theOnlySS
827  << ", theOnlyDS " << theOnlyDS << ", theSelLayers " << theSelLayers
828  << ", theMinLayer " << theMinLayer << ", theMaxLayer " << theMaxLayer
829  << ", theRphiOrStereoDetUnit " << theRphiOrStereoDetUnit;
830  }
831 
832  return newName;
833 }
#define LogDebug(id)
size
Write out results.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
string newName
Definition: mps_merge.py:84
uint16_t size_type
void AlignmentParameterSelector::setTECDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 282 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().

283 {
284  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
285  // but take care that nothing unknown is configured (to fetch typos!).
286 
287  const std::vector<std::string> parameterNames(pSet.getParameterNames());
288  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
289  iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
290 
291  // Calling swap is more efficient than assignment:
292  if (*iParam == "wheelRanges") {
293  pSet.getParameter<std::vector<int> >(*iParam).swap(theTECDetIdRanges.theWheelRanges);
294  } else if (*iParam == "petalRanges") {
295  pSet.getParameter<std::vector<int> >(*iParam).swap(theTECDetIdRanges.thePetalRanges);
296  } else if (*iParam == "moduleRanges") {
297  pSet.getParameter<std::vector<int> >(*iParam).swap(theTECDetIdRanges.theModuleRanges);
298  } else if (*iParam == "ringRanges") {
299  pSet.getParameter<std::vector<int> >(*iParam).swap(theTECDetIdRanges.theRingRanges);
300  } else if (*iParam == "sideRanges") {
301  pSet.getParameter<std::vector<int> >(*iParam).swap(theTECDetIdRanges.theSideRanges);
302  } else {
303  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setTECDetIdCuts] "
304  << "Unknown parameter '" << *iParam << "'.\n";
305  }
306  }
307 }
T getParameter(std::string const &) const
std::vector< std::string > getParameterNames() const
struct AlignmentParameterSelector::TECDetIdRanges theTECDetIdRanges
void AlignmentParameterSelector::setTIBDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 204 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().

205 {
206  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
207  // but take care that nothing unknown is configured (to fetch typos!).
208 
209  const std::vector<std::string> parameterNames(pSet.getParameterNames());
210  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
211  iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
212 
213  // Calling swap is more efficient than assignment:
214  if (*iParam == "layerRanges") {
215  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIBDetIdRanges.theLayerRanges);
216  } else if (*iParam == "moduleRanges") {
217  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIBDetIdRanges.theModuleRanges);
218  } else if (*iParam == "stringRanges") {
219  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIBDetIdRanges.theStringRanges);
220  } else if (*iParam == "sideRanges") {
221  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIBDetIdRanges.theSideRanges);
222  } else {
223  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setTIBDetIdCuts] "
224  << "Unknown parameter '" << *iParam << "'.\n";
225  }
226  }
227 }
T getParameter(std::string const &) const
std::vector< std::string > getParameterNames() const
struct AlignmentParameterSelector::TIBDetIdRanges theTIBDetIdRanges
void AlignmentParameterSelector::setTIDDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 230 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().

231 {
232  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
233  // but take care that nothing unknown is configured (to fetch typos!).
234 
235  const std::vector<std::string> parameterNames(pSet.getParameterNames());
236  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
237  iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
238 
239  // Calling swap is more efficient than assignment:
240  if (*iParam == "diskRanges") {
241  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIDDetIdRanges.theDiskRanges);
242  } else if (*iParam == "moduleRanges") {
243  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIDDetIdRanges.theModuleRanges);
244  } else if (*iParam == "ringRanges") {
245  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIDDetIdRanges.theRingRanges);
246  } else if (*iParam == "sideRanges") {
247  pSet.getParameter<std::vector<int> >(*iParam).swap(theTIDDetIdRanges.theSideRanges);
248  } else {
249  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setTIDDetIdCuts] "
250  << "Unknown parameter '" << *iParam << "'.\n";
251  }
252  }
253 }
T getParameter(std::string const &) const
std::vector< std::string > getParameterNames() const
struct AlignmentParameterSelector::TIDDetIdRanges theTIDDetIdRanges
void AlignmentParameterSelector::setTOBDetIdCuts ( const edm::ParameterSet pSet)
protected

Definition at line 256 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().

257 {
258  // Allow non-specified arrays to be interpreted as empty (i.e. no selection),
259  // but take care that nothing unknown is configured (to fetch typos!).
260 
261  const std::vector<std::string> parameterNames(pSet.getParameterNames());
262  for (std::vector<std::string>::const_iterator iParam = parameterNames.begin(),
263  iEnd = parameterNames.end(); iParam != iEnd; ++iParam) {
264 
265  // Calling swap is more efficient than assignment:
266  if (*iParam == "layerRanges") {
267  pSet.getParameter<std::vector<int> >(*iParam).swap(theTOBDetIdRanges.theLayerRanges);
268  } else if (*iParam == "moduleRanges") {
269  pSet.getParameter<std::vector<int> >(*iParam).swap(theTOBDetIdRanges.theModuleRanges);
270  } else if (*iParam == "sideRanges") {
271  pSet.getParameter<std::vector<int> >(*iParam).swap(theTOBDetIdRanges.theSideRanges);
272  } else if (*iParam == "rodRanges") {
273  pSet.getParameter<std::vector<int> >(*iParam).swap(theTOBDetIdRanges.theRodRanges);
274  } else {
275  throw cms::Exception("BadConfig") << "[AlignmentParameterSelector::setTOBDetIdCuts] "
276  << "Unknown parameter '" << *iParam << "'.\n";
277  }
278  }
279 }
T getParameter(std::string const &) const
std::vector< std::string > getParameterNames() const
struct AlignmentParameterSelector::TOBDetIdRanges theTOBDetIdRanges

Member Data Documentation

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

Definition at line 119 of file AlignmentParameterSelector.h.

Referenced by outsideDetIdRanges(), and setGeometryCuts().

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().

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

Definition at line 121 of file AlignmentParameterSelector.h.

Referenced by outsideDetIdRanges(), and setGeometryCuts().

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

Definition at line 120 of file AlignmentParameterSelector.h.

Referenced by outsideDetIdRanges(), and setGeometryCuts().

AlignableExtras* AlignmentParameterSelector::theExtras
private

Definition at line 105 of file AlignmentParameterSelector.h.

Referenced by addSelection().

int AlignmentParameterSelector::theMaxLayer
private

Definition at line 191 of file AlignmentParameterSelector.h.

Referenced by layerDeselected(), and setSpecials().

int AlignmentParameterSelector::theMinLayer
private

Definition at line 190 of file AlignmentParameterSelector.h.

Referenced by setSpecials().

AlignableMuon* AlignmentParameterSelector::theMuon
private

Definition at line 104 of file AlignmentParameterSelector.h.

Referenced by addSelection().

bool AlignmentParameterSelector::theOnlyDS
private

Definition at line 187 of file AlignmentParameterSelector.h.

Referenced by layerDeselected(), and setSpecials().

bool AlignmentParameterSelector::theOnlySS
private

Definition at line 188 of file AlignmentParameterSelector.h.

Referenced by layerDeselected(), and setSpecials().

struct AlignmentParameterSelector::PXBDetIdRanges AlignmentParameterSelector::thePXBDetIdRanges
private
struct AlignmentParameterSelector::PXFDetIdRanges AlignmentParameterSelector::thePXFDetIdRanges
private
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().

std::vector<double> AlignmentParameterSelector::theRangesPhi
private
std::vector<double> AlignmentParameterSelector::theRangesR
private
std::vector<double> AlignmentParameterSelector::theRangesX
private
std::vector<double> AlignmentParameterSelector::theRangesY
private
std::vector<double> AlignmentParameterSelector::theRangesZ
private
RphiOrStereoDetUnit AlignmentParameterSelector::theRphiOrStereoDetUnit
private

Definition at line 193 of file AlignmentParameterSelector.h.

Referenced by detUnitDeselected(), and setSpecials().

align::Alignables AlignmentParameterSelector::theSelectedAlignables
private

Definition at line 106 of file AlignmentParameterSelector.h.

Referenced by add(), and clear().

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

Definition at line 107 of file AlignmentParameterSelector.h.

Referenced by add(), and clear().

bool AlignmentParameterSelector::theSelLayers
private

Definition at line 189 of file AlignmentParameterSelector.h.

Referenced by layerDeselected(), and setSpecials().

struct AlignmentParameterSelector::TECDetIdRanges AlignmentParameterSelector::theTECDetIdRanges
private
struct AlignmentParameterSelector::TIBDetIdRanges AlignmentParameterSelector::theTIBDetIdRanges
private
struct AlignmentParameterSelector::TIDDetIdRanges AlignmentParameterSelector::theTIDDetIdRanges
private
struct AlignmentParameterSelector::TOBDetIdRanges AlignmentParameterSelector::theTOBDetIdRanges
private
AlignableTracker* AlignmentParameterSelector::theTracker
private