6#include <GeoModelHelpers/TransformSorter.h>
7#include <GaudiKernel/SystemOfUnits.h>
10 constexpr double tolerance = 0.001 * Gaudi::Units::mm;
13#define ORDER_PROP(PROP) \
15 if (std::abs(1.*PROP - 1.*other.PROP) > tolerance) { \
16 return PROP < other.PROP; \
36 static const GeoTrf::TransformSorter trfSorter{};
44 ostr<<
"Strip -- number: "<<
numStrips()<<
", ";
47 ostr<<
"Dimension -- width x height [mm]: "<<
halfWidth() * Gaudi::Units::mm<<
" x ";
60 if (std::abs(sAngle) < std::numeric_limits<float>::epsilon()) {
80 m_lenSlopEdge = std::hypot(2.*HalfHeight, HalfShortY - HalfLongY);
85 double HalfHeight,
double yCutout) {
87 double HalfLongYuncut = HalfLongY +
yCutout * (HalfLongY - HalfShortY)/(2*HalfHeight -
yCutout);
95 ATH_MSG_WARNING(
"It's impossible to flip a trapezoid twice. Swap short and long lengths");
113 const int numFirst) {
#define ATH_MSG_WARNING(x)
#define ORDER_PROP(PROP)
Helper macro to facilliate the ordering.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
void defineDiamond(double HalfShortY, double HalfLongY, double HalfHeight, double yCutout)
Defines the edges of the sTGC diamond L3 sector.
double halfWidth() const
Returns the half height of the strip panel.
Amg::Vector2D m_topLeft
Top right point of the trapezoid.
double stereoAngle() const
Returns the value of the stereo angle.
void defineStripLayout(Amg::Vector2D &&posFirst, const double stripPitch, const double stripWidth, const int numStrips, const int numFirst=1)
Defines the layout of the strip detector by specifing the position of the first strip w....
double m_stripWidth
Width of each strip line.
bool isFlipped() const
Returns whether the trapezoid is flipped.
const Amg::Vector2D & cornerTopLeft() const
Returns the top left corner of the trapezoid.
Amg::Vector2D m_bottomRight
Bottom right point of the trapezoid.
Amg::Vector2D m_bottomLeft
Bottom left point of the trapezoid.
bool operator<(const StripDesign &other) const
Odering operator.
int firstStripNumber() const
Returns the number of the first strip.
CxxUtils::CachedUniquePtr< Amg::Vector2D > m_dirRightEdge
Vector describing the right edge of the trapezoid (bottom right -> top right)
double m_cutLongEdge
Lenght of the line segment that's cut from the long edge to make the trapezoid diamond shaped.
CheckVector2D center(int stripNumb) const
Returns the bisector of the strip (Global numbering scheme)
bool m_hasStereo
Flag telling whether the strip design has a stereo angle or not.
double m_lenSlopEdge
Length of the edge connecting the short with the long egde.
const Amg::Vector2D & cornerTopRight() const
Returns the top right corner of the trapezoid.
void resetDirCache()
Resets the cache of the directions.
Amg::Vector2D m_stripDir
Orientiation of the strips along the panel.
void defineTrapezoid(double HalfShortY, double HalfLongY, double HalfHeight)
Defines the edges of the trapezoid.
int m_numStrips
Number of all strips.
double m_yCutout
Stores the diamond cutout length from the SQLite DB file.
CxxUtils::CachedUniquePtr< Amg::Vector2D > m_dirLeftEdge
Vector describing the left adge of the trapezoid (bottom left -> top left)
double yCutout() const
Returns the cutout of the diamond.
double stripPitch() const
Distance between two adjacent strips.
void flipTrapezoid()
Flips the edges of the trapezoid boundaries by 90 degrees clockwise.
double stripWidth() const
Width of a strip.
bool m_isFlipped
Flag telling whether the trapezoid has been flipped.
double m_shortHalfY
Trapezoid dimensions.
void setStereoAngle(double stereo)
Amg::Vector2D m_firstStripPos
First strip position.
Amg::Vector2D m_topRight
Bottom right point of the trapezoid.
double m_stripPitch
Distance between 2 adjacent strip centers.
CxxUtils::CachedUniquePtr< Amg::Vector2D > m_dirBotEdge
Vector describing the bottom edge of the trapezoid (bottom left -> bottom right)
int m_channelShift
Shift between the 0-th readout channel and the first strip described by the panel.
double shortHalfHeight() const
Returns the shorter half height of the panel.
double m_stereoAngle
Stereo angle of the strip design.
double longHalfHeight() const
Returns the longer half height of the panel.
Amg::Vector2D m_stripNormal
Vector pointing from strip N to the next strip.
virtual void print(std::ostream &ostr) const
Dump properties to the ostr.
CxxUtils::CachedUniquePtr< Amg::Vector2D > m_dirTopEdge
Vector describing the top edge of the trapzoid (top left -> top right)
bool hasStereoAngle() const
Returns whether a stereo angle is defined.
const Amg::Vector2D & cornerBotRight() const
Returns the bottom right corner of the trapezoid.
const Amg::Vector2D & cornerBotLeft() const
Returns the bottom left corner of the trapezoid.
virtual int numStrips() const
Number of strips on the panel.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, 2, 1 > Vector2D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
std::ostream & operator<<(std::ostream &ostr, const Chamber::defineArgs &args)
bool operator<(const MdtTubeLayer::CutTubes &a, const unsigned int tube)
GeoModel::TransientConstSharedPtr< StripDesign > StripDesignPtr