13 const std::vector<AlignableDet *> &alignableDets,
14 const std::vector<TrajectoryStateOnSurface> &tsos) {
15 std::vector<AlignableDetOrUnitPtr> detOrUnits;
16 detOrUnits.reserve(alignableDets.size());
18 std::vector<AlignableDet *>::const_iterator it, itEnd;
19 for (it = alignableDets.begin(), itEnd = alignableDets.end(); it != itEnd; ++it)
28 const std::vector<AlignableDetOrUnitPtr> &alignableDets,
29 const std::vector<TrajectoryStateOnSurface> &tsos) {
37 const std::vector<AlignableDetOrUnitPtr> &alignableDets,
38 const std::vector<TrajectoryStateOnSurface> &tsos) {
40 if (alignables.size() != alignableDets.size()) {
42 <<
"Inconsistent length of arguments: alignables=" << alignables.size()
43 <<
", alignableDets=" << alignableDets.size();
47 if (alignables.size() != tsos.size()) {
49 <<
"Inconsistent length of arguments: alignables=" << alignables.size() <<
", tsos=" << tsos.size();
53 align::Alignables::const_iterator itAlignable = alignables.begin();
54 std::vector<AlignableDetOrUnitPtr>::const_iterator itAlignableDet = alignableDets.begin();
55 std::vector<TrajectoryStateOnSurface>::const_iterator itTsos = tsos.begin();
59 unsigned int nAlignables = 0;
61 std::vector<AlgebraicMatrix> subDerivatives;
62 std::vector<AlgebraicVector> subCorrectionTerm;
66 while (itAlignable != alignables.end()) {
68 AlgebraicVector subAlignmentParameters = (*itAlignable)->alignmentParameters()->selectedParameters();
73 (*itAlignable)->alignmentParameters()->selectedDerivatives(*itTsos, *itAlignableDet);
75 subDerivatives.push_back(subAlignmentDerivatives.T());
76 subCorrectionTerm.push_back(subAlignmentDerivatives.T() * subAlignmentParameters);
80 if (
count(alignables.begin(), itAlignable, *itAlignable) == 0) {
82 nCollumn += subAlignmentDerivatives.num_row();
95 if (alignables.size() == nAlignables)
108 const std::vector<AlgebraicVector> &subCorrectionTerm,
const std::vector<AlgebraicMatrix> &subDerivatives) {
109 std::vector<AlgebraicVector>::const_iterator itSubCorrectionTerm = subCorrectionTerm.begin();
110 std::vector<AlgebraicMatrix>::const_iterator itSubDerivatives = subDerivatives.begin();
116 while (itSubCorrectionTerm != subCorrectionTerm.end()) {
121 iCollumn += (*itSubDerivatives).num_col();
123 ++itSubCorrectionTerm;
133 const std::vector<AlgebraicVector> &subCorrectionTerm,
134 const std::vector<AlgebraicMatrix> &subDerivatives,
136 std::vector<AlgebraicVector>::const_iterator itSubCorrectionTerm = subCorrectionTerm.begin();
137 std::vector<AlgebraicMatrix>::const_iterator itSubDerivatives = subDerivatives.begin();
138 align::Alignables::const_iterator itAlignables = alignables.begin();
139 align::Alignables::const_iterator itPosition;
140 align::Alignables::const_iterator itLastPosition;
145 while (itAlignables != alignables.end()) {
151 itLastPosition =
find(alignables.begin(), itAlignables, *itAlignables);
153 for (itPosition = alignables.begin(); itPosition != itLastPosition; ++itPosition) {
154 if (
count(alignables.begin(), itPosition, *itPosition) == 0)
155 iCollumn += subDerivatives[iAlignable].num_col();
164 ++itSubCorrectionTerm;
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
CLHEP::HepMatrix AlgebraicMatrix
CLHEP::HepVector AlgebraicVector
std::vector< Alignable * > Alignables