31 theAlignableDetToAlignableMap(alimap),
32 theAliposmap(aliposmap),
33 theAlilenmap(alilenmap) {}
43 theAlignableDetToAlignableMap(alimap),
44 theAliposmap(aliposmap),
45 theAlilenmap(alilenmap) {}
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)
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) {
393 std::vector<AlignableDetOrUnitPtr> &
output)
const {
397 std::vector<AlignableDet *>::const_iterator it, itEnd;
398 for (it =
input.begin(), itEnd =
input.end(); it != itEnd; ++it)
CompositeAlignmentParameters * clone(const AlgebraicVector &par, const AlgebraicSymMatrix &cov) const
Clone parameters.
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
std::map< Alignable *, int > Aliposmap
align::Alignables Components
vector of alignable components
AlignableDetToAlignableMap theAlignableDetToAlignableMap
Relate Alignable's and AlignableDet's.
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 convert(const std::vector< AlignableDet *> &input, std::vector< AlignableDetOrUnitPtr > &output) const
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static std::string const input
CLHEP::HepMatrix AlgebraicMatrix
AlgebraicVector correctionTerm(const std::vector< TrajectoryStateOnSurface > &tsosvec, const std::vector< AlignableDet *> &alidetvec) const
for backward compatibility, use std::vector<AlignableDetOrUnitPtr>
virtual AlgebraicMatrix selectedDerivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &alidet) const
AlgebraicMatrix selectedDerivativesLegacy(const TrajectoryStateOnSurface &tsos, AlignableDet *alidet) const
AlgebraicMatrix derivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &alidet) const
Get derivatives.
AlgebraicMatrix selectedDerivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &alidet) const
Get derivatives for selected alignables.
virtual ~CompositeAlignmentParameters()
destructor
AlgebraicVector parameterSubset(const align::Alignables &) const
Extract parameters for subset of alignables.
CLHEP::HepVector AlgebraicVector
AlgebraicMatrix derivativesLegacy(const TrajectoryStateOnSurface &tsos, AlignableDet *alidet) const
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
AlgebraicSymMatrix covarianceSubset(const align::Alignables &) const
Extract covariance matrix for subset of alignables.
std::map< Alignable *, int > Alilenmap
std::map< AlignableDetOrUnitPtr, Alignable * > AlignableDetToAlignableMap
char data[epos_bytes_allocation]
CLHEP::HepSymMatrix AlgebraicSymMatrix
align::Alignables extractAlignables(const align::Alignables &) const
Return vector of alignables without multiple occurences.
Components theComponents
Vector of alignable components.
Alignable * alignableFromAlignableDet(const AlignableDetOrUnitPtr &adet) const
Get relevant Alignable from AlignableDet.
Components components() const
Get vector of alignable components.