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

Enumerator
kBowedSurface 
kTwoBowedSurfaces 
kNoDeformations 

Definition at line 18 of file SurfaceDeformationFactory.h.

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

Function Documentation

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 41 of file SurfaceDeformationFactory.cc.

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

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

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

Definition at line 56 of file SurfaceDeformationFactory.cc.

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

57 {
58  if (params.size() <= BowedSurfaceDeformation::maxParameterSize() &&
60  return new BowedSurfaceDeformation(params);
61  else if (params.size() <= TwoBowedSurfacesDeformation::maxParameterSize() &&
63  return new TwoBowedSurfacesDeformation(params);
64 
65  throw cms::Exception("BadInput") << "SurfaceDeformationFactory::create: "
66  << "Params.size() (" << params.size()
67  << ") does not match.\n";
68 
69  return nullptr;
70 }
static unsigned int minParameterSize()
minimum size of vector that is accepted by constructor from vector
static unsigned int minParameterSize()
minimum size of vector that is accepted by constructor from vector
static unsigned int maxParameterSize()
maximum size of vector that is accepted by constructor from vector
static unsigned int maxParameterSize()
maximum size of vector that is accepted by constructor from vector
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 15 of file SurfaceDeformationFactory.cc.

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

Referenced by AlignableModifier::addDeformation().

16 {
17  if (typeString == "BowedSurface") return kBowedSurface;
18  else if (typeString == "TwoBowedSurfaces") 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 }
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 }
type
Definition: HCALResponse.h:21