CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

BowedSurfaceDeformation Class Reference

#include <BowedSurfaceDeformation.h>

Inheritance diagram for BowedSurfaceDeformation:
SurfaceDeformation

List of all members.

Public Member Functions

virtual bool add (const SurfaceDeformation &other)
 BowedSurfaceDeformation (const std::vector< double > &parameters)
 BowedSurfaceDeformation (double sagittaX, double sagittaXY, double sagittaY)
 constructor from sagittae, i.e. coefficients of Legendre polynomials
virtual BowedSurfaceDeformationclone () const
virtual std::vector< double > parameters () const
 parameters, i.e. sagittae as given in the constructor
virtual Local2DVector positionCorrection (const Local2DPoint &localPos, const LocalTrackAngles &localAngles, double length, double width) const
virtual int type () const
 specific type, i.e. SurfaceDeformationFactory::kBowedSurface

Static Public Member Functions

static unsigned int maxParameterSize ()
 maximum size of vector that is accepted by constructor from vector
static unsigned int minParameterSize ()
 minimum size of vector that is accepted by constructor from vector

Private Attributes

double theSagittaX
double theSagittaXY
double theSagittaY

Detailed Description

BowedSurfaceAlignmentParameters

Class to apply corrections to local positions resulting from a non-planar surface. The bows are parametrised using Legendre polynomials up to second order, excluding 0th and 1st order that are already treated by local w shift and rotations around local u and v axes.

Author:
: Gero Flucke date : October 2010
Revision:
1.2
Date:
2010/11/17 15:55:08

(last update by

Author:
flucke

)

Definition at line 23 of file BowedSurfaceDeformation.h.


Constructor & Destructor Documentation

BowedSurfaceDeformation::BowedSurfaceDeformation ( double  sagittaX,
double  sagittaXY,
double  sagittaY 
) [inline]

constructor from sagittae, i.e. coefficients of Legendre polynomials

Definition at line 27 of file BowedSurfaceDeformation.h.

Referenced by clone().

                                                                              :
    theSagittaX(sagittaX), theSagittaXY(sagittaXY), theSagittaY(sagittaY) {  }
BowedSurfaceDeformation::BowedSurfaceDeformation ( const std::vector< double > &  pars)

constructor from vector of sagittae, parameters.size() must be between minParameterSize() and maxParameterSize()

Author:
: Gero Flucke date : October 2010
Revision:
1.2
Date:
2010/11/17 15:55:09

(last update by

Author:
flucke

)

Definition at line 16 of file BowedSurfaceDeformation.cc.

References minParameterSize().

  : theSagittaX (pars.size() > 0 ? pars[0] : 0.),
    theSagittaXY(pars.size() > 1 ? pars[1] : 0.),
    theSagittaY (pars.size() > 2 ? pars[2] : 0.)
{
  if (pars.size() != minParameterSize()) {
    edm::LogError("BadSetup") << "@SUB=BowedSurfaceDeformation"
                              << "Input vector of wrong size " << pars.size()
                              << " instead of " << minParameterSize() << ", filled up with zeros!";
  }
}

Member Function Documentation

bool BowedSurfaceDeformation::add ( const SurfaceDeformation other) [virtual]

update information with parameters of 'other', false in case the type or some parameters do not match and thus the information cannot be used (then no changes are done), true if merge was successful

Implements SurfaceDeformation.

Definition at line 78 of file BowedSurfaceDeformation.cc.

References SurfaceDeformation::parameters(), theSagittaX, theSagittaXY, theSagittaY, SurfaceDeformation::type(), and type().

{
  if (other.type() == this->type()) {
    const std::vector<double> otherParams(other.parameters());
    if (otherParams.size() == 3) { // double check!
      theSagittaX  += otherParams[0]; // bows can simply be added up
      theSagittaXY += otherParams[1];
      theSagittaY  += otherParams[2];

      return true;
    }
  }

  return false;
}
BowedSurfaceDeformation * BowedSurfaceDeformation::clone ( void  ) const [virtual]
static unsigned int BowedSurfaceDeformation::maxParameterSize ( ) [inline, static]

