Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
cheprep::DefaultHepRepPoint Class Reference

#include <DefaultHepRepPoint.h>

+ Inheritance diagram for cheprep::DefaultHepRepPoint:

Public Member Functions

 DefaultHepRepPoint (HEPREP::HepRepInstance *instance, double x, double y, double z)
 
 ~DefaultHepRepPoint ()
 
HEPREP::HepRepInstancegetInstance ()
 
HEPREP::HepRepAttValuegetAttValue (std::string lowerCaseName)
 
HEPREP::HepRepPointcopy (HEPREP::HepRepInstance *parent)
 
double getX ()
 
double getY ()
 
double getZ ()
 
std::vector< double > * getXYZ (std::vector< double > *xyz)
 
double getRho ()
 
double getPhi ()
 
double getTheta ()
 
double getR ()
 
double getEta ()
 
double getX (double xVertex, double yVertex, double zVertex)
 
double getY (double xVertex, double yVertex, double zVertex)
 
double getZ (double xVertex, double yVertex, double zVertex)
 
double getRho (double xVertex, double yVertex, double zVertex)
 
double getPhi (double xVertex, double yVertex, double zVertex)
 
double getTheta (double xVertex, double yVertex, double zVertex)
 
double getR (double xVertex, double yVertex, double zVertex)
 
double getEta (double xVertex, double yVertex, double zVertex)
 
- Public Member Functions inherited from cheprep::DefaultHepRepAttribute
 DefaultHepRepAttribute ()
 
 ~DefaultHepRepAttribute ()
 
std::set< HEPREP::HepRepAttValue * > getAttValuesFromNode ()
 
void addAttValue (HEPREP::HepRepAttValue *hepRepAttValue)
 
void addAttValue (std::string key, char *value, int showLabel)
 
void addAttValue (std::string key, std::string value, int showLabel)
 
void addAttValue (std::string key, int value, int showLabel)
 
void addAttValue (std::string key, int64 value, int showLabel)
 
void addAttValue (std::string key, double value, int showLabel)
 
void addAttValue (std::string key, bool value, int showLabel)
 
void addAttValue (std::string key, std::vector< double > value, int showLabel)
 
void addAttValue (std::string key, double red, double green, double blue, double alpha, int showLabel)
 
HEPREP::HepRepAttValuegetAttValueFromNode (std::string lowerCaseName)
 
HEPREP::HepRepAttValueremoveAttValue (std::string key)
 
HEPREP::HepRepAttValuegetAttValue (std::string name)=0
 
- Public Member Functions inherited from HEPREP::HepRepAttribute
virtual ~HepRepAttribute ()
 Destructor.
 
virtual void addAttValue (HepRepAttValue *attValue)=0
 
