CMS 3D CMS Logo

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

#include <MSLayersAtAngle.h>

Public Member Functions

const MSLayerfindLayer (const MSLayer &layer) const
 
 MSLayersAtAngle ()
 
 MSLayersAtAngle (const std::vector< MSLayer > &layers)
 
void print () const
 
int size () const
 
float sumX0D (const PixelRecoPointRZ &pointI, const PixelRecoPointRZ &pointO, float tip=0.) const
 
float sumX0D (const PixelRecoPointRZ &pointI, const PixelRecoPointRZ &pointM, const PixelRecoPointRZ &pointO, float tip=0.) const
 
void update (const MSLayer &layer)
 

Private Types

typedef std::vector< MSLayer >
::const_iterator 
LayerItr
 

Private Member Functions

LayerItr findLayer (const PixelRecoPointRZ &point, LayerItr i1, LayerItr i2) const
 
float sum2RmRn (LayerItr i1, LayerItr i2, float rTarget, const PixelRecoLineRZ &line) const
 

Private Attributes

std::vector< MSLayertheLayers
 

Detailed Description

Definition at line 14 of file MSLayersAtAngle.h.

Member Typedef Documentation

typedef std::vector<MSLayer>::const_iterator MSLayersAtAngle::LayerItr
private

Definition at line 37 of file MSLayersAtAngle.h.

Constructor & Destructor Documentation

MSLayersAtAngle::MSLayersAtAngle ( )
inline

Definition at line 17 of file MSLayersAtAngle.h.

17 { }
MSLayersAtAngle::MSLayersAtAngle ( const std::vector< MSLayer > &  layers)

Definition at line 10 of file MSLayersAtAngle.cc.

References python.multivaluedict::sort(), and theLayers.

11  : theLayers(layers)
12 { sort(theLayers.begin(), theLayers.end()); }
std::vector< MSLayer > theLayers

Member Function Documentation

const MSLayer * MSLayersAtAngle::findLayer ( const MSLayer layer) const

Definition at line 14 of file MSLayersAtAngle.cc.

References spr::find(), and theLayers.

Referenced by MSLayersKeeperX0Averaged::init(), MSLayersKeeperX0AtEta::init(), MSLayersKeeperX0Averaged::layer(), MSLayersKeeperX0DetLayer::layer(), sumX0D(), MSLayer::sumX0D(), and MSLayer::x0().

15 {
16  vector<MSLayer>::const_iterator it =
17  find(theLayers.begin(), theLayers.end(), layer);
18  return it==theLayers.end() ? 0 : &(*it);
19 }
std::vector< MSLayer > theLayers
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
MSLayersAtAngle::LayerItr MSLayersAtAngle::findLayer ( const PixelRecoPointRZ point,
MSLayersAtAngle::LayerItr  ibeg,
MSLayersAtAngle::LayerItr  iend 
) const
private

Definition at line 91 of file MSLayersAtAngle.cc.

References kinem::EPSILON, and f.

95 {
96  const float BIG=99999.f;
97  const float EPSILON = 1.e-4f;
98  LayerItr theIt = ibeg; float dist = BIG;
99  for (LayerItr it = ibeg; it < iend; it++) {
100  float d = it->distance(point);
101  if (d < dist) {
102  if (d < EPSILON) return it;
103  dist = d;
104  theIt = it;
105  }
106  }
107  return theIt;
108 }
double f[11][100]
std::vector< MSLayer >::const_iterator LayerItr
const float EPSILON
Definition: AnglesUtil.h:23
void MSLayersAtAngle::print ( void  ) const

Definition at line 111 of file MSLayersAtAngle.cc.

References gather_cfg::cout, and theLayers.

112 {
113  for (LayerItr it = theLayers.begin(); it != theLayers.end(); it++)
114  cout <<*it<<endl;
115 }
std::vector< MSLayer > theLayers
std::vector< MSLayer >::const_iterator LayerItr
tuple cout
Definition: gather_cfg.py:41
int MSLayersAtAngle::size ( void  ) const
inline

Definition at line 30 of file MSLayersAtAngle.h.

References theLayers.

30 { return theLayers.size(); }
std::vector< MSLayer > theLayers
float MSLayersAtAngle::sum2RmRn ( MSLayersAtAngle::LayerItr  i1,
MSLayersAtAngle::LayerItr  i2,
float  rTarget,
const PixelRecoLineRZ line 
) const
private

Definition at line 70 of file MSLayersAtAngle.cc.

References PixelRecoLineRZ::cotLine(), cross(), f, and funct::log().

