CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (Geometry)
 
 AlignableObjectId (const TrackerGeometry *, const DTGeometry *, const CSCGeometry *)
 
 AlignableObjectId (const AlignableObjectId &)=default
 
 AlignableObjectId (AlignableObjectId &&)=default
 
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= (const AlignableObjectId &)=default
 
AlignableObjectIdoperator= (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 &)
 
static AlignableObjectId commonObjectIdProvider (const AlignableTracker *, const AlignableMuon *)
 

Static Private Member Functions

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

Private Attributes

Geometry geometry_ {Geometry::Unspecified}
 
const entry *entries_ nullptr
 

Detailed Description

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

Definition at line 15 of file AlignableObjectId.h.

Member Enumeration Documentation

Enumerator
RunI 
PhaseI 
PhaseII 
General 
Unspecified 

Definition at line 19 of file AlignableObjectId.h.

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

Constructor & Destructor Documentation

AlignableObjectId::AlignableObjectId ( AlignableObjectId::Geometry  geometry)

Definition at line 240 of file AlignableObjectId.cc.

References Exception, General, PhaseI, PhaseII, RunI, and Unspecified.

240  :
242 {
243  switch (geometry) {
244  case AlignableObjectId::Geometry::RunI: entries_ = entries_RunI; break;
245  case AlignableObjectId::Geometry::PhaseI: entries_ = entries_PhaseI; break;
246  case AlignableObjectId::Geometry::PhaseII: entries_ = entries_PhaseII; break;
247  case AlignableObjectId::Geometry::General: entries_ = entries_RunI; break;
248  case AlignableObjectId::Geometry::Unspecified: entries_ = nullptr; break;
249  }
250  if (!entries_) {
251  throw cms::Exception("LogicError")
252  << "@SUB=AlignableObjectId::ctor\n"
253  << "trying to create AlignableObjectId with unspecified geometry";
254  }
255 }
Geometry geometry() const
retrieve the geometry information
AlignableObjectId::AlignableObjectId ( const TrackerGeometry tracker,
const DTGeometry muonDt,
const CSCGeometry muonCsc 
)

Definition at line 260 of file AlignableObjectId.cc.

262  :
264  muonGeometry(muonDt, muonCsc)))
265 {
266 }
static Geometry trackerGeometry(const TrackerGeometry *)
static Geometry commonGeometry(Geometry, Geometry)
static Geometry muonGeometry(const DTGeometry *, const CSCGeometry *)
AlignableObjectId::AlignableObjectId ( const AlignableObjectId )
default
AlignableObjectId::AlignableObjectId ( AlignableObjectId &&  )
default
virtual AlignableObjectId::~AlignableObjectId ( )
virtualdefault

Member Function Documentation

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

Definition at line 337 of file AlignableObjectId.cc.

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

Referenced by commonObjectIdProvider().

337  {
338  if (first == Geometry::General) return second;
339  if (second == Geometry::General) return first;
340  if (first == second) return first;
341 
342  throw cms::Exception("AlignableObjectIdError")
343  << "@SUB=AlignableObjectId::commonGeometry\n"
344  << "impossible to find common geometry because the two geometries are "
345  << "different and none of them is 'General'";
346 }
U second(std::pair< T, U > const &p)
AlignableObjectId AlignableObjectId::commonObjectIdProvider ( const AlignableObjectId first,
const AlignableObjectId second 
)
static

Definition at line 349 of file AlignableObjectId.cc.

References geometry().

Referenced by AlignmentMonitorSurvey::book(), AlignmentMonitorGeneric::book(), HIPAlignmentAlgorithm::initialize(), PedeLabelerBase::PedeLabelerBase(), PedeSteerer::PedeSteerer(), and PedeSteererWeakModeConstraints::PedeSteererWeakModeConstraints().

350  {
351  return AlignableObjectId{commonGeometry(first.geometry(), second.geometry())};
352 }
static Geometry commonGeometry(Geometry, Geometry)
Allows conversion between type and name, and vice-versa.
Geometry geometry() const
retrieve the geometry information
AlignableObjectId AlignableObjectId::commonObjectIdProvider ( const AlignableTracker tracker,
const AlignableMuon muon 
)
static

Definition at line 355 of file AlignableObjectId.cc.

