94 const std::vector<AlignableDet*>& alidetvec )
const 96 std::vector<AlignableDetOrUnitPtr> detOrUnits;
97 this->
convert(alidetvec, detOrUnits);
104 const std::vector<AlignableDetOrUnitPtr>& alidetvec )
const 107 for (std::vector<AlignableDetOrUnitPtr>::const_iterator it=alidetvec.begin(); it!=alidetvec.end(); ++it)
117 const std::vector<AlignableDet*>& alidetvec)
const 119 std::vector<AlignableDetOrUnitPtr> detOrUnits;
120 this->
convert(alidetvec, detOrUnits);
128 const std::vector<AlignableDetOrUnitPtr>& alidetvec)
const 131 for (std::vector<AlignableDetOrUnitPtr>::const_iterator it=alidetvec.begin(); it!=alidetvec.end(); ++it )
142 const std::vector<AlignableDet*>& alidetvec)
const 150 const std::vector<AlignableDetOrUnitPtr>& alidetvec)
const 161 std::vector<TrajectoryStateOnSurface> tsosvec;
162 std::vector<AlignableDetOrUnitPtr> alidetvec;
163 tsosvec.push_back(tsos);
164 alidetvec.push_back(alidet);
183 const std::vector<AlignableDet*>& alidetvec )
const 186 if (alidetvec.size() != tsosvec.size())
188 edm::LogError(
"BadArgument") <<
" Inconsistent length of argument vectors! ";
193 std::vector<AlgebraicMatrix> vecderiv;
196 std::vector<TrajectoryStateOnSurface>::const_iterator itsos=tsosvec.begin();
197 for( std::vector<AlignableDet*>::const_iterator it=alidetvec.begin();
198 it!=alidetvec.end(); ++it, ++itsos )
204 vecderiv.push_back(thisselderiv);
205 nparam += thisselderiv.num_row();
210 for ( std::vector<AlgebraicMatrix>::const_iterator imat=vecderiv.begin();
211 imat!=vecderiv.end(); ++imat )
214 int npar=thisselderiv.num_row();
215 selderiv.sub(ipos,1,thisselderiv);
227 const std::vector<AlignableDet*>& alidetvec )
const 239 std::vector<TrajectoryStateOnSurface> tsosvec;
240 std::vector<AlignableDet*> alidetvec;
241 tsosvec.push_back(tsos);
242 alidetvec.push_back(alidet);
264 AlignableDetToAlignableMap::const_iterator iali =
278 const unsigned int nali =
sel.size();
281 std::vector<int> posvec;
282 std::vector<int> lenvec;
284 posvec.reserve( nali );
285 lenvec.reserve( nali );
294 for (
unsigned int iali = 0; iali < nali; ++iali )
296 int posi = posvec[iali];
297 int leni = lenvec[iali];
299 for (
int ir = 0; ir < leni; ++ir )
300 result[resi+ir] =
theData->parameters()[posi-1+ir];
316 const unsigned int nali =
sel.size();
319 std::vector<int> posvec;
320 std::vector<int> lenvec;
322 posvec.reserve( nali );
323 lenvec.reserve( nali );
333 for (
unsigned int iali = 0; iali < nali; ++iali )
335 int posi = posvec[iali];
336 int leni = lenvec[iali];
339 for (
unsigned int jali = 0; jali <= iali; ++jali )
341 int posj = posvec[jali];
342 int lenj = lenvec[jali];
344 for (
int ir = 0; ir < leni; ++ir )
345 for (
int ic = 0; ic < lenj; ++ic )
346 result[resi+ir][resj+ic] =
theData->covariance()[posi-1+ir][posj-1+ic];
369 std::vector<int> posveci;
370 std::vector<int> lenveci;
371 std::vector<int> posvecj;
372 std::vector<int> lenvecj;
374 posveci.reserve( seli.size() );
375 lenveci.reserve( seli.size() );
376 posvecj.reserve( selj.size() );
377 lenvecj.reserve( selj.size() );
389 for (
unsigned int iali = 0; iali < seli.size(); ++iali )
391 int posi = posveci[iali];
392 int leni = lenveci[iali];
395 for (
unsigned int jali = 0; jali < selj.size(); ++jali )
397 int posj = posvecj[jali];
398 int lenj = lenvecj[jali];
400 for (
int ir = 0; ir < leni; ++ir )
401 for (
int ic = 0; ic < lenj; ++ic )
402 result[resi+ir][resj+ic] =
theData->covariance()[posi-1+ir][posj-1+ic];
417 std::vector<int>& posvec,
418 std::vector<int>& lenvec,
423 for (
const auto& it: alignables) {
427 edm::LogError(
"NotFound" ) <<
"@SUB=CompositeAlignmentParameters::extractPositionAndLength" 428 <<
"Alignable not found in components!";
433 Aliposmap::const_iterator iposmap =
theAliposmap.find(it);
434 Alilenmap::const_iterator ilenmap =
theAlilenmap.find(it);
437 edm::LogError(
"NotFound" ) <<
"@SUB=CompositeAlignmentParameters::extractPositionAndLength" 438 <<
"position/length not found for Alignable in maps!";
441 posvec.push_back( iposmap->second );
442 lenvec.push_back( ilenmap->second );
443 length += ilenmap->second;
456 for (
const auto& itA: alignables) {
457 if (
std::find( result.begin(), result.end(), itA ) == result.end()) result.push_back(itA);
466 std::vector<AlignableDetOrUnitPtr> &
output)
const 469 output.reserve(input.size());
471 std::vector<AlignableDet*>::const_iterator it, itEnd;
472 for (it = input.begin(), itEnd = input.end(); it != itEnd; ++it)
align::Alignables Components
vector of alignable components
AlignableDetToAlignableMap theAlignableDetToAlignableMap
Relate Alignable's and AlignableDet's.
AlgebraicSymMatrix covarianceSubset(const align::Alignables &) const
Extract covariance matrix for subset of alignables.
bool extractPositionAndLength(const align::Alignables &alignables, std::vector< int > &posvec, std::vector< int > &lenvec, int &length) const
Extract position and length of parameters for a subset of Alignables.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Alignable * alignableFromAlignableDet(const AlignableDetOrUnitPtr &adet) const
Get relevant Alignable from AlignableDet.
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
static std::string const input
AlgebraicMatrix selectedDerivativesLegacy(const TrajectoryStateOnSurface &tsos, AlignableDet *alidet) const
deprecated due to 'AlignableDet*' interface (legacy code should not be needed anymore) ...
void convert(const std::vector< AlignableDet * > &input, std::vector< AlignableDetOrUnitPtr > &output) const
CLHEP::HepMatrix AlgebraicMatrix
Components components() const
Get vector of alignable components.
std::map< Alignable *, int > Alilenmap
virtual ~CompositeAlignmentParameters()
destructor
AlgebraicVector correctionTerm(const std::vector< TrajectoryStateOnSurface > &tsosvec, const std::vector< AlignableDet * > &alidetvec) const
for backward compatibility, use std::vector<AlignableDetOrUnitPtr>
CLHEP::HepVector AlgebraicVector
std::map< AlignableDetOrUnitPtr, Alignable * > AlignableDetToAlignableMap
AlgebraicMatrix derivativesLegacy(const TrajectoryStateOnSurface &tsos, AlignableDet *alidet) const
deprecated due to 'AlignableDet*' interface (legacy code should not be needed anymore) ...
align::Alignables extractAlignables(const align::Alignables &) const
Return vector of alignables without multiple occurences.
AlgebraicMatrix selectedDerivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &alidet) const
Get derivatives for selected alignables.
AlgebraicVector parameterSubset(const align::Alignables &) const
Extract parameters for subset of alignables.
std::vector< Alignable * > Alignables
Aliposmap theAliposmap
Maps to find parameters/covariance elements for given alignable.
CompositeAlignmentParameters(const AlgebraicVector &par, const AlgebraicSymMatrix &cov, const Components &comp)
constructors
char data[epos_bytes_allocation]
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::map< Alignable *, int > Aliposmap
Components theComponents
Vector of alignable components.
AlgebraicMatrix derivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &alidet) const
Get derivatives.
CompositeAlignmentParameters * clone(const AlgebraicVector &par, const AlgebraicSymMatrix &cov) const
Clone parameters.
virtual AlgebraicMatrix selectedDerivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &alidet) const