CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes
AlignableObjectId Class Reference

Allows conversion between type and name, and vice-versa. More...

#include <AlignableObjectId.h>

Classes

struct  entry
 

Public Types

enum  Geometry {
  Geometry::RunI, Geometry::PhaseI, Geometry::PhaseII, Geometry::General,
  Geometry::Unspecified
}
 

Public Member Functions

 AlignableObjectId (AlignableObjectId &&)=default
 
 AlignableObjectId (const AlignableObjectId &)=default
 
 AlignableObjectId (const TrackerGeometry *, const DTGeometry *, const CSCGeometry *, const GEMGeometry *)
 
 AlignableObjectId (Geometry)
 
Geometry geometry () const
 retrieve the geometry information More...
 
const char * idToString (align::StructureType type) const
 
align::StructureType nameToType (const std::string &name) const
 Convert name to type. More...
 
AlignableObjectIdoperator= (AlignableObjectId &&)=default
 
AlignableObjectIdoperator= (const AlignableObjectId &)=default
 
align::StructureType stringToId (const char *) const
 
align::StructureType stringToId (const std::string &s) const
 
std::string typeToName (align::StructureType type) const
 Convert type to name. More...
 
virtual ~AlignableObjectId ()=default
 

Static Public Member Functions

static Geometry commonGeometry (Geometry, Geometry)
 
static AlignableObjectId commonObjectIdProvider (const AlignableObjectId &, const AlignableObjectId &)
 
template<typename T >
AlignableObjectId commonObjectIdProvider (const T *tracker, std::nullptr_t)
 
template<typename TRACKER , typename MUON >
static AlignableObjectId commonObjectIdProvider (const TRACKER *, const MUON *)
 
template<typename TRACKER >
static AlignableObjectId commonObjectIdProvider (const TRACKER *, std::nullptr_t)
 

Static Private Member Functions

static Geometry muonGeometry (const DTGeometry *, const CSCGeometry *, const GEMGeometry *)
 
static Geometry trackerGeometry (const TrackerGeometry *)
 

Private Attributes

const entryentries_ {nullptr}
 
Geometry geometry_ {Geometry::Unspecified}
 

Detailed Description

Allows conversion between type and name, and vice-versa.

Definition at line 13 of file AlignableObjectId.h.

Member Enumeration Documentation

◆ Geometry

Enumerator
RunI 
PhaseI 
PhaseII 
General 
Unspecified 

Definition at line 16 of file AlignableObjectId.h.

16 { RunI, PhaseI, PhaseII, General, Unspecified };

Constructor & Destructor Documentation

◆ AlignableObjectId() [1/4]

AlignableObjectId::AlignableObjectId ( Geometry  )

◆ AlignableObjectId() [2/4]

AlignableObjectId::AlignableObjectId ( const TrackerGeometry tracker,
const DTGeometry muonDt,
const CSCGeometry muonCsc,
const GEMGeometry muonGem 
)

Definition at line 259 of file AlignableObjectId.cc.

263  : AlignableObjectId(commonGeometry(trackerGeometry(tracker), muonGeometry(muonDt, muonCsc, muonGem))) {}

◆ AlignableObjectId() [3/4]

AlignableObjectId::AlignableObjectId ( const AlignableObjectId )
default

◆ AlignableObjectId() [4/4]

AlignableObjectId::AlignableObjectId ( AlignableObjectId &&  )
default

◆ ~AlignableObjectId()

virtual AlignableObjectId::~AlignableObjectId ( )
virtualdefault

Member Function Documentation

◆ commonGeometry()

AlignableObjectId::Geometry AlignableObjectId::commonGeometry ( Geometry  first,
Geometry  second 
)
static

Definition at line 322 of file AlignableObjectId.cc.

322  {
323  if (first == Geometry::General)
324  return second;
325  if (second == Geometry::General)
326  return first;
327  if (first == second)
328  return first;
329 
330  throw cms::Exception("AlignableObjectIdError") << "@SUB=AlignableObjectId::commonGeometry\n"
331  << "impossible to find common geometry because the two geometries are "
332  << "different and none of them is 'General'";
333 }

References Exception, first, General, and edm::second().

Referenced by commonObjectIdProvider().

◆ commonObjectIdProvider() [1/4]

AlignableObjectId AlignableObjectId::commonObjectIdProvider ( const AlignableObjectId first,
const AlignableObjectId second 
)
static

◆ commonObjectIdProvider() [2/4]

