GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gear::RectangularPadRowLayout Class Reference

Implementation of PadRowLayout2D for a rectangular row based layout where all pads in a given row are equal and have rectangular shape. More...

#include <RectangularPadRowLayout.h>

Inheritance diagram for gear::RectangularPadRowLayout:
gear::PadRowLayout2D

Classes

struct  Row
 Internal helper class for RectangularPadRowLayout. More...
 

Public Member Functions

 RectangularPadRowLayout (double xMin, double xMax, double yMin=0.0)
 Construct the empty RectangularPadRowLayout with the width and x position specified through xMin and xMax and an optional yMin - yMax will be computed from the rows that are added with addRow().
 
 RectangularPadRowLayout (const RectangularPadRowLayout &)
 The copy constructor. More...
 
RectangularPadRowLayoutoperator= (const RectangularPadRowLayout &)
 The assignment operator.
 
virtual ~RectangularPadRowLayout ()
 Destructor.
 
PadRowLayout2Dclone () const
 Returns a copy (clone) of this class. More...
 
virtual void addRow (int nRow, int nPad, double padWidth, double padHeight, double rowHeight=0.0, double leftOffset=0.0, double rightOffset=0.0)
 Add nRow rows with the given parameters.
 
virtual void repeatRows (unsigned count)
 Repeat the current rows 'count' times - this allows to easily repeat a pattern of several rows, e.g. More...
 
int getRepeatRowCount () const
 Returns the number number for which a given row pattern has been repaeted.
 
virtual int getPadLayoutType () const
 
virtual int getPadLayoutImplType () const
 The type of the row layout implementation: PadRowLayout2D.RECTANGULARPADROWLAYOUT.
 
virtual int getCoordinateType () const
 The type of the row layouts coordinate system: PadRowLayout2D.CARTESIAN.
 
