HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
13 {
14 }
15 
16 
18 {
19 }
20 
21 
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 }
Long64_t gHarpoDebug
Definition: HarpoDebug.cxx:9
static const Int_t fkMaxNtracks
TpcSimMCEvent * GenerateEvent(Int_t seed=0)