CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Attributes | Friends

MSLayer Class Reference

#include <MSLayer.h>

List of all members.

Classes

struct  DataX0

Public Types

typedef PixelRecoRange< float > Range

Public Member Functions

std::pair< PixelRecoPointRZ, bool > crossing (const PixelRecoLineRZ &line) const dso_hidden
std::pair< PixelRecoPointRZ, bool > crossing (const SimpleLineRZ &line) const dso_hidden
float distance2 (const PixelRecoPointRZ &point) const dso_hidden
const
GeomDetEnumerators::Location
face () const
float halfThickness () const
 MSLayer ()
 MSLayer (GeomDetEnumerators::Location part, float position, Range range, float halfThickness=0., DataX0 dataX0=DataX0(0)) dso_hidden
 MSLayer (const DetLayer *layer, DataX0 dataX0=DataX0(0)) dso_hidden
bool operator< (const MSLayer &o) const dso_hidden
bool operator== (const MSLayer &o) const dso_hidden
float position () const
const Rangerange () const
int seqNum () const
float sumX0D (float cotTheta) const dso_hidden
float x0 (float cotTheta) const dso_hidden

Private Attributes

GeomDetEnumerators::Location theFace
float theHalfThickness
float thePosition
Range theRange
int theSeqNum
DataX0 theX0Data

Friends

struct MSLayersKeeper
std::ostream & operator<< (std::ostream &s, const MSLayer &l)

Detailed Description

Definition at line 14 of file MSLayer.h.


Member Typedef Documentation

Definition at line 16 of file MSLayer.h.


Constructor & Destructor Documentation

MSLayer::MSLayer ( const DetLayer layer,
DataX0  dataX0 = DataX0(0) 
)

Definition at line 33 of file MSLayer.cc.

References Reference_intrackfit_cff::barrel, gather_cfg::cout, Reference_intrackfit_cff::endcap, GeometricSearchDet::position(), ForwardDetLayer::specificSurface(), BarrelDetLayer::specificSurface(), GeometricSearchDet::surface(), BarrelDetLayer::surface(), theFace, theHalfThickness, thePosition, theRange, and PV3DBase< T, PVType, FrameType >::z().

  : theFace(layer->location()), theSeqNum(layer->seqNum()), theX0Data(dataX0)
{
  const BarrelDetLayer* bl; const ForwardDetLayer * fl;
  theHalfThickness = layer->surface().bounds().thickness()/2;  

  switch (theFace) {
  case barrel : 
    bl = static_cast<const BarrelDetLayer* >(layer);
    thePosition = bl->specificSurface().radius();
    theRange = Range(-bl->surface().bounds().length()/2,
                     bl->surface().bounds().length()/2);
    break;
  case endcap : 
    fl = static_cast<const ForwardDetLayer* >(layer);
    thePosition = fl->position().z(); 
    theRange = Range(fl->specificSurface().innerRadius(),
                     fl->specificSurface().outerRadius());
    break;
  default:
    // should throw or simimal
    cout << " ** MSLayer ** unknown part - will not work!" <<endl; 
    break;
  } 
}
MSLayer::MSLayer ( ) [inline]

Definition at line 33 of file MSLayer.h.

{ }
MSLayer::MSLayer ( GeomDetEnumerators::Location  part,
float  position,
Range  range,
float  halfThickness = 0.,
DataX0  dataX0 = DataX0(0) 
)

Definition at line 59 of file MSLayer.cc.


Member Function Documentation

pair< PixelRecoPointRZ, bool > MSLayer::crossing ( const PixelRecoLineRZ line) const

Definition at line 90 of file MSLayer.cc.

References Reference_intrackfit_cff::barrel, PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), PixelRecoLineRZ::rAtZ(), swap(), theFace, thePosition, theRange, relativeConstraints::value, z, and PixelRecoLineRZ::zAtR().

Referenced by MultipleScatteringParametrisation::operator()().

                                                                                 { 
  const float eps = 1.e-5;
  bool  inLayer = true;
  float value = (theFace==barrel) ? line.zAtR(thePosition) : line.rAtZ(thePosition);
  if (value > theRange.max()) { 
    value = theRange.max()-eps;
    inLayer = false;
  } else if (value < theRange.min() ) { 
    value = theRange.min()+eps;
    inLayer = false;
  }
  float z = thePosition;
  if (theFace==barrel) std::swap(z,value); // if barrel value is z
  return make_pair( PixelRecoPointRZ( value, z), inLayer);
}
pair< PixelRecoPointRZ, bool > MSLayer::crossing ( const SimpleLineRZ line) const

Definition at line 105 of file MSLayer.cc.

