CMS 3D CMS Logo

Enumerations | Functions
SurfaceDeformationFactory Namespace Reference

Enumerations

enum  Type { kBowedSurface = 1, kTwoBowedSurfaces, kNoDeformations }
 

Functions

SurfaceDeformationcreate (const std::vector< double > &params)
 
SurfaceDeformationcreate (int type, 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 ( const std::vector< double > &  params)

Definition at line 53 of file SurfaceDeformationFactory.cc.

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 }

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

◆ create() [2/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.

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 }

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

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

◆ 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.

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 }

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

Referenced by AlignableModifier::addDeformation().

◆ surfaceDeformationTypeName()

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

Definition at line 26 of file SurfaceDeformationFactory.cc.

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 }

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

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

BowedSurfaceDeformation::minParameterSize
static constexpr unsigned int minParameterSize()
minimum size of vector that is accepted by constructor from vector
Definition: BowedSurfaceDeformation.h:59
BowedSurfaceDeformation
Definition: BowedSurfaceDeformation.h:20
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
SurfaceDeformationFactory::kTwoBowedSurfaces
Definition: SurfaceDeformationFactory.h:20
AlignmentParametersFactory::kTwoBowedSurfaces
Definition: AlignmentParametersFactory.h:28
TwoBowedSurfacesDeformation::minParameterSize
static constexpr unsigned int minParameterSize()
minimum size of vector that is accepted by constructor from vector
Definition: TwoBowedSurfacesDeformation.h:69
BowedSurfaceDeformation::maxParameterSize
static constexpr unsigned int maxParameterSize()
maximum size of vector that is accepted by constructor from vector
Definition: BowedSurfaceDeformation.h:61
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TwoBowedSurfacesDeformation
Definition: TwoBowedSurfacesDeformation.h:19
AlignmentParametersFactory::kBowedSurface
Definition: AlignmentParametersFactory.h:27
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
SurfaceDeformationFactory::kBowedSurface
Definition: SurfaceDeformationFactory.h:19
TwoBowedSurfacesDeformation::maxParameterSize
static constexpr unsigned int maxParameterSize()
maximum size of vector that is accepted by constructor from vector
Definition: TwoBowedSurfacesDeformation.h:71
Exception
Definition: hltDiff.cc:246
SurfaceDeformationFactory::kNoDeformations
Definition: SurfaceDeformationFactory.h:21
SurfaceDeformationFactory::create
SurfaceDeformation * create(int type, const std::vector< double > &params)
Definition: SurfaceDeformationFactory.cc:40