Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:06

0001 #ifndef Alignment_CommonAlignment_SurveyResidual_h
0002 #define Alignment_CommonAlignment_SurveyResidual_h
0003 
0004 /** \class SurveyResidual
0005  *
0006  *  Class to find the residuals for survey constraint alignment.
0007  *
0008  *  For more info, please refer to
0009  *    http://www.pha.jhu.edu/~gritsan/cms/cms-note-survey.pdf
0010  *
0011  *  $Date: 2007/11/09 07:45:04 $
0012  *  $Revision: 1.6 $
0013  *  \author Chung Khim Lae
0014  */
0015 
0016 #include "Alignment/CommonAlignment/interface/StructureType.h"
0017 #include "Alignment/CommonAlignment/interface/Utilities.h"
0018 
0019 class Alignable;
0020 class AlignableSurface;
0021 
0022 class SurveyResidual {
0023 public:
0024   /// Constructor from an alignable whose residuals are to be found.
0025   /// The type of residuals (panel, disc etc.) is given by StructureType.
0026   /// Set bias to true for biased residuals.
0027   /// Default is to find unbiased residuals.
0028   SurveyResidual(const Alignable&,
0029                  align::StructureType,  // level at which residuals are found
0030                  bool bias = false      // true for biased residuals
0031   );
0032 
0033   /// Check if survey residual is valid (theMother != 0).
0034   /// This check must be done before calling the other methods so that
0035   /// calculations can be performed correctly.
0036   inline bool valid() const;
0037 
0038   /// Find residual for the alignable in local frame.
0039   /// Returns a vector based on the alignable's dof.
0040   AlgebraicVector sensorResidual() const;
0041 
0042   /// Find residuals in local frame for points on the alignable
0043   /// (current - nominal vectors).
0044   align::LocalVectors pointsResidual() const;
0045 
0046   /// Get inverse of survey covariance wrt given structure type in constructor.
0047   AlgebraicSymMatrix inverseCovariance() const;
0048 
0049 private:
0050   /// Find the terminal sisters of an alignable.
0051   /// bias = true to include itself in the list.
0052   void findSisters(const Alignable*, bool bias);
0053 
0054   /// Find the nominal and current vectors.
0055   void calculate(const Alignable&);
0056 
0057   // Cache some values for calculation
0058 
0059   const Alignable* theMother;  // mother that matches the structure type
0060                                // given in constructor
0061 
0062   const AlignableSurface& theSurface;  // current surface
0063 
0064   const std::vector<bool>& theSelector;  // flags for selected parameters
0065 
0066   std::vector<const Alignable*> theSisters;  // list of final daughters for
0067                                              // finding mother's position
0068 
0069   align::GlobalVectors theNominalVs;  // nominal points from mother's pos
0070   align::GlobalVectors theCurrentVs;  // current points rotated to nominal surf
0071 
0072   align::ErrorMatrix theCovariance;
0073 };
0074 
0075 bool SurveyResidual::valid() const { return theMother != nullptr; }
0076 
0077 #endif