CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignmentParameterStore.cc
Go to the documentation of this file.
1 
9 // This class's header should be first
11 
15 
19 
24 
25 
26 //__________________________________________________________________________________________________
28  const edm::ParameterSet& config ) :
29  theAlignables(alis)
30 {
31  if (config.getUntrackedParameter<bool>("UseExtendedCorrelations")) {
33  (config.getParameter<edm::ParameterSet>("ExtendedCorrelationsConfig"));
34  } else {
36  }
37 
38  edm::LogInfo("Alignment") << "@SUB=AlignmentParameterStore"
39  << "Created with " << theAlignables.size() << " alignables.";
40 }
41 
42 //__________________________________________________________________________________________________
44 {
45  delete theCorrelationsStore;
46 }
47 
48 //__________________________________________________________________________________________________
50 AlignmentParameterStore::selectParameters( const std::vector<AlignableDet*>& alignabledets ) const
51 {
52  std::vector<AlignableDetOrUnitPtr> detOrUnits;
53  detOrUnits.reserve(alignabledets.size());
54 
55  std::vector<AlignableDet*>::const_iterator it, iEnd;
56  for ( it = alignabledets.begin(), iEnd = alignabledets.end(); it != iEnd; ++it)
57  detOrUnits.push_back(AlignableDetOrUnitPtr(*it));
58 
59  return this->selectParameters(detOrUnits);
60 }
61 
62 //__________________________________________________________________________________________________
64 AlignmentParameterStore::selectParameters( const std::vector<AlignableDetOrUnitPtr>& alignabledets ) const
65 {
66 
68  std::map <AlignableDetOrUnitPtr,Alignable*> alidettoalimap;
69  std::map <Alignable*,int> aliposmap;
70  std::map <Alignable*,int> alilenmap;
71  int nparam=0;
72 
73  // iterate over AlignableDet's
74  for( std::vector<AlignableDetOrUnitPtr>::const_iterator iad = alignabledets.begin();
75  iad != alignabledets.end(); ++iad )
76  {
77  Alignable* ali = alignableFromAlignableDet( *iad );
78  if ( ali )
79  {
80  alidettoalimap[ *iad ] = ali; // Add to map
81  // Check if Alignable already there, insert into vector if not
82  if ( find(alignables.begin(),alignables.end(),ali) == alignables.end() )
83  {
84  alignables.push_back(ali);
86  nparam += ap->numSelected();
87  }
88  }
89  }
90 
91  AlgebraicVector* selpar = new AlgebraicVector( nparam, 0 );
92  AlgebraicSymMatrix* selcov = new AlgebraicSymMatrix( nparam, 0 );
93 
94  // Fill in parameters and corresponding covariance matricess
95  int ipos = 1; // NOTE: .sub indices start from 1
96  align::Alignables::const_iterator it1;
97  for( it1 = alignables.begin(); it1 != alignables.end(); ++it1 )
98  {
99  AlignmentParameters* ap = (*it1)->alignmentParameters();
100  selpar->sub( ipos, ap->selectedParameters() );
101  selcov->sub( ipos, ap->selectedCovariance() );
102  int npar = ap->numSelected();
103  aliposmap[*it1]=ipos;
104  alilenmap[*it1]=npar;
105  ipos +=npar;
106  }
107 
108  // Fill in the correlations. Has to be an extra loop, because the
109  // AlignmentExtendedCorrelationsStore (if used) needs the
110  // alignables' covariance matrices already present.
111  ipos = 1;
112  for( it1 = alignables.begin(); it1 != alignables.end(); ++it1 )
113  {
114  int jpos=1;
115 
116  // Look for correlations between alignables
117  align::Alignables::const_iterator it2;
118  for( it2 = alignables.begin(); it2 != it1; ++it2 )
119  {
120  theCorrelationsStore->correlations( *it1, *it2, *selcov, ipos-1, jpos-1 );
121  jpos += (*it2)->alignmentParameters()->numSelected();
122  }
123 
124  ipos += (*it1)->alignmentParameters()->numSelected();
125  }
126 
128  CompositeAlignmentParameters aap( data, alignables, alidettoalimap, aliposmap, alilenmap );
129 
130  return aap;
131 }
132 
133 
134 //__________________________________________________________________________________________________
137 {
138 
139  align::Alignables selectedAlignables;
140  std::map <AlignableDetOrUnitPtr,Alignable*> alidettoalimap; // This map won't be filled!!!
141  std::map <Alignable*,int> aliposmap;
142  std::map <Alignable*,int> alilenmap;
143  int nparam=0;
144 
145  // iterate over Alignable's
146  align::Alignables::const_iterator ita;
147  for ( ita = alignables.begin(); ita != alignables.end(); ++ita )
148  {
149  // Check if Alignable already there, insert into vector if not
150  if ( find(selectedAlignables.begin(), selectedAlignables.end(), *ita) == selectedAlignables.end() )
151  {
152  selectedAlignables.push_back( *ita );
153  AlignmentParameters* ap = (*ita)->alignmentParameters();
154  nparam += ap->numSelected();
155  }
156  }
157 
158  AlgebraicVector* selpar = new AlgebraicVector( nparam, 0 );
159  AlgebraicSymMatrix* selcov = new AlgebraicSymMatrix( nparam, 0 );
160 
161  // Fill in parameters and corresponding covariance matrices
162  int ipos = 1; // NOTE: .sub indices start from 1
163  align::Alignables::const_iterator it1;
164  for( it1 = selectedAlignables.begin(); it1 != selectedAlignables.end(); ++it1 )
165  {
166  AlignmentParameters* ap = (*it1)->alignmentParameters();
167  selpar->sub( ipos, ap->selectedParameters() );
168  selcov->sub( ipos, ap->selectedCovariance() );
169  int npar = ap->numSelected();
170  aliposmap[*it1]=ipos;
171  alilenmap[*it1]=npar;
172  ipos +=npar;
173  }
174 
175  // Fill in the correlations. Has to be an extra loop, because the
176  // AlignmentExtendedCorrelationsStore (if used) needs the
177  // alignables' covariance matrices already present.
178  ipos = 1;
179  for( it1 = selectedAlignables.begin(); it1 != selectedAlignables.end(); ++it1 )
180  {
181  int jpos=1;
182 
183  // Look for correlations between alignables
184  align::Alignables::const_iterator it2;
185  for( it2 = selectedAlignables.begin(); it2 != it1; ++it2 )
186  {
187  theCorrelationsStore->correlations( *it1, *it2, *selcov, ipos-1, jpos-1 );
188  jpos += (*it2)->alignmentParameters()->numSelected();
189  }
190 
191  ipos += (*it1)->alignmentParameters()->numSelected();
192  }
193 
195  CompositeAlignmentParameters aap( data, selectedAlignables, alidettoalimap, aliposmap, alilenmap );
196 
197  return aap;
198 }
199 
200 
201 //__________________________________________________________________________________________________
203 {
204 
205  align::Alignables alignables = aap.components();
206  const AlgebraicVector& parameters = aap.parameters();
207  const AlgebraicSymMatrix& covariance = aap.covariance();
208 
209  int ipos = 1; // NOTE: .sub indices start from 1
210 
211  // Loop over alignables
212  for( align::Alignables::const_iterator it=alignables.begin(); it != alignables.end(); ++it )
213  {
214  // Update parameters and local covariance
215  AlignmentParameters* ap = (*it)->alignmentParameters();
216  int nsel = ap->numSelected();
217  AlgebraicVector subvec = parameters.sub( ipos, ipos+nsel-1 );
218  AlgebraicSymMatrix subcov = covariance.sub( ipos, ipos+nsel-1 );
219  AlignmentParameters* apnew = ap->cloneFromSelected( subvec, subcov );
220  (*it)->setAlignmentParameters( apnew );
221 
222  // Now update correlations between detectors
223  if ( updateCorrelations )
224  {
225  int jpos = 1;
226  for( align::Alignables::const_iterator it2 = alignables.begin(); it2 != it; ++it2 )
227  {
228  theCorrelationsStore->setCorrelations( *it, *it2, covariance, ipos-1, jpos-1 );
229  jpos += (*it2)->alignmentParameters()->numSelected();
230  }
231  }
232 
233  ipos+=nsel;
234  }
235 
236 }
237 
238 
239 //__________________________________________________________________________________________________
241 {
243  for (align::Alignables::const_iterator iali = theAlignables.begin();
244  iali != theAlignables.end(); ++iali)
245  if ( (*iali)->alignmentParameters()->isValid() ) result.push_back(*iali);
246 
247  LogDebug("Alignment") << "@SUB=AlignmentParameterStore::validAlignables"
248  << "Valid alignables: " << result.size()
249  << "out of " << theAlignables.size();
250  return result;
251 }
252 
253 //__________________________________________________________________________________________________
255 {
256  Alignable *mother = alignableDet;
257  while (mother) {
258  if (mother->alignmentParameters()) return mother;
259  mother = mother->mother();
260  }
261 
262  return 0;
263 }
264 
265 //__________________________________________________________________________________________________
267 {
268  align::Alignables::const_iterator iali;
269  for ( iali = theAlignables.begin(); iali != theAlignables.end(); ++iali)
270  applyParameters( *iali );
271 }
272 
273 
274 //__________________________________________________________________________________________________
276 {
277 
278  AlignmentParameters *pars = (alignable ? alignable->alignmentParameters() : 0);
279  if (!pars) {
280  throw cms::Exception("BadAlignable")
281  << "applyParameters: provided alignable does not have alignment parameters";
282  }
283  pars->apply();
284 }
285 
286 
287 //__________________________________________________________________________________________________
289 {
290  // Erase contents of correlation map
292 
293  // Iterate over alignables in the store and reset parameters
294  align::Alignables::const_iterator iali;
295  for ( iali = theAlignables.begin(); iali != theAlignables.end(); ++iali )
296  resetParameters( *iali );
297 }
298 
299 
300 //__________________________________________________________________________________________________
302 {
303  if ( ali )
304  {
305  // Get alignment parameters for this alignable
307  if ( ap )
308  {
309  int npar=ap->numSelected();
310 
311  AlgebraicVector par(npar,0);
312  AlgebraicSymMatrix cov(npar,0);
313  AlignmentParameters* apnew = ap->cloneFromSelected(par,cov);
314  ali->setAlignmentParameters(apnew);
315  apnew->setValid(false);
316  }
317  else
318  edm::LogError("BadArgument") << "@SUB=AlignmentParameterStore::resetParameters"
319  << "alignable has no alignment parameter";
320  }
321  else
322  edm::LogError("BadArgument") << "@SUB=AlignmentParameterStore::resetParameters"
323  << "argument is NULL";
324 }
325 
326 
327 //__________________________________________________________________________________________________
329 {
330 
331  unsigned int nAlignables = theAlignables.size();
332 
333  for (unsigned int i = 0; i < nAlignables; ++i)
334  {
335  Alignable* ali = theAlignables[i];
336 
338  dynamic_cast<RigidBodyAlignmentParameters*>( ali->alignmentParameters() );
339 
340  if ( !ap )
341  throw cms::Exception("BadAlignable")
342  << "acquireRelativeParameters: "
343  << "provided alignable does not have rigid body alignment parameters";
344 
345  AlgebraicVector par( ap->size(),0 );
346  AlgebraicSymMatrix cov( ap->size(), 0 );
347 
348  // Get displacement and transform global->local
349  align::LocalVector dloc = ali->surface().toLocal( ali->displacement() );
350  par[0]=dloc.x();
351  par[1]=dloc.y();
352  par[2]=dloc.z();
353 
354  // Transform to local euler angles
355  align::EulerAngles euloc = align::toAngles( ali->surface().toLocal( ali->rotation() ) );
356  par[3]=euloc(1);
357  par[4]=euloc(2);
358  par[5]=euloc(3);
359 
360  // Clone parameters
361  RigidBodyAlignmentParameters* apnew = ap->clone(par,cov);
362 
363  ali->setAlignmentParameters(apnew);
364  }
365 }
366 
367 
368 //__________________________________________________________________________________________________
369 // Get type/layer from Alignable
370 // type: -6 -5 -4 -3 -2 -1 1 2 3 4 5 6
371 // TEC- TOB- TID- TIB- PxEC- PxBR- PxBr+ PxEC+ TIB+ TID+ TOB+ TEC+
372 // Layers start from zero
373 std::pair<int,int> AlignmentParameterStore::typeAndLayer(const Alignable* ali) const
374 {
375  return TrackerAlignableId().typeAndLayerFromDetId( ali->id() );
376 }
377 
378 
379 //__________________________________________________________________________________________________
382  const AlignablePositions& newpos,
383  int& ierr )
384 {
385  unsigned int nappl=0;
386  ierr=0;
387 
388  // Iterate over list of alignables
389  for (align::Alignables::const_iterator iali = alivec.begin(); iali != alivec.end(); ++iali) {
390  Alignable* ali = *iali;
391  align::ID id = ali->id();
392  align::StructureType typeId = ali->alignableObjectId();
393 
394  // Find corresponding entry in AlignablePositions
395  bool found=false;
396  for (AlignablePositions::const_iterator ipos = newpos.begin(); ipos != newpos.end(); ++ipos) {
397  if (id == ipos->id() && typeId == ipos->objId()) {
398  if (found) {
399  edm::LogError("DuplicatePosition")
400  << "New positions for alignable found more than once!";
401  } else {
402  // New position/rotation
403  const align::PositionType& pnew = ipos->pos();
404  const align::RotationType& rnew = ipos->rot();
405  // Current position / rotation
406  const align::PositionType& pold = ali->globalPosition();
407  const align::RotationType& rold = ali->globalRotation();
408 
409  // shift needed to move from current to new position
410  align::GlobalVector posDiff = pnew - pold;
411  align::RotationType rotDiff = rold.multiplyInverse(rnew);
412  align::rectify(rotDiff); // correct for rounding errors
413  ali->move( posDiff );
414  ali->rotateInGlobalFrame( rotDiff );
415  LogDebug("NewPosition") << "moving by:" << posDiff;
416  LogDebug("NewRotation") << "rotating by:\n" << rotDiff;
417 
418  // add position error
419  // AlignmentPositionError ape(shift.x(),shift.y(),shift.z());
420  // (*iali)->addAlignmentPositionError(ape);
421  // (*iali)->addAlignmentPositionErrorFromRotation(rot);
422 
423  found=true;
424  ++nappl;
425  }
426  }
427  }
428  }
429 
430  if ( nappl< newpos.size() )
431  edm::LogError("Mismatch") << "Applied only " << nappl << " new positions"
432  << " out of " << newpos.size();
433 
434  LogDebug("NewPositions") << "Applied new positions for " << nappl
435  << " out of " << alivec.size() <<" alignables.";
436 
437 }
438 
439 
440 //__________________________________________________________________________________________________
442 applyAlignableRelativePositions( const align::Alignables& alivec, const AlignableShifts& shifts, int& ierr )
443 {
444 
445  ierr=0;
446  unsigned int nappl=0;
447  unsigned int nAlignables = alivec.size();
448 
449  for (unsigned int i = 0; i < nAlignables; ++i) {
450  Alignable* ali = alivec[i];
451 
452  align::ID id = ali->id();
453  align::StructureType typeId = ali->alignableObjectId();
454 
455  // Find corresponding entry in AlignableShifts
456  bool found = false;
457  for (AlignableShifts::const_iterator ipos = shifts.begin(); ipos != shifts.end(); ++ipos) {
458  if (id == ipos->id() && typeId == ipos->objId()) {
459  if (found) {
460  edm::LogError("DuplicatePosition")
461  << "New positions for alignable found more than once!";
462  } else {
463  ali->move( ipos->pos() );
464  ali->rotateInGlobalFrame( ipos->rot() );
465 
466  // Add position error
467  //AlignmentPositionError ape(pnew.x(),pnew.y(),pnew.z());
468  //ali->addAlignmentPositionError(ape);
469  //ali->addAlignmentPositionErrorFromRotation(rnew);
470 
471  found=true;
472  ++nappl;
473  }
474  }
475  }
476  }
477 
478  if ( nappl < shifts.size() )
479  edm::LogError("Mismatch") << "Applied only " << nappl << " new positions"
480  << " out of " << shifts.size();
481 
482  LogDebug("NewPositions") << "Applied new positions for " << nappl << " alignables.";
483 }
484 
485 
486 
487 //__________________________________________________________________________________________________
489 {
491 }
492 
493 
494 
495 //__________________________________________________________________________________________________
497  const Parameters& parvec, int& ierr )
498 {
499  int ipass = 0;
500  int ifail = 0;
501  ierr = 0;
502 
503  // Iterate over alignables
504  for ( align::Alignables::const_iterator iali = alivec.begin(); iali != alivec.end(); ++iali )
505  {
506  // Iterate over Parameters
507  bool found=false;
508  for ( Parameters::const_iterator ipar = parvec.begin(); ipar != parvec.end(); ++ipar)
509  {
510  // Get new alignment parameters
511  AlignmentParameters* ap = *ipar;
512 
513  // Check if parameters belong to alignable
514  if ( ap->alignable() == (*iali) )
515  {
516  if (!found)
517  {
518  (*iali)->setAlignmentParameters(ap);
519  ++ipass;
520  found=true;
521  }
522  else edm::LogError("Alignment") << "@SUB=AlignmentParameterStore::attachAlignmentParameters"
523  << "More than one parameters for Alignable.";
524  }
525  }
526  if (!found) ++ifail;
527  }
528  if (ifail>0) ierr=-1;
529 
530  LogDebug("attachAlignmentParameters") << " Parameters, Alignables: " << parvec.size() << ","
531  << alivec.size() << "\n pass,fail: " << ipass << ","<< ifail;
532 }
533 
534 
535 //__________________________________________________________________________________________________
537  bool overwrite, int& ierr )
538 {
539  attachCorrelations( theAlignables, cormap, overwrite, ierr );
540 }
541 
542 
543 //__________________________________________________________________________________________________
545  const Correlations& cormap,
546  bool overwrite, int& ierr )
547 {
548  ierr=0;
549  int icount=0;
550 
551  // Iterate over correlations
552  for ( Correlations::const_iterator icor = cormap.begin(); icor!=cormap.end(); ++icor )
553  {
554  AlgebraicMatrix mat=(*icor).second;
555  Alignable* ali1 = (*icor).first.first;
556  Alignable* ali2 = (*icor).first.second;
557 
558  // Check if alignables exist
559  if ( find( alivec.begin(), alivec.end(), ali1 ) != alivec.end() &&
560  find( alivec.begin(), alivec.end(), ali2 ) != alivec.end() )
561  {
562  // Check if correlations already existing between these alignables
563  if ( !theCorrelationsStore->correlationsAvailable(ali1,ali2) || (overwrite) )
564  {
565  theCorrelationsStore->setCorrelations(ali1,ali2,mat);
566  ++icount;
567  }
568  else edm::LogInfo("AlreadyExists") << "Correlation existing and not overwritten";
569  }
570  else edm::LogInfo("IgnoreCorrelation") << "Ignoring correlation with no alignables!";
571  }
572 
573  LogDebug( "attachCorrelations" ) << " Alignables,Correlations: " << alivec.size() <<","<< cormap.size()
574  << "\n applied: " << icount ;
575 
576 }
577 
578 
579 //__________________________________________________________________________________________________
582  const std::vector<AlignmentUserVariables*>& uvarvec, int& ierr )
583 {
584  ierr=0;
585 
586  LogDebug("DumpArguments") << "size of alivec: " << alivec.size()
587  << "\nsize of uvarvec: " << uvarvec.size();
588 
589  std::vector<AlignmentUserVariables*>::const_iterator iuvar=uvarvec.begin();
590 
591  for ( align::Alignables::const_iterator iali=alivec.begin(); iali!=alivec.end(); ++iali, ++iuvar )
592  {
593  AlignmentParameters* ap = (*iali)->alignmentParameters();
594  AlignmentUserVariables* uvarnew = (*iuvar);
595  ap->setUserVariables(uvarnew);
596  }
597 }
598 
599 
600 //__________________________________________________________________________________________________
602  double valshift, double valrot )
603 {
604  unsigned int nAlignables = alivec.size();
605 
606  for (unsigned int i = 0; i < nAlignables; ++i)
607  {
608  Alignable* ali = alivec[i];
609 
610  // First reset APE
611  AlignmentPositionError nulApe(0,0,0);
612  ali->setAlignmentPositionError(nulApe, true);
613 
614  // Set APE from displacement
615  AlignmentPositionError ape(valshift,valshift,valshift);
616  if ( valshift > 0. ) ali->addAlignmentPositionError(ape, true);
617  else ali->setAlignmentPositionError(ape, true);
618  // GF: Resetting and setting as above does not really make sense to me,
619  // and adding to zero or setting is the same! I'd just do
620  //ali->setAlignmentPositionError(AlignmentPositionError ape(valshift,valshift,valshift),true);
621 
622  // Set APE from rotation
624  r(1)=valrot; r(2)=valrot; r(3)=valrot;
626  }
627 
628  LogDebug("StoreAPE") << "Store APE from shift: " << valshift
629  << "\nStore APE from rotation: " << valrot;
630 }
631 
632 //__________________________________________________________________________________________________
635  std::vector<std::vector<ParameterId> > &paramIdsVecOut,
636  std::vector<std::vector<double> > &factorsVecOut,
637  bool all, double epsilon) const
638 {
639  // Weak point if all = false:
640  // Ignores constraints between non-subsequent levels in case the parameter is not considered in
641  // the intermediate level, e.g. global z for dets and layers is aligned, but not for rods!
642  if (!ali || !ali->alignmentParameters()) return false;
643 
644  const std::vector<bool> &aliSel= ali->alignmentParameters()->selector();
645  paramIdsVecOut.clear();
646  factorsVecOut.clear();
647 
648  bool firstComp = true;
649  for (align::Alignables::const_iterator iComp = aliComps.begin(), iCompE = aliComps.end();
650  iComp != iCompE; ++iComp) {
651 
652  const ParametersToParametersDerivatives p2pDerivs(**iComp, *ali);
653  if (!p2pDerivs.isOK()) {
654  throw cms::Exception("BadConfig")
655  << "AlignmentParameterStore::hierarchyConstraints"
656  << " Bad match of types of AlignmentParameters classes.\n";
657  return false;
658  }
659  const std::vector<bool> &aliCompSel = (*iComp)->alignmentParameters()->selector();
660  for (unsigned int iParMast = 0, iParMastUsed = 0; iParMast < aliSel.size(); ++iParMast) {
661  if (!all && !aliSel[iParMast]) continue;// no higher level parameter & constraint deselected
662  if (firstComp) { // fill output with empty arrays
663  paramIdsVecOut.push_back(std::vector<ParameterId>());
664  factorsVecOut.push_back(std::vector<double>());
665  }
666  for (unsigned int iParComp = 0; iParComp < aliCompSel.size(); ++iParComp) {
667  if (aliCompSel[iParComp]) {
668  const double factor = p2pDerivs(iParMast, iParComp);
669  if (fabs(factor) > epsilon) {
670  paramIdsVecOut[iParMastUsed].push_back(ParameterId(*iComp, iParComp));
671  factorsVecOut[iParMastUsed].push_back(factor);
672  }
673  }
674  }
675  ++iParMastUsed;
676  }
677  firstComp = false;
678  } // end loop on components
679 
680  return true;
681 }
#define LogDebug(id)
void attachUserVariables(const align::Alignables &alivec, const std::vector< AlignmentUserVariables * > &uvarvec, int &ierr)
Attach User Variables to given alignables.
T getParameter(std::string const &) const
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:180
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
void resetParameters(void)
reset parameters, correlations, user variables
std::map< std::pair< Alignable *, Alignable * >, AlgebraicMatrix > Correlations
virtual RigidBodyAlignmentParameters * clone(const AlgebraicVector &parameters, const AlgebraicSymMatrix &covMatrix) const
Clone all parameters (for update of parameters)
const int numSelected(void) const
Get number of selected parameters.
std::pair< Alignable *, unsigned int > ParameterId
a single alignable parameter of an Alignable
virtual void addAlignmentPositionErrorFromRotation(const RotationType &rotation, bool propagateDown)=0
AlgebraicVector selectedParameters(void) const
Get selected parameters.
void setAlignmentPositionError(const align::Alignables &alivec, double valshift, double valrot)
Set Alignment position error.
align::Alignables validAlignables(void) const
get all alignables with valid parameters
uint32_t ID
Definition: Definitions.h:26
bool isOK() const
Indicate whether able to provide the derivatives.
void attachCorrelations(const align::Alignables &alivec, const Correlations &cormap, bool overwrite, int &ierr)
Attach correlations to given alignables.
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:135
virtual ~AlignmentParameterStore()
destructor
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
void applyParameters(void)
Obsolete: Use AlignableNavigator::alignableDetFromDetId and alignableFromAlignableDet.
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
const std::vector< bool > & selector(void) const
Get alignment parameter selector vector.
mathSSE::Rot3< T > rot
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
virtual void addAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)=0
virtual bool correlationsAvailable(Alignable *ap1, Alignable *ap2) const
Check whether correlations are stored for a given pair of alignables.
void applyAlignableAbsolutePositions(const align::Alignables &alis, const AlignablePositions &newpos, int &ierr)
apply absolute positions to alignables
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
Definition: Alignable.h:57
void updateParameters(const CompositeAlignmentParameters &aap, bool updateCorrelations=true)
update parameters
std::vector< AlignableRelData > AlignableShifts
Definition: AlignableData.h:52
const AlgebraicVector & parameters() const
Get alignment parameters.
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:138
virtual void setCorrelations(Alignable *ap1, Alignable *ap2, const AlgebraicSymMatrix &cov, int row, int col)
align::RotationType toLocal(const align::RotationType &) const
Return in local frame a rotation given in global frame.
std::vector< AlignmentParameters * > Parameters
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
Definition: Alignable.cc:79
CLHEP::HepMatrix AlgebraicMatrix
void rectify(RotationType &)
Correct a rotation matrix for rounding errors.
Definition: Utilities.cc:196
void setValid(bool v)
Set validity flag.
AlignmentParameterStore(const align::Alignables &alis, const edm::ParameterSet &config)
constructor
bool hierarchyConstraints(const Alignable *aliMaster, const align::Alignables &aliComps, std::vector< std::vector< ParameterId > > &paramIdsVecOut, std::vector< std::vector< double > > &factorsVecOut, bool all, double epsilon) const
Components components() const
Get vector of alignable components.
void applyAlignableRelativePositions(const align::Alignables &alivec, const AlignableShifts &shifts, int &ierr)
apply relative shifts to alignables
tuple result
Definition: query.py:137
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
const AlgebraicSymMatrix & covariance() const
Get parameter covariance matrix.
virtual void resetCorrelations(void)
Reset correlations.
(Abstract) Base class for alignment algorithm user variables
EulerAngles toAngles(const RotationType &)
Convert rotation matrix to angles about x-, y-, z-axes (frame rotation).
Definition: Utilities.cc:7
Alignable * alignable(void) const
Get pointer to corresponding alignable.
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)=0
Set the alignment position error - if (!propagateDown) do not affect daughters.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
AlgebraicSymMatrix selectedCovariance(void) const
Get covariance matrix of selected parameters.
CLHEP::HepVector AlgebraicVector
AlgebraicVector EulerAngles
Definition: Definitions.h:36
virtual void correlations(Alignable *ap1, Alignable *ap2, AlgebraicSymMatrix &cov, int row, int col) const
void setUserVariables(AlignmentUserVariables *auv)
Set pointer to user variables.
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
align::Alignables theAlignables
alignables
CompositeAlignmentParameters selectParameters(const std::vector< AlignableDet * > &alignabledets) const
const int size(void) const
Get number of parameters.
std::vector< Alignable * > Alignables
Definition: Utilities.h:28
AlignmentCorrelationsStore * theCorrelationsStore
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:40
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId) const
std::vector< AlignableAbsData > AlignablePositions
Definition: AlignableData.h:51
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
const double epsilon
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
void attachAlignmentParameters(const align::Alignables &alivec, const Parameters &parvec, int &ierr)
Attach alignment parameters to given alignables.
virtual AlignmentParameters * cloneFromSelected(const AlgebraicVector &par, const AlgebraicSymMatrix &cov) const =0
Alignable * alignableFromAlignableDet(AlignableDetOrUnitPtr alignableDet) const
Obsolete: Use AlignableNavigator::alignableDetFromGeomDet and alignableFromAlignableDet.
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:85
virtual void apply()=0
apply parameters to alignable
const align::Alignables & alignables(void) const
get all alignables
std::pair< int, int > typeAndLayer(const Alignable *ali) const
Obtain type and layer from Alignable.
const double par[8 *NPar][4]