]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALParton.cxx
Modifiactions by M. Horner.
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALParton.cxx
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 /* $Id:  */
17 /*
18   $Log$
19   Revision 1.2  2002/10/14 14:55:35  hristov
20   Merging the VirtualMC branch to the main development branch (HEAD)
21
22   Revision 1.1.2.1  2002/08/28 15:06:50  alibrary
23   Updating to v3-09-01
24
25   Revision 1.1  2002/08/21 10:29:29  schutz
26   New classes (by Renan)
27
28 */
29
30 //*-- Author: Renan Cabrera (Creighton U.)
31
32 #include "AliEMCALParton.h"
33 #include "Ecommon.h"
34 ClassImp(AliEMCALParton)   
35     
36 //____________________________________________________________________________
37 AliEMCALParton::AliEMCALParton()
38 {
39   // Default constructor
40   fTrackEnergy = 0;
41   fTrackEta    = 0;
42   fTrackPhi    = 0;
43   fTrackPDG    = 0;
44   fNTracks     = 0;
45 }
46
47 AliEMCALParton::AliEMCALParton(Float_t energy, Float_t phi, Float_t eta)
48 {
49   // Constructor
50   fEnergy = energy;
51   fPhi    = phi;
52   fEta    = eta;
53   fTrackEnergy = 0;
54   fTrackEta    = 0;
55   fTrackPhi    = 0;
56   fTrackPDG    = 0;
57   fNTracks     = 0;
58 }
59
60 void AliEMCALParton::SetTrackList(Int_t NTracks, Float_t* Energy,  Float_t* Eta, Float_t* Phi, Int_t* PDG)
61 {
62
63   if (fNTracks)
64   {
65     delete[] fTrackEnergy;
66     delete[] fTrackEta;
67     delete[] fTrackPhi;
68     delete[] fTrackPDG;
69   }
70   fNTracks     = NTracks;
71   fTrackEnergy = new Float_t[NTracks];
72   fTrackEta    = new Float_t[NTracks];
73   fTrackPhi    = new Float_t[NTracks];
74   fTrackPDG    = new Int_t[NTracks];
75   
76   for (Int_t i=0;i<NTracks;i++)
77   {
78     fTrackEnergy[i] = Energy[i] ;
79     fTrackEta[i]    = Eta[i];
80     fTrackPhi[i]    = Phi[i];
81     fTrackPDG[i]    = PDG[i];
82   } 
83 }
84
85 void AliEMCALParton::GetTrackList(Float_t* Energy,  Float_t* Eta, Float_t* Phi, Int_t* PDG)
86 {
87   for (Int_t i=0;i<fNTracks;i++)
88   {
89     Energy[i] = fTrackEnergy[i] ;
90     Eta[i]    = fTrackEta[i];
91     Phi[i]    = fTrackPhi[i];
92     PDG[i]    = fTrackPDG[i];
93   } 
94 }
95
96
97 //____________________________________________________________________________
98
99 AliEMCALParton::~AliEMCALParton()
100 {
101   // Destructor
102   delete[] fTrackEnergy;
103   delete[] fTrackEta;
104   delete[] fTrackPhi;
105   delete[] fTrackPDG;
106   
107 }