test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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)
 convert int to ParametersType (if same value) - exception if no corresponding type More...
 
std::string parametersTypeName (ParametersType parType)
 convert ParametersType to string understood by parametersType(string &typeString) More...
 

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 term...
24  kRigidBody4D, // RigidBodyAlignmentParameters4D
25  kBeamSpot, // BeamSpotAlignmentParameters
26  kBowedSurface, // BowedSurfaceAlignmentParameters
27  kTwoBowedSurfaces // TwoBowedSurfacesAlignmentParameters
28  };

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 75 of file AlignmentParametersFactory.cc.

References edm::hlt::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().

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

convert string to ParametersType - exception if not known

Definition at line 23 of file AlignmentParametersFactory.cc.

References edm::hlt::Exception, kBeamSpot, kBowedSurface, kRigidBody, kRigidBody4D, kSurvey, and kTwoBowedSurfaces.

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

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

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

Definition at line 38 of file AlignmentParametersFactory.cc.

References edm::hlt::Exception, kBeamSpot, kBowedSurface, kRigidBody, kRigidBody4D, kSurvey, and kTwoBowedSurfaces.

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

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

Definition at line 54 of file AlignmentParametersFactory.cc.

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

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

55  {
56  switch(parType) {
57  case kRigidBody:
58  return "RigiBody";
59  case kSurvey: //GF: do not belong here, so remove in the long term...
60  return "Survey";
61  case kRigidBody4D:
62  return "RigiBody4D";
63  case kBeamSpot:
64  return "BeamSpot";
65  case kBowedSurface:
66  return "BowedSurface";
67  case kTwoBowedSurfaces:
68  return "TwoBowedSurfaces";
69  }
70 
71  return "unknown_should_never_reach"; // to please the compiler
72  }