]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliMCParticle.cxx
Fix for copy/paste error
[u/mrichter/AliRoot.git] / STEER / AliMCParticle.cxx
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
24 #include <TRefArray.h>
25
26 #include "AliMCParticle.h"
27
28
29 ClassImp(AliMCParticle)
30
31 AliMCParticle::AliMCParticle():
32     AliVParticle(),
33     fParticle(0),
34     fTrackReferences(0),
35     fNTrackRef(0),
36     fLabel(-1)
37 {
38     // Constructor
39 }
40
41     
42 AliMCParticle::AliMCParticle(TParticle* part, TRefArray* rarray, Int_t index):
43     AliVParticle(),
44     fParticle(part),
45     fTrackReferences(rarray),
46     fNTrackRef(0),
47     fLabel(index)
48 {
49     // Constructor
50     if (rarray != 0) {
51       fNTrackRef = fTrackReferences->GetEntriesFast();
52     }
53 }
54     
55     
56 AliMCParticle::AliMCParticle(const AliMCParticle& mcPart) :
57     AliVParticle(mcPart),
58     fParticle(0),    
59     fTrackReferences(0),
60     fNTrackRef(0),
61     fLabel(-1)
62 {
63 // Copy constructor
64 }
65
66 AliMCParticle& AliMCParticle::operator=(const AliMCParticle& mcPart)
67
68
69   if (this!=&mcPart) { 
70     AliVParticle::operator=(mcPart);
71   }
72   
73   return *this; 
74 }
75
76 AliMCParticle::~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