CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Enumerations | Functions
AlignmentParametersFactory Namespace Reference

Enumerations

enum  ParametersType {
  kRigidBody = 0, kSurvey, kRigidBody4D, kBeamSpot,
  kBowedSurface, kTwoBowedSurfaces
}
 enums for all available AlignmentParameters More...
 

Functions

AlignmentParameterscreateParameters (Alignable *ali, ParametersType parType, const std::vector< bool > &sel)
 
ParametersType parametersType (const std::string &typeString)
 convert string to ParametersType - exception if not known More...
 
ParametersType parametersType (int typeInt)
 
std::string parametersTypeName (ParametersType parType)
 

Detailed Description

Factory interface to create AlignmentParameters for the known types, defined by the enum AlignmentParametersFactory::ParametersType.

Date:
2010/09/10 11:19:23
Revision:
1.4

(last update by

Author:
mussgill

)

Date:
2010/09/10 11:19:37
Revision:
1.3

(last update by

Author:
mussgill

)

Enumeration Type Documentation

enums for all available AlignmentParameters

Enumerator
kRigidBody 
kSurvey 
kRigidBody4D 
kBeamSpot 
kBowedSurface 
kTwoBowedSurfaces 

Definition at line 21 of file AlignmentParametersFactory.h.

21  {
22  kRigidBody = 0, // RigidBodyAlignmentParameters
23  kSurvey, // SurveyParameters GF: do not belong here, so remove in the long
24  // term...
25  kRigidBody4D, // RigidBodyAlignmentParameters4D
26  kBeamSpot, // BeamSpotAlignmentParameters
27  kBowedSurface, // BowedSurfaceAlignmentParameters
28  kTwoBowedSurfaces // TwoBowedSurfacesAlignmentParameters
29  };

Function Documentation

AlignmentParameters * AlignmentParametersFactory::createParameters ( Alignable ali,
ParametersType  parType,
const std::vector< bool > &  sel 
)

create AlignmentParameters of type 'parType' for Alignable 'ali' with selection 'sel' for active parameters

Definition at line 83 of file AlignmentParametersFactory.cc.

References Exception, kBeamSpot, kBowedSurface, kRigidBody, kRigidBody4D, kSurvey, kTwoBowedSurfaces, RigidBodyAlignmentParameters::N_PARAM, BeamSpotAlignmentParameters::N_PARAM, BowedSurfaceAlignmentParameters::N_PARAM, and TwoBowedSurfacesAlignmentParameters::N_PARAM.

Referenced by AlignmentParameterBuilder::add(), and AlignmentParametersIORoot::readOne().

83  {
84  switch (parType) {
85  case kRigidBody: {
88  return new RigidBodyAlignmentParameters(ali, par, cov, sel);
89  } break;
90  case kSurvey:
91  // creates some unwanted dependencies - and does not fit into
92  // AlignmentParameters anyway!
93  throw cms::Exception("BadConfig") << "AlignmentParametersFactory cannot create SurveyParameters.";
94  // edm::LogWarning("Alignment") << "@SUB=createParameters"
95  // << "Creating SurveyParameters of length 0!";
96  // return new SurveyParameters(ali, AlgebraicVector(),
97  // AlgebraicSymMatrix());
98  break;
99  case kRigidBody4D: {
102  return new RigidBodyAlignmentParameters4D(ali, par, cov, sel);
103  } break;
104  case kBeamSpot: {
107  return new BeamSpotAlignmentParameters(ali, par, cov, sel);
108  } break;
109  case kBowedSurface: {
112  return new BowedSurfaceAlignmentParameters(ali, par, cov, sel);
113  } break;
114  case kTwoBowedSurfaces: {
117  return new TwoBowedSurfacesAlignmentParameters(ali, par, cov, sel);
118  } break;
119  }
120 
121  return nullptr; // unreached (all ParametersType appear in switch), to please
122  // the compiler
123  }
CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix
ParametersType AlignmentParametersFactory::parametersType ( const std::string &  typeString)

convert string to ParametersType - exception if not known

Definition at line 22 of file AlignmentParametersFactory.cc.

References Exception, kBeamSpot, kBowedSurface, kRigidBody, kRigidBody4D, kSurvey, and kTwoBowedSurfaces.

Referenced by AlignmentParameterBuilder::addAllSelections(), ParametersToParametersDerivatives::init(), and AlignmentParametersIORoot::readOne().

22  {
23  if (typeString == "RigidBody")
24  return kRigidBody;
25  else if (typeString == "Survey")
26  return kSurvey; // GF: do not belong here, so remove in the long term...
27  else if (typeString == "RigidBody4D")
28  return kRigidBody4D;
29  else if (typeString == "BeamSpot")
30  return kBeamSpot;
31  else if (typeString == "BowedSurface")
32  return kBowedSurface;
33  else if (typeString == "TwoBowedSurfaces")
34  return kTwoBowedSurfaces;
35  throw cms::Exception("BadConfig") << "AlignmentParametersFactory"
36  << " No AlignmentParameters with name '" << typeString << "'.";
37 
38  return kRigidBody; // to please compiler...
39  }
ParametersType AlignmentParametersFactory::parametersType ( int  typeInt)

convert int to ParametersType (if same value) - exception if no corresponding type

Definition at line 42 of file AlignmentParametersFactory.cc.

References Exception, kBeamSpot, kBowedSurface, kRigidBody, kRigidBody4D, kSurvey, and kTwoBowedSurfaces.

42  {
43  if (typeInt == kRigidBody)
44  return kRigidBody;
45  if (typeInt == kSurvey)
46  return kSurvey; // GF: do not belong here, so remove in the long term...
47  if (typeInt == kRigidBody4D)
48  return kRigidBody4D;
49  if (typeInt == kBeamSpot)
50  return kBeamSpot;
51  if (typeInt == kBowedSurface)
52  return kBowedSurface;
53  if (typeInt == kTwoBowedSurfaces)
54  return kTwoBowedSurfaces;
55 
56  throw cms::Exception("BadConfig") << "AlignmentParametersFactory"
57  << " No AlignmentParameters with number " << typeInt << ".";
58 
59  return kRigidBody; // to please compiler...
60  }
std::string AlignmentParametersFactory::parametersTypeName ( ParametersType  parType)

convert ParametersType to string understood by parametersType(string &typeString)

Definition at line 63 of file AlignmentParametersFactory.cc.

References kBeamSpot, kBowedSurface, kRigidBody, kRigidBody4D, kSurvey, and kTwoBowedSurfaces.

Referenced by AlignmentParameterBuilder::addSelections(), and ParametersToParametersDerivatives::init().

63  {
64  switch (parType) {
65  case kRigidBody:
66  return "RigiBody";
67  case kSurvey: // GF: do not belong here, so remove in the long term...
68  return "Survey";
69  case kRigidBody4D:
70  return "RigiBody4D";
71  case kBeamSpot:
72  return "BeamSpot";
73  case kBowedSurface:
74  return "BowedSurface";
75  case kTwoBowedSurfaces:
76  return "TwoBowedSurfaces";
77  }
78 
79  return "unknown_should_never_reach"; // to please the compiler
80  }