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:121
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(), alignCSCRings::e, f, and create_public_lumi_plots::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
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:46
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:46
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 progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and 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().