Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
g4lbne
src
TrackPoint_t.cc
Go to the documentation of this file.
1
//----------------------------------------------------------------------
2
// Sets the relevant memebers of the data class for storing the
3
// MC data for the Hadron and Muon Monitors.
4
//
5
// $Id: TrackPoint_t.cc,v 1.1 2011/07/13 16:20:52 loiacono Exp $
6
//----------------------------------------------------------------------
7
8
9
#include "globals.hh"
10
#include "G4ios.hh"
11
12
#include "
TrackPoint_t.hh
"
13
14
ClassImp
(
TrackPoint_t
)
15
16
//-----------------------------------------------------------------------------------
17
TrackPoint_t
::
TrackPoint_t
()
18
:
type
(-999),
19
trkid(-999),
20
gen(-99),
21
impwt(1.0),
22
x
(-99999.0),
23
y
(-99999.0),
24
z
(-99999.0),
25
px(-99999.0),
26
py(-99999.0),
27
pz(-99999.0)
28
29
{
30
31
}
32
33
//-----------------------------------------------------------------------------------
34
TrackPoint_t::~TrackPoint_t
()
35
{
36
// TrackPoint_t destructor
37
}
38
39
40
//------------------------------------------------------------------------------------------
41
Float_t
TrackPoint_t::GetPosition
(
int
i
)
const
42
{
43
if
(i == 0)
return
x
;
44
else
if
(i == 1)
return
y
;
45
else
if
(i == 2)
return
z
;
46
else
47
{
48
std::cout <<
"TrackPoint_t::GetPosition - invalid position index "
<< i
49
<<
". Valid indices are 0, 1, and 2. "
<<
std::endl
;
50
return
-999999.0;
51
}
52
}
53
54
//------------------------------------------------------------------------------------------
55
Float_t
TrackPoint_t::GetPosition
(
const
std::string
&
pos
)
const
56
{
57
if
(pos ==
"x"
|| pos ==
"X"
)
return
x
;
58
else
if
(pos ==
"y"
|| pos ==
"Y"
)
return
y
;
59
else
if
(pos ==
"z"
|| pos ==
"Z"
)
return
z
;
60
else
61
{
62
std::cout <<
"TrackPoint_t::GetPosition - invalid position \""
<< pos
63
<<
"\". Valid positions are x, y, z, X, Y and Z. "
<<
std::endl
;
64
return
-999999.0;
65
}
66
}
67
68
//------------------------------------------------------------------------------------------
69
Float_t
TrackPoint_t::GetMomentum
(
int
i
)
const
70
{
71
if
(i == 0)
return
px
;
72
else
if
(i == 1)
return
py
;
73
else
if
(i == 2)
return
pz
;
74
else
75
{
76
std::cout <<
"TrackPoint_t::GetMomentum - invalid momentum index "
<< i
77
<<
". Valid indices are 0, 1, and 2. "
<<
std::endl
;
78
return
-999999.0;
79
}
80
}
81
82
//------------------------------------------------------------------------------------------
83
Float_t
TrackPoint_t::GetMomentum
(
const
std::string
&
pos
)
const
84
{
85
if
(pos ==
"x"
|| pos ==
"X"
)
return
px
;
86
else
if
(pos ==
"y"
|| pos ==
"Y"
)
return
py
;
87
else
if
(pos ==
"z"
|| pos ==
"Z"
)
return
pz
;
88
else
89
{
90
std::cout <<
"TrackPoint_t::GetMomentum - invalid momentum direction \""
<< pos
91
<<
"\". Valid directions are x, y, z, X, Y and Z. "
<<
std::endl
;
92
return
-999999.0;
93
}
94
}
95
96
//------------------------------------------------------------------------------------------
97
void
TrackPoint_t::Print
()
98
{
99
100
std::cout <<
"TrackPoint_t::Print - "
<<
std::endl
;
101
std::cout <<
" type = "
<<
type
<<
std::endl
;
102
std::cout <<
" track ID = "
<<
trkid
<<
std::endl
;
103
std::cout <<
" generation = "
<<
gen
<<
std::endl
;
104
std::cout <<
" impwt = "
<<
impwt
<<
std::endl
;
105
std::cout <<
" x = "
<<
x
<<
std::endl
;
106
std::cout <<
" y = "
<<
y
<<
std::endl
;
107
std::cout <<
" z = "
<<
z
<<
std::endl
;
108
std::cout <<
" px = "
<<
px
<<
std::endl
;
109
std::cout <<
" py = "
<<
py
<<
std::endl
;
110
std::cout <<
" pz = "
<<
pz
<<
std::endl
;
111
}
TrackPoint_t::z
Float_t z
Definition:
TrackPoint_t.hh:54
string
std::string string
Definition:
nybbler.cc:12
TrackPoint_t::type
Int_t type
Definition:
TrackPoint_t.hh:48
TrackPoint_t::trkid
Int_t trkid
Definition:
TrackPoint_t.hh:49
TrackPoint_t.hh
sensitivity_comps.i
int i
Definition:
sensitivity_comps.py:15
y
double y
Definition:
GapWidth_module.cc:109
ClassImp
ClassImp(TrackPoint_t) TrackPoint_t
Definition:
TrackPoint_t.cc:14
TrackPoint_t::GetMomentum
Float_t GetMomentum(int i) const
Definition:
TrackPoint_t.cc:69
TrackPoint_t::Print
void Print()
Definition:
TrackPoint_t.cc:97
TrackPoint_t::impwt
Double_t impwt
Definition:
TrackPoint_t.hh:51
z
double z
Definition:
GapWidth_module.cc:108
TrackPoint_t::GetPosition
Float_t GetPosition(int i) const
Definition:
TrackPoint_t.cc:41
TrackPoint_t::~TrackPoint_t
virtual ~TrackPoint_t()
Definition:
TrackPoint_t.cc:34
TrackPoint_t::px
Float_t px
Definition:
TrackPoint_t.hh:55
MakeVectorFile.pos
tuple pos
Definition:
MakeVectorFile.py:66
TrackPoint_t::py
Float_t py
Definition:
TrackPoint_t.hh:56
type
static QCString type
Definition:
declinfo.cpp:672
train.x
list x
Definition:
train.py:276
TrackPoint_t
Definition:
TrackPoint_t.hh:23
TrackPoint_t::gen
Int_t gen
Definition:
TrackPoint_t.hh:50
TrackPoint_t::pz
Float_t pz
Definition:
TrackPoint_t.hh:57
TrackPoint_t::x
Float_t x
Definition:
TrackPoint_t.hh:52
TrackPoint_t::y
Float_t y
Definition:
TrackPoint_t.hh:53
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11