template<typename T >
AlignableObjectId AlignableObjectId::commonObjectIdProvider ( const T tracker,
std::nullptr_t   
)
static

◆ commonObjectIdProvider() [3/4]

template<typename TRACKER , typename MUON >
AlignableObjectId AlignableObjectId::commonObjectIdProvider ( const TRACKER *  tracker,
const MUON *  muon 
)
static

Definition at line 54 of file AlignableObjectId.h.

54  {
55  auto trackerGeometry = (tracker ? tracker->objectIdProvider().geometry() : AlignableObjectId::Geometry::General);
56  auto muonGeometry = (muon ? muon->objectIdProvider().geometry() : AlignableObjectId::Geometry::General);
58 }

References commonGeometry(), General, muonGeometry(), PbPb_ZMuSkimMuonDPG_cff::tracker, and trackerGeometry().

◆ commonObjectIdProvider() [4/4]

template<typename TRACKER >
static AlignableObjectId AlignableObjectId::commonObjectIdProvider ( const TRACKER *  ,
std::nullptr_t   
)
static

◆ geometry()

Geometry AlignableObjectId::geometry ( ) const
inline

retrieve the geometry information

Definition at line 27 of file AlignableObjectId.h.

27 { return geometry_; }

References geometry_.

Referenced by AlignableTrackerBuilder::AlignableTrackerBuilder().

◆ idToString()

const char * AlignableObjectId::idToString ( align::StructureType  type) const

Definition at line 272 of file AlignableObjectId.cc.

272  {
273  const char *result = objectIdToString(type, entries_);
274 
275  if (result == nullptr) {
276  throw cms::Exception("AlignableObjectIdError") << "Unknown alignableObjectId " << type;
277  }
278 
279  return result;
280 }

References entries_, Exception, and mps_fire::result.

Referenced by AlignableTrackerBuilder::buildAlignableDetUnits(), AlignableCompositeBuilder::buildAll(), AlignableCompositeBuilder::buildLevel(), MomentumDependentPedeLabeler::buildMomentumDependencyMap(), AlignableTrackerBuilder::buildPixelDetector(), TrackerAlignmentLevelBuilder::buildPXBAlignmentLevels(), TrackerAlignmentLevelBuilder::buildPXEAlignmentLevels(), RunRangeDependentPedeLabeler::buildRunRangeDependencyMap(), AlignableTrackerBuilder::buildStripDetector(), TrackerAlignmentLevelBuilder::buildTECAlignmentLevels(), TrackerAlignmentLevelBuilder::buildTIBAlignmentLevels(), TrackerAlignmentLevelBuilder::buildTIDAlignmentLevels(), TrackerAlignmentLevelBuilder::buildTOBAlignmentLevels(), PedeSteererWeakModeConstraints::checkSelectionShiftParameter(), PedeSteererWeakModeConstraints::constructConstraints(), PedeSteererWeakModeConstraints::createAlignablesDataStructure(), MisalignmentScenarioBuilder::decodeMovements_(), AlignableIndexer::get(), MuonAlignmentInputXML::getCSCnode(), MuonAlignmentInputXML::getDTnode(), PedeSteerer::hierarchyConstraint(), PedeSteerer::hierarchyConstraints(), PedeSteererWeakModeConstraints::makeLevelsFilenames(), PedeSteerer::presigmas(), PedeSteerer::presigmasFile(), typeToName(), and MuonAlignmentOutputXML::writeComponents().

◆ muonGeometry()

AlignableObjectId::Geometry AlignableObjectId::muonGeometry ( const DTGeometry ,
const CSCGeometry ,
const GEMGeometry  
)
staticprivate

Definition at line 315 of file AlignableObjectId.cc.

317  {
318  // muon alignment structure types are identical for all kinds of geometries
319  return Geometry::General;
320 }

References General.

Referenced by commonObjectIdProvider().

◆ nameToType()

align::StructureType AlignableObjectId::nameToType ( const std::string &  name) const

Convert name to type.

Definition at line 266 of file AlignableObjectId.cc.

266 { return stringToId(name.c_str()); }

References Skims_PA_cff::name, and stringToId().

◆ operator=() [1/2]

AlignableObjectId& AlignableObjectId::operator= ( AlignableObjectId &&  )
default

◆ operator=() [2/2]

AlignableObjectId& AlignableObjectId::operator= ( const AlignableObjectId )
default

◆ stringToId() [1/2]

align::StructureType AlignableObjectId::stringToId ( const char *  name) const

Definition at line 283 of file AlignableObjectId.cc.

