#include <MSLayer.h>
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 Range & | range () 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) |
typedef PixelRecoRange<float> MSLayer::Range |
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 | ( | 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), theSeqNum(-1), theX0Data(dataX0) { }
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] |
bool MSLayer::operator< | ( | const MSLayer & | o | ) | const |
Definition at line 76 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 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 |
Definition at line 152 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(), likely, MSLayer::DataX0::slopeSumX0D, mathSSE::sqrt(), sumX0D(), MSLayer::DataX0::sumX0D, theFace, and theX0Data.
Referenced by MultipleScatteringParametrisation::operator()(), and sumX0D().
{ if likely(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 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.; }
friend struct MSLayersKeeper [friend] |
std::ostream& operator<< | ( | std::ostream & | s, |
const MSLayer & | l | ||
) | [friend] |
GeomDetEnumerators::Location MSLayer::theFace [private] |
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().
Range MSLayer::theRange [private] |
Definition at line 68 of file MSLayer.h.
Referenced by crossing(), distance2(), MSLayer(), and range().
int MSLayer::theSeqNum [private] |
DataX0 MSLayer::theX0Data [private] |
Definition at line 72 of file MSLayer.h.
Referenced by MSLayersKeeper::getDataX0(), operator<<(), MSLayersKeeper::setDataX0(), sumX0D(), and x0().