29 ySplit_(this->ySplitFromAlignable(ali))
41 if (parameters.num_row() !=
N_PARAM) {
42 throw cms::Exception(
"BadParameters") <<
"in TwoBowedSurfacesAlignmentParameters(): " 43 << parameters.num_row() <<
" instead of " <<
N_PARAM 57 if (parameters.num_row() !=
N_PARAM) {
58 throw cms::Exception(
"BadParameters") <<
"in TwoBowedSurfacesAlignmentParameters(): " 59 << parameters.num_row() <<
" instead of " <<
N_PARAM 104 const unsigned int indexOffset = (localY <
ySplit_ ? 0 :
dx2);
107 result[indexOffset +
i][0] = derivs[
i][0];
108 result[indexOffset +
i][1] = derivs[
i][1];
121 <<
"TwoBowedSurfacesAlignmentParameters::derivatives: The hit alignable must match the " 122 <<
"aligned one (i.e. bowed surface parameters cannot be used for composed alignables)\n";
134 <<
"TwoBowedSurfacesAlignmentParameters::apply: parameters without alignable";
139 const double halfLength = surface.
length() * 0.5;
140 const double halfLength1 = (halfLength +
ySplit_) * 0.5;
141 const double halfLength2 = (halfLength -
ySplit_) * 0.5;
148 rigidBowPar1[
i] = params[
i];
153 rigidBowPar1[3] = params[
dslopeY1] / halfLength1;
154 rigidBowPar2[3] = params[
dslopeY2] / halfLength2;
155 rigidBowPar1[4] = -params[
dslopeX1] / (surface.
width() * 0.5);
156 rigidBowPar2[4] = -params[
dslopeX2] / (surface.
width() * 0.5);
159 rigidBowPar1[5] = params[
drotZ1] / gammaScale1;
163 rigidBowPar2[5] = params[
drotZ2] / gammaScale2;
167 for (
unsigned int i = 0;
i < 3; ++
i) {
168 angles[
i] = (rigidBowPar1[
i+3] + rigidBowPar2[
i+3]) * 0.5;
173 const double yMean1 = -halfLength + halfLength1;
174 const double yMean2 = halfLength - halfLength2;
175 rigidBowPar1[
dz1] -= angles[0] * yMean1;
176 rigidBowPar2[
dz1] -= angles[0] * yMean2;
178 rigidBowPar1[
dx1] += angles[2] * yMean1;
179 rigidBowPar2[
dx1] += angles[2] * yMean2;
183 (rigidBowPar1[
dy1] + rigidBowPar2[
dy1]) * 0.5,
184 (rigidBowPar1[
dz1] + rigidBowPar2[
dz1]) * 0.5);
198 std::vector<align::Scalar> deformations; deformations.reserve(13);
210 deformations.push_back((rigidBowPar1[
i] - rigidBowPar2[
i]) * 0.5);
213 deformations.push_back(
ySplit_);
234 std::cout <<
"Contents of TwoBowedSurfacesAlignmentParameters:" 235 <<
"\nParameters: " <<
theData->parameters()
236 <<
"\nCovariance: " <<
theData->covariance() << std::endl;
245 const double r =
pos.perp();
256 edm::LogError(
"Alignment") <<
"@SUB=TwoBowedSurfacesAlignmentParameters::ySplitFromAlignable" 257 <<
"There are no split modules for radii < 58, but r = " <<
r;
259 }
else if (fabs(
pos.z()) < 118.) {
261 }
else if (r > 90.) {
274 }
else if (r > 75.) {
align::Scalar width() const
TwoBowedSurfacesAlignmentParameters * clone(const AlgebraicVector ¶meters, const AlgebraicSymMatrix &covMatrix) const override
Clone all parameters (for update of parameters)
AlgebraicMatrix derivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &aliDet) const override
Get all derivatives.
const LocalTrajectoryParameters & localParameters() const
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
const AlgebraicVector & parameters(void) const
Get alignment 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 * cloneFromSelected(const AlgebraicVector ¶meters, const AlgebraicSymMatrix &covMatrix) const override
Clone selected 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
int type() const override
tell type (AlignmentParametersFactory::ParametersType - but no circular dependency) ...
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