76 const std::vector<AlignableDet *> &alidetvec)
const {
77 std::vector<AlignableDetOrUnitPtr> detOrUnits;
78 this->
convert(alidetvec, detOrUnits);
84 const std::vector<AlignableDetOrUnitPtr> &alidetvec)
const {
86 for (std::vector<AlignableDetOrUnitPtr>::const_iterator it = alidetvec.begin(); it != alidetvec.end(); ++it)
95 const std::vector<AlignableDet *> &alidetvec)
const {
96 std::vector<AlignableDetOrUnitPtr> detOrUnits;
97 this->
convert(alidetvec, detOrUnits);
104 const std::vector<TrajectoryStateOnSurface> &tsosvec,
const std::vector<AlignableDetOrUnitPtr> &alidetvec)
const {
106 for (std::vector<AlignableDetOrUnitPtr>::const_iterator it = alidetvec.begin(); it != alidetvec.end(); ++it)
116 const std::vector<AlignableDet *> &alidetvec)
const {
122 const std::vector<TrajectoryStateOnSurface> &tsosvec,
const std::vector<AlignableDetOrUnitPtr> &alidetvec)
const {
130 std::vector<TrajectoryStateOnSurface> tsosvec;
131 std::vector<AlignableDetOrUnitPtr> alidetvec;
132 tsosvec.push_back(tsos);
133 alidetvec.push_back(alidet);
148 const std::vector<AlignableDet *> &alidetvec)
const {
150 if (alidetvec.size() != tsosvec.size()) {
151 edm::LogError(
"BadArgument") <<
" Inconsistent length of argument vectors! ";
156 std::vector<AlgebraicMatrix> vecderiv;
159 std::vector<TrajectoryStateOnSurface>::const_iterator itsos = tsosvec.begin();
160 for (std::vector<AlignableDet *>::const_iterator it = alidetvec.begin(); it != alidetvec.end(); ++it, ++itsos) {
165 vecderiv.push_back(thisselderiv);
166 nparam += thisselderiv.num_row();
171 for (std::vector<AlgebraicMatrix>::const_iterator imat = vecderiv.begin(); imat != vecderiv.end(); ++imat) {
173 int npar = thisselderiv.num_row();
174 selderiv.sub(ipos, 1, thisselderiv);
184 const std::vector<TrajectoryStateOnSurface> &tsosvec,
const std::vector<AlignableDet *> &alidetvec)
const {
192 std::vector<TrajectoryStateOnSurface> tsosvec;
193 std::vector<AlignableDet *> alidetvec;
194 tsosvec.push_back(tsos);
195 alidetvec.push_back(alidet);
211 return (*iali).second;
220 const unsigned int nali =
sel.size();
223 std::vector<int> posvec;
224 std::vector<int> lenvec;
226 posvec.reserve(nali);
227 lenvec.reserve(nali);
237 for (
unsigned int iali = 0; iali < nali; ++iali) {
238 int posi = posvec[iali];
239 int leni = lenvec[iali];
241 for (
int ir = 0; ir < leni; ++ir)
242 result[resi + ir] =
theData->parameters()[posi - 1 + ir];
255 const unsigned int nali =
sel.size();
258 std::vector<int> posvec;
259 std::vector<int> lenvec;
261 posvec.reserve(nali);
262 lenvec.reserve(nali);
273 for (
unsigned int iali = 0; iali < nali; ++iali) {
274 int posi = posvec[iali];
275 int leni = lenvec[iali];
278 for (
unsigned int jali = 0; jali <= iali; ++jali) {
279 int posj = posvec[jali];
280 int lenj = lenvec[jali];
282 for (
int ir = 0; ir < leni; ++ir)
283 for (
int ic = 0; ic < lenj; ++ic)
284 result[resi + ir][resj + ic] =
theData->covariance()[posi - 1 + ir][posj - 1 + ic];
304 std::vector<int> posveci;
305 std::vector<int> lenveci;
306 std::vector<int> posvecj;
307 std::vector<int> lenvecj;
309 posveci.reserve(seli.size());
310 lenveci.reserve(seli.size());
311 posvecj.reserve(selj.size());
312 lenvecj.reserve(selj.size());
326 for (
unsigned int iali = 0; iali < seli.size(); ++iali) {
327 int posi = posveci[iali];
328 int leni = lenveci[iali];
331 for (
unsigned int jali = 0; jali < selj.size(); ++jali) {
332 int posj = posvecj[jali];
333 int lenj = lenvecj[jali];
335 for (
int ir = 0; ir < leni; ++ir)
336 for (
int ic = 0; ic < lenj; ++ic)
337 result[resi + ir][resj + ic] =
theData->covariance()[posi - 1 + ir][posj - 1 + ic];
350 std::vector<int> &posvec,
351 std::vector<int> &lenvec,
355 for (
const auto &it : alignables) {
358 edm::LogError(
"NotFound") <<
"@SUB=CompositeAlignmentParameters::extractPositionAndLength" 359 <<
"Alignable not found in components!";
364 Aliposmap::const_iterator iposmap =
theAliposmap.find(it);
365 Alilenmap::const_iterator ilenmap =
theAlilenmap.find(it);
367 edm::LogError(
"NotFound") <<
"@SUB=CompositeAlignmentParameters::extractPositionAndLength" 368 <<
"position/length not found for Alignable in maps!";
371 posvec.push_back(iposmap->second);
372 lenvec.push_back(ilenmap->second);
373 length += ilenmap->second;
383 for (
const auto &itA : alignables) {
384 if (
std::find(result.begin(), result.end(), itA) == result.end())
385 result.push_back(itA);
393 std::vector<AlignableDetOrUnitPtr> &
output)
const {
395 output.reserve(input.size());
397 std::vector<AlignableDet *>::const_iterator it, itEnd;
398 for (it = input.begin(), itEnd = input.end(); it != itEnd; ++it)
std::map< Alignable *, int > Aliposmap
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
void convert(const std::vector< AlignableDet * > &input, std::vector< AlignableDetOrUnitPtr > &output) const
CLHEP::HepMatrix AlgebraicMatrix
Components components() const
Get vector of alignable components.
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
AlgebraicMatrix derivativesLegacy(const TrajectoryStateOnSurface &tsos, AlignableDet *alidet) const
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
std::map< Alignable *, int > Alilenmap
std::map< AlignableDetOrUnitPtr, Alignable * > AlignableDetToAlignableMap
char data[epos_bytes_allocation]
CLHEP::HepSymMatrix AlgebraicSymMatrix
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