]>
Commit | Line | Data |
---|---|---|
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 | ||
29 | ClassImp(AliESDEventMFT) | |
30 | ||
31 | //==================================================================================================================================================== | |
32 | ||
33 | AliESDEventMFT::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 | ||
46 | AliESDEventMFT::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 | ||
61 | AliESDEventMFT::AliESDEventMFT(const AliESDEventMFT &esdEventMFT): | |
62 | AliESDEvent(esdEventMFT), | |
274c2dce | 63 | fMuonForwardTracks(NULL) |
820b4d9e | 64 | { |
65 | ||
66 | // copy constructor | |
274c2dce | 67 | fMuonForwardTracks = new TClonesArray(*(esdEventMFT.fMuonForwardTracks)); |
68 | fMuonForwardTracks->SetOwner(kTRUE); | |
820b4d9e | 69 | AddObject(fMuonForwardTracks); |
274c2dce | 70 | |
820b4d9e | 71 | } |
72 | ||
73 | //==================================================================================================================================================== | |
74 | ||
75 | AliESDEventMFT& AliESDEventMFT::operator=(const AliESDEventMFT &esdEventMFT) { | |
76 | ||
77 | // Asignment operator | |
78 | ||
79 | // check assignement to self | |
80 | if (this == &esdEventMFT) return *this; | |
81 | ||
82 | // base class assignement | |
83 | AliESDEvent::operator=(esdEventMFT); | |
84 | ||
85 | // clear memory | |
274c2dce | 86 | Clear(""); |
820b4d9e | 87 | |
274c2dce | 88 | fMuonForwardTracks = new TClonesArray(*(esdEventMFT.fMuonForwardTracks)); |
89 | fMuonForwardTracks->SetOwner(kTRUE); | |
90 | AddObject(fMuonForwardTracks); | |
820b4d9e | 91 | |
92 | return *this; | |
93 | ||
94 | } | |
95 | ||
96 | //==================================================================================================================================================== | |
97 | ||
98 | AliESDEventMFT::~AliESDEventMFT() { | |
99 | ||
100 | // destructor | |
101 | ||
274c2dce | 102 | delete fMuonForwardTracks; |
820b4d9e | 103 | |
104 | } | |
105 | ||
106 | //==================================================================================================================================================== | |
107 | ||
108 | void AliESDEventMFT::AddMuonForwardTrack(const AliMuonForwardTrack *muonForwardTrack) { | |
109 | ||
110 | TClonesArray &myMuonForwardTracks = *fMuonForwardTracks; | |
111 | new (myMuonForwardTracks[fMuonForwardTracks->GetEntriesFast()]) AliMuonForwardTrack(*muonForwardTrack); | |
112 | ||
113 | } | |
114 | ||
115 | //==================================================================================================================================================== |