]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliMCParticle.cxx
Fixed problems after a merge
[u/mrichter/AliRoot.git] / STEER / AliMCParticle.cxx
CommitLineData
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
29ClassImp(AliMCParticle)
30
31AliMCParticle::AliMCParticle():
32 AliVParticle(),
93df0e9b 33 fParticle(0),
34 fTrackReferences(0),
eee13e8d 35 fNTrackRef(0),
36 fLabel(-1)
415d9f5c 37{
38 // Constructor
39}
40
eee13e8d 41
42AliMCParticle::AliMCParticle(TParticle* part, TRefArray* rarray, Int_t index):
415d9f5c 43 AliVParticle(),
93df0e9b 44 fParticle(part),
45 fTrackReferences(rarray),
eee13e8d 46 fNTrackRef(0),
47 fLabel(index)
415d9f5c 48{
49 // Constructor
93df0e9b 50 if (rarray != 0) {
f1ac8a97 51 fNTrackRef = fTrackReferences->GetEntriesFast();
93df0e9b 52 }
415d9f5c 53}
54
55
56AliMCParticle::AliMCParticle(const AliMCParticle& mcPart) :
57 AliVParticle(mcPart),
f1ac8a97 58 fParticle(0),
59 fTrackReferences(0),
eee13e8d 60 fNTrackRef(0),
61 fLabel(-1)
415d9f5c 62{
63// Copy constructor
64}
65
66AliMCParticle& AliMCParticle::operator=(const AliMCParticle& mcPart)
f1ac8a97 67{
68
69 if (this!=&mcPart) {
70 AliVParticle::operator=(mcPart);
415d9f5c 71 }
72
73 return *this;
74}
f1ac8a97 75
76AliMCParticle::~AliMCParticle()
77{
78 // delete the track references passed externally
79 // fParticle should be handled by the user
80 // AliStack in case of AliMCEventHandler
81 if(fTrackReferences){
82 delete fTrackReferences;
83 fTrackReferences = 0;
84 }
85}
86
87
88