Referenced by sumX0D().

75 {
76  float sum2 = 0.f;
77  float cotTh = line.cotLine();
78  for (LayerItr it = i1; it < i2; it++) {
79  pair<PixelRecoPointRZ,bool> cross = it->crossing(line);
80  if (cross.second) {
81  float x0 = it->x0(cotTh);
82  float dr = rTarget-cross.first.r();
83  if (x0 > 1.e-5f) dr *= 1.f+0.038f*std::log(x0);
84  sum2 += x0*dr*dr;
85  }
86 // cout << *it << " crossing: "<<cross.second<<endl;
87  }
88  return sum2;
89 }
float cotLine() const
double f[11][100]
std::vector< MSLayer >::const_iterator LayerItr
Log< T >::type log(const T &t)
Definition: Log.h:22
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or &quot;cross&quot; product, with a vector of same type.
float MSLayersAtAngle::sumX0D ( const PixelRecoPointRZ pointI,
const PixelRecoPointRZ pointO,
float  tip = 0. 
) const

Definition at line 34 of file MSLayersAtAngle.cc.

References findLayer(), PixelRecoPointRZ::r(), mathSSE::sqrt(), sum2RmRn(), and theLayers.

Referenced by MultipleScatteringParametrisation::operator()().

38 {
39  LayerItr iO = findLayer(pointO, theLayers.begin(), theLayers.end());
40 // cout << "outer Layer: "<<*iO<<endl;
41  LayerItr iI = findLayer(pointI, theLayers.begin(), iO);
42 // cout << "inner Layer: "<<*iI<<endl;
43 
44  return sqrt(sum2RmRn(iI,iO, pointO.r(),
45  PixelRecoLineRZ(pointI, pointO, tip)));
46 }
std::vector< MSLayer > theLayers
float sum2RmRn(LayerItr i1, LayerItr i2, float rTarget, const PixelRecoLineRZ &line) const
T sqrt(T t)
Definition: SSEVec.h:28
std::vector< MSLayer >::const_iterator LayerItr
float r() const
const MSLayer * findLayer(const MSLayer &layer) const
float MSLayersAtAngle::sumX0D ( const PixelRecoPointRZ pointI,
const PixelRecoPointRZ pointM,
const PixelRecoPointRZ pointO,
float  tip = 0. 
) const

Definition at line 48 of file MSLayersAtAngle.cc.

References findLayer(), geometryCSVtoXML::line, PixelRecoPointRZ::r(), funct::sqr(), mathSSE::sqrt(), sum2RmRn(), and theLayers.

53 {
54  LayerItr iO = findLayer(pointO, theLayers.begin(), theLayers.end());
55  LayerItr iI = findLayer(pointI, theLayers.begin(), iO);
56  LayerItr iM = findLayer(pointM, iI, iO);
57 
58  float drOI = pointO.r() - pointI.r();
59  float drMO = pointO.r() - pointM.r();
60  float drMI = pointM.r() - pointI.r();
61 
62  PixelRecoLineRZ line(pointI, pointO, tip);
63  float sum2I = sum2RmRn(iI+1, iM, pointI.r(), line);
64  float sum2O = sum2RmRn(iM, iO, pointO.r(), line);
65 
66  return sqrt( sum2I* sqr(drMO) + sum2O*sqr(drMI) )/drOI;
67 }
std::vector< MSLayer > theLayers
float sum2RmRn(LayerItr i1, LayerItr i2, float rTarget, const PixelRecoLineRZ &line) const
T sqrt(T t)
Definition: SSEVec.h:28
std::vector< MSLayer >::const_iterator LayerItr
float r() const
Square< F >::type sqr(const F &f)
Definition: Square.h:13
const MSLayer * findLayer(const MSLayer &layer) const
void MSLayersAtAngle::update ( const MSLayer layer)

Definition at line 22 of file MSLayersAtAngle.cc.

References spr::find(), python.multivaluedict::sort(), and theLayers.

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

23 {
24  vector<MSLayer>::iterator it = find(theLayers.begin(),theLayers.end(),layer);
25  if (it == theLayers.end()) {
26  theLayers.push_back(layer);
27  sort(theLayers.begin(), theLayers.end());
28  } else {
29  *it = layer;
30  }
31 }
std::vector< MSLayer > theLayers
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7

Member Data Documentation

std::vector<MSLayer> MSLayersAtAngle::theLayers
private

Definition at line 34 of file MSLayersAtAngle.h.

Referenced by findLayer(), MSLayersAtAngle(), print(), size(), sumX0D(), and update().