virtual void addAttValue (std::string key, char *value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, std::string value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, int64 value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, int value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, double value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, bool value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, std::vector< double > value, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual void addAttValue (std::string key, double red, double green, double blue, double alpha=1.0, int showLabel=HepRepConstants::SHOW_NONE)=0
 
virtual HepRepAttValueremoveAttValue (std::string key)=0
 
virtual HepRepAttValuegetAttValue (std::string name)=0
 
virtual std::set< HepRepAttValue * > getAttValuesFromNode ()=0
 
virtual HepRepAttValuegetAttValueFromNode (std::string lowerCaseName)=0
 
- Public Member Functions inherited from HEPREP::HepRepPoint
virtual ~HepRepPoint ()
 Destructor.
 
virtual double getX ()=0
 
virtual double getY ()=0
 
virtual double getZ ()=0
 
virtual double getRho ()=0
 
virtual double getPhi ()=0
 
virtual double getTheta ()=0
 
virtual double getR ()=0
 
virtual double getEta ()=0
 
virtual double getX (double xVertex, double yVertex, double zVertex)=0
 
virtual double getY (double xVertex, double yVertex, double zVertex)=0
 
virtual double getZ (double xVertex, double yVertex, double zVertex)=0
 
virtual double getRho (double xVertex, double yVertex, double zVertex)=0
 
virtual double getPhi (double xVertex, double yVertex, double zVertex)=0
 
virtual double getTheta (double xVertex, double yVertex, double zVertex)=0
 
virtual double getR (double xVertex, double yVertex, double zVertex)=0
 
virtual double getEta (double xVertex, double yVertex, double zVertex)=0
 
virtual std::vector< double > * getXYZ (std::vector< double > *xyz)=0
 
virtual HepRepInstancegetInstance ()=0
 
virtual HepRepPointcopy (HepRepInstance *parent)=0
 

Protected Attributes

double x
 
double y
 
double z
 

Detailed Description

Definition at line 22 of file DefaultHepRepPoint.h.

Constructor & Destructor Documentation

◆ DefaultHepRepPoint()

cheprep::DefaultHepRepPoint::DefaultHepRepPoint ( HEPREP::HepRepInstance instance,
double  x,
double  y,
double  z 
)

Definition at line 17 of file DefaultHepRepPoint.cc.

18 : DefaultHepRepAttribute(), instance(inst), x(xx), y(yy), z(zz) {
19
20 if (instance == NULL) {
21 cerr << "HepRepPoints cannot be created without a HepRepInstance." << endl;
22 } else {
23 instance->addPoint(this);
24 }
25}
virtual void addPoint(HepRepPoint *point)=0

◆ ~DefaultHepRepPoint()

cheprep::DefaultHepRepPoint::~DefaultHepRepPoint ( )

Definition at line 27 of file DefaultHepRepPoint.cc.

27 {
28}

Member Function Documentation

◆ copy()

HepRepPoint * cheprep::DefaultHepRepPoint::copy ( HEPREP::HepRepInstance parent)
virtual

Returns a deep copy of this point.

Parameters
parentto add the copy to.
Returns
copy of this point.

Implements HEPREP::HepRepPoint.

Definition at line 39 of file DefaultHepRepPoint.cc.

39 {
40 return new DefaultHepRepPoint(inst, x, y, z);
41}
DefaultHepRepPoint(HEPREP::HepRepInstance *instance, double x, double y, double z)

◆ getAttValue()

HepRepAttValue * cheprep::DefaultHepRepPoint::getAttValue ( std::string  name)
virtual

Returns the attValue specified by name. This attValue is normally searched on the node itself and then on its type, moving up the typetree.

Parameters
nameof attribute value.
Returns
attribute value.

Implements cheprep::DefaultHepRepAttribute.

Definition at line 34 of file DefaultHepRepPoint.cc.

34 {
35 HepRepAttValue* value = getAttValueFromNode(lowerCaseName);
36 return (value != NULL) ? value : instance->getAttValue(lowerCaseName);
37}
virtual HepRepAttValue * getAttValue(std::string name)=0
HEPREP::HepRepAttValue * getAttValueFromNode(std::string lowerCaseName)

◆ getEta() [1/2]

double cheprep::DefaultHepRepPoint::getEta ( )
virtual

Returns coordinate with respect to vertex at (0, 0, 0).

Returns
eta = -0.5*clog((1.-ct)/(1.+ct)), where ct = .cos(getTheta(dx, dy, dz));

Implements HEPREP::HepRepPoint.

Definition at line 79 of file DefaultHepRepPoint.cc.

79 {
80 double ct = cos(getTheta());
81 return -0.5*log((1.-ct)/(1.+ct));
82}

◆ getEta() [2/2]

double cheprep::DefaultHepRepPoint::getEta ( double  xVertex,
double  yVertex,
double  zVertex 
)
virtual

Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).

Returns
eta = -0.5*clog((1.-ct)/(1.+ct)), where ct = .cos(getTheta(dx, dy, dz));

Implements HEPREP::HepRepPoint.

