13 const std::vector< AlignableDet* > & alignableDets,
14 const std::vector< TrajectoryStateOnSurface > & tsos )
16 std::vector<AlignableDetOrUnitPtr> detOrUnits;
17 detOrUnits.reserve(alignableDets.size());
19 std::vector<AlignableDet*>::const_iterator it, itEnd;
20 for (it = alignableDets.begin(), itEnd = alignableDets.end(); it != itEnd; ++it)
29 const std::vector< AlignableDetOrUnitPtr > & alignableDets,
30 const std::vector< TrajectoryStateOnSurface > & tsos )
39 const std::vector< AlignableDetOrUnitPtr > & alignableDets,
40 const std::vector< TrajectoryStateOnSurface > & tsos )
44 if ( alignables.size() != alignableDets.size() )
47 <<
"Inconsistent length of arguments: alignables=" << alignables.size()
48 <<
", alignableDets=" << alignableDets.size();
52 if ( alignables.size() != tsos.size() )
55 <<
"Inconsistent length of arguments: alignables=" << alignables.size()
56 <<
", tsos=" << tsos.size();
60 std::vector< Alignable* >::const_iterator itAlignable = alignables.begin();
61 std::vector< AlignableDetOrUnitPtr >::const_iterator itAlignableDet = alignableDets.begin();
62 std::vector< TrajectoryStateOnSurface >::const_iterator itTsos = tsos.begin();
66 unsigned int nAlignables = 0;
68 std::vector< AlgebraicMatrix > subDerivatives;
69 std::vector< AlgebraicVector > subCorrectionTerm;
73 while ( itAlignable != alignables.end() )
77 ( *itAlignable )->alignmentParameters()->selectedParameters();
81 ( *itAlignable )->alignmentParameters()->selectedDerivatives( *itTsos, *itAlignableDet );
83 subDerivatives.push_back( subAlignmentDerivatives.T() );
84 subCorrectionTerm.push_back( subAlignmentDerivatives.T()*subAlignmentParameters );
88 if (
count( alignables.begin(), itAlignable, *itAlignable ) == 0 )
91 nCollumn += subAlignmentDerivatives.num_row();
104 if ( alignables.size() == nAlignables )
119 const std::vector< AlgebraicMatrix > & subDerivatives )
121 std::vector< AlgebraicVector >::const_iterator itSubCorrectionTerm = subCorrectionTerm.begin();
122 std::vector< AlgebraicMatrix >::const_iterator itSubDerivatives = subDerivatives.begin();
128 while ( itSubCorrectionTerm != subCorrectionTerm.end() )
134 iCollumn += ( *itSubDerivatives ).num_col();
136 ++itSubCorrectionTerm;
147 const std::vector< AlgebraicMatrix > & subDerivatives,
148 const std::vector< Alignable* > & alignables )
151 std::vector< AlgebraicVector >::const_iterator itSubCorrectionTerm = subCorrectionTerm.begin();
152 std::vector< AlgebraicMatrix >::const_iterator itSubDerivatives = subDerivatives.begin();
153 std::vector< Alignable* >::const_iterator itAlignables = alignables.begin();
154 std::vector< Alignable* >::const_iterator itPosition;
155 std::vector< Alignable* >::const_iterator itLastPosition;
160 while ( itAlignables != alignables.end() )
167 itLastPosition =
find( alignables.begin(), itAlignables, *itAlignables );
169 for ( itPosition = alignables.begin(); itPosition != itLastPosition; ++itPosition )
171 if (
count( alignables.begin(), itPosition, *itPosition ) == 0 )
172 iCollumn += subDerivatives[iAlignable].num_col();
181 ++itSubCorrectionTerm;
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
CLHEP::HepMatrix AlgebraicMatrix
CLHEP::HepVector AlgebraicVector