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::VersatileDiskRowLayout Class Reference

Implementation of PadRowLayout2D for a wedge shaped module. More...

#include <VersatileDiskRowLayout.h>

Inheritance diagram for gear::VersatileDiskRowLayout:
gear::FixedDiskLayoutBase gear::PadRowLayout2D

Classes

class  Row
 Internal helper class for VersatileDiskRowLayout, describing one row. More...
 

Public Member Functions

 VersatileDiskRowLayout (double rMin)
 Construct the VersatileDiskRowLayout. More...
 
 VersatileDiskRowLayout (const VersatileDiskRowLayout &)
 The copy constructor. More...
 
VersatileDiskRowLayoutoperator= (const VersatileDiskRowLayout &)
 The assignment operator.
 
virtual ~VersatileDiskRowLayout ()
 Destructor.
 
PadRowLayout2Dclone () const
 Returns a copy (clone) of this class. More...
 
virtual void addRow (int nPads, double padPitch, double rowHeight, double offset=0., double padWidth=0., double padHeight=0., int repeat=1)
 Add 'repeat' rows with the given parameters. More...
 
virtual int getPadLayoutImplType () const
 The type of the row layout implementation: PadRowLayout2D.FIXEDPADSIZEDISKLAYOUT.
 
virtual int getPadLayoutType () const
 
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 in radians.
 
virtual double getPadPitch (int padIndex) const
 The pitch of the pad in radians.
 
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 r/y==0.
 
virtual int getPadNumber (int padIndex) const
 The pad number (column) within the row - numbering starts at phi/x =.
 
virtual int getPadIndex (int rowNum, int padNum) const
 Create a padIndex for the given row and pad ( column ) number.
 
virtual int getNearestPad (double c0, double c1) const
 The index of the pad nearest to the given point in 2d coordinates (x,y,) or (r,phi).
 
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 c0, double c1, int padIndex) const
 True if coordinate (c0,c1) is within the given pad.
 
virtual bool isInsidePad (double c0, double c1) const
 True if coordinate (c0,c1) is within any pad.
 
virtual bool isFrayed () const
 Get information whether geometry has large staggering.
 
const std::vector< Row > & rows () const
 Get access to the individual rows.
 
- Public Member Functions inherited from gear::FixedDiskLayoutBase
virtual int getCoordinateType () const
 The type of the row layouts coordinate system: PadRowLayout2D.POLAR.
 
virtual double getDistanceToPad (double c0, double c1, int padIndex) const
 Returns the closest distance to the edge (outer border) of the pad.
 
- Public Member Functions inherited from gear::PadRowLayout2D
virtual ~PadRowLayout2D ()
 Destructor.
 

Protected Member Functions

void copy_and_assign (const VersatileDiskRowLayout &)
 function to copy all internal variables, incl. More...
 
void cleanup ()
 function to delete all the objects pointed to and owned by the VersatileDiskRowLayout. More...
 

Protected Attributes

int _nPad {}
 number of pads, keep for performance reasons
 
std::vector< Row_rows {}
 vector with all the rows of the pad plane
 
std::vector< double > _extent {}
 the plane extent
 
std::vector< std::vector< int > * > _padIndices {}
 vector for getPadsInRow
 
bool _isFrayed {}
 Flag that describes if the geometry is frayed.
 

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 wedge shaped module.

It is made up of individual rows. All pads within a row are the same. They are keystone shaped. The height and width can vary from row to row. Each row can have an offset in phi, so a staggering can be implemented.

The geometry is specified as frayed if the edge of a the first or last pad in a row is further away from the edge than half its height. In this case the getNearestPad() function does not work reliably.

For a description and visualisation of the geometric parameters see the documentation of the XML syntax in VersatileDiskRowLayoutXML.

Author
M. Killenberg, University of Bonn
Version
$Id$

Definition at line 25 of file VersatileDiskRowLayout.h.

Constructor & Destructor Documentation

gear::VersatileDiskRowLayout::VersatileDiskRowLayout ( double  rMin)

Construct the VersatileDiskRowLayout.

The only requred parameter is the minimal radius. All other parameters are calculated when adding the pad rows.

Definition at line 13 of file VersatileDiskRowLayout.cc.

References _extent.

Referenced by clone().

gear::VersatileDiskRowLayout::VersatileDiskRowLayout ( const VersatileDiskRowLayout right)

The copy constructor.

Needed because _padIndices allocates memory dynamically

Definition at line 24 of file VersatileDiskRowLayout.cc.

References copy_and_assign().

Member Function Documentation

void gear::VersatileDiskRowLayout::addRow ( int  nPads,
double  padPitch,
double  rowHeight,
double  offset = 0.,
double  padWidth = 0.,
double  padHeight = 0.,
int  repeat = 1 
)
virtual

Add 'repeat' rows with the given parameters.

padPitch, padWidth and offset are measured at the central radius of the pad (middle of the pad row). All dimensions are in mm in this function. Note that this is different from the getPadWidth() and getPadPitch() functions (and all other functions derrived from PadRowLayout2D), which answer in radian as this is a polar layout.

Definition at line 53 of file VersatileDiskRowLayout.cc.

References _extent, _nPad, _padIndices, and _rows.

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

void gear::VersatileDiskRowLayout::cleanup ( )
protected

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

Used by desctructor and assigment operator to avoid code duplication

Definition at line 171 of file VersatileDiskRowLayout.cc.

References _padIndices.

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

PadRowLayout2D * gear::VersatileDiskRowLayout::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 48 of file VersatileDiskRowLayout.cc.

References VersatileDiskRowLayout().

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

function to copy all internal variables, incl.

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

Definition at line 29 of file VersatileDiskRowLayout.cc.

References _extent, _isFrayed, _nPad, _padIndices, and _rows.

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

int gear::VersatileDiskRowLayout::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().}

Reimplemented from gear::FixedDiskLayoutBase.

Definition at line 151 of file VersatileDiskRowLayout.cc.

References gear::FixedDiskLayoutBase::getCoordinateType().

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

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

keystone).

Reimplemented from gear::FixedDiskLayoutBase.

Definition at line 160 of file VersatileDiskRowLayout.h.


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