Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
srcs
sbnanaobj
sbnanaobj
StandardRecord
SRVector3D.h
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
// \file SRVector3D.h
3
// \author Christopher Backhouse - bckhouse@caltech.edu
4
////////////////////////////////////////////////////////////////////////
5
6
#ifndef SRVECTOR3D_H
7
#define SRVECTOR3D_H
8
9
#ifndef __castxml__
10
#include "TVector3.h"
11
#endif
12
13
namespace
caf
14
{
15
/// A 3-vector with more efficient storage than TVector3
16
class
SRVector3D
17
{
18
public
:
19
SRVector3D
();
20
virtual
~SRVector3D
();
21
22
#ifndef __castxml__
23
SRVector3D
(
float
x
,
float
y
,
float
z
);
24
/// Easy conversion from TVector3
25
SRVector3D
(
const
TVector3& v);
26
27
void
SetXYZ
(
float
x,
float
y,
float
z);
28
29
/// Easy conversion back to TVector3
30
operator
TVector3()
const
;
31
32
void
SetX
(
float
_x){x = _x;}
33
void
SetY
(
float
_y){y = _y;}
34
void
SetZ
(
float
_z){z = _z;}
35
36
float
X
()
const
{
return
x
;}
37
float
Y
()
const
{
return
y
;}
38
float
Z
()
const
{
return
z
;}
39
40
// The more common TVector3 operations, mostly for use with TTree::Draw
41
//
42
// NB: you need to specify the initial "rec." when using these
43
float
Mag2
()
const
{
return
x*x+y*y+z*
z
;}
44
float
Mag
()
const
{
return
sqrt(
Mag2
());}
45
float
Dot
(
const
SRVector3D
& v)
const
{
return
x*v.
x
+ y*v.
y
+ z*v.
z
;}
46
SRVector3D
Unit
()
const
47
{
48
const
float
m
=
Mag
();
49
return
SRVector3D
(x/m, y/m, z/m);
50
}
51
#endif
52
53
float
x
;
54
float
y
;
55
float
z
;
56
};
57
58
}
// end namespace
59
60
#endif // SRVECTOR3D_H
61
//////////////////////////////////////////////////////////////////////////////
62
caf::SRVector3D
A 3-vector with more efficient storage than TVector3.
Definition:
SRVector3D.h:16
caf::SRVector3D::SetXYZ
void SetXYZ(float x, float y, float z)
Definition:
SRVector3D.cxx:33
caf::SRVector3D::SetX
void SetX(float _x)
Definition:
SRVector3D.h:32
caf::SRVector3D::Mag2
float Mag2() const
Definition:
SRVector3D.h:43
caf::SRVector3D::Y
float Y() const
Definition:
SRVector3D.h:37
gen_crt_frags.m
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
Definition:
gen_crt_frags.py:1347
caf::SRVector3D::SetZ
void SetZ(float _z)
Definition:
SRVector3D.h:34
caf::SRVector3D::X
float X() const
Definition:
SRVector3D.h:36
caf::SRVector3D::z
float z
Definition:
SRVector3D.h:55
caf::SRVector3D::Unit
SRVector3D Unit() const
Definition:
SRVector3D.h:46
caf::SRVector3D::~SRVector3D
virtual ~SRVector3D()
Definition:
SRVector3D.cxx:29
caf::SRVector3D::Z
float Z() const
Definition:
SRVector3D.h:38
caf::SRVector3D::y
float y
Definition:
SRVector3D.h:54
caf::SRVector3D::Dot
float Dot(const SRVector3D &v) const
Definition:
SRVector3D.h:45
caf::SRVector3D::x
float x
Definition:
SRVector3D.h:53
caf::SRVector3D::Mag
float Mag() const
Definition:
SRVector3D.h:44
caf::SRVector3D::SRVector3D
SRVector3D()
Definition:
SRVector3D.cxx:12
caf::SRVector3D::SetY
void SetY(float _y)
Definition:
SRVector3D.h:33
Generated by
1.8.5