GOAT (Geometrical optics application tool) 0.1
Loading...
Searching...
No Matches
GOAT::raytracing::Detector Class Referenceabstract

The abstract Detector class provides an interface to a detector to store the information about the electric field into any kind of an array. More...

#include <detector.h>

Inheritance diagram for GOAT::raytracing::Detector:
GOAT::raytracing::DetectorPlane GOAT::raytracing::Kirchhoff

Public Member Functions

void clean ()
 Clean all data, i.e. all data is set to zero (Data array is not removed)
void clear ()
 clear
virtual bool cross (maths::Vector< double > P, maths::Vector< double > k, int &i1, int &i2, double &l)=0
double D1 ()
 return the length in the first direction
double D2 ()
 return the length in the second direction
 Detector (const Detector &Det)
 copy constructor
 Detector (int n1, int n2)
 Constructor which is called by the size of the array (n1 x n2)
 Detector (void)
maths::Vector< double > gete1 ()
 returns the direction of the first axis of the detector
maths::Vector< double > gete2 ()
 returns the direction of the second axis of the detector
bool load (const char *fn)
void mult (double fac)
 Multiply with factor. This functions multiplies all elements of the detector with the factor fac.
int N1 ()
 returns the dimension of the array in the first direction
int N2 ()
 returns the dimension of the array in the second direction
maths::Vector< double > norm ()
 returns the normal vector of the detectors surface
maths::Vector< std::complex< double > > & operator() (int i1, int i2)
 bracket operator which gives the content inside the array determined by the indices i1 and i2
Detectoroperator= (const Detector &D)
maths::Vector< double > position ()
 returns the position of the detector
void save (const char *fn)
 stores the content (the whole vector)
void saveabs (const char *fn)
 stores the content (absolute value of the electric field) of the detector array in the file determined by its filename fn
void saveimag (const char *fn, int coord)
 stores the content (imaginary part of one component of the the electric field, coord determines the coordinate 0,1,2 for x,y,z) of the detector array in the file fn
void savePhase (const char *fn, int coord)
 stores the content (phase of one component of the electric field, coord determines the coordinate 0,1,2 for x,y,z) of the detector array in the file fn
void savereal (const char *fn, int coord)
 stores the content (real part of one component of the the electric field, coord determines the coordinate 0,1,2 for x,y,z) of the detector array in the file fn
void setD (double d1, double d2)
void setD1 (double d1)
void setD2 (double d2)
void setN (int n1, int n2)
 set the dimensions of the array
void setN1 (int n1)
 set the dimension of the array in the first direction
void setN2 (int n2)
 set the dimension of the array in the second direction
void setPosition (maths::Vector< double > Pos)
 set the position of the detector
int Type ()
 returns kind of detector
 ~Detector (void)

Public Attributes

std::vector< std::vector< maths::Vector< std::complex< double > > > > D
 Here, the data will be stored.
std::string fname

Protected Member Functions

void init (int n1, int n2)
 initialise array (for internal use only)

Protected Attributes

double d1 =0
double d2 =0
maths::Vector< double > e1
 unit vector in the first direction
maths::Vector< double > e2
 unit vector in the second direction
maths::Vector< double > n
int n1 =0
int n2 =0
maths::Vector< double > P
 Position of the detector.
int type =-1

Friends

class DetectorPlane
std::ostream & operator<< (std::ostream &os, Detector &D)

Detailed Description

The abstract Detector class provides an interface to a detector to store the information about the electric field into any kind of an array.

Definition at line 21 of file detector.h.

Constructor & Destructor Documentation

◆ Detector() [1/3]

GOAT::raytracing::Detector::Detector ( void )

◆ Detector() [2/3]

GOAT::raytracing::Detector::Detector ( int n1,
int n2 )

Constructor which is called by the size of the array (n1 x n2)

◆ Detector() [3/3]

GOAT::raytracing::Detector::Detector ( const Detector & Det)

copy constructor

◆ ~Detector()

GOAT::raytracing::Detector::~Detector ( void )

Member Function Documentation

◆ clean()

void GOAT::raytracing::Detector::clean ( )

Clean all data, i.e. all data is set to zero (Data array is not removed)

◆ clear()

void GOAT::raytracing::Detector::clear ( )

clear

◆ cross()

virtual bool GOAT::raytracing::Detector::cross ( maths::Vector< double > P,
maths::Vector< double > k,
int & i1,
int & i2,
double & l )
pure virtual

The virtual function checks if the ray hits the detector.

Returns
true, if ray hits the detector otherwise false
Parameters
[in]Pcurrent position of the ray
[in]kdirection of the ray
[out]i1first index of the hit point within the detector array
[out]i2second index of the hit point within the detector array
[out]ddistance between ray and detector (along the ray)

Implemented in GOAT::raytracing::DetectorPlane.

◆ D1()

double GOAT::raytracing::Detector::D1 ( )

return the length in the first direction

◆ D2()

double GOAT::raytracing::Detector::D2 ( )

return the length in the second direction

◆ gete1()

maths::Vector< double > GOAT::raytracing::Detector::gete1 ( )
inline

returns the direction of the first axis of the detector

Definition at line 81 of file detector.h.

◆ gete2()

