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
16using namespace std;
17
18//_____________________________________________________________________________
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//_____________________________________________________________________________
35{
36 // Return mass of beam particles
37
38 if( !fBeam )
39 return kBig;
41 if( !rp )
42 return kBig;
43 return rp->GetBeamM();
44}
45
46//_____________________________________________________________________________
48{
49 // Return charge of beam particles (electrons: -1)
50
51 if( !fBeam )
52 return 0;
54 if( !rp )
55 return 0;
56 return rp->GetBeamQ();
57}
58
59//_____________________________________________________________________________
61{
62 // Return beam energy uncertainty
63
64 if( !fBeam )
65 return kBig;
67 if( !rp )
68 return kBig;
69 return rp->GetBeamdE();
70}
71
72//_____________________________________________________________________________
int Int_t
const Data_t kBig
Definition DataType.h:15
double Double_t
winID h TVirtualViewer3D TVirtualGLPainter p
Double_t GetP() const
Definition THaBeamInfo.h:45
Double_t GetM() const
Double_t GetE() const
Double_t GetdE() const
THaBeam * fBeam
Definition THaBeamInfo.h:79
Int_t GetQ() const
THaRunParameters * GetRunParameters() const
Definition THaBeam.h:25
Int_t GetBeamQ() const
Double_t GetBeamdE() const
Double_t GetBeamM() const
Double_t Sqrt(Double_t x)
STL namespace.
TMarker m
ClassImp(TPyArg)