CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Attributes | Friends
MSLayer Class Reference

#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 Rangerange () 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)
 

Detailed Description

Definition at line 12 of file MSLayer.h.

Member Typedef Documentation

Definition at line 14 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, 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().

34  : theFace(layer->location()), theX0Data(dataX0)
35 {
36  const BarrelDetLayer* bl; const ForwardDetLayer * fl;
37  theHalfThickness = layer->surface().bounds().thickness()/2;
38 
39  switch (theFace) {
40  case barrel :
41  bl = static_cast<const BarrelDetLayer* >(layer);
43  theRange = Range(-bl->surface().bounds().length()/2,
44  bl->surface().bounds().length()/2);
45  break;
46  case endcap :
47  fl = static_cast<const ForwardDetLayer* >(layer);
48  thePosition = fl->position().z();
51  break;
52  default:
53  // should throw or simimal
54  cout << " ** MSLayer ** unknown part - will not work!" <<endl;
55  break;
56  }
57 }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
virtual float length() const =0
virtual Location location() const =0
Which part of the detector (barrel, endcap)
float theHalfThickness
Definition: MSLayer.h:57
Range theRange
Definition: MSLayer.h:56
virtual float thickness() const =0
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:55
T z() const
Definition: PV3DBase.h:63
virtual const BoundDisk & specificSurface() const
DataX0 theX0Data
Definition: MSLayer.h:58
const Bounds & bounds() const
Definition: BoundSurface.h:89
virtual const BoundSurface & surface() const
GeometricSearchDet interface.
virtual const Surface::PositionType & position() const
Returns position of the surface.
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
float thePosition
Definition: MSLayer.h:55
float outerRadius() const
The outer radius of the disk.
Definition: BoundDisk.h:75
float innerRadius() const
The inner radius of the disk.
Definition: BoundDisk.h:72
tuple cout
Definition: gather_cfg.py:121
GeomDetEnumerators::Location theFace
Definition: MSLayer.h:54
PixelRecoRange< float > Range
Definition: MSLayer.h:14
MSLayer::MSLayer ( )
inline

Definition at line 31 of file MSLayer.h.

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

Definition at line 59 of file MSLayer.cc.

61  : theFace(part),
63  theRange(range),
65  theX0Data(dataX0)
66  { }
float theHalfThickness
Definition: MSLayer.h:57
Range theRange
Definition: MSLayer.h:56
const Range & range() const
Definition: MSLayer.h:37
float position() const
Definition: MSLayer.h:40
float halfThickness() const
Definition: MSLayer.h:41
DataX0 theX0Data
Definition: MSLayer.h:58
part
Definition: HCALResponse.h:21
float thePosition
Definition: MSLayer.h:55
GeomDetEnumerators::Location theFace
Definition: MSLayer.h:54

Member Function Documentation

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().

78 {
79  const float eps = 1.e-5;
80  bool inLayer = true;
81  if (theFace==barrel) {
82  float value = line.zAtR(thePosition);
83  if (value > theRange.max()) {
84  value = theRange.max()-eps;
85  inLayer = false;
86  }
87  else if (value < theRange.min() ) {
88  value = theRange.min()+eps;
89  inLayer = false;
90  }
91  return make_pair( PixelRecoPointRZ(thePosition, value), inLayer) ;
92  }
93  else {
94  float value = line.rAtZ(thePosition);
95  if (value > theRange.max()) {
96  value = theRange.max()-eps;
97  inLayer = false;
98  }
99  else if (value < theRange.min() ) {
100  value = theRange.min()+eps;
101  inLayer = false;
102  }
103  return make_pair( PixelRecoPointRZ( value, thePosition), inLayer);
104  }
105 }
T max() const
Range theRange
Definition: MSLayer.h:56
T min() const
float zAtR(float r) const
float thePosition
Definition: MSLayer.h:55
float rAtZ(float z) const
GeomDetEnumerators::Location theFace
Definition: MSLayer.h:54
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().

108 {
109  float dr = 0;
110  float dz = 0;
111  switch(theFace) {
112  case barrel:
113  dr = std::abs(point.r()-thePosition);
114  if (theRange.inside(point.z())) {
115  return (dr < theHalfThickness) ? 0.f : dr;
116  }
117  else {
118  dz = point.z() > theRange.max() ?
119  point.z()-theRange.max() : theRange.min() - point.z();
120  }
121  break;
122  case endcap:
123  dz = std::abs(point.z()-thePosition);
124  if (theRange.inside(point.r())) {
125  return (dz < theHalfThickness) ? 0. : dz;
126  }
127  else {
128  dr = point.r() > theRange.max() ?
129  point.r()-theRange.max() : theRange.min()-point.r();
130  }
131  break;
132  case invalidLoc: break; // make gcc happy
133  }
134  return std::sqrt(sqr(dr)+sqr(dz));
135 }
T max() const
float theHalfThickness
Definition: MSLayer.h:57
Range theRange
Definition: MSLayer.h:56
#define abs(x)
Definition: mlp_lapack.h:159
T min() const
T sqrt(T t)
Definition: SSEVec.h:46
float z() const
bool inside(const T &value) const
float r() const
float thePosition
Definition: MSLayer.h:55
Square< F >::type sqr(const F &f)
Definition: Square.h:13
GeomDetEnumerators::Location theFace
Definition: MSLayer.h:54
const GeomDetEnumerators::Location& MSLayer::face ( ) const
inline

