Main Page
Namespaces
Classes
Package Documentation
Alignment
CommonAlignmentParametrization
src
AlignmentParametersFactory.cc
Go to the documentation of this file.
1
5
#include "
Alignment/CommonAlignmentParametrization/interface/AlignmentParametersFactory.h
"
6
#include "
Alignment/CommonAlignmentParametrization/interface/BeamSpotAlignmentParameters.h
"
7
#include "
Alignment/CommonAlignmentParametrization/interface/BowedSurfaceAlignmentParameters.h
"
8
#include "
Alignment/CommonAlignmentParametrization/interface/RigidBodyAlignmentParameters.h
"
9
#include "
Alignment/CommonAlignmentParametrization/interface/RigidBodyAlignmentParameters4D.h
"
10
#include "
Alignment/CommonAlignmentParametrization/interface/TwoBowedSurfacesAlignmentParameters.h
"
11
//#include "Alignment/SurveyAnalysis/interface/SurveyParameters.h"
12
#include "
DataFormats/CLHEP/interface/AlgebraicObjects.h
"
13
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
14
#include "
FWCore/Utilities/interface/Exception.h
"
15
16
#include <string>
17
#include <vector>
18
19
namespace
AlignmentParametersFactory
{
20
21
//_______________________________________________________________________________________
22
ParametersType
parametersType
(
const
std::string
&typeString) {
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
}
40
41
//_______________________________________________________________________________________
42
ParametersType
parametersType
(
int
typeInt) {
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
}
61
62
//_______________________________________________________________________________________
63
std::string
parametersTypeName
(
ParametersType
parType) {
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
}
81
82
//_______________________________________________________________________________________
83
AlignmentParameters
*
createParameters
(
Alignable
*ali,
ParametersType
parType,
const
std::vector<bool> &
sel
) {
84
switch
(parType) {
85
case
kRigidBody
: {
86
const
AlgebraicVector
par(
RigidBodyAlignmentParameters::N_PARAM
, 0);
87
const
AlgebraicSymMatrix
cov(
RigidBodyAlignmentParameters::N_PARAM
, 0);
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
: {
100
const
AlgebraicVector
par(
RigidBodyAlignmentParameters4D::N_PARAM
, 0);
101
const
AlgebraicSymMatrix
cov(
RigidBodyAlignmentParameters4D::N_PARAM
, 0);
102
return
new
RigidBodyAlignmentParameters4D
(ali, par, cov, sel);
103
}
break
;
104
case
kBeamSpot
: {
105
const
AlgebraicVector
par(
BeamSpotAlignmentParameters::N_PARAM
, 0);
106
const
AlgebraicSymMatrix
cov(
BeamSpotAlignmentParameters::N_PARAM
, 0);
107
return
new
BeamSpotAlignmentParameters
(ali, par, cov, sel);
108
}
break
;
109
case
kBowedSurface
: {
110
const
AlgebraicVector
par(
BowedSurfaceAlignmentParameters::N_PARAM
, 0);
111
const
AlgebraicSymMatrix
cov(
BowedSurfaceAlignmentParameters::N_PARAM
, 0);
112
return
new
BowedSurfaceAlignmentParameters
(ali, par, cov, sel);
113
}
break
;
114
case
kTwoBowedSurfaces
: {
115
const
AlgebraicVector
par(
TwoBowedSurfacesAlignmentParameters::N_PARAM
, 0);
116
const
AlgebraicSymMatrix
cov(
TwoBowedSurfacesAlignmentParameters::N_PARAM
, 0);
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
}
124
}
// namespace AlignmentParametersFactory
RigidBodyAlignmentParameters4D
Definition:
RigidBodyAlignmentParameters4D.h:22
AlignmentParametersFactory.h
BeamSpotAlignmentParameters.h
MessageLogger.h
RigidBodyAlignmentParameters
Definition:
RigidBodyAlignmentParameters.h:21
Exception
Definition:
hltDiff.cc:292
Alignable
Definition:
Alignable.h:27
BeamSpotAlignmentParameters::N_PARAM
Definition:
BeamSpotAlignmentParameters.h:24
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
AlignmentParameters
Definition:
AlignmentParameters.h:35
AlignmentParametersFactory::kBowedSurface
Definition:
AlignmentParametersFactory.h:27
BowedSurfaceAlignmentParameters.h
BowedSurfaceAlignmentParameters::N_PARAM
Definition:
BowedSurfaceAlignmentParameters.h:41
AlignmentParametersFactory::parametersTypeName
std::string parametersTypeName(ParametersType parType)
Definition:
AlignmentParametersFactory.cc:63
TwoBowedSurfacesAlignmentParameters.h
BeamSpotAlignmentParameters
Definition:
BeamSpotAlignmentParameters.h:21
AlignmentParametersFactory::ParametersType
ParametersType
enums for all available AlignmentParameters
Definition:
AlignmentParametersFactory.h:21
AlignmentParametersFactory
BowedSurfaceAlignmentParameters
Definition:
BowedSurfaceAlignmentParameters.h:27
AlignmentParametersFactory::kRigidBody4D
Definition:
AlignmentParametersFactory.h:25
RigidBodyAlignmentParameters4D.h
AlgebraicObjects.h
AlignmentParametersFactory::createParameters
AlignmentParameters * createParameters(Alignable *ali, ParametersType parType, const std::vector< bool > &sel)
Definition:
AlignmentParametersFactory.cc:83
Exception.h
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition:
AlgebraicObjects.h:12
TwoBowedSurfacesAlignmentParameters::N_PARAM
Definition:
TwoBowedSurfacesAlignmentParameters.h:69
RigidBodyAlignmentParameters.h
AlignmentParametersFactory::kSurvey
Definition:
AlignmentParametersFactory.h:23
AlignmentParametersFactory::kBeamSpot
Definition:
AlignmentParametersFactory.h:26
AlignmentParametersFactory::kTwoBowedSurfaces
Definition:
AlignmentParametersFactory.h:28
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition:
AlgebraicObjects.h:14
RigidBodyAlignmentParameters::N_PARAM
Definition:
RigidBodyAlignmentParameters.h:24
AlignmentParametersFactory::parametersType
ParametersType parametersType(const std::string &typeString)
convert string to ParametersType - exception if not known
Definition:
AlignmentParametersFactory.cc:22
TwoBowedSurfacesAlignmentParameters
Definition:
TwoBowedSurfacesAlignmentParameters.h:43
AlignmentParametersFactory::kRigidBody
Definition:
AlignmentParametersFactory.h:22
triggerObjects_cff.sel
sel
Definition:
triggerObjects_cff.py:33
Generated for CMSSW Reference Manual by
1.8.11