Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::ViewDrift Class Reference

Visualize drift lines and tracks. More...

#include <ViewDrift.hh>

Inheritance diagram for Garfield::ViewDrift:
Garfield::ViewBase

Public Member Functions

 ViewDrift ()
 Constructor.
 ~ViewDrift ()=default
 Destructor.
void Clear ()
 Delete existing drift lines, tracks and markers.
void Plot (const bool twod=false, const bool axis=true, const bool snapshot=false)
 Draw the drift lines.
void Plot2d (const bool axis=true, const bool snapshot=false)
 Make a 2D plot of the drift lines in the current viewing plane.
void Plot3d (const bool axis=true, const bool ogl=true, const bool snapshot=false)
 Make a 3D plot of the drift lines.
void EnableClusterMarkers (const bool on=true)
 Draw markers (or not) at every collision along a track.
void SetClusterMarkerSize (const double size)
 Set the size of the cluster markers (see TAttMarker).
void SetCollisionMarkerSize (const double size)
 Set the size of the collision markers (see TAttMarker).
void SetColourElectrons (const short col)
 Set the colour with which to draw electron drift lines.
void SetColourHoles (const short col)
 Set the colour with which to draw hole drift lines.
void SetColourNegativeIons (const short col)
 Set the colour with which to draw negative ion drift lines.
void SetColourIons (const short col)
 Set the colour with which to draw ion drift lines.
void SetColourTracks (const short col)
 Set the colour with which to draw charged particle tracks.
void SetColourPhotons (const short col)
 Set the colour with which to draw photons.
void SetColourExcitations (const short col)
 Set the colour with which to draw excitation markers.
void SetColourIonisations (const short col)
 Set the colour with which to draw ionisation markers.
void SetColourAttachments (const short col)
 Set the colour with which to draw attachment markers.
void SetElectronsToFront ()
 Put electron drift lines on top of the ion/hole drift lines.
std::size_t GetNumberOfDriftLines () const
 Get the number of drift lines stored.
void GetDriftLine (const std::size_t i, std::vector< std::array< float, 3 > > &driftLine, bool &electron) const
 Retrieve the coordinates of a given drift line.
std::size_t NewDriftLine (const Particle particle, const std::size_t np, const float x0, const float y0, const float z0)
void NewChargedParticleTrack (const std::size_t np, std::size_t &id, const float x0, const float y0, const float z0)
void SetDriftLinePoint (const std::size_t iL, const std::size_t iP, const float x, const float y, const float z)
void AddDriftLinePoint (const std::size_t iL, const float x, const float y, const float z)
void SetTrackPoint (const std::size_t iL, const std::size_t iP, const float x, const float y, const float z)
void AddTrackPoint (const std::size_t iL, const float x, const float y, const float z)
void AddExcitation (const float x, const float y, const float z)
void AddIonisation (const float x, const float y, const float z)
void AddAttachment (const float x, const float y, const float z)
void AddPhoton (const float x0, const float y0, const float z0, const float x1, const float y1, const float z1)
Public Member Functions inherited from Garfield::ViewBase
 ViewBase ()=delete
 Default constructor.
 ViewBase (const std::string &name)
 Constructor.
virtual ~ViewBase ()=default
 Destructor.
void SetCanvas (TPad *pad)
 Set the canvas to be painted on.
void SetCanvas ()
 Unset an external canvas.
TPad * GetCanvas ()
 Retrieve the canvas.
void SetArea (const double xmin, const double ymin, const double xmax, const double ymax)
 Set the x- and y-axis limits (in local coordinates of the current viewing plane, if applicable).
virtual void SetArea (const double xmin, const double ymin, const double zmin, const double xmax, const double ymax, const double zmax)
 Set a bounding box (if applicable).
void SetArea ()
 Use default x- and y-axis limits (based on the bounding box of the sensor/component, if applicable).
virtual void SetPlane (const double fx, const double fy, const double fz, const double x0, const double y0, const double z0)
 Set the projection (viewing plane), if applicable.
virtual void SetPlane (const double fx, const double fy, const double fz, const double x0, const double y0, const double z0, const double hx, const double hy, const double hz)
 Set the projection plane specifying a hint for the in-plane x axis.
void Rotate (const double angle)
 Rotate the viewing plane (angle in radian).
void SetPlaneXY ()
 Set the viewing plane to x-y.
void SetPlaneXZ ()
 Set the viewing plane to x-z.
void SetPlaneYZ ()
 Set the viewing plane to y-z.
void SetPlaneZX ()
 Set the viewing plane to z-x.
void SetPlaneZY ()
 Set the viewing plane to z-y.
void EnableDebugging (const bool on=true)
 Switch on/off debugging output.

