Adding the new detector MFT (Antonio Uras)
[u/mrichter/AliRoot.git] / MFT / AliESDEventMFT.cxx
CommitLineData
820b4d9e 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//
18// ESD Event with MUON+MFT muon tracks (AliMuonForwardTrack)
19//
20// Contact author: antonio.uras@cern.ch
21//
22//====================================================================================================================================================
23
24#include "AliESDEvent.h"
25#include "TClonesArray.h"
26#include "AliMuonForwardTrack.h"
27#include "AliESDEventMFT.h"
28
29ClassImp(AliESDEventMFT)
30
31//====================================================================================================================================================
32
33AliESDEventMFT::AliESDEventMFT():
34 AliESDEvent(),
35 fMuonForwardTracks(0x0)
36{
37
38 // default constructor
39 fMuonForwardTracks = new TClonesArray("AliMuonForwardTrack", 0);
40 AddObject(fMuonForwardTracks);
41
42}
43
44//====================================================================================================================================================
45
46AliESDEventMFT::AliESDEventMFT(AliESDEvent &esdEvent):
47 AliESDEvent(esdEvent),
48 fMuonForwardTracks(0x0)
49{
50
51 AliDebug(1, "building array of muon tracks");
52 fMuonForwardTracks = new TClonesArray("AliMuonForwardTrack");
53 AliDebug(1, "adding array of muon tracks to list");
54 AddObject(fMuonForwardTracks);
55 AliDebug(1, "event created!");
56
57}
58
59//====================================================================================================================================================
60
61AliESDEventMFT::AliESDEventMFT(const AliESDEventMFT &esdEventMFT):
62 AliESDEvent(esdEventMFT),
63 fMuonForwardTracks(esdEventMFT.fMuonForwardTracks)
64{
65
66 // copy constructor
67 AddObject(fMuonForwardTracks);
68
69}
70
71//====================================================================================================================================================
72
73AliESDEventMFT& AliESDEventMFT::operator=(const AliESDEventMFT &esdEventMFT) {
74
75 // Asignment operator
76
77 // check assignement to self
78 if (this == &esdEventMFT) return *this;
79
80 // base class assignement
81 AliESDEvent::operator=(esdEventMFT);
82
83 // clear memory
84 Clear();
85
86 fMuonForwardTracks = esdEventMFT.fMuonForwardTracks;
87
88 return *this;
89
90}
91
92//====================================================================================================================================================
93
94AliESDEventMFT::~AliESDEventMFT() {
95
96 // destructor
97
98 if (fMuonForwardTracks) {
99 // fMuonForwardTracks->Delete();
100 delete fMuonForwardTracks;
101 }
102
103}
104
105//====================================================================================================================================================
106
107void AliESDEventMFT::AddMuonForwardTrack(const AliMuonForwardTrack *muonForwardTrack) {
108
109 TClonesArray &myMuonForwardTracks = *fMuonForwardTracks;
110 new (myMuonForwardTracks[fMuonForwardTracks->GetEntriesFast()]) AliMuonForwardTrack(*muonForwardTrack);
111
112}
113
114//====================================================================================================================================================