18 edm::LogInfo(
"Alignment") <<
"@SUB=AlignmentExtendedCorrelationsStore::AlignmentExtendedCorrelationsStore"
30 if ( ap1 == 0 ) { previousAlignable = 0;
return; }
35 if ( ap1 == previousAlignable )
37 ExtendedCorrelationsTable::const_iterator itC2 = previousCorrelations->find( ap2 );
38 if ( itC2 != previousCorrelations->end() )
47 ExtendedCorrelations::const_iterator itC1 =
theCorrelations.find( ap1 );
50 previousAlignable = ap1;
51 previousCorrelations = (*itC1).second;
53 ExtendedCorrelationsTable::const_iterator itC2 = (*itC1).second->find( ap2 );
54 if ( itC2 != (*itC1).second->end() )
75 if ( ap1 == 0 ) { previousAlignable = 0;
return; }
80 if ( ap1 == previousAlignable )
90 previousAlignable = ap1;
91 previousCorrelations = itC->second;
101 previousAlignable = ap1;
102 previousCorrelations = newTable;
116 ExtendedCorrelationsTable::iterator itC2 = itC1->second->find( ap1 );
117 if ( itC2 != itC1->second->end() )
140 ExtendedCorrelations::const_iterator itC1 =
theCorrelations.find( ap1 );
143 ExtendedCorrelationsTable::const_iterator itC2 = itC1->second->find( ap2 );
144 if ( itC2 != itC1->second->end() )
146 mat = transpose ? itC2->second.matrix().T() : itC2->second.matrix();
160 ExtendedCorrelations::const_iterator itC1 =
theCorrelations.find( ap1 );
163 ExtendedCorrelationsTable::const_iterator itC2 = itC1->second->find( ap2 );
164 if ( itC2 != itC1->second->end() )
return true;
172 ExtendedCorrelations::iterator itC;
185 unsigned int size = 0;
186 ExtendedCorrelations::const_iterator itC;
188 size += itC->second->size();
200 ExtendedCorrelationsTable::iterator itC = table->find( ap2 );
202 if ( itC != table->end() )
222 (*table)[ap2] = newEntry;
231 int nRow = entry.
numRow();
232 int nCol = entry.
numCol();
234 for (
int iRow = 0; iRow < nRow; ++iRow )
236 double factor =
sqrt(cov[row+iRow][row+iRow]);
238 <<
"NaN-factor: sqrt(" << cov[row+iRow][row+iRow] <<
")";
240 for (
int jCol = 0; jCol < nCol; ++jCol )
241 cov[row+iRow][col+jCol] = entry( iRow, jCol )*factor;
244 for (
int jCol = 0; jCol < nCol; ++jCol )
246 double factor =
sqrt(cov[col+jCol][col+jCol]);
248 <<
"NaN-factor: sqrt(" << cov[col+jCol][col+jCol] <<
")";
250 for (
int iRow = 0; iRow < nRow; ++iRow )
251 cov[row+iRow][col+jCol] *= factor;
260 int nRow = entry.
numRow();
261 int nCol = entry.
numCol();
263 for (
int iRow = 0; iRow < nRow; ++iRow )
265 double factor =
sqrt(cov[col+iRow][col+iRow]);
267 <<
"NaN-factor: sqrt(" << cov[col+iRow][col+iRow] <<
")";
268 for (
int jCol = 0; jCol < nCol; ++jCol )
269 cov[row+jCol][col+iRow] = entry( iRow, jCol )*factor;
272 for (
int jCol = 0; jCol < nCol; ++jCol )
274 double factor =
sqrt(cov[row+jCol][row+jCol]);
276 <<
"NaN-factor: sqrt(" << cov[row+jCol][row+jCol] <<
")";
277 for (
int iRow = 0; iRow < nRow; ++iRow )
278 cov[row+jCol][col+iRow] *= factor;
288 int nRow = entry.
numRow();
289 int nCol = entry.
numCol();
291 for (
int iRow = 0; iRow < nRow; ++iRow )
293 double factor =
sqrt(cov[row+iRow][row+iRow]);
294 for (
int jCol = 0; jCol < nCol; ++jCol )
295 entry( iRow, jCol ) = cov[row+iRow][col+jCol]/factor;
300 for (
int jCol = 0; jCol < nCol; ++jCol )
302 double factor =
sqrt(cov[col+jCol][col+jCol]);
303 for (
int iRow = 0; iRow < nRow; ++iRow )
305 entry( iRow, jCol ) /= factor;
306 if ( fabs( entry( iRow, jCol ) ) > maxCorr ) maxCorr = fabs( entry( iRow, jCol ) );
318 int nRow = entry.
numRow();
319 int nCol = entry.
numCol();
321 for (
int iRow = 0; iRow < nRow; ++iRow )
323 double factor =
sqrt(cov[col+iRow][col+iRow]);
324 for (
int jCol = 0; jCol < nCol; ++jCol )
325 entry( iRow, jCol ) = cov[row+jCol][col+iRow]/factor;
330 for (
int jCol = 0; jCol < nCol; ++jCol )
332 double factor =
sqrt(cov[row+jCol][row+jCol]);
333 for (
int iRow = 0; iRow < nRow; ++iRow )
335 entry( iRow, jCol ) /= factor;
336 if ( fabs( entry( iRow, jCol ) ) > maxCorr ) maxCorr = fabs( entry( iRow, jCol ) );
352 else if ( maxCorr >
theCut )
T getParameter(std::string const &) const
virtual void resetCorrelations(void)
Reset correlations.
std::map< Alignable *, ExtendedCorrelationsEntry > ExtendedCorrelationsTable
virtual void fillCorrelationsTable(Alignable *ap1, Alignable *ap2, ExtendedCorrelationsTable *table, const AlgebraicSymMatrix &cov, int row, int col, bool transpose)
virtual void fillCovariance(Alignable *ap1, Alignable *ap2, const ExtendedCorrelationsEntry &entry, AlgebraicSymMatrix &cov, int row, int col) const
virtual unsigned int size(void) const
Get number of stored correlations.
virtual bool correlationsAvailable(Alignable *ap1, Alignable *ap2) const
Check whether correlations are stored for a given pair of alignables.
AlignmentExtendedCorrelationsEntry ExtendedCorrelationsEntry
virtual void correlations(Alignable *ap1, Alignable *ap2, AlgebraicSymMatrix &cov, int row, int col) const
const short unsigned int numRow(void) const
Get the number of rows of the correlation matrix.
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
const short unsigned int numCol(void) const
Get the number of columns of the correlation matrix.
virtual void setCorrelations(Alignable *ap1, Alignable *ap2, const AlgebraicSymMatrix &cov, int row, int col)
CLHEP::HepMatrix AlgebraicMatrix
virtual void fillCovarianceT(Alignable *ap1, Alignable *ap2, const ExtendedCorrelationsEntry &entry, AlgebraicSymMatrix &cov, int row, int col) const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void resizeCorruptCorrelations(ExtendedCorrelationsEntry &entry, double maxCorr)
virtual void readFromCovariance(Alignable *ap1, Alignable *ap2, ExtendedCorrelationsEntry &entry, const AlgebraicSymMatrix &cov, int row, int col)
int numSelected(void) const
Get number of selected parameters.
virtual void readFromCovarianceT(Alignable *ap1, Alignable *ap2, ExtendedCorrelationsEntry &entry, const AlgebraicSymMatrix &cov, int row, int col)
AlignmentExtendedCorrelationsStore(const edm::ParameterSet &config)
ExtendedCorrelations theCorrelations
CLHEP::HepSymMatrix AlgebraicSymMatrix
virtual void getCorrelations(Alignable *ap1, Alignable *ap2, AlgebraicMatrix &mat) const
Get correlations.