Private Member Functions

bool SetPlotLimits2d ()
bool SetPlotLimits3d ()
void DrawMarkers2d (const std::vector< std::array< float, 3 > > &points, const short col, const double size)
void DrawMarkers3d (const std::vector< std::array< float, 3 > > &points, const short col, const double size)

Private Attributes

std::mutex m_mutex
std::vector< std::pair< std::vector< std::array< float, 3 > >, Particle > > m_driftLines
std::vector< std::vector< std::array< float, 3 > > > m_tracks
std::vector< std::array< std::array< float, 3 >, 2 > > m_photons
std::vector< std::array< float, 3 > > m_exc
std::vector< std::array< float, 3 > > m_ion
std::vector< std::array< float, 3 > > m_att
double m_markerSizeCluster = 0.01
double m_markerSizeCollision = 0.5
short m_colTrack = kGreen + 3
short m_colPhoton = kBlue + 1
short m_colElectron = kOrange - 3
short m_colHole = kRed + 1
short m_colIon = kRed + 1
short m_colNegativeIon = kGray + 2
short m_colExcitation = kGreen + 3
short m_colIonisation = kOrange - 3
short m_colAttachment = kCyan + 3
bool m_drawClusters = false
bool m_eTop = false

Friends

class ViewFEMesh

Additional Inherited Members

Static Public Member Functions inherited from Garfield::ViewBase
static std::string FindUnusedFunctionName (const std::string &s)
 Find an unused function name.
static std::string FindUnusedHistogramName (const std::string &s)
 Find an unused histogram name.
static std::string FindUnusedCanvasName (const std::string &s)
 Find an unused canvas name.
Protected Member Functions inherited from Garfield::ViewBase
void UpdateProjectionMatrix ()
template<typename T>
void ToPlane (const T x, const T y, const T z, T &xp, T &yp) const
template<typename T>
bool InBox (const std::array< T, 3 > &x) const
void Clip (const std::array< float, 3 > &x0, const std::array< float, 3 > &x1, std::array< float, 3 > &xc) const
void DrawLine (const std::vector< std::array< float, 3 > > &xl, const short col, const short lw)
std::string LabelX ()
std::string LabelY ()
std::string PlaneDescription ()
bool PlotLimits (Sensor *sensor, double &xmin, double &ymin, double &xmax, double &ymax) const
bool PlotLimits (Component *cmp, double &xmin, double &ymin, double &xmax, double &ymax) const
bool PlotLimitsFromUserBox (double &xmin, double &ymin, double &xmax, double &ymax) const
bool PlotLimits (std::array< double, 3 > &bbmin, std::array< double, 3 > &bbmax, double &xmin, double &ymin, double &xmax, double &ymax) const
Static Protected Member Functions inherited from Garfield::ViewBase
static bool RangeSet (TVirtualPad *)
static void SetRange (TVirtualPad *pad, const double x0, const double y0, const double x1, const double y1)
Protected Attributes inherited from Garfield::ViewBase
std::string m_className = "ViewBase"
bool m_debug = false
bool m_userPlotLimits = false
double m_xMinPlot = -1.
double m_xMaxPlot = 1.
double m_yMinPlot = -1.
double m_yMaxPlot = 1.
bool m_userBox = false
double m_xMinBox = -1.
double m_xMaxBox = 1.
double m_yMinBox = -1.
double m_yMaxBox = 1.
double m_zMinBox = -1.
double m_zMaxBox = 1.
std::array< std::array< double, 3 >, 3 > m_proj
std::array< double, 4 > m_plane {{0, 0, 1, 0}}
std::array< std::array< double, 3 >, 3 > m_prmat

Detailed Description

Visualize drift lines and tracks.

Definition at line 18 of file ViewDrift.hh.

Constructor & Destructor Documentation

◆ ViewDrift()

Garfield::ViewDrift::ViewDrift ( )

Constructor.

◆ ~ViewDrift()

Garfield::ViewDrift::~ViewDrift ( )
default

Destructor.

Member Function Documentation

◆ AddAttachment()

void Garfield::ViewDrift::AddAttachment ( const float x,
const float y,
const float z )

◆ AddDriftLinePoint()

void Garfield::ViewDrift::AddDriftLinePoint ( const std::size_t iL,
const float x,
const float y,
const float z )

◆ AddExcitation()

void Garfield::ViewDrift::AddExcitation ( const float x,
const float y,
const float z )

◆ AddIonisation()

void Garfield::ViewDrift::AddIonisation ( const float x,
const float y,
const float z )

◆ AddPhoton()

void Garfield::ViewDrift::AddPhoton ( const float x0,
const float y0,
const float z0,
const float x1,
const float y1,
const float z1 )

