HARPO
5.1.1
Main Page
Related Pages
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
simbase
TpcSimEventGenerator.cxx
Go to the documentation of this file.
1
2
#include "TClonesArray.h"
3
#include "TRandom3.h"
4
5
#include "
TpcSimMCEvent.h
"
6
#include "
TpcSimEventGenerator.h
"
7
8
ClassImp(
TpcSimEventGenerator
)
9
10
11
12
TpcSimEventGenerator
::
TpcSimEventGenerator
()
13
{
14
}
15
16
17
TpcSimEventGenerator::~TpcSimEventGenerator
()
18
{
19
}
20
21
22
TpcSimMCEvent
*
TpcSimEventGenerator::GenerateEvent
(Int_t
/* seed */
)
23
{
24
25
TpcSimMCEvent
*
event
=
new
TpcSimMCEvent
();
26
27
Int_t ntracks = 1;
28
Double_t x0, y0, z0, t0;
29
gRandom->Sphere(x0,y0,z0,50);
30
z0 -= 100;
31
t0 = 2;
32
for
(Int_t iTr = 0; iTr<ntracks; iTr++){
33
if
(event->GetNtracks()>=
fkMaxNtracks
)
break
;
34
Double_t px0, py0, pz0;
35
Int_t pid = 11;
36
// x0 = gRandom->Gaus(0,1);
37
// y0 = gRandom->Gaus(0,1);
38
// z0 = 10 + gRandom->Gaus(0,1);
39
px0 = 0.1*gRandom->Gaus(0,1);
40
py0 = 0.1*gRandom->Gaus(0,1);
41
pz0 = 1;
42
if
(
gHarpoDebug
>0)
43
Info(
"GenerateEvent"
,
"%f %f %f %f | %f %f %f | %d"
,
44
x0,y0,z0,t0,
45
px0,py0,pz0,
46
pid);
47
TpcSimMCTrack
* tr =
new
TpcSimMCTrack
(x0,y0,z0,t0,
48
px0,py0,pz0,
49
pid);
// electron
50
51
event
->AddTrack(tr);
52
}
53
54
return
event;
55
}
TpcSimEventGenerator.h
TpcSimEventGenerator::~TpcSimEventGenerator
virtual ~TpcSimEventGenerator()
Definition:
TpcSimEventGenerator.cxx:17
TpcSimMCEvent.h
TpcSimMCEvent
Definition:
TpcSimMCEvent.h:84
gHarpoDebug
Long64_t gHarpoDebug
Definition:
HarpoDebug.cxx:9
TpcSimMCTrack
Definition:
TpcSimMCEvent.h:13
TpcSimEventGenerator
Definition:
TpcSimEventGenerator.h:8
TpcSimEventGenerator::fkMaxNtracks
static const Int_t fkMaxNtracks
Definition:
TpcSimEventGenerator.h:18
TpcSimEventGenerator::GenerateEvent
TpcSimMCEvent * GenerateEvent(Int_t seed=0)
Definition:
TpcSimEventGenerator.cxx:22
Generated by
1.8.6