References commonGeometry(), General, geometry(), AlignableMuon::objectIdProvider(), and AlignableTracker::objectIdProvider().

356  {
357  auto trackerGeometry = (tracker ?
358  tracker->objectIdProvider().geometry() :
360  auto muonGeometry = (muon ?
361  muon->objectIdProvider().geometry() :
364 }
static Geometry trackerGeometry(const TrackerGeometry *)
static Geometry commonGeometry(Geometry, Geometry)
const AlignableObjectId & objectIdProvider() const
Return muon alignable object ID provider derived from the muon system geometry.
Definition: AlignableMuon.h:82
static Geometry muonGeometry(const DTGeometry *, const CSCGeometry *)
Geometry geometry() const
retrieve the geometry information
const AlignableObjectId & objectIdProvider() const
Return tracker alignable object ID provider derived from the tracker&#39;s geometry.
Geometry AlignableObjectId::geometry ( ) const
inline

retrieve the geometry information

Definition at line 30 of file AlignableObjectId.h.

References geometry_.

Referenced by commonObjectIdProvider(), and Vispa.Gui.ConnectableWidget.ConnectableWidget::leaveEvent().

30 { return geometry_; }
const char * AlignableObjectId::idToString ( align::StructureType  type) const
AlignableObjectId::Geometry AlignableObjectId::muonGeometry ( const DTGeometry ,
const CSCGeometry  
)
staticprivate

Definition at line 331 of file AlignableObjectId.cc.

331  {
332  // muon alignment structure types are identical for all kinds of geometries
333  return Geometry::General;
334 }
align::StructureType AlignableObjectId::nameToType ( const std::string &  name) const

Convert name to type.

Definition at line 270 of file AlignableObjectId.cc.

References stringToId().

271 {
272  return stringToId(name.c_str());
273 }
align::StructureType stringToId(const char *) const
AlignableObjectId& AlignableObjectId::operator= ( const AlignableObjectId )
default
AlignableObjectId& AlignableObjectId::operator= ( AlignableObjectId &&  )
default
align::StructureType AlignableObjectId::stringToId ( const char *  name) const

Definition at line 296 of file AlignableObjectId.cc.

References Exception, mergeVDriftHistosByStation::name, and mps_fire::result.

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

297 {
298  auto result = stringToObjectId(name, entries_);
299  if (result == -1)
300  {
301  throw cms::Exception("AlignableObjectIdError")
302  << "Unknown alignableObjectId " << name;
303  }
304 
305  return result;
306 }
tuple result
Definition: mps_fire.py:84
align::StructureType AlignableObjectId::stringToId ( const std::string &  s) const
inline

Definition at line 39 of file AlignableObjectId.h.

References stringToId().

39  {
40  return stringToId(s.c_str()); }
align::StructureType stringToId(const char *) const
AlignableObjectId::Geometry AlignableObjectId::trackerGeometry ( const TrackerGeometry geometry)
staticprivate

Definition at line 310 of file AlignableObjectId.cc.

References Exception, TrackerGeometry::isThere(), GeomDetEnumerators::P1PXEC, GeomDetEnumerators::P2PXEC, and GeomDetEnumerators::PixelEndcap.

310  {
311  if (geometry->isThere(GeomDetEnumerators::P2PXEC)) {
312  // use structure-type <-> name translation for PhaseII geometry
313  return Geometry::PhaseII;
314 
315  } else if (geometry->isThere(GeomDetEnumerators::P1PXEC)) {
316  // use structure-type <-> name translation for PhaseI geometry
317  return Geometry::PhaseI;
318 
319  } else if (geometry->isThere(GeomDetEnumerators::PixelEndcap)) {
320  // use structure-type <-> name translation for RunI geometry
321  return Geometry::RunI;
322 
323  } else {
324  throw cms::Exception("AlignableObjectIdError")
325  << "@SUB=AlignableObjectId::trackerGeometry\n"
326  << "unknown version of TrackerGeometry";
327  }
328 }
bool isThere(GeomDetEnumerators::SubDetector subdet) const
std::string AlignableObjectId::typeToName ( align::StructureType  type) const

Member Data Documentation

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

Definition at line 53 of file AlignableObjectId.h.

Referenced by geometry().

const entry* entries_ AlignableObjectId::nullptr
private

Definition at line 52 of file AlignableObjectId.h.