44#include "TRestDetectorReadoutPixel.h"
46#include <TRestMetadata.h>
70 TVector2 center(0, 0);
75 center = (oppositeVertex - origin) / 4. + origin;
77 center = (origin + oppositeVertex) / 2.;
88 TVector2 vertex(0, 0);
93 else if (n % 4 == 1) {
95 vertex = vertex.Rotate(
fRotation * TMath::Pi() / 180.);
97 vertex = vertex + origin;
98 }
else if (n % 4 == 2) {
100 vertex = vertex.Rotate(
fRotation * TMath::Pi() / 180.);
102 vertex = vertex + origin;
103 }
else if (n % 4 == 3) {
105 vertex = vertex.Rotate(
fRotation * TMath::Pi() / 180.);
107 vertex = vertex + origin;
118 Double_t
const x = pos.X();
140 pos = pos.Rotate(-
fRotation * TMath::Pi() / 180.);
150 std::cout <<
" rotation : " <<
fRotation <<
" degrees"
153 std::cout <<
"triangle" << std::endl;
155 std::cout <<
"rectangle" << std::endl;
A class to store the readout pixel definition used in TRestDetectorReadoutChannel.
TVector2 GetCenter() const
Returns the center TVector2 position of the pixel.
Double_t fPixelSizeY
The pixel y size.
Double_t fPixelOriginX
The pixel x-origin position, left-bottom corner.
Double_t GetOriginX() const
Returns the x-coordinate pixel origin.
Double_t fTolerance
It will be initialized with the module parameter "pixelTolerance".
Double_t GetSizeX() const
Returns the pixel size in X.
Bool_t IsInside(const TVector2 &pos)
Determines if a given TVector2 pos coordinates are found inside the pixel. The coordinates are refere...
Double_t GetOriginY() const
Returns the y-coordinate pixel origin.
void Initialize()
Initializes the pixel members.
void Print() const
Prints on screen the pixel details, origin, size, rotation.
TVector2 GetVertex(int n) const
Returns the specified pixel vertex position.
TVector2 TransformToPixelCoordinates(const TVector2 &pixel) const
Transforms the coordinates given in a TVector2 to the internal pixel coordinate system....
virtual ~TRestDetectorReadoutPixel()
TRestDetectorReadoutPixel default destructor.
TRestDetectorReadoutPixel()
TRestDetectorReadoutPixel default constructor.
Double_t fPixelSizeX
The pixel x size.
Double_t fPixelOriginY
The pixel y-origin position, left-bottom corner.
Double_t GetSizeY() const
Returns the pixel size in Y.