GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
TPCModule.h
1 // =========================================================================
2 // Since the removal of aid header files are modified directly (Killenberg 2010/07/06)
3 // =========================================================================
4 #ifndef GEAR_TPCMODULE_H
5 #define GEAR_TPCMODULE_H 1
6 
7 #include <vector>
8 
9 #include "GEAR.h"
10 #include "gear/GearParameters.h"
11 #include "gear/PadRowLayout2D.h"
12 
13 namespace gear {
14 
41 class TPCModule : virtual public GearParameters, virtual public PadRowLayout2D {
42 
43 public:
44 
49 
50  public:
52  message = "gear::TPCModule::NoZPositionException: Set the z position of a module before calling getZPosition(). There is no useful default value.";
53  }
54  virtual ~NoZPositionException() { /*no_op*/; }
55  };
56 
57 
59  virtual ~TPCModule() { /* nop */; }
60 
64  virtual int getPadLayoutType() const = 0;
65 
70  virtual int getPadShape() const = 0;
71 
74  virtual int getNPads() const = 0;
75 
78  virtual int getNRows() const = 0;
79 
82  virtual double getRowHeight(int rowNumber) const = 0;
83 
86  virtual double getPadWidth(int padIndex) const = 0;
87 
90  virtual Vector2D getPadCenter(int padIndex) const = 0;
91 
94  virtual double getPadHeight(int padIndex) const = 0;
95 
99  virtual const std::vector<int> & getPadsInRow(int rowNumber) const = 0;
100 
106  virtual const std::vector<double> & getPlaneExtent() const = 0;
107 
123  virtual const std::vector<double> & getModuleExtent() const = 0;
124 
133  virtual const std::vector<double> & getLocalModuleExtent() const = 0;
134 
138  virtual int getRowNumber(int padIndex) const = 0;
139 
143  virtual int getPadNumber(int padIndex) const = 0;
144 
147  virtual int getPadIndex(int rowNum, int padNum) const = 0;
148 
152  virtual int getNearestPad(double c0, double c1) const = 0;
153 
156  virtual int getRightNeighbour(int padIndex) const = 0;
157 
160  virtual int getLeftNeighbour(int padIndex) const = 0;
161 
164  virtual bool isInsidePad(double c0, double c1, int padIndex) const = 0;
165 
168  virtual bool isInsidePad(double c0, double c1) const = 0;
169 
174  virtual bool isInsideModule(double c0, double c1) const = 0;
175 
178  virtual double getReadoutFrequency() const = 0;
179 
183  virtual const Vector2D & getOffset() const = 0;
184 
193  virtual double getZPosition() const = 0;
194 
198  virtual double getAngle() const = 0;
199 
203  virtual double getDistanceToPad(double c0, double c1, int index) const = 0;
204 
208  virtual double getDistanceToModule(double c0, double c1) const = 0;
209 
212  virtual int getModuleID() const = 0;
213 
218  virtual bool isOverlapping(TPCModule * testThisModule) const = 0;
219 
232  virtual double getBorderWidth() const = 0;
233 
238  virtual int getTPCCoordinateType() const = 0;
239 
250  virtual const PadRowLayout2D & getLocalPadLayout() const = 0;
251 
261  virtual Vector2D globalToLocal(double c0, double c1) const = 0;
262 
273  virtual Vector2D localToGlobal(double c0, double c1) const = 0;
274 
275 
276 }; // class
277 } // namespace gear
278 #endif /* ifndef GEAR_TPCMODULE_H */
virtual Vector2D getPadCenter(int padIndex) const =0
The center of the pad in global 2D coordinates, (x,y) or (r,phi).
virtual Vector2D globalToLocal(double c0, double c1) const =0
Returns the local coordinates for a point in global coordinates.
virtual double getZPosition() const =0
Returns the z position of the module.
Abstract description of a planar subdetector with pads (cells) that are positioned in rows (circular ...
Base exception class for GEAR - all other exceptions extend this.
Definition: GEAR.h:41
virtual double getDistanceToPad(double c0, double c1, int index) const =0
Returns the distance from a global coodinate (c0,c1), to a given pad&#39;s nearest boundery; (c0...
virtual int getRightNeighbour(int padIndex) const =0
The index of the right neighbour pad.
virtual const Vector2D & getOffset() const =0
Returns the offest of Modules origin from the global origin A vector from Global (0,0) to module (0,0)
virtual double getPadHeight(int padIndex) const =0
The height of the pad in mm.
virtual int getNRows() const =0
The number of rows on this module.
virtual bool isInsidePad(double c0, double c1, int padIndex) const =0
True if global coordinate (c0,c1) is within the given pad.
virtual int getPadIndex(int rowNum, int padNum) const =0
Create a padIndex for the given row and pad ( column ) number.
virtual bool isInsideModule(double c0, double c1) const =0
True if global coordinate (c0,c1) is within this modules area of amplification/interest.
virtual Vector2D localToGlobal(double c0, double c1) const =0
Returns the global coordinates for a point in local coordinates.
virtual int getLeftNeighbour(int padIndex) const =0
The index of the left neighbour pad.
Abstract interface for a set of parameters that can be used to describe the geometrical properties of...
virtual const PadRowLayout2D & getLocalPadLayout() const =0
Returns a reference to the instance of the underlaying pad layout.
virtual int getPadShape() const =0
The shape of the pads, one of PadRowLayout2D.RECTANGLE (Keystone) , PadRowLayout2D.DIAMOND, PadRowLayout2D.HEXAGON, PadRowLayout2D.CHEVRON.
virtual double getPadWidth(int padIndex) const =0
The width of the pad at padIndex in mm (CARTESIAN) or radians (POLAR).
virtual double getReadoutFrequency() const =0
The readout frequency in Hz.
virtual const std::vector< double > & getLocalModuleExtent() const =0
The module extent in local coordinates.
virtual int getModuleID() const =0
Returns module ID.
virtual int getNPads() const =0
The total number of pads on this module.
virtual double getAngle() const =0
Returns the rotation of the module, in Rads, with respect to the modules internal origin...
virtual ~TPCModule()
Destructor.
Definition: TPCModule.h:59
virtual double getBorderWidth() const =0
Returns the amount by which the pad plane has been extended to produce the module plane...
virtual int getTPCCoordinateType() const =0
Returns the TPCs coordinate type.
virtual const std::vector< double > & getPlaneExtent() const =0
Inherited from PadRowLayout2D.
virtual int getPadNumber(int padIndex) const =0
The pad number (column) within the row - numbering starts at lowest phi/x.
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 bool isOverlapping(TPCModule *testThisModule) const =0
Returns True if this and The given module * overlap pad regions Note: overlaping sensitive regions is...
virtual double getRowHeight(int rowNumber) const =0
The row height in mm.
An exception that is special for the TPCModule.
Definition: TPCModule.h:48
virtual const std::vector< double > & getModuleExtent() const =0
Maximal extent of the sensitive plane, defined relative to global origin - [xmin,xmax,ymin,ymax] CARTESIAN or [rmin,rmax,phimin,phimax] POLAR, may contain dead space due to conversion from local to global coordinate system.
A wrapper Class for PadRowLayout2D which converts between the actual pad layouts local coodinate syst...
Definition: TPCModule.h:41
virtual double getDistanceToModule(double c0, double c1) const =0
Returns distastance from a global coodinate (c0,c1), to the module&#39;s nearest boundery; (c0...
virtual int getRowNumber(int padIndex) const =0
The number of the row within this module that contains the pad at padIndex - numbering starts at lowe...
virtual int getNearestPad(double c0, double c1) const =0
The index of the pad nearest to the given point in global 2D coordinates, (x,y,) or (r...
virtual int getPadLayoutType() const =0
The type of the row layout: PadRowLayout2D.CARTESIAN or PadRowLayout2D.POLAR.