maximum size of vector that is accepted by constructor from vector

Definition at line 60 of file BowedSurfaceDeformation.h.

Referenced by SurfaceDeformationFactory::create().

{ return 3;}
static unsigned int BowedSurfaceDeformation::minParameterSize ( ) [inline, static]

minimum size of vector that is accepted by constructor from vector

Definition at line 58 of file BowedSurfaceDeformation.h.

Referenced by BowedSurfaceDeformation(), and SurfaceDeformationFactory::create().

{ return 3;}
std::vector< double > BowedSurfaceDeformation::parameters ( void  ) const [virtual]

parameters, i.e. sagittae as given in the constructor

Implements SurfaceDeformation.

Definition at line 95 of file BowedSurfaceDeformation.cc.

References query::result, theSagittaX, theSagittaXY, and theSagittaY.

{
  std::vector<double> result(3);
  result[0] = theSagittaX;
  result[1] = theSagittaXY;
  result[2] = theSagittaY;

  return result;
}
SurfaceDeformation::Local2DVector BowedSurfaceDeformation::positionCorrection ( const Local2DPoint localPos,
const LocalTrackAngles localAngles,
double  length,
double  width 
) const [virtual]

correction to add to local position depending on

  • track parameters in local frame (from LocalTrajectoryParameters): track position as Local2DPoint(x,y) track angles as LocalTrackAngles(dxdz, dydz)
  • length of surface (local y-coordinate)
  • width of surface (local x-coordinate)

Implements SurfaceDeformation.

Definition at line 42 of file BowedSurfaceDeformation.cc.

References Topology::LocalTrackAngles::dxdz(), Topology::LocalTrackAngles::dydz(), theSagittaX, theSagittaXY, theSagittaY, PV2DBase< T, PVType, FrameType >::x(), x, PV2DBase< T, PVType, FrameType >::y(), and detailsBasic3DVector::y.

{

// different widthes at high/low y could somehow be treated by theRelWidthLowY
//   if (widthLowY > 0. && widthHighY != widthLowY) {
//     // TEC would always create a warning...
//     edm::LogWarning("UnusableData") << "@SUB=BowedSurfaceDeformation::positionCorrection"
//                                  << "Cannot yet deal with different widthes, take "
//                                  << widthHighY << " not " << widthLowY;
//   }
//   const double width = widthHighY;
  
  double uRel = (width  ? 2. * localPos.x() / width  : 0.);  // relative u (-1 .. +1)
  double vRel = (length ? 2. * localPos.y() / length : 0.);  // relative v (-1 .. +1)
  // 'range check':
  const double cutOff = 1.5;
  if (uRel < -cutOff) { uRel = -cutOff; } else if (uRel > cutOff) { uRel = cutOff; }
  if (vRel < -cutOff) { vRel = -cutOff; } else if (vRel > cutOff) { vRel = cutOff; }
  
  // apply coefficients to Legendre polynomials
  // to get local height relative to 'average'
  const double dw 
    = (uRel * uRel - 1./3.) * theSagittaX
    +  uRel * vRel          * theSagittaXY
    + (vRel * vRel - 1./3.) * theSagittaY;

  // positive dxdz/dydz and positive dw mean negative shift in x/y: 
  const Local2DVector::ScalarType x = -dw * localAngles.dxdz();
  const Local2DVector::ScalarType y = -dw * localAngles.dydz();
  
  return Local2DVector(x, y);
}
int BowedSurfaceDeformation::type ( ) const [virtual]

Member Data Documentation

Definition at line 63 of file BowedSurfaceDeformation.h.

Referenced by add(), clone(), parameters(), and positionCorrection().

Definition at line 64 of file BowedSurfaceDeformation.h.

Referenced by add(), clone(), parameters(), and positionCorrection().

Definition at line 65 of file BowedSurfaceDeformation.h.

Referenced by add(), clone(), parameters(), and positionCorrection().