Geant4 9.6.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 23 of file DefaultHepRepPoint.h.

Constructor & Destructor Documentation

◆ DefaultHepRepPoint()

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

Definition at line 18 of file DefaultHepRepPoint.cc.

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

◆ ~DefaultHepRepPoint()

cheprep::DefaultHepRepPoint::~DefaultHepRepPoint ( )

Definition at line 28 of file DefaultHepRepPoint.cc.

28 {
29}

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 40 of file DefaultHepRepPoint.cc.

40 {
41 return new DefaultHepRepPoint(inst, x, y, z);
42}
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 35 of file DefaultHepRepPoint.cc.

35 {
36 HepRepAttValue* value = getAttValueFromNode(lowerCaseName);
37 return (value != NULL) ? value : instance->getAttValue(lowerCaseName);
38}
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 80 of file DefaultHepRepPoint.cc.

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

◆ 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 117 of file DefaultHepRepPoint.cc.

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

◆ getInstance()

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

Returns associated instance (parent).

Returns
HepRepInstance.

Implements HEPREP::HepRepPoint.

Definition at line 31 of file DefaultHepRepPoint.cc.

31 {
32 return instance;
33}

◆ 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 67 of file DefaultHepRepPoint.cc.

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

◆ 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 103 of file DefaultHepRepPoint.cc.

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

◆ 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 75 of file DefaultHepRepPoint.cc.

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

◆ 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 111 of file DefaultHepRepPoint.cc.

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

◆ 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 63 of file DefaultHepRepPoint.cc.

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

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 97 of file DefaultHepRepPoint.cc.

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

◆ 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 71 of file DefaultHepRepPoint.cc.

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

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 107 of file DefaultHepRepPoint.cc.

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

◆ 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 44 of file DefaultHepRepPoint.cc.

44 {
45 return x;
46}

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 85 of file DefaultHepRepPoint.cc.

85 {
86 return x - xVertex;
87}

◆ 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 56 of file DefaultHepRepPoint.cc.

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

◆ 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 48 of file DefaultHepRepPoint.cc.

48 {
49 return y;
50}

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 89 of file DefaultHepRepPoint.cc.

89 {
90 return y - yVertex;
91}

◆ 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 52 of file DefaultHepRepPoint.cc.

52 {
53 return z;
54}

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 93 of file DefaultHepRepPoint.cc.

93 {
94 return z - zVertex;
95}

Member Data Documentation

◆ x

double cheprep::DefaultHepRepPoint::x
protected

Definition at line 29 of file DefaultHepRepPoint.h.

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

◆ y

double cheprep::DefaultHepRepPoint::y
protected

Definition at line 29 of file DefaultHepRepPoint.h.

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

◆ z

double cheprep::DefaultHepRepPoint::z
protected

Definition at line 29 of file DefaultHepRepPoint.h.

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


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