GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
FixedPadAngleDiskLayout.h
1 #ifndef FixedPadAngleDiskLayout_h
2 #define FixedPadAngleDiskLayout_h 1
3 
4 #include <vector>
5 #include "gearimpl/FixedDiskLayoutBase.h"
6 
7 
8 namespace gear {
9 
25 
26  public:
27 
28 
29  protected:
30  double _rMin {};
31  double _rMax {};
32  int _nRow {};
33  double _rowHeight {};
34  double _phiMin{};
35  double _phiMax{};
36 // double _padWidth {};
37 // double _padHeight {};
38 // double _padGap {};
39  double _padAngle{};
40  int _nPadsInRow{};
41  int _nPad {};
42 
43  std::vector<double> _extent {};
44  mutable std::vector< std::vector<int>* > _padIndices {};
45 
52 
57  void cleanup();
58 
59 
60  public:
61 
66  FixedPadAngleDiskLayout( double rMin, double rMax, int nRow,
67  double phiMin, double phiMax, int nPadsInRow ) ;
68 
73 
76 
78  virtual ~FixedPadAngleDiskLayout() ;
79 
80  /* The clone function. Used to access the copy-constructor if this class via the
81  * acstract PadRowLayout2D interface.
82  */
83  PadRowLayout2D* clone() const;
84 
85 
87  virtual double getPadGap() const { return 0 ; }
88 
91  virtual double getFixedPadAngle() const { return _padAngle ; }
92 
93 
97  virtual int getPadLayoutImplType() const { return PadRowLayout2D::FIXEDPADANGLEDISKLAYOUT; }
98 
99  /* The type of the row layout: PadRowLayout2D::POLAR.
100  */
101  //
102  // Already implemented in FixedDiskLayoutBase
103  //virtual int getCoordinateType() const { return PadRowLayout2D::POLAR ; }
104  //virtual int getPadLayoutType() const;
105 
106  /* The shape of the pads: PadRowLayout2D::RECTANGLE (i.e.\ keystone).
107  */
108  //
109  // Already implemented in FixedDiskLayoutBase
110  //virtual int getPadShape() const { return PadRowLayout2D::RECTANGLE ; }
111 
114  virtual int getNPads() const { return _nPad ; }
115 
118  virtual int getNRows() const { return _nRow ; }
119 
122  virtual double getRowHeight(int /*rowNumber*/) const { return _rowHeight ; }
123 
126  virtual double getPadHeight(int /*padIndex*/) const { return _rowHeight ; }
127 
131  virtual double getPadWidth(int /*padIndex*/) const { return _padAngle;}
132 
136  virtual double getPadPitch(int /*padIndex*/) const { return _padAngle;}
137 
140  virtual Vector2D getPadCenter(int padIndex) const;
141 
145  virtual int getNPadsInRow() const {return _nPadsInRow; }
146 
149  virtual const std::vector<int>& getPadsInRow(int rowNumber) const ;
150 
153  virtual const std::vector<double>& getPlaneExtent() const { return _extent ; }
154 
155  /* The number of the row that contains the pad at padIndex.
156  * Numbering starts at rMin and phiMin.
157  */
158  //
159  // Already implemented in FixedDiskLayoutBase
160  //virtual int getRowNumber(int padIndex) const { return ( 0xffff0000 & padIndex ) >> 16 ; }
161 
162  /* The pad number (column) within the row - numbering starts at phi/x =.
163  */
164  //
165  // Already implemented in FixedDiskLayoutBase
166  //virtual int getPadNumber(int padIndex) const { return ( 0x0000ffff & padIndex ) ; }
167 
170  virtual int getPadIndex(int rowNum, int padNum) const;
171 
174  virtual int getNearestPad(double c0, double c1) const;
175 
178  virtual int getRightNeighbour(int padIndex) const;
179 
182  virtual int getLeftNeighbour(int padIndex) const;
183 
186  virtual bool isInsidePad(double c0, double c1, int padIndex) const;
187 
190  virtual bool isInsidePad(double c0, double c1) const;
191 
192  /* Returns the closest distance to the edge of the pad
193  */
194  //
195  // Already implemented in FixedDiskLayoutBase
196  //virtual double getDistanceToPad(double c0, double c1, int padIndex) const;
197 
198  }; // class
199 
200 } // namespace gear
201 #endif // ifndef FixedPadAngleDiskLayout_h
virtual int getNearestPad(double c0, double c1) const
The index of the pad nearest to the given point in 2d coordinates (r, phi).
virtual Vector2D getPadCenter(int padIndex) const
The center of the pad in 2d coordinates (r,phi).
virtual ~FixedPadAngleDiskLayout()
Destructor.
Abstract description of a planar subdetector with pads (cells) that are positioned in rows (circular ...
virtual int getRightNeighbour(int padIndex) const
The index of the right neighbour pad.
virtual double getPadGap() const
The gap width in mm that was given in the C&#39;tor.
Base class for circular PadRowLayout2D implementations.
Implementation of PadRowLayout2D for a disk with fixed angled keystone pads.
virtual const std::vector< double > & getPlaneExtent() const
Extent of the sensitive plane [rmin,rmax,phimin,phimax].
FixedPadAngleDiskLayout & operator=(const FixedPadAngleDiskLayout &)
The assignment operator.
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 double getPadHeight(int) const
The height of the pad in mm.
virtual int getPadLayoutImplType() const
The type of the row layout implementation: PadRowLayout2D.FIXEDPADANGLEDISKLAYOUT.
virtual int getNPads() const
The total number of pads in the TPC.
void copy_and_assign(const FixedPadAngleDiskLayout &)
Function to copy all internal variables, incl. the objects pointed to and owned by the FixedPadAngleD...
FixedPadAngleDiskLayout(double rMin, double rMax, int nRow, double phiMin, double phiMax, int nPadsInRow)
Construct the FixedPadAngleDiskLayout from the given parameters rMin, rMax, nRow, phiMin...
virtual int getPadIndex(int rowNum, int padNum) const
Create a padIndex for the given row and pad ( column ) number.
virtual double getFixedPadAngle() const
The fixed width of the pads in mm.
virtual double getRowHeight(int) const
The row height in mm.
PadRowLayout2D * clone() const
Returns a copy (clone) of this class.
virtual int getNRows() const
The number of rows.
virtual const std::vector< int > & getPadsInRow(int rowNumber) const
Indices of all pads in row rowNumber (row indices start at rMin).
virtual double getPadPitch(int) const
The pitch of the pad in radians! (In this implementation there is no gap, identical to the pad width)...
void cleanup()
Function to delete all the objects pointed to and owned by the FixedPadAngleDiskLayout.
virtual int getNPadsInRow() const
Get the (fixed) number of pads per row.
virtual double getPadWidth(int) const
The width of the pad in radians! (In this implementation there is no gap, identical to the pad pitch)...