#include <MSLayer.h>
Classes | |
struct | DataX0 |
Public Types | |
typedef PixelRecoRange< float > | Range |
Public Member Functions | |
std::pair< PixelRecoPointRZ, bool > | crossing (const PixelRecoLineRZ &line) const |
float | distance (const PixelRecoPointRZ &point) const |
const GeomDetEnumerators::Location & | face () const |
float | halfThickness () const |
MSLayer (const DetLayer *layer, DataX0 dataX0=DataX0(0)) | |
MSLayer () | |
MSLayer (GeomDetEnumerators::Location part, float position, Range range, float halfThickness=0., DataX0 dataX0=DataX0(0)) | |
bool | operator< (const MSLayer &o) const |
bool | operator== (const MSLayer &o) const |
float | position () const |
const Range & | range () const |
float | sumX0D (float cotTheta) const |
float | x0 (float cotTheta) const |
Private Attributes | |
GeomDetEnumerators::Location | theFace |
float | theHalfThickness |
float | thePosition |
Range | theRange |
DataX0 | theX0Data |
Friends | |
struct | MSLayersKeeper |
std::ostream & | operator<< (std::ostream &s, const MSLayer &l) |
typedef PixelRecoRange<float> MSLayer::Range |
Definition at line 33 of file MSLayer.cc.
References Reference_intrackfit_cff::barrel, BoundSurface::bounds(), gather_cfg::cout, Reference_intrackfit_cff::endcap, BoundDisk::innerRadius(), Bounds::length(), BoundDisk::outerRadius(), GeometricSearchDet::position(), Cylinder::radius(), ForwardDetLayer::specificSurface(), BarrelDetLayer::specificSurface(), GeometricSearchDet::surface(), BarrelDetLayer::surface(), theFace, theHalfThickness, thePosition, theRange, Bounds::thickness(), and PV3DBase< T, PVType, FrameType >::z().
: theFace(layer->location()), 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 | ( | GeomDetEnumerators::Location | part, |
float | position, | ||
Range | range, | ||
float | halfThickness = 0. , |
||
DataX0 | dataX0 = DataX0(0) |
||
) |
Definition at line 59 of file MSLayer.cc.
: theFace(part), thePosition(position), theRange(range), theHalfThickness(halfThickness), theX0Data(dataX0) { }
pair< PixelRecoPointRZ, bool > MSLayer::crossing | ( | const PixelRecoLineRZ & | line | ) | const |
Definition at line 76 of file MSLayer.cc.
References Reference_intrackfit_cff::barrel, PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), PixelRecoLineRZ::rAtZ(), theFace, thePosition, theRange, relativeConstraints::value, and PixelRecoLineRZ::zAtR().
{ const float eps = 1.e-5; bool inLayer = true; if (theFace==barrel) { float value = line.zAtR(thePosition); if (value > theRange.max()) { value = theRange.max()-eps; inLayer = false; } else if (value < theRange.min() ) { value = theRange.min()+eps; inLayer = false; } return make_pair( PixelRecoPointRZ(thePosition, value), inLayer) ; } else { float value = line.rAtZ(thePosition); if (value > theRange.max()) { value = theRange.max()-eps; inLayer = false; } else if (value < theRange.min() ) { value = theRange.min()+eps; inLayer = false; } return make_pair( PixelRecoPointRZ( value, thePosition), inLayer); } }
float MSLayer::distance | ( | const PixelRecoPointRZ & | point | ) | const |
Definition at line 107 of file MSLayer.cc.
References abs, Reference_intrackfit_cff::barrel, Reference_intrackfit_cff::endcap, PixelRecoRange< T >::inside(), GeomDetEnumerators::invalidLoc, PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), PixelRecoPointRZ::r(), funct::sqr(), mathSSE::sqrt(), theFace, theHalfThickness, thePosition, theRange, and PixelRecoPointRZ::z().
{ float dr = 0; float dz = 0; switch(theFace) { case barrel: dr = std::abs(point.r()-thePosition); if (theRange.inside(point.z())) { return (dr < theHalfThickness) ? 0.f : dr; } else { dz = point.z() > theRange.max() ? point.z()-theRange.max() : theRange.min() - point.z(); } break; case endcap: dz = std::abs(point.z()-thePosition); if (theRange.inside(point.r())) { return (dz < theHalfThickness) ? 0. : dz; } else { dr = point.r() > theRange.max() ? point.r()-theRange.max() : theRange.min()-point.r(); } break; case invalidLoc: break; // make gcc happy } return std::sqrt(sqr(dr)+sqr(dz)); }
const GeomDetEnumerators::Location& MSLayer::face | ( | ) | const [inline] |
Definition at line 39 of file MSLayer.h.
References theFace.
Referenced by operator<<().
{ return theFace; }
float MSLayer::halfThickness | ( | ) | const [inline] |
bool MSLayer::operator< | ( | const MSLayer & | o | ) | const |
Definition at line 138 of file MSLayer.cc.
References abs, Reference_intrackfit_cff::barrel, Reference_intrackfit_cff::endcap, PixelRecoRange< T >::max(), range(), theFace, and thePosition.
{ if (theFace==barrel && o.theFace==barrel) return thePosition < o.thePosition; else if (theFace==barrel && o.theFace==endcap) return thePosition < o.range().max(); else if (theFace==endcap && o.theFace==endcap ) return std::abs(thePosition) < std::abs(o.thePosition); else return range().max() < o.thePosition; }
bool MSLayer::operator== | ( | const MSLayer & | o | ) | const |
Definition at line 70 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 40 of file MSLayer.h.
References thePosition.
Referenced by operator<<().
{ return thePosition; }
const Range& MSLayer::range | ( | ) | const [inline] |
Definition at line 37 of file MSLayer.h.
References theRange.
Referenced by operator<(), and operator<<().
{ return theRange; }
float MSLayer::sumX0D | ( | float | cotTheta | ) | const |
Definition at line 169 of file MSLayer.cc.
References MSLayer::DataX0::allLayers, Reference_intrackfit_cff::barrel, MSLayer::DataX0::cotTheta, Reference_intrackfit_cff::endcap, f, MSLayersAtAngle::findLayer(), MSLayer::DataX0::hasFSlope, MSLayer::DataX0::hasX0, GeomDetEnumerators::invalidLoc, MSLayersKeeper::layers(), MSLayer::DataX0::slopeSumX0D, mathSSE::sqrt(), sumX0D(), MSLayer::DataX0::sumX0D, theFace, and theX0Data.
Referenced by MSLayersKeeperX0Averaged::init(), and sumX0D().
{ if (theX0Data.hasX0) { switch(theFace) { case barrel: return theX0Data.sumX0D *std::sqrt( std::sqrt( (1.f+cotTheta*cotTheta) / (1.f+theX0Data.cotTheta*theX0Data.cotTheta) ) ); case endcap: return (theX0Data.hasFSlope) ? theX0Data.sumX0D + theX0Data.slopeSumX0D * (1.f/cotTheta-1.f/theX0Data.cotTheta) : theX0Data.sumX0D; case invalidLoc: break;// make gcc happy } } else if (theX0Data.allLayers) { const MSLayer* dataLayer = theX0Data.allLayers->layers(cotTheta).findLayer(*this); if (dataLayer) return dataLayer->sumX0D(cotTheta); } return 0.; }
float MSLayer::x0 | ( | float | cotTheta | ) | const |
Definition at line 151 of file MSLayer.cc.
References abs, MSLayer::DataX0::allLayers, Reference_intrackfit_cff::barrel, Reference_intrackfit_cff::endcap, f, MSLayersAtAngle::findLayer(), MSLayer::DataX0::hasX0, GeomDetEnumerators::invalidLoc, MSLayersKeeper::layers(), mathSSE::sqrt(), theFace, theX0Data, x0(), and MSLayer::DataX0::x0.
Referenced by MSLayersKeeperX0Averaged::init(), and x0().
{ if (theX0Data.hasX0) { float OverSinTheta = std::sqrt(1.f+cotTheta*cotTheta); switch(theFace) { case barrel: return theX0Data.x0*OverSinTheta; case endcap: return theX0Data.x0*std::abs(OverSinTheta/cotTheta); case invalidLoc: return 0.;// make gcc happy } } else if (theX0Data.allLayers) { const MSLayer * dataLayer = theX0Data.allLayers->layers(cotTheta).findLayer(*this); if (dataLayer) return dataLayer->x0(cotTheta); } return 0.; }
friend struct MSLayersKeeper [friend] |
std::ostream& operator<< | ( | std::ostream & | s, |
const MSLayer & | l | ||
) | [friend] |
GeomDetEnumerators::Location MSLayer::theFace [private] |
Definition at line 54 of file MSLayer.h.
Referenced by crossing(), distance(), face(), MSLayer(), operator<(), operator==(), sumX0D(), and x0().
float MSLayer::theHalfThickness [private] |
Definition at line 57 of file MSLayer.h.
Referenced by distance(), halfThickness(), and MSLayer().
float MSLayer::thePosition [private] |
Definition at line 55 of file MSLayer.h.
Referenced by crossing(), distance(), MSLayer(), operator<(), operator==(), and position().
Range MSLayer::theRange [private] |
Definition at line 56 of file MSLayer.h.
Referenced by crossing(), distance(), MSLayer(), and range().
DataX0 MSLayer::theX0Data [private] |
Definition at line 58 of file MSLayer.h.
Referenced by MSLayersKeeper::getDataX0(), operator<<(), MSLayersKeeper::setDataX0(), sumX0D(), and x0().