]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDsimple.cxx
Adding protected copy constructor and assignment operator
[u/mrichter/AliRoot.git] / TRD / AliTRDsimple.cxx
CommitLineData
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
88cb7938 16/* $Id$ */
16bf9884 17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// Simplified TRD slow simulator //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
24#include <stdlib.h>
25
26#include "AliTRDsimple.h"
27#include "AliTRDsimpleGen.h"
28#include "AliTRDsimpleMC.h"
29
30ClassImp(AliTRDsimple)
31
32//_____________________________________________________________________________
33AliTRDsimple::AliTRDsimple():TObject()
34{
35 //
36 // AliTRDsimple default constructor
37 //
38
a1c3aded 39 fGenerator = NULL;
16bf9884 40
41}
42
43//_____________________________________________________________________________
73ae7b59 44AliTRDsimple::AliTRDsimple(const AliTRDsimple &s):TObject(s)
16bf9884 45{
46 //
47 // AliTRDsimple copy constructor
48 //
49
50 ((AliTRDsimple &) s).Copy(*this);
51
52}
53
54//_____________________________________________________________________________
55AliTRDsimple::~AliTRDsimple()
56{
57 //
58 // AliTRDsimple destructor
59 //
60
61 if (fGenerator) {
62 delete fGenerator;
63 }
64
65}
66
67//_____________________________________________________________________________
68AliTRDsimple &AliTRDsimple::operator=(const AliTRDsimple &s)
69{
70 //
71 // Assignment operator
72 //
73
74 if (this != &s) ((AliTRDsimple &) s).Copy(*this);
75 return *this;
76
77}
78
a1c3aded 79//_____________________________________________________________________________
80void AliTRDsimple::Init()
81{
82 //
83 // Initialization
84 //
85
86 fGenerator = new AliTRDsimpleGen();
87
88 // Create the MC object
89 new AliTRDsimpleMC("simple","Simplified Monte Carlo");
90
91}
92
16bf9884 93//_____________________________________________________________________________
e0d47c25 94void AliTRDsimple::Copy(TObject &s) const
16bf9884 95{
96 //
97 // Copy function
98 //
99
100 fGenerator->Copy(*((AliTRDsimple &) s).fGenerator);
101
102}
103
104//_____________________________________________________________________________
105void AliTRDsimple::ProcessEvent(Int_t ievent)
106{
107 //
108 // Runs a single event
109 //
110
111 Int_t copy = 0;
112
113 // Generate a new particle
114 fGenerator->NewParticle(ievent);
115
116 // Track the event
117 do {
118 gMC->ProcessEvent();
119 }
120 while (gMC->CurrentVolID(copy) != -1);
121
122}
123