94 const std::vector<AlignableDet*>& alidetvec )
const 96 std::vector<AlignableDetOrUnitPtr> detOrUnits;
97 this->
convert(alidetvec, detOrUnits);
104 const std::vector<AlignableDetOrUnitPtr>& alidetvec )
const 106 std::vector<Alignable*> alivec;
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 130 std::vector<Alignable*> alivec;
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];
361 const std::vector<Alignable*>& vecj )
const 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 ( std::vector<Alignable*>::const_iterator it = alignables.begin(); it != alignables.end(); ++it )
428 edm::LogError(
"NotFound" ) <<
"@SUB=CompositeAlignmentParameters::extractPositionAndLength" 429 <<
"Alignable not found in components!";
434 Aliposmap::const_iterator iposmap =
theAliposmap.find( *it );
435 Alilenmap::const_iterator ilenmap =
theAlilenmap.find( *it );
438 edm::LogError(
"NotFound" ) <<
"@SUB=CompositeAlignmentParameters::extractPositionAndLength" 439 <<
"position/length not found for Alignable in maps!";
442 posvec.push_back( iposmap->second );
443 lenvec.push_back( ilenmap->second );
444 length += ilenmap->second;
452 std::vector< Alignable* >
455 std::vector< Alignable* >
result;
457 std::vector< Alignable* >::const_iterator itA, itEnd;
458 for ( itA = alignables.begin(), itEnd = alignables.end(); itA != itEnd; ++itA )
460 if (
std::find( result.begin(), result.end(), *itA ) == result.end() ) result.push_back( *itA );
469 std::vector<AlignableDetOrUnitPtr> &
output)
const 472 output.reserve(input.size());
474 std::vector<AlignableDet*>::const_iterator it, itEnd;
475 for (it = input.begin(), itEnd = input.end(); it != itEnd; ++it)
bool extractPositionAndLength(const std::vector< Alignable * > &alignables, std::vector< int > &posvec, std::vector< int > &lenvec, int &length) const
Extract position and length of parameters for a subset of Alignables.
std::vector< Alignable * > extractAlignables(const std::vector< Alignable * > &alignables) const
Return vector of alignables without multiple occurences.
std::vector< Alignable * > Components
vector of alignable components
AlignableDetToAlignableMap theAlignableDetToAlignableMap
Relate Alignable's and AlignableDet's.
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
AlgebraicSymMatrix covarianceSubset(const std::vector< Alignable * > &vec) const
Extract covariance matrix for subset of alignables.
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) ...
AlgebraicVector parameterSubset(const std::vector< Alignable * > &vec) const
Extract parameters for subset of alignables.
AlgebraicMatrix selectedDerivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &alidet) const
Get derivatives for selected 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