References Reference_intrackfit_cff::barrel, PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), SimpleLineRZ::rAtZ(), swap(), theFace, thePosition, theRange, relativeConstraints::value, z, and SimpleLineRZ::zAtR().

                                                                              { 
  const float eps = 1.e-5;
  bool  inLayer = true;
  float value = (theFace==barrel) ? line.zAtR(thePosition) : line.rAtZ(thePosition);
  if (value > theRange.max()) { 
    value = theRange.max()-eps;
    inLayer = false;
  } else if (value < theRange.min() ) { 
    value = theRange.min()+eps;
    inLayer = false;
  }
  float z = thePosition;
  if (theFace==barrel) std::swap(z,value); // if barrel value is z
  return make_pair( PixelRecoPointRZ( value, z), inLayer);
}
float MSLayer::distance2 ( const PixelRecoPointRZ point) const

Definition at line 122 of file MSLayer.cc.

References abs, Reference_intrackfit_cff::barrel, PixelRecoRange< T >::inside(), PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), PixelRecoPointRZ::r(), funct::sqr(), theFace, theHalfThickness, thePosition, theRange, findQualityFiles::v, and PixelRecoPointRZ::z().

{
  float u = (theFace==barrel) ? point.r() : point.z();
  float v = (theFace==barrel) ? point.z() : point.r();
 
  float  du = std::abs(u-thePosition);
  if (theRange.inside(v))  return (du < theHalfThickness) ? 0.f : du*du;

  float dv = (v > theRange.max()) ?
            v-theRange.max() : theRange.min() - v;
  return sqr(du)+sqr(dv);
}
const GeomDetEnumerators::Location& MSLayer::face ( ) const [inline]

Definition at line 47 of file MSLayer.h.

References theFace.

Referenced by operator<<().

{ return theFace; }
float MSLayer::halfThickness ( ) const [inline]

Definition at line 49 of file MSLayer.h.

References theHalfThickness.

{ return theHalfThickness; }
bool MSLayer::operator< ( const MSLayer o) const
bool MSLayer::operator== ( const MSLayer o) const

Definition at line 71 of file MSLayer.cc.

References abs, f, theFace, and thePosition.

{
  return  theFace == o.theFace && std::abs(thePosition-o.thePosition) < 1.e-3f;
}
float MSLayer::position ( ) const [inline]

Definition at line 48 of file MSLayer.h.

References thePosition.

Referenced by operator<<().

{ return thePosition; }
const Range& MSLayer::range ( ) const [inline]

Definition at line 45 of file MSLayer.h.

References theRange.

Referenced by operator<(), and operator<<().

{ return theRange; }
int MSLayer::seqNum ( ) const [inline]

Definition at line 41 of file MSLayer.h.

References theSeqNum.

Referenced by MultipleScatteringParametrisation::operator()().

{ return theSeqNum;}
float MSLayer::sumX0D ( float  cotTheta) const
float MSLayer::x0 ( float  cotTheta) const

Definition at line 137 of file MSLayer.cc.

References abs, MSLayer::DataX0::allLayers, Reference_intrackfit_cff::barrel, f, MSLayersAtAngle::findLayer(), MSLayer::DataX0::hasX0, MSLayersKeeper::layers(), likely, mathSSE::sqrt(), theFace, theX0Data, x0(), and MSLayer::DataX0::x0.

Referenced by MultipleScatteringParametrisation::operator()(), and x0().

{
  if likely(theX0Data.hasX0) {
    float OverSinTheta = std::sqrt(1.f+cotTheta*cotTheta);
    return (theFace==barrel) ? theX0Data.x0*OverSinTheta :
                               theX0Data.x0*OverSinTheta/std::abs(cotTheta);
  } else if (theX0Data.allLayers) {
    const MSLayer * dataLayer =
       theX0Data.allLayers->layers(cotTheta).findLayer(*this);
    if (dataLayer) return  dataLayer->x0(cotTheta);
  } 
  return 0.;
}

Friends And Related Function Documentation

friend struct MSLayersKeeper [friend]

Definition at line 74 of file MSLayer.h.

std::ostream& operator<< ( std::ostream &  s,
const MSLayer l 
) [friend]

Member Data Documentation

Definition at line 66 of file MSLayer.h.

Referenced by crossing(), distance2(), face(), MSLayer(), operator<(), operator==(), sumX0D(), and x0().

float MSLayer::theHalfThickness [private]

Definition at line 69 of file MSLayer.h.

Referenced by distance2(), halfThickness(), and MSLayer().

float MSLayer::thePosition [private]

Definition at line 67 of file MSLayer.h.

Referenced by crossing(), distance2(), MSLayer(), operator<(), operator==(), and position().

Definition at line 68 of file MSLayer.h.

Referenced by crossing(), distance2(), MSLayer(), and range().

int MSLayer::theSeqNum [private]

Definition at line 70 of file MSLayer.h.

Referenced by seqNum().