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 *)
 
 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 *)
 
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 12 of file AlignableObjectId.h.

Member Enumeration Documentation

◆ Geometry

Enumerator
RunI 
PhaseI 
PhaseII 
General 
Unspecified 

Definition at line 15 of file AlignableObjectId.h.

15 { 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 
)

Definition at line 247 of file AlignableObjectId.cc.

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

307  {
308  if (first == Geometry::General)
309  return second;
310  if (second == Geometry::General)
311  return first;
312  if (first == second)
313  return first;
314 
315  throw cms::Exception("AlignableObjectIdError") << "@SUB=AlignableObjectId::commonGeometry\n"
316  << "impossible to find common geometry because the two geometries are "
317  << "different and none of them is 'General'";
318 }

References Exception, dqmdumpme::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 53 of file AlignableObjectId.h.

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

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 26 of file AlignableObjectId.h.

26 { return geometry_; }

References geometry_.

Referenced by AlignableTrackerBuilder::AlignableTrackerBuilder().

◆ idToString()

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

Definition at line 259 of file AlignableObjectId.cc.

259  {
260  const char *result = objectIdToString(type, entries_);
261 
262  if (result == nullptr) {
263  throw cms::Exception("AlignableObjectIdError") << "Unknown alignableObjectId " << type;
264  }
265 
266  return result;
267 }

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  
)
staticprivate

Definition at line 302 of file AlignableObjectId.cc.

302  {
303  // muon alignment structure types are identical for all kinds of geometries
304  return Geometry::General;
305 }

References General.

Referenced by commonObjectIdProvider().

◆ nameToType()

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

Convert name to type.

Definition at line 253 of file AlignableObjectId.cc.

253 { 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 270 of file AlignableObjectId.cc.

270  {
271  auto result = stringToObjectId(name, entries_);
272  if (result == -1) {
273  throw cms::Exception("AlignableObjectIdError") << "Unknown alignableObjectId " << name;
274  }
275 
276  return result;
277 }

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 35 of file AlignableObjectId.h.

35 { 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 280 of file AlignableObjectId.cc.

280  {
281  if (!geometry)
282  return Geometry::General;
283 
284  if (geometry->isThere(GeomDetEnumerators::P2PXEC)) {
285  // use structure-type <-> name translation for PhaseII geometry
286  return Geometry::PhaseII;
287 
288  } else if (geometry->isThere(GeomDetEnumerators::P1PXEC)) {
289  // use structure-type <-> name translation for PhaseI geometry
290  return Geometry::PhaseI;
291 
292  } else if (geometry->isThere(GeomDetEnumerators::PixelEndcap)) {
293  // use structure-type <-> name translation for RunI geometry
294  return Geometry::RunI;
295 
296  } else {
297  throw cms::Exception("AlignableObjectIdError") << "@SUB=AlignableObjectId::trackerGeometry\n"
298  << "unknown version of TrackerGeometry";
299  }
300 }

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 48 of file AlignableObjectId.h.

Referenced by idToString(), and stringToId().

◆ geometry_

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

Definition at line 49 of file AlignableObjectId.h.

Referenced by geometry().

AlignableObjectId
Allows conversion between type and name, and vice-versa.
Definition: AlignableObjectId.h:12
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
dqmdumpme.first
first
Definition: dqmdumpme.py:55
AlignableObjectId::muonGeometry
static Geometry muonGeometry(const DTGeometry *, const CSCGeometry *)
Definition: AlignableObjectId.cc:302
AlignableObjectId::AlignableObjectId
AlignableObjectId(Geometry)
alignCSCRings.s
s
Definition: alignCSCRings.py:92
GeomDetEnumerators::P1PXEC
Definition: GeomDetEnumerators.h:26
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:39
AlignableObjectId::entries_
const entry * entries_
Definition: AlignableObjectId.h:48
Exception
Definition: hltDiff.cc:246
AlignableObjectId::stringToId
align::StructureType stringToId(const char *) const
Definition: AlignableObjectId.cc:270
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:259
mps_fire.result
result
Definition: mps_fire.py:311
AlignableObjectId::commonGeometry
static Geometry commonGeometry(Geometry, Geometry)
Definition: AlignableObjectId.cc:307
AlignableObjectId::geometry_
Geometry geometry_
Definition: AlignableObjectId.h:49
AlignableObjectId::Geometry::PhaseI
AlignableObjectId::trackerGeometry
static Geometry trackerGeometry(const TrackerGeometry *)
Definition: AlignableObjectId.cc:280
GeomDetEnumerators::P2PXEC
Definition: GeomDetEnumerators.h:28