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 260 of file AlignableObjectId.cc.

264  : 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 323 of file AlignableObjectId.cc.

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

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 273 of file AlignableObjectId.cc.

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

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 316 of file AlignableObjectId.cc.

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

References General.

Referenced by commonObjectIdProvider().

◆ nameToType()

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

Convert name to type.

Definition at line 267 of file AlignableObjectId.cc.

267 { 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 284 of file AlignableObjectId.cc.

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

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 294 of file AlignableObjectId.cc.

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

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:316
AlignableObjectId::AlignableObjectId
AlignableObjectId(Geometry)
alignCSCRings.s
s
Definition: alignCSCRings.py:92
GeomDetEnumerators::P1PXEC
Definition: GeomDetEnumerators.h:26
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
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:284
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:273
mps_fire.result
result
Definition: mps_fire.py:311
AlignableObjectId::commonGeometry
static Geometry commonGeometry(Geometry, Geometry)
Definition: AlignableObjectId.cc:323
AlignableObjectId::geometry_
Geometry geometry_
Definition: AlignableObjectId.h:50
AlignableObjectId::Geometry::PhaseI
AlignableObjectId::trackerGeometry
static Geometry trackerGeometry(const TrackerGeometry *)
Definition: AlignableObjectId.cc:294
GeomDetEnumerators::P2PXEC
Definition: GeomDetEnumerators.h:28