CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/RecoTracker/TkMSParametrization/interface/MSLayer.h

Go to the documentation of this file.
00001 #ifndef MSLayer_H
00002 #define MSLayer_H
00003 #include "TrackingTools/DetLayers/interface/DetLayer.h"
00004 #include "RecoTracker/TkMSParametrization/interface/PixelRecoPointRZ.h"
00005 #include "RecoTracker/TkMSParametrization/interface/PixelRecoLineRZ.h"
00006 #include "RecoTracker/TkMSParametrization/interface/PixelRecoRange.h"
00007 #include <iosfwd>
00008 
00009 class DetLayer;
00010 class MSLayersKeeper;
00011 
00012 class MSLayer {
00013 public:
00014   typedef PixelRecoRange<float> Range;
00015 
00016   struct DataX0 { 
00017     DataX0(const MSLayersKeeper *al = 0) 
00018       : hasX0(false), allLayers(al) { }
00019     DataX0(float ax0, float asX0D, float aCotTheta) 
00020       : hasX0(true), hasFSlope(false), x0(ax0), sumX0D(asX0D), 
00021         cotTheta(aCotTheta), allLayers(0) { }
00022     void setForwardSumX0DSlope(float aSlope) 
00023         { hasFSlope= true; slopeSumX0D = aSlope; }
00024     bool hasX0, hasFSlope;
00025     float x0, sumX0D, cotTheta, slopeSumX0D;
00026     const MSLayersKeeper *allLayers; 
00027   };
00028 
00029 public:
00030   MSLayer(const DetLayer* layer, DataX0 dataX0 = DataX0(0) );
00031   MSLayer() { }
00032 
00033   MSLayer(GeomDetEnumerators::Location part, float position, Range range, 
00034            float halfThickness = 0., 
00035            DataX0 dataX0 = DataX0(0) );
00036 
00037   const Range & range() const  { return theRange; }
00038  
00039   const GeomDetEnumerators::Location & face() const  { return theFace; }
00040   float position() const { return thePosition; }
00041   float halfThickness() const { return theHalfThickness; }
00042 
00043   float x0(float cotTheta) const;
00044   float sumX0D(float cotTheta) const; 
00045 
00046   bool operator== (const MSLayer &o) const;
00047   bool operator<  (const MSLayer &o) const;
00048   std::pair<PixelRecoPointRZ,bool> crossing(const PixelRecoLineRZ &line) const;
00049   float distance(const PixelRecoPointRZ & point) const;
00050 
00051 private:
00052 
00053   GeomDetEnumerators::Location theFace;
00054   float thePosition;
00055   Range theRange;
00056   float theHalfThickness;
00057   DataX0 theX0Data;
00058 
00059   friend struct MSLayersKeeper;
00060   friend std::ostream& operator<<( std::ostream& s, const MSLayer & l);
00061 
00062 };
00063 
00064 std::ostream& operator<<( std::ostream& s, const MSLayer & l);
00065 std::ostream& operator<<( std::ostream& s, const MSLayer::DataX0 & d);
00066 #endif