Definition at line 39 of file MSLayer.h.

References theFace.

Referenced by operator<<().

39 { return theFace; }
GeomDetEnumerators::Location theFace
Definition: MSLayer.h:54
float MSLayer::halfThickness ( ) const
inline

Definition at line 41 of file MSLayer.h.

References theHalfThickness.

41 { return theHalfThickness; }
float theHalfThickness
Definition: MSLayer.h:57
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.

139 {
140 
141  if (theFace==barrel && o.theFace==barrel)
142  return thePosition < o.thePosition;
143  else if (theFace==barrel && o.theFace==endcap)
144  return thePosition < o.range().max();
145  else if (theFace==endcap && o.theFace==endcap )
147  else
148  return range().max() < o.thePosition;
149 }
T max() const
#define abs(x)
Definition: mlp_lapack.h:159
const Range & range() const
Definition: MSLayer.h:37
float thePosition
Definition: MSLayer.h:55
GeomDetEnumerators::Location theFace
Definition: MSLayer.h:54
bool MSLayer::operator== ( const MSLayer o) const

Definition at line 70 of file MSLayer.cc.

References abs, f, theFace, and thePosition.

71 {
72  return theFace == o.theFace && std::abs(thePosition-o.thePosition) < 1.e-3f;
73 }
#define abs(x)
Definition: mlp_lapack.h:159
double f[11][100]
float thePosition
Definition: MSLayer.h:55
GeomDetEnumerators::Location theFace
Definition: MSLayer.h:54
float MSLayer::position ( ) const
inline

Definition at line 40 of file MSLayer.h.

References thePosition.

Referenced by operator<<().

40 { return thePosition; }
float thePosition
Definition: MSLayer.h:55
const Range& MSLayer::range ( ) const
inline

Definition at line 37 of file MSLayer.h.

References theRange.

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

37 { return theRange; }
Range theRange
Definition: MSLayer.h:56
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(), MSLayer::DataX0::sumX0D, sumX0D(), theFace, and theX0Data.

Referenced by MSLayersKeeperX0Averaged::init(), and sumX0D().

170 {
171 if (theX0Data.hasX0) {
172  switch(theFace) {
173  case barrel:
174  return theX0Data.sumX0D
175  *std::sqrt( std::sqrt( (1.f+cotTheta*cotTheta)
177  )
178  );
179  case endcap:
180  return (theX0Data.hasFSlope) ?
182  + theX0Data.slopeSumX0D * (1.f/cotTheta-1.f/theX0Data.cotTheta)
183  : theX0Data.sumX0D;
184  case invalidLoc: break;// make gcc happy
185  }
186  } else if (theX0Data.allLayers) {
187  const MSLayer* dataLayer =
188  theX0Data.allLayers->layers(cotTheta).findLayer(*this);
189  if (dataLayer) return dataLayer->sumX0D(cotTheta);
190  }
191  return 0.;
192 
193 }
const MSLayersKeeper * allLayers
Definition: MSLayer.h:26
float sumX0D(float cotTheta) const
Definition: MSLayer.cc:169
bool hasFSlope
Definition: MSLayer.h:24
T sqrt(T t)
Definition: SSEVec.h:46
DataX0 theX0Data
Definition: MSLayer.h:58
double f[11][100]
virtual const MSLayersAtAngle & layers(float cotTheta) const =0
float cotTheta
Definition: MSLayer.h:25
float slopeSumX0D
Definition: MSLayer.h:25
GeomDetEnumerators::Location theFace
Definition: MSLayer.h:54
const MSLayer * findLayer(const MSLayer &layer) const
float sumX0D
Definition: MSLayer.h:25
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, MSLayer::DataX0::x0, and x0().

Referenced by MSLayersKeeperX0Averaged::init(), and x0().

152 {
153  if (theX0Data.hasX0) {
154  float OverSinTheta = std::sqrt(1.f+cotTheta*cotTheta);
155  switch(theFace) {
156  case barrel: return theX0Data.x0*OverSinTheta;
157  case endcap: return theX0Data.x0*std::abs(OverSinTheta/cotTheta);
158  case invalidLoc: return 0.;// make gcc happy
159  }
160  } else if (theX0Data.allLayers) {
161  const MSLayer * dataLayer =
162  theX0Data.allLayers->layers(cotTheta).findLayer(*this);
163  if (dataLayer) return dataLayer->x0(cotTheta);
164  }
165  return 0.;
166 }
const MSLayersKeeper * allLayers
Definition: MSLayer.h:26
#define abs(x)
Definition: mlp_lapack.h:159
float x0(float cotTheta) const
Definition: MSLayer.cc:151
T sqrt(T t)
Definition: SSEVec.h:46
DataX0 theX0Data
Definition: MSLayer.h:58
double f[11][100]
virtual const MSLayersAtAngle & layers(float cotTheta) const =0
GeomDetEnumerators::Location theFace
Definition: MSLayer.h:54
const MSLayer * findLayer(const MSLayer &layer) const

Friends And Related Function Documentation

friend struct MSLayersKeeper
friend

Definition at line 60 of file MSLayer.h.

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

Member Data Documentation

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