GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
PadRowLayout2D.h
1 // -*- C++ -*-
2 #ifndef GEAR_PADROWLAYOUT2D_H
3 #define GEAR_PADROWLAYOUT2D_H 1
4 
5 #include <vector>
6 
7 #include "GEAR.h"
8 
9 namespace gear {
10 
21 
22 public:
24  virtual ~PadRowLayout2D() { /* nop */; }
25 
26  // Static constants (enums) for the type of the row layout
27 
28  static const int RECTANGULARPADROWLAYOUT = 1 ;
29  static const int FIXEDPADSIZEDISKLAYOUT = 2 ;
30  static const int FIXEDPADANGLEDISKLAYOUT = 3 ;
31  static const int VERSATILEDISKROWLAYOUT = 4 ;
32  static const int TPCMODULE = 100 ;
33 
34  static const int CARTESIAN = 1 ;
35  static const int POLAR = 2 ;
36 
37  static const int RECTANGLE = 1 ;
38  static const int DIAMOND = 2 ;
39  static const int HEXAGON = 3 ;
40  static const int CHEVRON = 4 ;
41 
47  virtual PadRowLayout2D * clone() const = 0;
48 
58  virtual int getPadLayoutType() const = 0;
59 
66  virtual int getPadLayoutImplType() const = 0;
67 
72  virtual int getCoordinateType() const = 0;
73 
77  virtual int getPadShape() const = 0;
78 
81  virtual int getNPads() const = 0;
82 
85  virtual int getNRows() const = 0;
86 
89  virtual double getRowHeight(int rowNumber) const = 0;
90 
95  virtual double getPadWidth(int padIndex) const = 0;
96 
100  virtual double getPadPitch(int padIndex) const = 0;
101 
104  virtual Vector2D getPadCenter(int padIndex) const = 0;
105 
108  virtual double getPadHeight(int padIndex) const = 0;
109 
113  virtual const std::vector<int> & getPadsInRow(int rowNumber) const = 0;
114 
118  virtual const std::vector<double> & getPlaneExtent() const = 0;
119 
122  virtual int getRowNumber(int padIndex) const = 0;
123 
126  virtual int getPadNumber(int padIndex) const = 0;
127 
130  virtual int getPadIndex(int rowNum, int padNum) const = 0;
131 
135  virtual int getNearestPad(double c0, double c1) const = 0;
136 
139  virtual int getRightNeighbour(int padIndex) const = 0;
140 
143  virtual int getLeftNeighbour(int padIndex) const = 0;
144 
147  virtual bool isInsidePad(double c0, double c1, int padIndex) const = 0;
148 
151  virtual bool isInsidePad(double c0, double c1) const = 0;
152 
159  virtual double getDistanceToPad(double c0, double c1, int padIndex) const = 0;
160 }; // class
161 } // namespace gear
162 #endif /* ifndef GEAR_PADROWLAYOUT2D_H */
virtual int getPadIndex(int rowNum, int padNum) const =0
Create a padIndex for the given row and pad ( column ) number.
Abstract description of a planar subdetector with pads (cells) that are positioned in rows (circular ...
virtual bool isInsidePad(double c0, double c1, int padIndex) const =0
True if coordinate (c0,c1) is within the given pad.
virtual int getNPads() const =0
The total number of pads.
virtual int getCoordinateType() const =0
The type of the row layouts coordinate system: PadRowLayout2D.CARTESIAN or PadRowLayout2D.POLAR.
virtual double getRowHeight(int rowNumber) const =0
The row height in mm.
virtual int getPadLayoutImplType() const =0
The type of the row layout implementation: PadRowLayout2D.RECTANGULARPADROWLAYOUT, PadRowLayout2D.FIXEDPADSIZEDISKLAYOUT, PadRowLayout2D.FIXEDPADANGLEDISKLAYOUT or PadRowLayout2D.TPCMODULE.
virtual int getNRows() const =0
The number of rows.
virtual double getPadHeight(int padIndex) const =0
The height of the pad in mm.
virtual int getPadLayoutType() const =0
virtual double getPadWidth(int padIndex) const =0
The width of the pad at padIndex in mm (CARTESIAN) or radians (POLAR).
virtual double getPadPitch(int padIndex) const =0
The pitch (i.
virtual int getRightNeighbour(int padIndex) const =0
The index of the right neighbour pad.
virtual int getPadNumber(int padIndex) const =0
The pad number (column) within the row - numbering starts at phi/x == 0.
virtual double getDistanceToPad(double c0, double c1, int padIndex) const =0
Returns the closest distance to the edge (outer border) of the pad.
virtual ~PadRowLayout2D()
Destructor.
virtual int getRowNumber(int padIndex) const =0
The number of the row that contains the pad at padIndex - numbering starts at r/y==0.
virtual const std::vector< int > & getPadsInRow(int rowNumber) const =0
Indices of all pads in row rowNumber (row indices start from 0 at the bottom (CARTESIAN) or at the ce...
virtual PadRowLayout2D * clone() const =0
Returns a copy (clone) of this class.
virtual const std::vector< double > & getPlaneExtent() const =0
Extent of the sensitive plane - [xmin,xmax,ymin,ymax] CARTESIAN or [rmin,rmax,phimin,phimax] POLAR.
virtual int getPadShape() const =0
The shape of the pads, one of PadRowLayout2D.RECTANGLE (Keystone), PadRowLayout2D.DIAMOND, PadRowLayout2D.HEXAGON, PadRowLayout2D.CHEVRON.
virtual int getNearestPad(double c0, double c1) const =0
The index of the pad nearest to the given point in 2d coordinates (x,y,) or (r,phi).
virtual int getLeftNeighbour(int padIndex) const =0
The index of the left neighbour pad.
virtual Vector2D getPadCenter(int padIndex) const =0
The center of the pad in 2d coordinates, (x,y) or (r,phi).