◆ AddTrackPoint()

void Garfield::ViewDrift::AddTrackPoint ( const std::size_t iL,
const float x,
const float y,
const float z )

◆ Clear()

void Garfield::ViewDrift::Clear ( )

Delete existing drift lines, tracks and markers.

◆ DrawMarkers2d()

void Garfield::ViewDrift::DrawMarkers2d ( const std::vector< std::array< float, 3 > > & points,
const short col,
const double size )
private

◆ DrawMarkers3d()

void Garfield::ViewDrift::DrawMarkers3d ( const std::vector< std::array< float, 3 > > & points,
const short col,
const double size )
private

◆ EnableClusterMarkers()

void Garfield::ViewDrift::EnableClusterMarkers ( const bool on = true)
inline

Draw markers (or not) at every collision along a track.

Definition at line 38 of file ViewDrift.hh.

38{ m_drawClusters = on; }

◆ GetDriftLine()

void Garfield::ViewDrift::GetDriftLine ( const std::size_t i,
std::vector< std::array< float, 3 > > & driftLine,
bool & electron ) const

Retrieve the coordinates of a given drift line.

◆ GetNumberOfDriftLines()

std::size_t Garfield::ViewDrift::GetNumberOfDriftLines ( ) const
inline

Get the number of drift lines stored.

Definition at line 66 of file ViewDrift.hh.

66{ return m_driftLines.size(); }
std::vector< std::pair< std::vector< std::array< float, 3 > >, Particle > > m_driftLines
Definition ViewDrift.hh:99

◆ NewChargedParticleTrack()

void Garfield::ViewDrift::NewChargedParticleTrack ( const std::size_t np,
std::size_t & id,
const float x0,
const float y0,
const float z0 )

◆ NewDriftLine()

std::size_t Garfield::ViewDrift::NewDriftLine ( const Particle particle,
const std::size_t np,
const float x0,
const float y0,
const float z0 )

◆ Plot()

void Garfield::ViewDrift::Plot ( const bool twod = false,
const bool axis = true,
const bool snapshot = false )

Draw the drift lines.

◆ Plot2d()

void Garfield::ViewDrift::Plot2d ( const bool axis = true,
const bool snapshot = false )

Make a 2D plot of the drift lines in the current viewing plane.

◆ Plot3d()

void Garfield::ViewDrift::Plot3d ( const bool axis = true,
const bool ogl = true,
const bool snapshot = false )

Make a 3D plot of the drift lines.

◆ SetClusterMarkerSize()

void Garfield::ViewDrift::SetClusterMarkerSize ( const double size)

Set the size of the cluster markers (see TAttMarker).

◆ SetCollisionMarkerSize()

void Garfield::ViewDrift::SetCollisionMarkerSize ( const double size)

Set the size of the collision markers (see TAttMarker).

◆ SetColourAttachments()

void Garfield::ViewDrift::SetColourAttachments ( const short col)
inline

Set the colour with which to draw attachment markers.

Definition at line 61 of file ViewDrift.hh.

61{ m_colAttachment = col; }

◆ SetColourElectrons()

void Garfield::ViewDrift::SetColourElectrons ( const short col)
inline

Set the colour with which to draw electron drift lines.

Definition at line 45 of file ViewDrift.hh.

45{ m_colElectron = col; }

◆ SetColourExcitations()

void Garfield::ViewDrift::SetColourExcitations ( const short col)
inline

Set the colour with which to draw excitation markers.

Definition at line 57 of file ViewDrift.hh.

57{ m_colExcitation = col; }

◆ SetColourHoles()

void Garfield::ViewDrift::SetColourHoles ( const short col)
inline

Set the colour with which to draw hole drift lines.

Definition at line 47 of file ViewDrift.hh.

47{ m_colHole = col; }

◆ SetColourIonisations()

void Garfield::ViewDrift::SetColourIonisations ( const short col)
inline

Set the colour with which to draw ionisation markers.

Definition at line 59 of file ViewDrift.hh.

59{ m_colIonisation = col; }

◆ SetColourIons()

void Garfield::ViewDrift::SetColourIons ( const short col)
inline

Set the colour with which to draw ion drift lines.

Definition at line 51 of file ViewDrift.hh.

51{ m_colIon = col; }

◆ SetColourNegativeIons()

void Garfield::ViewDrift::SetColourNegativeIons ( const short col)
inline

Set the colour with which to draw negative ion drift lines.

Definition at line 49 of file ViewDrift.hh.

49{ m_colNegativeIon = col; }

◆ SetColourPhotons()

void Garfield::ViewDrift::SetColourPhotons ( const short col)
inline

