CMS 3D CMS Logo

Enumerations | Functions
SurfaceDeformationFactory Namespace Reference

Enumerations

enum  Type { kBowedSurface = 1, kTwoBowedSurfaces, kNoDeformations }
 

Functions

SurfaceDeformationcreate (int type, const std::vector< double > &params)
 
SurfaceDeformationcreate (const std::vector< double > &params)
 
Type surfaceDeformationType (const std::string &typeString)
 convert string to 'Type' - exception if string is not known More...
 
std::string surfaceDeformationTypeName (const Type &type)
 

Enumeration Type Documentation

◆ Type

Enumerator
kBowedSurface 
kTwoBowedSurfaces 
kNoDeformations 

Definition at line 17 of file SurfaceDeformationFactory.h.

17  {
18  // rigid body has no deformations! kRigidBody = 0,
19  kBowedSurface = 1, // BowedSurfaceDeformation
20  kTwoBowedSurfaces, // TwoBowedSurfacesDeformation
21  kNoDeformations // To please compilers
22  };

Function Documentation

◆ create() [1/2]

SurfaceDeformation * SurfaceDeformationFactory::create ( int  type,
const std::vector< double > &  params 
)

Create an instance of the concrete implementations of the 'SurfaceDeformation' interface First argument 'type' must match one of the enums defined above and the size of 'params' must match the expectation of the concrete type (exception otherwise).

Definition at line 40 of file SurfaceDeformationFactory.cc.

References Exception, AlignmentParametersFactory::kBowedSurface, AlignmentParametersFactory::kTwoBowedSurfaces, and submitPVValidationJobs::params.

Referenced by AlignableModifier::addDeformation(), AlignmentParameterStore::applyAlignableAbsolutePositions(), AlignmentParameterStore::applyAlignableRelativePositions(), GeometryAligner::attachSurfaceDeformations(), and TrackerGeometryCompare::createROOTGeometry().

40  {
41  switch (type) {
42  case kBowedSurface:
43  case kTwoBowedSurfaces:
45  default:
46  throw cms::Exception("BadInput") << "SurfaceDeformationFactory::create: "
47  << "Unknown SurfaceDeformation type " << type << " (need " << kBowedSurface
48  << " or " << kTwoBowedSurfaces << ")\n";
49  return nullptr;
50  }
51 }
SurfaceDeformation * create(int type, const std::vector< double > &params)

◆ create() [2/2]

SurfaceDeformation * SurfaceDeformationFactory::create ( const std::vector< double > &  params)

Definition at line 53 of file SurfaceDeformationFactory.cc.

References Exception, BowedSurfaceDeformation::maxParameterSize(), TwoBowedSurfacesDeformation::maxParameterSize(), BowedSurfaceDeformation::minParameterSize(), TwoBowedSurfacesDeformation::minParameterSize(), and submitPVValidationJobs::params.

53  {
56  return new BowedSurfaceDeformation(params);
60 
61  throw cms::Exception("BadInput") << "SurfaceDeformationFactory::create: "
62  << "Params.size() (" << params.size() << ") does not match.\n";
63 
64  return nullptr;
65 }
static constexpr unsigned int minParameterSize()
minimum size of vector that is accepted by constructor from vector
static constexpr unsigned int minParameterSize()
minimum size of vector that is accepted by constructor from vector
static constexpr unsigned int maxParameterSize()
maximum size of vector that is accepted by constructor from vector
static constexpr unsigned int maxParameterSize()
maximum size of vector that is accepted by constructor from vector

◆ surfaceDeformationType()

SurfaceDeformationFactory::Type SurfaceDeformationFactory::surfaceDeformationType ( const std::string &  typeString)

convert string to 'Type' - exception if string is not known

Author
: Gero Flucke date : October 2010

Definition at line 14 of file SurfaceDeformationFactory.cc.

References Exception, AlignmentParametersFactory::kBowedSurface, kNoDeformations, and AlignmentParametersFactory::kTwoBowedSurfaces.

Referenced by AlignableModifier::addDeformation().

14  {
15  if (typeString == "BowedSurface")
16  return kBowedSurface;
17  else if (typeString == "TwoBowedSurfaces")
18  return kTwoBowedSurfaces;
19  else {
20  throw cms::Exception("BadInput") << "SurfaceDeformationFactory::surfaceDeformationType: "
21  << "Unknown SurfaceDeformation type " << typeString
22  << " (must be 'BowedSurface' or 'TwoBowedSurfaces'.\n";
23  return kNoDeformations; // not reached, to please the compiler
24  }
25 }

◆ surfaceDeformationTypeName()

std::string SurfaceDeformationFactory::surfaceDeformationTypeName ( const Type type)

Definition at line 26 of file SurfaceDeformationFactory.cc.

References Exception, AlignmentParametersFactory::kBowedSurface, AlignmentParametersFactory::kTwoBowedSurfaces, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by AlignmentParameterStore::applyAlignableAbsolutePositions(), and AlignmentParameterStore::applyAlignableRelativePositions().

26  {
27  switch (type) {
28  case kBowedSurface:
29  return std::string("BowedSurface");
30  case kTwoBowedSurfaces:
31  return std::string("TwoBowedSurfaces");
32  default:
33  throw cms::Exception("BadInput") << "SurfaceDeformationFactory::surfaceDeformationTypeName: "
34  << "Unknown SurfaceDeformation type " << type
35  << " (must be 'kBowedSurface' or 'kTwoBowedSurfaces'.\n";
36  return std::string("NoDeformations");
37  }
38 }