29 ySplit_(this->ySplitFromAlignable(ali)) {}
35 :
AlignmentParameters(alignable, parameters, covMatrix), ySplit_(this->ySplitFromAlignable(alignable)) {
36 if (parameters.num_row() !=
N_PARAM) {
37 throw cms::Exception(
"BadParameters") <<
"in TwoBowedSurfacesAlignmentParameters(): " << parameters.num_row()
38 <<
" instead of " <<
N_PARAM <<
" parameters.";
47 :
AlignmentParameters(alignable, parameters, covMatrix, selection), ySplit_(this->ySplitFromAlignable(alignable)) {
48 if (parameters.num_row() !=
N_PARAM) {
49 throw cms::Exception(
"BadParameters") <<
"in TwoBowedSurfacesAlignmentParameters(): " << parameters.num_row()
50 <<
" instead of " <<
N_PARAM <<
" parameters.";
88 const unsigned int indexOffset = (localY <
ySplit_ ? 0 :
dx2);
91 result[indexOffset +
i][0] = derivs[
i][0];
92 result[indexOffset +
i][1] = derivs[
i][1];
105 throw cms::Exception(
"MisMatch") <<
"TwoBowedSurfacesAlignmentParameters::derivatives: The hit "
106 "alignable must match the "
107 <<
"aligned one (i.e. bowed surface parameters cannot be used for "
108 "composed alignables)\n";
118 throw cms::Exception(
"BadParameters") <<
"TwoBowedSurfacesAlignmentParameters::apply: parameters without "
124 const double halfLength = surface.
length() * 0.5;
125 const double halfLength1 = (halfLength +
ySplit_) * 0.5;
126 const double halfLength2 = (halfLength -
ySplit_) * 0.5;
133 rigidBowPar1[
i] = params[
i];
138 rigidBowPar1[3] = params[
dslopeY1] / halfLength1;
139 rigidBowPar2[3] = params[
dslopeY2] / halfLength2;
140 rigidBowPar1[4] = -params[
dslopeX1] / (surface.
width() * 0.5);
141 rigidBowPar2[4] = -params[
dslopeX2] / (surface.
width() * 0.5);
144 rigidBowPar1[5] = params[
drotZ1] / gammaScale1;
148 rigidBowPar2[5] = params[
drotZ2] / gammaScale2;
152 for (
unsigned int i = 0;
i < 3; ++
i) {
153 angles[
i] = (rigidBowPar1[
i + 3] + rigidBowPar2[
i + 3]) * 0.5;
158 const double yMean1 = -halfLength + halfLength1;
159 const double yMean2 = halfLength - halfLength2;
160 rigidBowPar1[
dz1] -= angles[0] * yMean1;
161 rigidBowPar2[
dz1] -= angles[0] * yMean2;
163 rigidBowPar1[
dx1] += angles[2] * yMean1;
164 rigidBowPar2[
dx1] += angles[2] * yMean2;
168 (rigidBowPar1[
dy1] + rigidBowPar2[
dy1]) * 0.5,
169 (rigidBowPar1[
dz1] + rigidBowPar2[
dz1]) * 0.5);
184 std::vector<align::Scalar> deformations;
185 deformations.reserve(13);
197 deformations.push_back((rigidBowPar1[
i] - rigidBowPar2[
i]) * 0.5);
200 deformations.push_back(
ySplit_);
216 std::cout <<
"Contents of TwoBowedSurfacesAlignmentParameters:"
217 <<
"\nParameters: " <<
theData->parameters() <<
"\nCovariance: " <<
theData->covariance() << std::endl;
226 const double r = pos.perp();
237 edm::LogError(
"Alignment") <<
"@SUB=TwoBowedSurfacesAlignmentParameters::ySplitFromAlignable"
238 <<
"There are no split modules for radii < 58, but r = " <<
r;
240 }
else if (fabs(pos.z()) < 118.) {
242 }
else if (r > 90.) {
256 }
else if (r > 75.) {
align::Scalar width() const
const LocalTrajectoryParameters & localParameters() const
int type() const override
tell type (AlignmentParametersFactory::ParametersType - but no circular dependency) ...
constexpr uint16_t localY(uint16_t py)
AlgebraicSymMatrix expandSymMatrix(const AlgebraicSymMatrix &m, const std::vector< bool > &sel) const
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
const std::vector< bool > & selector(void) const
Get alignment parameter selector vector.
void apply() override
apply parameters to alignable
Log< level::Error, false > LogError
TwoBowedSurfacesAlignmentParameters * cloneFromSelected(const AlgebraicVector ¶meters, const AlgebraicSymMatrix &covMatrix) const override
Clone selected parameters (for update of parameters)
AlignmentUserVariables * userVariables(void) const
Get pointer to user variables.
CLHEP::HepMatrix AlgebraicMatrix
void rectify(RotationType &)
Correct a rotation matrix for rounding errors.
void setValid(bool v)
Set validity flag.
virtual void addSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown)=0
TwoBowedSurfacesAlignmentParameters * clone(const AlgebraicVector ¶meters, const AlgebraicSymMatrix &covMatrix) const override
Clone all parameters (for update of parameters)
static double gammaScale(double width, double splitLength)
Alignable * alignable(void) const
Get pointer to corresponding alignable.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
double ySplitFromAlignable(const Alignable *ali) const
CLHEP::HepVector AlgebraicVector
AlgebraicVector EulerAngles
align::Scalar length() const
AlgebraicVector expandVector(const AlgebraicVector &m, const std::vector< bool > &sel) const
BowedSurfaceAlignmentDerivatives BowedDerivs
Give parameters a name (do not change order, see derivatives(..)!)
void setUserVariables(AlignmentUserVariables *auv)
Set pointer to user variables.
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
AlgebraicVector5 mixedFormatVector() const
AlgebraicMatrix derivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &aliDet) const override
Get all derivatives.
bool isValid(void) const
Get validity flag.
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
CLHEP::HepSymMatrix AlgebraicSymMatrix
static unsigned int const shift
TwoBowedSurfacesAlignmentParameters(Alignable *alignable)
Constructor with empty parameters/covariance.
const PositionType & globalPosition() const
Return the global position of the object.
virtual void print() const
print parameters to screen