virtual int getPadShape () const
 The shape of the pads: PadRowLayout2D::RECTANGLE (i.e. More...
 
virtual int getNPads () const
 The total number of pads in the TPC.
 
virtual int getNRows () const
 The number of rows.
 
virtual double getRowHeight (int rowNumber) const
 The row height in mm.
 
virtual double getPadHeight (int padIndex) const
 The height of the pad in mm.
 
virtual double getPadWidth (int padIndex) const
 The width of the pad at padIndex in mm. More...
 
virtual double getPadPitch (int padIndex) const
 The pitch (i. More...
 
virtual Vector2D getPadCenter (int padIndex) const
 The center of the pad in 2d coordinates, (x,y) or (r,phi).
 
virtual const std::vector< int > & getPadsInRow (int rowNumber) const
 Indices of all pads in row rowNumber (row indices start from 0 at the bottom (CARTESIAN) or at the center (POLAR)).
 
virtual const std::vector
< double > & 
getPlaneExtent () const
 Extent of the sensitive plane - [xmin,xmax,ymin,ymax] CARTESIAN or [rmin,rmax,phimin,phimax] POLAR.
 
virtual int getRowNumber (int padIndex) const
 The number of the row that contains the pad at padIndex - numbering starts at y==0 (bottom).
 
virtual int getPadNumber (int padIndex) const
 The pad number (column) within the row - numbering starts at x==0 (left).
 
virtual int getPadIndex (int rowNum, int padNum) const
 Create a padIndex for the given row and pad ( column ) number.
 
virtual int getNearestPad (double x, double y) const
 The index of the pad nearest to the given point in 2d coordinates (x,y,) or (r,phi).
 
int getNearestPadOld (double x, double y) const
 
virtual int getRightNeighbour (int padIndex) const
 The index of the right neighbour pad.
 
virtual int getLeftNeighbour (int padIndex) const
 The index of the left neighbour pad.
 
virtual bool isInsidePad (double x, double y, int padIndex) const
 True if coordinate (x,y) is within the given pad.
 
virtual bool isInsidePad (double x, double y) const
 True if coordinate (x,y) is within any pad.
 
virtual double getDistanceToPad (double c0, double c1, int padIndex) const
 Returns the closest distance to the edge (outer border) of the pad.
 
const std::vector< unsigned > & equalRowNumbers () const
 Helper method to identify equal row numbers in this layout (as they have been added). More...
 
const std::vector< Row > & rows () const
 Helper method with all row data. More...
 
- Public Member Functions inherited from gear::PadRowLayout2D
virtual ~PadRowLayout2D ()
 Destructor.
 

Protected Member Functions

void copy_and_assign (const RectangularPadRowLayout &)
 function to copy all internal variables, incl. More...
 
void cleanup ()
 function to delete all the objects pointed to and owned by the GearMgr. More...
 
double distanceToBox (const Vector2D &p, double xMin, double yMin, double xMax, double yMax) const
 Helper function for finding the nearest pad - returns the distance for points outside the box and -1. More...
 

Protected Attributes

int _nRow {}
 
int _nPad {}
 
int _repeatRows {}
 
std::vector< Row_rows {}
 
std::vector< double > _extent {}
 
std::vector< std::vector< int > * > _padIndices {}
 
std::vector< unsigned > _nRows {}
 

Additional Inherited Members

- Static Public Attributes inherited from gear::PadRowLayout2D
static const int RECTANGULARPADROWLAYOUT = 1
 
static const int FIXEDPADSIZEDISKLAYOUT = 2
 
static const int FIXEDPADANGLEDISKLAYOUT = 3
 
static const int VERSATILEDISKROWLAYOUT = 4
 
static const int TPCMODULE = 100
 
static const int CARTESIAN = 1
 
static const int POLAR = 2
 
static const int RECTANGLE = 1
 
static const int DIAMOND = 2
 
static const int HEXAGON = 3
 
static const int CHEVRON = 4
 

Detailed Description

Implementation of PadRowLayout2D for a rectangular row based layout where all pads in a given row are equal and have rectangular shape.

However rows can vary in height and layout. The pads with the given height and width are distributed in the rows symmetrically where an optional uninstrumented left or right offset is taken into account (this allows, e.g. staggering of rows). Rows are specified/filled from the bottom up. Uninstrumented areas on the plane will occur if a row height is given that exceeds the pad height and/or if the pads don't fill the complete row (minus the left/right offset).
This code is in parts based on ideas and an extension of original implementations by M. Weber RWTH Aachen and J. McGeachie UVic, Ca..

Author
F. Gaede, DESY
Version
$Id$

Definition at line 26 of file RectangularPadRowLayout.h.

Constructor & Destructor Documentation

gear::RectangularPadRowLayout::RectangularPadRowLayout ( const RectangularPadRowLayout right)

The copy constructor.

Needed because _padIndices allocates memory dynamically

Definition at line 29 of file RectangularPadRowLayout.cc.

References copy_and_assign().

Member Function Documentation

void gear::RectangularPadRowLayout::cleanup ( )
protected

function to delete all the objects pointed to and owned by the GearMgr.

Used by desctructor and assigment operator to avoid code duplication

Definition at line 220 of file RectangularPadRowLayout.cc.

Referenced by operator=(), and ~RectangularPadRowLayout().

PadRowLayout2D * gear::RectangularPadRowLayout::clone ( ) const
virtual

Returns a copy (clone) of this class.

As PadRowLayout2D is an abstract interface with several implementation, this is used get a copy of the actual implementation without having to know what the actual implementation is.

Implements gear::PadRowLayout2D.

Definition at line 55 of file RectangularPadRowLayout.cc.

References RectangularPadRowLayout().

void gear::RectangularPadRowLayout::copy_and_assign ( const RectangularPadRowLayout right)
protected

function to copy all internal variables, incl.

the objects pointed to and owned by the GearMgr. Used by constructor and assigment operator to avoid code duplication

Definition at line 34 of file RectangularPadRowLayout.cc.

Referenced by operator=(), and RectangularPadRowLayout().

double gear::RectangularPadRowLayout::distanceToBox ( const Vector2D p,
double  xMin,
double  yMin,
double  xMax,
double  yMax 
) const
protected

Helper function for finding the nearest pad - returns the distance for points outside the box and -1.

for points inside.

Definition at line 513 of file RectangularPadRowLayout.cc.

Referenced by getDistanceToPad().

const std::vector<unsigned>& gear::RectangularPadRowLayout::equalRowNumbers ( ) const
inline

Helper method to identify equal row numbers in this layout (as they have been added).

Definition at line 214 of file RectangularPadRowLayout.h.

Referenced by gear::RectangularPadRowLayoutXML::toXML().

int gear::RectangularPadRowLayout::getPadLayoutType ( ) const
virtual
Deprecated:
{ As there now is more than one implementation for each coordinate type this is not sufficient to distinguish the implementations any more. Use getPadLayoutImplType() to get the implementation type. Use getCoordinateType() to get the type of the coordinate system.

For backward compatibility this function returns PadRowLayout2D.CARTESIAN, i. e. getCoordinateType().}

Implements gear::PadRowLayout2D.

Definition at line 200 of file RectangularPadRowLayout.cc.

References getCoordinateType().

double gear::RectangularPadRowLayout::getPadPitch ( int  padIndex) const
virtual

The pitch (i.

e. pad width plus gap) of the pad at padIndex in mm.

Implements gear::PadRowLayout2D.

Definition at line 178 of file RectangularPadRowLayout.cc.

References getRowNumber().

virtual int gear::RectangularPadRowLayout::getPadShape ( ) const
inlinevirtual

The shape of the pads: PadRowLayout2D::RECTANGLE (i.e.

keystone).

Implements gear::PadRowLayout2D.

Definition at line 129 of file RectangularPadRowLayout.h.

double gear::RectangularPadRowLayout::getPadWidth ( int  padIndex) const
virtual

The width of the pad at padIndex in mm.

This is only the metal of the pad. Use getPadPitch() to get the effective pitch.

Implements gear::PadRowLayout2D.

Definition at line 171 of file RectangularPadRowLayout.cc.

References getRowNumber().

Referenced by getDistanceToPad().

void gear::RectangularPadRowLayout::repeatRows ( unsigned  count)
virtual

Repeat the current rows 'count' times - this allows to easily repeat a pattern of several rows, e.g.

2 rows offset to each other by half a padWidth (staggering). Can only be called once per layout, i.e. no multiple rpeat patterns are allowed.

Definition at line 134 of file RectangularPadRowLayout.cc.

References addRow().

Referenced by gear::RectangularPadRowLayoutXML::fromXML().

const std::vector<Row>& gear::RectangularPadRowLayout::rows ( ) const
inline

Helper method with all row data.

Definition at line 217 of file RectangularPadRowLayout.h.

Referenced by gear::RectangularPadRowLayoutXML::toXML().


The documentation for this class was generated from the following files: