CMS 3D CMS Logo

SurfaceDeformationFactory.cc
Go to the documentation of this file.
1 
5 
9 
10 // included by header:
11 // #include <vector>
12 // #include <string>
13 
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 }
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 }
39 
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 }
52 
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 }
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
SurfaceDeformation
Definition: SurfaceDeformation.h:18
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
SurfaceDeformationFactory::Type
Type
Definition: SurfaceDeformationFactory.h:17
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
TwoBowedSurfacesDeformation::maxParameterSize
static constexpr unsigned int maxParameterSize()
maximum size of vector that is accepted by constructor from vector
Definition: TwoBowedSurfacesDeformation.h:71
TwoBowedSurfacesDeformation.h
SurfaceDeformationFactory::surfaceDeformationTypeName
std::string surfaceDeformationTypeName(const Type &type)
Definition: SurfaceDeformationFactory.cc:26
SurfaceDeformationFactory.h
SurfaceDeformationFactory::surfaceDeformationType
Type surfaceDeformationType(const std::string &typeString)
convert string to 'Type' - exception if string is not known
Definition: SurfaceDeformationFactory.cc:14
Exception
Definition: hltDiff.cc:245
Exception.h
SurfaceDeformationFactory::kNoDeformations
Definition: SurfaceDeformationFactory.h:21
BowedSurfaceDeformation.h
SurfaceDeformationFactory::create
SurfaceDeformation * create(int type, const std::vector< double > &params)
Definition: SurfaceDeformationFactory.cc:40