maths::Vector< double > GOAT::raytracing::Detector::gete2 ( )
inline

returns the direction of the second axis of the detector

Definition at line 82 of file detector.h.

◆ init()

void GOAT::raytracing::Detector::init ( int n1,
int n2 )
protected

initialise array (for internal use only)

◆ load()

bool GOAT::raytracing::Detector::load ( const char * fn)

@load detector data from filexmlReader::readDetectors() This function loads detector data from file. It expects a complex vector format. The first line has to start with "%n1 " followed by the number of items in e1-direction. The second row must start with "%n2" followed by the number of items in e2-direction.

◆ mult()

void GOAT::raytracing::Detector::mult ( double fac)

Multiply with factor. This functions multiplies all elements of the detector with the factor fac.

◆ N1()

int GOAT::raytracing::Detector::N1 ( )

returns the dimension of the array in the first direction

◆ N2()

int GOAT::raytracing::Detector::N2 ( )

returns the dimension of the array in the second direction

◆ norm()

maths::Vector< double > GOAT::raytracing::Detector::norm ( )
inline

returns the normal vector of the detectors surface

Definition at line 73 of file detector.h.

◆ operator()()

maths::Vector< std::complex< double > > & GOAT::raytracing::Detector::operator() ( int i1,
int i2 )
inline

bracket operator which gives the content inside the array determined by the indices i1 and i2

Definition at line 28 of file detector.h.

◆ operator=()

Detector & GOAT::raytracing::Detector::operator= ( const Detector & D)

◆ position()

maths::Vector< double > GOAT::raytracing::Detector::position ( )
inline

returns the position of the detector

Definition at line 72 of file detector.h.

◆ save()

void GOAT::raytracing::Detector::save ( const char * fn)

stores the content (the whole vector)

◆ saveabs()

void GOAT::raytracing::Detector::saveabs ( const char * fn)

stores the content (absolute value of the electric field) of the detector array in the file determined by its filename fn

◆ saveimag()

void GOAT::raytracing::Detector::saveimag ( const char * fn,
int coord )

stores the content (imaginary part of one component of the the electric field, coord determines the coordinate 0,1,2 for x,y,z) of the detector array in the file fn

◆ savePhase()

void GOAT::raytracing::Detector::savePhase ( const char * fn,
int coord )

stores the content (phase of one component of the electric field, coord determines the coordinate 0,1,2 for x,y,z) of the detector array in the file fn

◆ savereal()

void GOAT::raytracing::Detector::savereal ( const char * fn,
int coord )

stores the content (real part of one component of the the electric field, coord determines the coordinate 0,1,2 for x,y,z) of the detector array in the file fn

◆ setD()

void GOAT::raytracing::Detector::setD ( double d1,
double d2 )

◆ setD1()

void GOAT::raytracing::Detector::setD1 ( double d1)

◆ setD2()

void GOAT::raytracing::Detector::setD2 ( double d2)

◆ setN()

void GOAT::raytracing::Detector::setN ( int n1,
int n2 )

set the dimensions of the array

◆ setN1()

void GOAT::raytracing::Detector::setN1 ( int n1)

set the dimension of the array in the first direction

◆ setN2()

void GOAT::raytracing::Detector::setN2 ( int n2)

set the dimension of the array in the second direction

◆ setPosition()

void GOAT::raytracing::Detector::setPosition ( maths::Vector< double > Pos)
inline

set the position of the detector

Definition at line 48 of file detector.h.

◆ Type()

int GOAT::raytracing::Detector::Type ( )
inline

returns kind of detector

Definition at line 58 of file detector.h.

◆ DetectorPlane

friend class DetectorPlane ( void )
friend

Definition at line 92 of file detector.h.

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
Detector & D )
friend

Member Data Documentation

◆ D

std::vector<std::vector<maths::Vector<std::complex<double> > > > GOAT::raytracing::Detector::D

Here, the data will be stored.

Definition at line 70 of file detector.h.

◆ d1

double GOAT::raytracing::Detector::d1 =0
protected

Definition at line 89 of file detector.h.

◆ d2

double GOAT::raytracing::Detector::d2 =0
protected

Definition at line 89 of file detector.h.

◆ e1

maths::Vector<double> GOAT::raytracing::Detector::e1
protected

unit vector in the first direction

Definition at line 84 of file detector.h.

◆ e2

maths::Vector<double> GOAT::raytracing::Detector::e2
protected

unit vector in the second direction

Definition at line 85 of file detector.h.

◆ fname

std::string GOAT::raytracing::Detector::fname

Definition at line 75 of file detector.h.

◆ n

maths::Vector<double> GOAT::raytracing::Detector::n
protected

Definition at line 87 of file detector.h.

◆ n1

int GOAT::raytracing::Detector::n1 =0
protected

Definition at line 90 of file detector.h.

◆ n2

int GOAT::raytracing::Detector::n2 =0
protected

Definition at line 90 of file detector.h.

◆ P

maths::Vector<double> GOAT::raytracing::Detector::P
protected

Position of the detector.

Definition at line 86 of file detector.h.

◆ type

int GOAT::raytracing::Detector::type =-1
protected

Definition at line 91 of file detector.h.


The documentation for this class was generated from the following file: