Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes
cheprep::DefaultHepRepPoint Class Reference

#include <DefaultHepRepPoint.h>

Inheritance diagram for cheprep::DefaultHepRepPoint:
cheprep::DefaultHepRepAttribute HEPREP::HepRepPoint HEPREP::HepRepAttribute HEPREP::HepRepAttribute

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)
 
- Public Member Functions inherited from HEPREP::HepRepAttribute
virtual ~HepRepAttribute ()
 Destructor. More...
 
- Public Member Functions inherited from HEPREP::HepRepPoint
virtual ~HepRepPoint ()
 Destructor. More...
 

Protected Attributes

double x
 
double y
 
double z
 

Detailed Description

Definition at line 23 of file DefaultHepRepPoint.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file DefaultHepRepPoint.cc.

References HEPREP::HepRepInstance::addPoint().

Referenced by copy().

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
cheprep::DefaultHepRepPoint::~DefaultHepRepPoint ( )

Definition at line 28 of file DefaultHepRepPoint.cc.

28  {
29 }

Member Function Documentation

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.

References DefaultHepRepPoint(), x, y, and z.

40  {
41  return new DefaultHepRepPoint(inst, x, y, z);
42 }
DefaultHepRepPoint(HEPREP::HepRepInstance *instance, double x, double y, double z)
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.

References HEPREP::HepRepAttribute::getAttValue(), and cheprep::DefaultHepRepAttribute::getAttValueFromNode().

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)
const XML_Char int const XML_Char * value
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.

References getTheta().

80  {
81  double ct = cos(getTheta());
82  return -0.5*log((1.-ct)/(1.+ct));
83 }
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.

References getTheta().

117  {
118  double ct = cos(getTheta(xVertex, yVertex, zVertex));
119  return -0.5*log((1.-ct)/(1.+ct));
120 }
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 }
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.

References x, and y.

67  {
68  return atan2(y, x);
69 }
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.

References getX(), and getY().

103  {
104  return atan2(getY(xVertex, yVertex, zVertex), getX(xVertex, yVertex, zVertex));
105 }
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.

References getRho(), and z.

75  {
76  double r = getRho();
77  return sqrt(r*r + z*z);
78 }
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.

References getRho(), and getZ().

111  {
112  double dr = getRho(xVertex, yVertex, zVertex);
113  double dz = getZ(xVertex, yVertex, zVertex);
114  return sqrt(dr*dr + dz*dz);
115 }
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.

References x, and y.

Referenced by getR(), and getTheta().

63  {
64  return sqrt(x*x + y*y);
65 }
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.

References getX(), and getY().

97  {
98  double dx = getX(xVertex, yVertex, zVertex);
99  double dy = getY(xVertex, yVertex, zVertex);
100  return sqrt(dx*dx + dy*dy);
101 }
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.

References getRho(), and z.

Referenced by getEta().

71  {
72  return atan2(getRho(), z);
73 }
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.

References getRho(), and getZ().

107  {
108  return atan2(getRho(xVertex, yVertex, zVertex), getZ(xVertex, yVertex, zVertex));
109 }
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.

References x.

Referenced by getPhi(), and getRho().

44  {
45  return x;
46 }
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.

References x.

85  {
86  return x - xVertex;
87 }
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.

References x, y, and z.

56  {
57  (*xyz)[0] = x;
58  (*xyz)[1] = y;
59  (*xyz)[2] = z;
60  return xyz;
61 }
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.

References y.

Referenced by getPhi(), and getRho().

48  {
49  return y;
50 }
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.

References y.

89  {
90  return y - yVertex;
91 }
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.

References z.

Referenced by getR(), and getTheta().

52  {
53  return z;
54 }
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.

References z.

93  {
94  return z - zVertex;
95 }

Field Documentation

double cheprep::DefaultHepRepPoint::x
protected

Definition at line 29 of file DefaultHepRepPoint.h.

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

double cheprep::DefaultHepRepPoint::y
protected

Definition at line 29 of file DefaultHepRepPoint.h.

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

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: