CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

TwoBowedSurfacesDeformation Class Reference

#include <TwoBowedSurfacesDeformation.h>

Inheritance diagram for TwoBowedSurfacesDeformation:
SurfaceDeformation

List of all members.

Public Member Functions

virtual bool add (const SurfaceDeformation &other)
virtual
TwoBowedSurfacesDeformation
clone () const
virtual std::vector< double > parameters () const
 parameters - see constructor for meaning
virtual Local2DVector positionCorrection (const Local2DPoint &localPos, const LocalTrackAngles &localAngles, double length, double width) const
 TwoBowedSurfacesDeformation (const std::vector< double > &parameters)
virtual int type () const
 specific type, i.e. SurfaceDeformationFactory::kTwoBowedSurfaces

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

std::vector< double > theParameters

Detailed Description

TwoBowedSurfacesAlignmentParameters

Class to apply corrections to local positions resulting from two surfaces chained in local y. Possible 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. In addition store relative shifts and rotations of the two surfaces.

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

(last update by

Author:
flucke

)

Definition at line 25 of file TwoBowedSurfacesDeformation.h.


Constructor & Destructor Documentation

TwoBowedSurfacesDeformation::TwoBowedSurfacesDeformation ( const std::vector< double > &  pars)

Constructor from vector of parameters, its size() must be between minParameterSize() and maxParameterSize(). The parameters are (in that order)

  • mean sagittaX of both surfaces
  • mean sagittaXY
  • mean sagittaY
  • 'delta' u of both surfaces (shift surface at lower/higher y by +u/-u)
  • 'delta' v of both surfaces
  • 'delta' w of both surfaces
  • 'delta' alpha of both surfaces (rotate around local x)
  • 'delta' beta
  • 'delta' gamma
  • 'delta' sagittaX of both surfaces (add/subtract for surfaces at lower/higher y)
  • 'delta' sagittaXY
  • 'delta' sagittaY
  • ySplit: y-value where surfaces are split
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 TwoBowedSurfacesDeformation.cc.

References minParameterSize(), and theParameters.

Referenced by clone().

  : theParameters(pars)
{
  if (pars.size() != minParameterSize()) {
    edm::LogError("BadSetup") << "@SUB=TwoBowedSurfacesDeformation"
                              << "Input vector of wrong size " << pars.size()
                              << " instead of " << minParameterSize() << ", add zeros to fill up!";
  }
  while (theParameters.size() < minParameterSize()) theParameters.push_back(0.);
}

Member Function Documentation

bool TwoBowedSurfacesDeformation::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 98 of file TwoBowedSurfacesDeformation.cc.

References i, LogDebug, SurfaceDeformation::parameters(), theParameters, SurfaceDeformation::type(), and type().

{
  if (this->type() == other.type()) {
    const std::vector<double> otherParameters(other.parameters());
    if (otherParameters.size() == theParameters.size()) {
      if (theParameters.back() == otherParameters.back()) {
        for (unsigned int i = 0; i < theParameters.size() - 1; ++i) {// -1 for ySplit
          // mean bows, delta shifts, delta angles and delta bows can simply be added up
          theParameters[i] += otherParameters[i];
        }
        return true;
      } else { // ySplit values are different!
        LogDebug("Alignment") << "@SUB=TwoBowedSurfacesDeformation::add"
                              << "Different ySplit: this " << theParameters.back() 
                              << ", to add " << otherParameters.back();
      }
    } // same size
  } // same type

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

maximum size of vector that is accepted by constructor from vector

Definition at line 73 of file TwoBowedSurfacesDeformation.h.

Referenced by SurfaceDeformationFactory::create().

{ return 13;}
static unsigned int TwoBowedSurfacesDeformation::minParameterSize ( ) [inline, static]

minimum size of vector that is accepted by constructor from vector

Definition at line 71 of file TwoBowedSurfacesDeformation.h.

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

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

parameters - see constructor for meaning

Implements SurfaceDeformation.

Definition at line 121 of file TwoBowedSurfacesDeformation.cc.

References theParameters.

Referenced by positionCorrection().

{
  return theParameters;
}
SurfaceDeformation::Local2DVector TwoBowedSurfacesDeformation::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 41 of file TwoBowedSurfacesDeformation.cc.

References Topology::LocalTrackAngles::dxdz(), Topology::LocalTrackAngles::dydz(), parameters(), tablePrinter::width, PV2DBase< T, PVType, FrameType >::x(), x, PV2DBase< T, PVType, FrameType >::y(), and detailsBasic3DVector::y.

{
  const double ySplit = this->parameters().back();

// treatment of different widthes at high/low y could be done by theRelWidthLowY or so
//   if (widthLowY > 0. && widthHighY != widthLowY) {
//     std::cout << "SurfaceDeformation::positionCorrection2Bowed: Cannot yet deal "
//            << " with different widthes, take " << widthHighY << " not " << widthLowY
//            << std::endl;
//   }
//   const double width = widthHighY;
  
  // Some signs depend on whether we are in surface part below or above ySplit:
  const double sign = (localPos.y() < ySplit ? +1. : -1.); 
  const double yMiddle = ySplit * 0.5 - sign * length * .25;
  // 'calibrate' y length and transform y to be w.r.t. surface middle
  const double myY = localPos.y() - yMiddle;
  const double myLength = length * 0.5 + sign * ySplit;
  
  double uRel = 2. * localPos.x() / width;  // relative u (-1 .. +1)
  double vRel = 2. * myY / myLength;        // 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; }
  
  const std::vector<double> &pars = this->parameters();
  // 1st, get dw effect depending 
  // - on the surface sagittas (Legendre polynomials),
  //   see BowedSurfaceAlignmentDerivatives::operator()(..)
  // - relative dw
  // - surface specific dalpha (note that this shifts surface specific dw)
  // - surface specific dbeta
  const double dw 
    = (uRel * uRel - 1./3.) * (pars[0] + sign * pars[9])  // sagittaX
    +  uRel * vRel          * (pars[1] + sign * pars[10]) // sagittaXY
    + (vRel * vRel - 1./3.) * (pars[2] + sign * pars[11]) // sagittaY
    + sign * pars[5]                 // different dw
    + myY          * sign * pars[6]  // different dalpha
    - localPos.x() * sign * pars[7]; // different dbeta
  // 2nd, translate the dw effect to shifts in x and y
  // Positive dxdz/dydz and positive dw mean negative shift in x/y: 
  Local2DVector::ScalarType x = -dw * localAngles.dxdz();
  Local2DVector::ScalarType y = -dw * localAngles.dydz();
  // 3rd, treat in-plane differences depending on surface from xy-shifts... 
  x += (sign * pars[3]); // different du
  y += (sign * pars[4]); // different dv
  //     ...and gamma-rotation
  x -= myY          * (sign * pars[8]); // different dgamma for u
  y += localPos.x() * (sign * pars[8]); // different dgamma for v

  return Local2DVector(x, y);
}
int TwoBowedSurfacesDeformation::type ( ) const [virtual]

Member Data Documentation

std::vector<double> TwoBowedSurfacesDeformation::theParameters [private]

Definition at line 77 of file TwoBowedSurfacesDeformation.h.

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