6b3705b34f0758b90973e4d596e93b89e7c1350a
[u/mrichter/AliRoot.git] / TPC / Upgrade / AliToyMCEvent.cxx
1 #include "AliToyMCEvent.h"
2
3 ClassImp(AliToyMCEvent);
4 Int_t AliToyMCEvent::fgEvCounter = 0;
5
6 AliToyMCEvent::AliToyMCEvent()
7   :TObject()
8   ,fEventNumber(0)
9   ,fEventType(kPhysics)
10   ,fT0(-1.)
11   ,fX(-1000.)
12   ,fY(-1000.)
13   ,fZ(-1000.)
14   ,fSCscale(-1.)
15   ,fSCscaleChi2(0)
16   ,fTracks("AliToyMCTrack")
17 {
18   fEventNumber = fgEvCounter;
19   fgEvCounter++;
20 }
21
22 //____________________________________________________
23 AliToyMCEvent::AliToyMCEvent(const AliToyMCEvent &event)
24   : TObject(event)
25   ,fEventNumber(event.fEventNumber)
26   ,fEventType(event.fEventType)
27   ,fT0(event.fT0)
28   ,fX(event.fX)
29   ,fY(event.fY)
30   ,fZ(event.fZ)
31   ,fSCscale(event.fSCscale)
32   ,fSCscaleChi2(event.fSCscaleChi2)
33   ,fTracks(event.fTracks)
34 {
35   //
36 }
37
38 //_____________________________________________________
39 AliToyMCEvent& AliToyMCEvent::operator = (const AliToyMCEvent &event)
40 {
41   //assignment operator
42   if (&event == this) return *this;
43   new (this) AliToyMCEvent(event);
44
45   return *this;
46 }
47 //_____________________________________________________
48 AliToyMCTrack* AliToyMCEvent::AddTrack(const AliToyMCTrack &track)
49 {
50   return new(fTracks[fTracks.GetEntriesFast()]) AliToyMCTrack(track);
51 }
52 //____________________________________________________
53 AliToyMCTrack* AliToyMCEvent::AddTrack(Double_t xyz[3],Double_t pxpypz[3],
54                         Double_t cv[21],Short_t sign)
55 {
56   return new(fTracks[fTracks.GetEntriesFast()]) AliToyMCTrack(xyz,pxpypz,cv,sign);
57 }
58