#include <BoundSpan.h>
Public Member Functions | |
BoundSpan () | |
void | compute (Surface const &plane) |
std::pair< float, float > const & | phiSpan () const |
std::pair< float, float > const & | rSpan () const |
std::pair< float, float > const & | zSpan () const |
Private Attributes | |
std::pair< float, float > | m_phiSpan |
std::pair< float, float > | m_rSpan |
std::pair< float, float > | m_zSpan |
Definition at line 13 of file BoundSpan.h.
BoundSpan::BoundSpan | ( | ) | [inline] |
Definition at line 17 of file BoundSpan.h.
void BoundSpan::compute | ( | Surface const & | plane | ) |
Definition at line 8 of file BoundSpan.cc.
References Surface::bounds(), i, m_phiSpan, m_zSpan, Parameters::parameters, Geom::phiLess(), phimax, phimin, Surface::toGlobal(), create_public_lumi_plots::width, z, SiStripMonitorClusterAlca_cfi::zmax, and SiStripMonitorClusterAlca_cfi::zmin.
Referenced by Bounds::computeSpan().
{ const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); Surface::GlobalPoint corners[8]; if (trapezoidalBounds) { std::array<const float, 4> const & parameters = (*trapezoidalBounds).parameters(); float hbotedge = parameters[0]; float htopedge = parameters[1]; float hapothem = parameters[3]; float thickness = (*trapezoidalBounds).thickness(); corners[0] = plane.toGlobal( LocalPoint( -htopedge, hapothem, thickness/2)); corners[1] = plane.toGlobal( LocalPoint( htopedge, hapothem, thickness/2)); corners[2] = plane.toGlobal( LocalPoint( hbotedge, -hapothem, thickness/2)); corners[3] = plane.toGlobal( LocalPoint( -hbotedge, -hapothem, thickness/2)); corners[4] = plane.toGlobal( LocalPoint( -htopedge, hapothem, -thickness/2)); corners[5] = plane.toGlobal( LocalPoint( htopedge, hapothem, -thickness/2)); corners[6] = plane.toGlobal( LocalPoint( hbotedge, -hapothem, -thickness/2)); corners[7] = plane.toGlobal( LocalPoint( -hbotedge, -hapothem, -thickness/2)); }else if(rectangularBounds) { float length = rectangularBounds->length(); float width = rectangularBounds->width(); float thickness = (*rectangularBounds).thickness(); corners[0] = plane.toGlobal( LocalPoint( -width/2, -length/2, thickness/2)); corners[1] = plane.toGlobal( LocalPoint( -width/2, +length/2, thickness/2)); corners[2] = plane.toGlobal( LocalPoint( +width/2, -length/2, thickness/2)); corners[3] = plane.toGlobal( LocalPoint( +width/2, +length/2, thickness/2)); corners[4] = plane.toGlobal( LocalPoint( -width/2, -length/2, -thickness/2)); corners[5] = plane.toGlobal( LocalPoint( -width/2, +length/2, -thickness/2)); corners[6] = plane.toGlobal( LocalPoint( +width/2, -length/2, -thickness/2)); corners[7] = plane.toGlobal( LocalPoint( +width/2, +length/2, -thickness/2)); }else{ } float phimin = corners[0].barePhi(); float phimax = phimin; float zmin = corners[0].z(); float zmax = zmin; for ( int i = 1; i < 8; i++ ) { float cPhi = corners[i].barePhi(); if ( Geom::phiLess( cPhi, phimin)) { phimin = cPhi; } if ( Geom::phiLess( phimax, cPhi)) { phimax = cPhi; } float z = corners[i].z(); if ( z < zmin) zmin = z; if ( z > zmax) zmax = z; } m_zSpan.first = zmin; m_zSpan.second = zmax; m_phiSpan.first = phimin; m_phiSpan.second = phimax; }
std::pair<float,float> const& BoundSpan::phiSpan | ( | ) | const [inline] |
Definition at line 22 of file BoundSpan.h.
References m_phiSpan.
Referenced by Bounds::phiSpan().
{ return m_phiSpan; }
std::pair<float,float> const& BoundSpan::rSpan | ( | ) | const [inline] |
Definition at line 24 of file BoundSpan.h.
References m_rSpan.
Referenced by Bounds::rSpan().
{ return m_rSpan; }
std::pair<float,float> const& BoundSpan::zSpan | ( | ) | const [inline] |
Definition at line 23 of file BoundSpan.h.
References m_zSpan.
Referenced by Bounds::zSpan().
{ return m_zSpan; }
std::pair<float,float> BoundSpan::m_phiSpan [private] |
Definition at line 27 of file BoundSpan.h.
std::pair<float,float> BoundSpan::m_rSpan [private] |
Definition at line 29 of file BoundSpan.h.
Referenced by rSpan().
std::pair<float,float> BoundSpan::m_zSpan [private] |
Definition at line 28 of file BoundSpan.h.