]>
Commit | Line | Data |
---|---|---|
16bf9884 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* | |
17 | $Log$ | |
18 | */ | |
19 | ||
20 | /////////////////////////////////////////////////////////////////////////////// | |
21 | // // | |
22 | // Simplified TRD slow simulator // | |
23 | // // | |
24 | /////////////////////////////////////////////////////////////////////////////// | |
25 | ||
26 | #include <stdlib.h> | |
27 | ||
28 | #include "AliTRDsimple.h" | |
29 | #include "AliTRDsimpleGen.h" | |
30 | #include "AliTRDsimpleMC.h" | |
31 | ||
32 | ClassImp(AliTRDsimple) | |
33 | ||
34 | //_____________________________________________________________________________ | |
35 | AliTRDsimple::AliTRDsimple():TObject() | |
36 | { | |
37 | // | |
38 | // AliTRDsimple default constructor | |
39 | // | |
40 | ||
41 | fGenerator = new AliTRDsimpleGen(); | |
42 | ||
43 | // Create the MC object | |
44 | new AliTRDsimpleMC("simple","Simplified Monte Carlo"); | |
45 | ||
46 | } | |
47 | ||
48 | //_____________________________________________________________________________ | |
49 | AliTRDsimple::AliTRDsimple(const AliTRDsimple &s) | |
50 | { | |
51 | // | |
52 | // AliTRDsimple copy constructor | |
53 | // | |
54 | ||
55 | ((AliTRDsimple &) s).Copy(*this); | |
56 | ||
57 | } | |
58 | ||
59 | //_____________________________________________________________________________ | |
60 | AliTRDsimple::~AliTRDsimple() | |
61 | { | |
62 | // | |
63 | // AliTRDsimple destructor | |
64 | // | |
65 | ||
66 | if (fGenerator) { | |
67 | delete fGenerator; | |
68 | } | |
69 | ||
70 | } | |
71 | ||
72 | //_____________________________________________________________________________ | |
73 | AliTRDsimple &AliTRDsimple::operator=(const AliTRDsimple &s) | |
74 | { | |
75 | // | |
76 | // Assignment operator | |
77 | // | |
78 | ||
79 | if (this != &s) ((AliTRDsimple &) s).Copy(*this); | |
80 | return *this; | |
81 | ||
82 | } | |
83 | ||
84 | //_____________________________________________________________________________ | |
85 | void AliTRDsimple::Copy(TObject &s) | |
86 | { | |
87 | // | |
88 | // Copy function | |
89 | // | |
90 | ||
91 | fGenerator->Copy(*((AliTRDsimple &) s).fGenerator); | |
92 | ||
93 | } | |
94 | ||
95 | //_____________________________________________________________________________ | |
96 | void AliTRDsimple::ProcessEvent(Int_t ievent) | |
97 | { | |
98 | // | |
99 | // Runs a single event | |
100 | // | |
101 | ||
102 | Int_t copy = 0; | |
103 | ||
104 | // Generate a new particle | |
105 | fGenerator->NewParticle(ievent); | |
106 | ||
107 | // Track the event | |
108 | do { | |
109 | gMC->ProcessEvent(); | |
110 | } | |
111 | while (gMC->CurrentVolID(copy) != -1); | |
112 | ||
113 | } | |
114 |