Definition at line 116 of file DefaultHepRepPoint.cc.

116 {
117 double ct = cos(getTheta(xVertex, yVertex, zVertex));
118 return -0.5*log((1.-ct)/(1.+ct));
119}

◆ getInstance()

HepRepInstance * cheprep::DefaultHepRepPoint::getInstance ( )
virtual

Returns associated instance (parent).

Returns
HepRepInstance.

Implements HEPREP::HepRepPoint.

Definition at line 30 of file DefaultHepRepPoint.cc.

30 {
31 return instance;
32}

◆ getPhi() [1/2]

double cheprep::DefaultHepRepPoint::getPhi ( )
virtual

Returns coordinate with respect to vertex at (0, 0, 0).

Returns
phi = std::atan2(dy, dx);

Implements HEPREP::HepRepPoint.

Definition at line 66 of file DefaultHepRepPoint.cc.

66 {
67 return atan2(y, x);
68}

◆ getPhi() [2/2]

double cheprep::DefaultHepRepPoint::getPhi ( double  xVertex,
double  yVertex,
double  zVertex 
)
virtual

Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).

Returns
phi = std::atan2(dy, dx);

Implements HEPREP::HepRepPoint.

Definition at line 102 of file DefaultHepRepPoint.cc.

102 {
103 return atan2(getY(xVertex, yVertex, zVertex), getX(xVertex, yVertex, zVertex));
104}

◆ getR() [1/2]

double cheprep::DefaultHepRepPoint::getR ( )
virtual

Returns coordinate with respect to vertex at (0, 0, 0).

Returns
r = std::sqrt(dx2+dy2+dz2);

Implements HEPREP::HepRepPoint.

Definition at line 74 of file DefaultHepRepPoint.cc.

74 {
75 double r = getRho();
76 return sqrt(r*r + z*z);
77}

◆ getR() [2/2]

double cheprep::DefaultHepRepPoint::getR ( double  xVertex,
double  yVertex,
double  zVertex 
)
virtual

Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).

Returns
r = std::sqrt(dx2+dy2+dz2);

Implements HEPREP::HepRepPoint.

Definition at line 110 of file DefaultHepRepPoint.cc.

110 {
111 double dr = getRho(xVertex, yVertex, zVertex);
112 double dz = getZ(xVertex, yVertex, zVertex);
113 return sqrt(dr*dr + dz*dz);
114}

◆ getRho() [1/2]

double cheprep::DefaultHepRepPoint::getRho ( )
virtual

Returns coordinate with respect to vertex at (0, 0, 0).

Returns
rho = std::sqrt(dx2+dy2);

Implements HEPREP::HepRepPoint.

Definition at line 62 of file DefaultHepRepPoint.cc.

62 {
63 return sqrt(x*x + y*y);
64}

Referenced by getR(), and getTheta().

◆ getRho() [2/2]

double cheprep::DefaultHepRepPoint::getRho ( double  xVertex,
double  yVertex,
double  zVertex 
)
virtual

Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).

Returns
rho = std::sqrt(dx2+dy2);

Implements HEPREP::HepRepPoint.

Definition at line 96 of file DefaultHepRepPoint.cc.

96 {
97 double dx = getX(xVertex, yVertex, zVertex);
98 double dy = getY(xVertex, yVertex, zVertex);
99 return sqrt(dx*dx + dy*dy);
100}

◆ getTheta() [1/2]

double cheprep::DefaultHepRepPoint::getTheta ( )
virtual

Returns coordinate with respect to vertex at (0, 0, 0).

Returns
theta = std::atan2(rho, dx);

Implements HEPREP::HepRepPoint.

Definition at line 70 of file DefaultHepRepPoint.cc.

70 {
71 return atan2(getRho(), z);
72}

Referenced by getEta().

◆ getTheta() [2/2]

