23#ifndef RestCore_TRestDetectorReadoutPlane
24#define RestCore_TRestDetectorReadoutPlane
31#include "TRestDetectorReadoutChannel.h"
32#include "TRestDetectorReadoutModule.h"
82 void SetRotation(Double_t radians);
84 void SetAxisX(
const TVector3& axis);
159 TVector2 GetPositionInPlane(
const TVector3& point)
const;
160 Double_t GetDistanceToPlane(
const TVector3& point)
const;
162 TVector3 GetPositionInWorld(
const TVector2& point, Double_t height = 0)
const;
166 void Print(Int_t DetailLevel = 0);
168 Int_t
FindChannel(Int_t module,
const TVector2& position);
170 Double_t
GetX(Int_t modID, Int_t chID);
171 Double_t
GetY(Int_t modID, Int_t chID);
174 void GetBoundaries(
double& xmin,
double& xmax,
double& ymin,
double& ymax);
TVector2 GetDistanceToModule(const TVector2 &position)
Creates a TVector2 with shortest norm going from the given position pos to the module....
Bool_t isDaqIDInside(Int_t daqId)
This method determines if the daqId given is associated to any of the readout readout channels in any...
Int_t GetNumberOfChannels()
Returns the total number of channels in the readout plane.
Int_t isZInsideDriftVolume(Double_t z)
This method determines if a given position in z is inside the drift volume drifting distance for this...
TRestDetectorReadoutModule * GetModuleByID(Int_t modID)
Returns a pointer to a module using its internal module id.
void SetPosition(const TVector3 &position)
Sets the readout plane position.
void SetNormal(const TVector3 &normal)
It updates the value of the normal vector and recalculates the corresponding X and Y axis.
TH2Poly * GetReadoutHistogram()
Creates and returns a TH2Poly object with the readout pixel description.
TVector3 GetNormal() const
Returns a TVector3 with a vector normal to the readout plane.
Double_t fRotation
Rotation (in radians) of the readout plane around the normal vector.
Double_t GetHeight() const
Returns the height of the readout volume.
Double_t GetChargeCollection() const
Returns the charge collection ratio at this readout plane.
TVector3 GetAxisY() const
Returns a TVector3 with a vector that defines the Y-axis plane coordinate system.
void AddModule(TRestDetectorReadoutModule &rModule)
Adds a new module to the readout plane.
TVector3 GetPosition() const
Returns a TVector3 with the readout plane position.
Int_t fId
The plane id number imposed by the order of creation. Being the first id=0.
Double_t fChargeCollection
The fraction of charge/energy this readout plane collects from a hit position.
void Print(Int_t DetailLevel=0)
Prints information with details of the readout plane and modules defined inside the readout plane.
void SetChargeCollection(Double_t charge)
Sets the value for the charge collection.
Double_t GetRotation() const
Returns the rotation angle in radians of the reference frame with respect to the normal vector.
TRestDetectorReadoutPlane()
Default TRestDetectorReadoutPlane constructor.
void PrintMetadata()
Prints the readout plane description.
void SetID(int id)
Sets the planeId. This is done by TRestDetectorReadout during initialization.
TVector3 GetAxisX() const
Returns a TVector3 with a vector that defines the X-axis plane coordinate system.
void Draw()
Draws the readout plane using GetReadoutHistogram.
Double_t GetX(Int_t modID, Int_t chID)
Returns the X coordinate of a given channel in a given module using their internal module and channel...
Double_t GetDistanceTo(const TVector3 &pos) const
Returns the perpendicular distance to the readout plane from a given position pos.
TRestDetectorReadoutModule * GetModule(size_t mod)
Returns a pointer to a readout module using its std::vector index.
Int_t FindChannel(Int_t module, const TVector2 &position)
Finds the readout channel index for a given module stored in a given module index stored in the reado...
Double_t fHeight
A length in mm that confers a 3rd dimension to the readout plane and defines a volume.
void GetBoundaries(double &xmin, double &xmax, double &ymin, double &ymax)
Finds the xy boundaries of the readout plane delimited by the modules.
Double_t GetY(Int_t modID, Int_t chID)
Returns the Y coordinate of a given channel in a given module using their internal module and channel...
size_t GetNumberOfModules()
Returns the total number of modules in the readout plane.
virtual ~TRestDetectorReadoutPlane()
Default TRestDetectorReadoutPlane destructor.
TVector3 fPosition
The position of the readout plane that defines the origin (0,0) in plane coordinates.
TVector3 GetCathodePosition() const
Returns a TVector3 with the cathode position.
void SetHeight(Double_t d)
Used to define the height of the readout volume with sign crosscheck.
TVector3 fAxisX
A vector contained in the plane that defines the plane X-axis.
TVector3 fAxisY
A vector contained in the plane that defines the plane Y-axis.
TVector2 GetDistanceToModule(Int_t mod, const TVector2 &position)
TVector3 fNormal
A vector that defines the plane orientation and the side of the active volume.
Int_t GetID() const
Returns an integer with the plane id number.
Double_t GetDriftDistance() const
Returns the total drift distance. Equivalent to the height of the readout volume.
std::vector< TRestDetectorReadoutModule > fReadoutModules
< A list of TRestDetectorReadoutModule components contained in the readout plane.
Int_t GetModuleIDFromPosition(const TVector3 &position)
This method returns the module id where pos is found. The z-coordinate must be found in between the c...