]>
Commit | Line | Data |
---|---|---|
415d9f5c | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2007, 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 | /* $Id$ */ | |
17 | ||
18 | //------------------------------------------------------------------------- | |
19 | // Realisation of AliVParticle for MC Particles | |
20 | // Implementation wraps a TParticle and delegates the methods | |
21 | // Author: Andreas Morsch, CERN | |
22 | //------------------------------------------------------------------------- | |
23 | ||
93df0e9b | 24 | #include <TRefArray.h> |
25 | ||
415d9f5c | 26 | #include "AliMCParticle.h" |
27 | ||
28 | ||
29 | ClassImp(AliMCParticle) | |
30 | ||
31 | AliMCParticle::AliMCParticle(): | |
32 | AliVParticle(), | |
93df0e9b | 33 | fParticle(0), |
34 | fTrackReferences(0), | |
35 | fNTrackRef(0) | |
415d9f5c | 36 | { |
37 | // Constructor | |
38 | } | |
39 | ||
93df0e9b | 40 | AliMCParticle::AliMCParticle(TParticle* part, TRefArray* rarray): |
415d9f5c | 41 | AliVParticle(), |
93df0e9b | 42 | fParticle(part), |
43 | fTrackReferences(rarray), | |
44 | fNTrackRef(0) | |
415d9f5c | 45 | { |
46 | // Constructor | |
93df0e9b | 47 | if (rarray != 0) { |
f1ac8a97 | 48 | fNTrackRef = fTrackReferences->GetEntriesFast(); |
93df0e9b | 49 | } |
415d9f5c | 50 | } |
51 | ||
52 | ||
53 | AliMCParticle::AliMCParticle(const AliMCParticle& mcPart) : | |
54 | AliVParticle(mcPart), | |
f1ac8a97 | 55 | fParticle(0), |
56 | fTrackReferences(0), | |
57 | fNTrackRef(0) | |
415d9f5c | 58 | { |
59 | // Copy constructor | |
60 | } | |
61 | ||
62 | AliMCParticle& AliMCParticle::operator=(const AliMCParticle& mcPart) | |
f1ac8a97 | 63 | { |
64 | ||
65 | if (this!=&mcPart) { | |
66 | AliVParticle::operator=(mcPart); | |
415d9f5c | 67 | } |
68 | ||
69 | return *this; | |
70 | } | |
f1ac8a97 | 71 | |
72 | AliMCParticle::~AliMCParticle() | |
73 | { | |
74 | // delete the track references passed externally | |
75 | // fParticle should be handled by the user | |
76 | // AliStack in case of AliMCEventHandler | |
77 | if(fTrackReferences){ | |
78 | delete fTrackReferences; | |
79 | fTrackReferences = 0; | |
80 | } | |
81 | } | |
82 | ||
83 | ||
84 |