Set the colour with which to draw photons.

Definition at line 55 of file ViewDrift.hh.

55{ m_colPhoton = col; }

◆ SetColourTracks()

void Garfield::ViewDrift::SetColourTracks ( const short col)
inline

Set the colour with which to draw charged particle tracks.

Definition at line 53 of file ViewDrift.hh.

53{ m_colTrack = col; }

◆ SetDriftLinePoint()

void Garfield::ViewDrift::SetDriftLinePoint ( const std::size_t iL,
const std::size_t iP,
const float x,
const float y,
const float z )

◆ SetElectronsToFront()

void Garfield::ViewDrift::SetElectronsToFront ( )
inline

Put electron drift lines on top of the ion/hole drift lines.

Definition at line 63 of file ViewDrift.hh.

63{ m_eTop = true; }

◆ SetPlotLimits2d()

bool Garfield::ViewDrift::SetPlotLimits2d ( )
private

◆ SetPlotLimits3d()

bool Garfield::ViewDrift::SetPlotLimits3d ( )
private

◆ SetTrackPoint()

void Garfield::ViewDrift::SetTrackPoint ( const std::size_t iL,
const std::size_t iP,
const float x,
const float y,
const float z )

◆ ViewFEMesh

friend class ViewFEMesh
friend

Definition at line 93 of file ViewDrift.hh.

Member Data Documentation

◆ m_att

std::vector<std::array<float, 3> > Garfield::ViewDrift::m_att
private

Definition at line 106 of file ViewDrift.hh.

◆ m_colAttachment

short Garfield::ViewDrift::m_colAttachment = kCyan + 3
private

Definition at line 119 of file ViewDrift.hh.

◆ m_colElectron

short Garfield::ViewDrift::m_colElectron = kOrange - 3
private

Definition at line 113 of file ViewDrift.hh.

◆ m_colExcitation

short Garfield::ViewDrift::m_colExcitation = kGreen + 3
private

Definition at line 117 of file ViewDrift.hh.

◆ m_colHole

short Garfield::ViewDrift::m_colHole = kRed + 1
private

Definition at line 114 of file ViewDrift.hh.

◆ m_colIon

short Garfield::ViewDrift::m_colIon = kRed + 1
private

Definition at line 115 of file ViewDrift.hh.

◆ m_colIonisation

short Garfield::ViewDrift::m_colIonisation = kOrange - 3
private

Definition at line 118 of file ViewDrift.hh.

◆ m_colNegativeIon

short Garfield::ViewDrift::m_colNegativeIon = kGray + 2
private

Definition at line 116 of file ViewDrift.hh.

◆ m_colPhoton

short Garfield::ViewDrift::m_colPhoton = kBlue + 1
private

Definition at line 112 of file ViewDrift.hh.

◆ m_colTrack

short Garfield::ViewDrift::m_colTrack = kGreen + 3
private

Definition at line 111 of file ViewDrift.hh.

◆ m_drawClusters

bool Garfield::ViewDrift::m_drawClusters = false
private

Definition at line 121 of file ViewDrift.hh.

◆ m_driftLines

std::vector<std::pair<std::vector<std::array<float, 3> >, Particle> > Garfield::ViewDrift::m_driftLines
private

Definition at line 99 of file ViewDrift.hh.

◆ m_eTop

bool Garfield::ViewDrift::m_eTop = false
private

Definition at line 123 of file ViewDrift.hh.

◆ m_exc

std::vector<std::array<float, 3> > Garfield::ViewDrift::m_exc
private

Definition at line 104 of file ViewDrift.hh.

◆ m_ion

std::vector<std::array<float, 3> > Garfield::ViewDrift::m_ion
private

Definition at line 105 of file ViewDrift.hh.

◆ m_markerSizeCluster

double Garfield::ViewDrift::m_markerSizeCluster = 0.01
private

Definition at line 108 of file ViewDrift.hh.

◆ m_markerSizeCollision

double Garfield::ViewDrift::m_markerSizeCollision = 0.5
private

Definition at line 109 of file ViewDrift.hh.

◆ m_mutex

std::mutex Garfield::ViewDrift::m_mutex
private

Definition at line 96 of file ViewDrift.hh.

◆ m_photons

std::vector<std::array<std::array<float, 3>, 2> > Garfield::ViewDrift::m_photons
private

Definition at line 102 of file ViewDrift.hh.

◆ m_tracks

std::vector<std::vector<std::array<float, 3> > > Garfield::ViewDrift::m_tracks
private

Definition at line 101 of file ViewDrift.hh.


The documentation for this class was generated from the following file:
  • /builds/garfield/docs/source/Include/Garfield/ViewDrift.hh