double cheprep::DefaultHepRepPoint::getTheta ( double  xVertex,
double  yVertex,
double  zVertex 
)
virtual

Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).

Returns
theta = std::atan2(rho, dx);

Implements HEPREP::HepRepPoint.

Definition at line 106 of file DefaultHepRepPoint.cc.

106 {
107 return atan2(getRho(xVertex, yVertex, zVertex), getZ(xVertex, yVertex, zVertex));
108}

◆ getX() [1/2]

double cheprep::DefaultHepRepPoint::getX ( )
virtual

Returns coordinate with respect to vertex at (0, 0, 0).

Returns
dx-coordinate

Implements HEPREP::HepRepPoint.

Definition at line 43 of file DefaultHepRepPoint.cc.

43 {
44 return x;
45}

Referenced by getPhi(), and getRho().

◆ getX() [2/2]

double cheprep::DefaultHepRepPoint::getX ( double  xVertex,
double  yVertex,
double  zVertex 
)
virtual

Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).

Returns
dx-coordinate

Implements HEPREP::HepRepPoint.

Definition at line 84 of file DefaultHepRepPoint.cc.

84 {
85 return x - xVertex;
86}

◆ getXYZ()

vector< double > * cheprep::DefaultHepRepPoint::getXYZ ( std::vector< double > *  xyz)
virtual

Returns coordinate with respect to vertex at (0, 0, 0).

Parameters
xyzlist of three coordinates which are filled and returned. If null, a new list of three coordinates is allocated.
Returns
list of 3 coordinates.

Implements HEPREP::HepRepPoint.

Definition at line 55 of file DefaultHepRepPoint.cc.

55 {
56 (*xyz)[0] = x;
57 (*xyz)[1] = y;
58 (*xyz)[2] = z;
59 return xyz;
60}

◆ getY() [1/2]

double cheprep::DefaultHepRepPoint::getY ( )
virtual

Returns coordinate with respect to vertex at (0, 0, 0).

Returns
dy-coordinate

Implements HEPREP::HepRepPoint.

Definition at line 47 of file DefaultHepRepPoint.cc.

47 {
48 return y;
49}

Referenced by getPhi(), and getRho().

◆ getY() [2/2]

double cheprep::DefaultHepRepPoint::getY ( double  xVertex,
double  yVertex,
double  zVertex 
)
virtual

Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).

Returns
dy-coordinate

Implements HEPREP::HepRepPoint.

Definition at line 88 of file DefaultHepRepPoint.cc.

88 {
89 return y - yVertex;
90}

◆ getZ() [1/2]

double cheprep::DefaultHepRepPoint::getZ ( )
virtual

Returns coordinate with respect to vertex at (0, 0, 0).

Returns
dz-coordinate

Implements HEPREP::HepRepPoint.

Definition at line 51 of file DefaultHepRepPoint.cc.

51 {
52 return z;
53}

Referenced by getR(), and getTheta().

◆ getZ() [2/2]

double cheprep::DefaultHepRepPoint::getZ ( double  xVertex,
double  yVertex,
double  zVertex 
)
virtual

Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).

Returns
dz-coordinate

Implements HEPREP::HepRepPoint.

Definition at line 92 of file DefaultHepRepPoint.cc.

92 {
93 return z - zVertex;
94}

Member Data Documentation

◆ x

double cheprep::DefaultHepRepPoint::x
protected

Definition at line 28 of file DefaultHepRepPoint.h.

Referenced by copy(), getPhi(), getRho(), getX(), and getXYZ().

◆ y

double cheprep::DefaultHepRepPoint::y
protected

Definition at line 28 of file DefaultHepRepPoint.h.

Referenced by copy(), getPhi(), getRho(), getXYZ(), and getY().

◆ z

double cheprep::DefaultHepRepPoint::z
protected

Definition at line 28 of file DefaultHepRepPoint.h.

Referenced by copy(), getR(), getTheta(), getXYZ(), and getZ().


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