Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaBeamInfo.cxx
Go to the documentation of this file.
1
//*-- Author : Ole Hansen 27-Apr-04
2
4
//
5
// THaBeamInfo
6
//
7
// Utility class/structure for holding variable beam information.
8
//
10
11
#include "
THaBeamInfo.h
"
12
#include "
THaBeam.h
"
13
#include "
THaRunParameters.h
"
14
#include "
TMath.h
"
15
16
using namespace
std
;
17
18
//_____________________________________________________________________________
19
Double_t
THaBeamInfo::GetE
()
const
20
{
21
// Return beam energy. This is the energy corresponding to the
22
// current beam momentum and mass, not necessarily the same as
23
// the nominal beam energy in the run database.
24
25
if
( !
fBeam
)
26
return
kBig
;
27
28
Double_t
m
=
GetM
();
29
Double_t
p
=
GetP
();
30
return
TMath::Sqrt
(
p
*
p
+
m
*
m
);
31
}
32
33
//_____________________________________________________________________________
34
Double_t
THaBeamInfo::GetM
()
const
35
{
36
// Return mass of beam particles
37
38
if
( !
fBeam
)
39
return
kBig
;
40
THaRunParameters
* rp =
fBeam
->
GetRunParameters
();
41
if
( !rp )
42
return
kBig
;
43
return
rp->
GetBeamM
();
44
}
45
46
//_____________________________________________________________________________
47
Int_t
THaBeamInfo::GetQ
()
const
48
{
49
// Return charge of beam particles (electrons: -1)
50
51
if
( !
fBeam
)
52
return
0;
53
THaRunParameters
* rp =
fBeam
->
GetRunParameters
();
54
if
( !rp )
55
return
0;
56
return
rp->
GetBeamQ
();
57
}
58
59
//_____________________________________________________________________________
60
Double_t
THaBeamInfo::GetdE
()
const
61
{
62
// Return beam energy uncertainty
63
64
if
( !
fBeam
)
65
return
kBig
;
66
THaRunParameters
* rp =
fBeam
->
GetRunParameters
();
67
if
( !rp )
68
return
kBig
;
69
return
rp->
GetBeamdE
();
70
}
71
72
//_____________________________________________________________________________
73
ClassImp
(
THaBeamInfo
)
Int_t
int Int_t
kBig
const Data_t kBig
Definition
DataType.h:15
Double_t
double Double_t
p
winID h TVirtualViewer3D TVirtualGLPainter p
THaBeamInfo.h
THaBeam.h
THaRunParameters.h
TMath.h
THaBeamInfo
Definition
THaBeamInfo.h:15
THaBeamInfo::GetP
Double_t GetP() const
Definition
THaBeamInfo.h:45
THaBeamInfo::GetM
Double_t GetM() const
Definition
THaBeamInfo.cxx:34
THaBeamInfo::GetE
Double_t GetE() const
Definition
THaBeamInfo.cxx:19
THaBeamInfo::GetdE
Double_t GetdE() const
Definition
THaBeamInfo.cxx:60
THaBeamInfo::fBeam
THaBeam * fBeam
Definition
THaBeamInfo.h:79
THaBeamInfo::GetQ
Int_t GetQ() const
Definition
THaBeamInfo.cxx:47
THaBeam::GetRunParameters
THaRunParameters * GetRunParameters() const
Definition
THaBeam.h:25
THaRunParameters
Definition
THaRunParameters.h:16
THaRunParameters::GetBeamQ
Int_t GetBeamQ() const
Definition
THaRunParameters.h:26
THaRunParameters::GetBeamdE
Double_t GetBeamdE() const
Definition
THaRunParameters.h:23
THaRunParameters::GetBeamM
Double_t GetBeamM() const
Definition
THaRunParameters.h:24
TMath::Sqrt
Double_t Sqrt(Double_t x)
std
STL namespace.
m
TMarker m
ClassImp
ClassImp(TPyArg)
Podd
THaBeamInfo.cxx
Generated by
1.9.8