1 #ifndef TPCModuleImpl_h
2 #define TPCModuleImpl_h 1
4 #include "gear/TPCModule.h"
5 #include "gearimpl/GearParametersImpl.h"
26 std::vector<double> _planeExtent{};
27 std::vector<double> _moduleExtent{};
30 double _readoutFrequency{};
41 bool _localIsGlobal{};
220 virtual bool isInsidePad(
double c0,
double c1,
int padIndex)
const;
224 virtual bool isInsidePad(
double c0,
double c1)
const;
298 void setOffset(
double x_r,
double y_phi);
303 void setAngle(
double angle);
305 void setBorderWidth(
double border) ;
320 #endif // ifndef TPCModuleImpl_h
virtual int getRightNeighbour(int padIndex) const
The index of the right neighbour pad.
bool _zPositionIsSet
Flag to show whether the setZPosition() function had been called.
Implementation of GearParameters - a set off parameters that can be used to describe the geometrical ...
virtual bool isInsideModule(double c0, double c1) const
True if global coordinate (c0,c1) is within this modules area of amplification/interest.
virtual int getNearestPad(double x, double y) const
The index of the pad nearest to the given point in Global 2d coordinates (x,y,) or (r...
virtual int getPadIndex(int rowNum, int padNum) const =0
Create a padIndex for the given row and pad ( column ) number.
std::vector< double > calculateGlobalExtentPolarPolar(std::vector< double > localExtent)
Calculate the global extent for a given local extent if both local and global coordinate system are p...
void setOffset(double x_r, double y_phi)
Set the offset of the local pad plane wrt.
Abstract description of a planar subdetector with pads (cells) that are positioned in rows (circular ...
virtual int getPadIndex(int rowNum, int padNum) const
Create a padIndex for the given row and pad ( column ) number.
virtual int getNRows() const
The number of rows.
int getTPCCoordinateType() const
Returns the TPCs coordinate type.
virtual int getPadLayoutImplType() const
The type of the row layout implementation: PadRowLayout2D.TPCMODULE.
std::vector< double > _localModuleExtent
The module extend in the pad plane's coordinate system.
virtual bool isOverlapping(TPCModule *testThisModule) const
Returns True if this and The given module * overlap pad regions Note: overlaping sensitive regions is...
virtual int getPadLayoutType() const
virtual double getDistanceToPad(double c0, double c1, int index) const
Returns the distance from a global coodinate (c0,c1), to a given pad's nearest boundery; (c0...
std::vector< double > calculateGlobalExtentCartesianPolar(std::vector< double > localExtent)
Calculate the global extent for a given local extent if the global coordinates are cartesian and the ...
virtual const std::vector< double > & getModuleExtent() const
Extent of the sensitive plane in TPC's coordinate system, with extended region just outside module fr...
virtual double getReadoutFrequency() const
The readout frequency in Hz.
void checkLocalIsGlobal()
Function to set the _localIsGlobal flag in case both coordinate systems are identical.
int _momsCoordinateType
AKA coordinate type of the TPC which contains this module.
gear::Vector2D _offset
The offset in cordinates described by _momsCoordinateType.
virtual int getPadShape() const
The shape of the pads: PadRowLayout2D::RECTANGLE (i.e.
virtual int getPadNumber(int padIndex) const
The pad number (column) within the row - numbering starts at x==0 (left).
virtual int getNPads() const
The total number of pads in the TPC.
virtual int getNPads() const =0
The total number of pads.
TPCModuleImpl(int moduleID, PadRowLayout2D *padRowLayout, int TPCCoordinateType, double readoutFrequency=0)
Construct the empty RectangularPadRowLayout with the width and x position specified through xMin and ...
virtual double getRowHeight(int rowNumber) const =0
The row height in mm.
void setReadoutFrequency(double frequency)
kept for backward compatibility, please set readout frequency in constructor
void setZPosition(double z)
Set the z position of the module.
virtual double getBorderWidth() const
Returns the amount by which the pad plane has been extended to produce the module plane...
virtual double getZPosition() const
Returns the z position of the module.
virtual int getModuleID() const
Returns module ID.
PadRowLayout2D * clone() const
Returns a copy (clone) of this class.
double _sin_angle
For performance: cache the sine of the angle.
virtual const std::vector< double > & getPlaneExtent() const
Inherited from PadRowLayout2D.
TPCModuleImpl & operator=(const TPCModuleImpl &)
The assignment operator.
virtual double getPadHeight(int padIndex) const
The height of the pad in mm.
virtual ~TPCModuleImpl()
Destructor.
virtual double getRowHeight(int rowNumber) const
The row height in mm.
void cleanup()
function to delete all the objects pointed to and owned by the TPCModule.
virtual int getNRows() const =0
The number of rows.
void copy_and_assign(const TPCModuleImpl &)
function to copy all internal variables, incl.
double _cos_angle
For performance: cache the cosine of the angle.
virtual const std::vector< double > & getLocalModuleExtent() const
The module extent in local coordinates.
virtual double getPadHeight(int padIndex) const =0
The height of the pad in mm.
gear::Vector2D localToGlobal(double c0, double c1) const
Returns the global coordinates for a point in local coordinates.
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 gear::Vector2D getPadCenter(int padIndex) const
The center of the pad in mother's 2d coordinates, (x,y) or (r,phi).
virtual double getPadPitch(int padIndex) const
The pitch of the pad in mm.
double _angle
The angle wrt. the local coordinate system.
virtual double getPadWidth(int padIndex) const =0
The width of the pad at padIndex in mm (CARTESIAN) or radians (POLAR).
virtual int getRowNumber(int padIndex) const
The number of the row, for the given module(all modules restart at 0), that contains the pad at padIn...
virtual double getAngle() const
Returns the rotation of the module, in Rads, with respect to the modules internal origin...
virtual double getDistanceToModule(double c0, double c1) const
Returns distastance from a global coodinate (c0,c1), to the module's nearest boundery; (c0...
void convertLocalPlaneToGlobalPlaneExtend(void)
Transforms the local planeExtend to a global planeExtend, global moduleExtend and localModuleExtend...
virtual double getPadPitch(int padIndex) const =0
The pitch (i.
gear::Vector2D _offset_cartesian
The offset in cartesian cordinates.
double _zPosition
The z positon of the module.
virtual int getRightNeighbour(int padIndex) const =0
The index of the right neighbour pad.
virtual bool isInsidePad(double c0, double c1, int padIndex) const
True if coordinate (x,y) is within the given pad.
double _border
Area around a pad Plane to extend the amplification reagion so that the outmost pads don't loose elec...
virtual int getPadNumber(int padIndex) const =0
The pad number (column) within the row - numbering starts at phi/x == 0.
virtual double getPadWidth(int padIndex) const
The width of the pad in mm.
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...
std::vector< double > calculateGlobalExtentCartesianCartesian(std::vector< double > localExtent)
Calculate the global extent for a given local extent if both local and global coordinate system are c...
virtual int getPadShape() const =0
The shape of the pads, one of PadRowLayout2D.RECTANGLE (Keystone), PadRowLayout2D.DIAMOND, PadRowLayout2D.HEXAGON, PadRowLayout2D.CHEVRON.
virtual int getLeftNeighbour(int padIndex) const =0
The index of the left neighbour pad.
A wrapper Class for PadRowLayout2D which converts between the actual pad layouts local coodinate syst...
A wrapper Class for PadRowLayout2D, allowing which converts between local and global coordinate syste...
gear::Vector2D globalToLocal(double c0, double c1) const
Returns the local coordinates for a point in global coordinates.
virtual int getLeftNeighbour(int padIndex) const
The index of the left neighbour pad.
virtual const gear::Vector2D & getOffset() const
Returns the offest of Modules origin from the global origin A vector from Global (0,0) to module (0,0)
virtual int getCoordinateType() const
Identical to getTPCCoordinateType(), because this is the type of coordinates which are returned...
const PadRowLayout2D & getLocalPadLayout() const
Returns a reference to the instance of the underlaying pad layout.