1 #ifndef RectangularPadRowLayout_h
2 #define RectangularPadRowLayout_h 1
5 #include "gear/PadRowLayout2D.h"
37 double RightOffset {};
39 double WidthPerPad {};
47 std::vector<Row> _rows {};
48 std::vector<double> _extent {};
49 mutable std::vector< std::vector<int>* > _padIndices {};
50 std::vector<unsigned> _nRows {};
86 PadRowLayout2D*
clone()
const;
90 virtual void addRow(
int nRow,
int nPad ,
double padWidth ,
double padHeight ,
91 double rowHeight =0.0,
double leftOffset =0.0 ,
92 double rightOffset =0.0 );
129 virtual int getPadShape()
const {
return PadRowLayout2D::RECTANGLE ; }
166 virtual const std::vector<int>&
getPadsInRow(
int rowNumber)
const ;
179 virtual int getPadNumber(
int padIndex)
const {
return ( 0x0000ffff & padIndex ) ; }
183 virtual int getPadIndex(
int rowNum,
int padNum)
const;
190 int getNearestPadOld(
double x,
double y)
const;
202 virtual bool isInsidePad(
double x,
double y,
int padIndex)
const;
206 virtual bool isInsidePad(
double x,
double y)
const;
217 const std::vector<Row>&
rows()
const {
return _rows ; }
224 double distanceToBox(
const Vector2D& p ,
double xMin,
double yMin,
double xMax,
double yMax )
const ;
229 #endif // ifndef RectangularPadRowLayout_h
int getRepeatRowCount() const
Returns the number number for which a given row pattern has been repaeted.
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...
virtual int getNPads() const
The total number of pads in the TPC.
virtual double getDistanceToPad(double c0, double c1, int padIndex) const
Returns the closest distance to the edge (outer border) of the pad.
virtual int getRowNumber(int padIndex) const
The number of the row that contains the pad at padIndex - numbering starts at y==0 (bottom)...
const std::vector< Row > & rows() const
Helper method with all row data.
Abstract description of a planar subdetector with pads (cells) that are positioned in rows (circular ...
virtual double getPadPitch(int padIndex) const
The pitch (i.
virtual int getPadShape() const
The shape of the pads: PadRowLayout2D::RECTANGLE (i.e.
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).
PadRowLayout2D * clone() const
Returns a copy (clone) of this class.
virtual int getPadIndex(int rowNum, int padNum) const
Create a padIndex for the given row and pad ( column ) number.
virtual ~RectangularPadRowLayout()
Destructor.
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 ce...
virtual double getPadWidth(int padIndex) const
The width of the pad at padIndex in mm.
virtual Vector2D getPadCenter(int padIndex) const
The center of the pad in 2d coordinates, (x,y) or (r,phi).
RectangularPadRowLayout(double xMin, double xMax, double yMin=0.0)
Construct the empty RectangularPadRowLayout with the width and x position specified through xMin and ...
const std::vector< unsigned > & equalRowNumbers() const
Helper method to identify equal row numbers in this layout (as they have been added).
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 int getPadNumber(int padIndex) const
The pad number (column) within the row - numbering starts at x==0 (left).
RectangularPadRowLayout & operator=(const RectangularPadRowLayout &)
The assignment operator.
virtual double getRowHeight(int rowNumber) const
The row height in mm.
virtual bool isInsidePad(double x, double y, int padIndex) const
True if coordinate (x,y) is within the given pad.
void cleanup()
function to delete all the objects pointed to and owned by the GearMgr.
virtual int getRightNeighbour(int padIndex) const
The index of the right neighbour pad.
virtual double getPadHeight(int padIndex) const
The height of the pad in mm.
virtual const std::vector< double > & getPlaneExtent() const
Extent of the sensitive plane - [xmin,xmax,ymin,ymax] CARTESIAN or [rmin,rmax,phimin,phimax] POLAR.
void copy_and_assign(const RectangularPadRowLayout &)
function to copy all internal variables, incl.
virtual int getPadLayoutType() const
virtual void repeatRows(unsigned count)
Repeat the current rows 'count' times - this allows to easily repeat a pattern of several rows...
virtual int getLeftNeighbour(int padIndex) const
The index of the left neighbour pad.
virtual int getCoordinateType() const
The type of the row layouts coordinate system: PadRowLayout2D.CARTESIAN.
Implementation of PadRowLayout2D for a rectangular row based layout where all pads in a given row are...
Internal helper class for RectangularPadRowLayout.
virtual int getPadLayoutImplType() const
The type of the row layout implementation: PadRowLayout2D.RECTANGULARPADROWLAYOUT.
virtual int getNRows() const
The number of rows.