283  {
284  auto result = stringToObjectId(name, entries_);
285  if (result == -1) {
286  throw cms::Exception("AlignableObjectIdError") << "Unknown alignableObjectId " << name;
287  }
288 
289  return result;
290 }

References entries_, Exception, Skims_PA_cff::name, and mps_fire::result.

Referenced by TrackerGeometryCompare::analyze(), nameToType(), MisalignmentScenarioBuilder::propagateParameters_(), and TrackerGeometryCompare::setCommonTrackerSystem().

◆ stringToId() [2/2]

align::StructureType AlignableObjectId::stringToId ( const std::string &  s) const
inline

Definition at line 36 of file AlignableObjectId.h.

36 { return stringToId(s.c_str()); }

References alignCSCRings::s, and stringToId().

Referenced by stringToId().

◆ trackerGeometry()

AlignableObjectId::Geometry AlignableObjectId::trackerGeometry ( const TrackerGeometry geometry)
staticprivate

Definition at line 293 of file AlignableObjectId.cc.

293  {
294  if (!geometry)
295  return Geometry::General;
296 
297  if (geometry->isThere(GeomDetEnumerators::P2PXEC)) {
298  // use structure-type <-> name translation for PhaseII geometry
299  return Geometry::PhaseII;
300 
301  } else if (geometry->isThere(GeomDetEnumerators::P1PXEC)) {
302  // use structure-type <-> name translation for PhaseI geometry
303  return Geometry::PhaseI;
304 
305  } else if (geometry->isThere(GeomDetEnumerators::PixelEndcap)) {
306  // use structure-type <-> name translation for RunI geometry
307  return Geometry::RunI;
308 
309  } else {
310  throw cms::Exception("AlignableObjectIdError") << "@SUB=AlignableObjectId::trackerGeometry\n"
311  << "unknown version of TrackerGeometry";
312  }
313 }

References Exception, General, GeomDetEnumerators::P1PXEC, GeomDetEnumerators::P2PXEC, PhaseI, PhaseII, GeomDetEnumerators::PixelEndcap, and RunI.

Referenced by commonObjectIdProvider().

◆ typeToName()

std::string AlignableObjectId::typeToName ( align::StructureType  type) const

Member Data Documentation

◆ entries_

const entry* AlignableObjectId::entries_ {nullptr}
private

Definition at line 49 of file AlignableObjectId.h.

Referenced by idToString(), and stringToId().

◆ geometry_

Geometry AlignableObjectId::geometry_ {Geometry::Unspecified}
private

Definition at line 50 of file AlignableObjectId.h.

Referenced by geometry().

AlignableObjectId
Allows conversion between type and name, and vice-versa.
Definition: AlignableObjectId.h:13
AlignableObjectId::Geometry::RunI
muon
Definition: MuonCocktails.h:17
geometry
Definition: geometry.py:1
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
AlignableObjectId::Geometry::PhaseII
AlignableObjectId::Geometry::General
AlignableObjectId::muonGeometry
static Geometry muonGeometry(const DTGeometry *, const CSCGeometry *, const GEMGeometry *)
Definition: AlignableObjectId.cc:315
AlignableObjectId::AlignableObjectId
AlignableObjectId(Geometry)
alignCSCRings.s
s
Definition: alignCSCRings.py:92
GeomDetEnumerators::P1PXEC
Definition: GeomDetEnumerators.h:26
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
AlignableObjectId::entries_
const entry * entries_
Definition: AlignableObjectId.h:49
Exception
Definition: hltDiff.cc:245
AlignableObjectId::stringToId
align::StructureType stringToId(const char *) const
Definition: AlignableObjectId.cc:283
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
GeomDetEnumerators::PixelEndcap
Definition: GeomDetEnumerators.h:12
AlignableObjectId::idToString
const char * idToString(align::StructureType type) const
Definition: AlignableObjectId.cc:272
mps_fire.result
result
Definition: mps_fire.py:311
AlignableObjectId::commonGeometry
static Geometry commonGeometry(Geometry, Geometry)
Definition: AlignableObjectId.cc:322
AlignableObjectId::geometry_
Geometry geometry_
Definition: AlignableObjectId.h:50
AlignableObjectId::Geometry::PhaseI
AlignableObjectId::trackerGeometry
static Geometry trackerGeometry(const TrackerGeometry *)
Definition: AlignableObjectId.cc:293
GeomDetEnumerators::P2PXEC
Definition: GeomDetEnumerators.h:28