hlit-ana
0.0.0
Main Page
Related Pages
Classes
Files
File List
All
Classes
Functions
Variables
Pages
HlitEvent.cxx
1
#include <TString.h>
2
#include <TRandom.h>
3
#include "HlitEvent.h"
4
6
ClassImp(
HlitEvent
);
8
9
HlitEvent::HlitEvent
()
10
: TObject(), fID(0), fVx(0.0), fVy(0.0), fVz(0.0), fNTracks(0), fTracks(0) {
14
}
15
16
HlitEvent::HlitEvent
(Long64_t
id
, Double_t vx, Double_t vy, Double_t vz)
17
: TObject(), fID(id), fVx(vx), fVy(vy), fVz(vz), fNTracks(0), fTracks(0) {
21
22
fTracks
=
new
TClonesArray(
"HlitTrack"
);
23
gRandom->SetSeed(0);
24
}
25
26
HlitEvent::~HlitEvent
() {
30
31
delete
fTracks
;
32
fTracks
= 0;
33
}
34
35
HlitTrack
*
HlitEvent::AddTrack
() {
39
return
(
HlitTrack
*)
fTracks
->ConstructedAt(
fNTracks
++);
40
}
41
void
HlitEvent::Print
(Option_t *option)
const
{
45
Printf(
"id=%lld vx=%.3f vy=%.3f vz=%.3f"
,
fID
,
fVx
,
fVy
,
fVz
);
46
47
if
(!
fTracks
)
48
return
;
49
50
TString str(option);
51
str.ToLower();
52
if
(str.Contains(
"all"
)) {
53
HlitTrack
*t;
54
for
(Int_t i = 0; i <
fTracks
->GetEntries(); i++) {
55
t = (
HlitTrack
*)
fTracks
->At(i);
56
t->
Print
();
57
}
58
}
59
}
60
61
void
HlitEvent::Clear
(Option_t *) {
65
fID
= 0;
66
fVx
= 0;
67
fVy
= 0;
68
fVz
= 0;
69
70
fNTracks
= 0;
71
fTracks
->Clear(
"C"
);
72
}
73
74
void
HlitEvent::BuildVertexRandom
() {
78
79
fVx
= gRandom->Gaus();
80
fVy
= gRandom->Gaus();
81
fVz
= gRandom->Gaus();
82
}
HlitTrack
Track object.
Definition:
HlitTrack.h:13
HlitEvent::Clear
virtual void Clear(Option_t *option="")
Definition:
HlitEvent.cxx:61
HlitEvent::fVy
Double_t fVy
Vertex y.
Definition:
HlitEvent.h:87
HlitEvent::fVx
Double_t fVx
Vertex x.
Definition:
HlitEvent.h:86
HlitEvent::fTracks
TClonesArray * fTracks
Array with all tracks.
Definition:
HlitEvent.h:92
HlitEvent::HlitEvent
HlitEvent()
Definition:
HlitEvent.cxx:9
HlitEvent
Event object.
Definition:
HlitEvent.h:15
HlitEvent::fNTracks
Int_t fNTracks
Number of tracks.
Definition:
HlitEvent.h:89
HlitEvent::fVz
Double_t fVz
Vertex z.
Definition:
HlitEvent.h:88
HlitEvent::fID
Long64_t fID
ID of event.
Definition:
HlitEvent.h:85
HlitEvent::BuildVertexRandom
void BuildVertexRandom()
Definition:
HlitEvent.cxx:74
HlitEvent::~HlitEvent
virtual ~HlitEvent()
Definition:
HlitEvent.cxx:26
HlitTrack::Print
virtual void Print(Option_t *option="") const
Definition:
HlitTrack.cxx:39
HlitEvent::AddTrack
HlitTrack * AddTrack()
Definition:
HlitEvent.cxx:35
HlitEvent::Print
virtual void Print(Option_t *option="") const
Definition:
HlitEvent.cxx:41
HlitBase
HlitEvent.cxx
Generated by
1.8.5