]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODPid.cxx
Remove compilation warnings
[u/mrichter/AliRoot.git] / STEER / AliAODPid.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 //     AOD Pid class to store additional pid information
20 //     Author: Annalisa Mastroserio
21 //-------------------------------------------------------------------------
22
23 #include "AliAODPid.h"
24 #include "AliESDtrack.h"
25 #include "AliLog.h"
26
27 ClassImp(AliAODPid)
28
29
30 //______________________________________________________________________________
31 AliAODPid::AliAODPid():
32     fITSsignal(0), 
33     fTPCsignal(0),
34     fTPCsignalN(0),
35     fTPCmomentum(0),
36     fTRDnSlices(0),
37     fTRDslices(0x0),
38     fTOFesdsignal(0),
39     fHMPIDsignal(0)
40 {
41   // default constructor
42     for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]   = 0; 
43     for(Int_t i=0; i<3; i++) fEMCALPosition[i]    = 0.;
44     for(Int_t i=0; i<5; i++) fTOFpidResolution[i] = 0.;
45     for(Int_t i=0; i<6; i++) fTRDmomentum[i]      = 0.;
46     for(Int_t i=0; i<3; i++) fEMCALMomentum[i]    = 0.;
47   
48 }
49
50 //______________________________________________________________________________
51 AliAODPid::~AliAODPid() 
52 {
53   delete [] fTRDslices;
54   fTRDslices = 0;
55   // destructor
56 }
57
58
59 //______________________________________________________________________________
60 AliAODPid::AliAODPid(const AliAODPid& pid) : 
61   TObject(pid),
62   fITSsignal(pid.fITSsignal), 
63   fTPCsignal(pid.fTPCsignal),
64   fTPCsignalN(pid.fTPCsignalN),
65   fTPCmomentum(pid.fTPCmomentum),
66   fTRDnSlices(pid.fTRDnSlices),
67   fTRDslices(0x0),
68   fTOFesdsignal(pid.fTOFesdsignal),
69   fHMPIDsignal(pid.fHMPIDsignal)
70 {
71   // Copy constructor
72     fTRDslices = new Double32_t[fTRDnSlices];
73     for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
74     for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
75     for(Int_t i=0; i<3; i++) {
76       fEMCALPosition[i]=pid.fEMCALPosition[i];
77       fEMCALMomentum[i]=pid.fEMCALMomentum[i];
78     }
79     for(Int_t i=0; i<6; i++) fTRDmomentum[i]=pid.fTRDmomentum[i];
80
81     for(Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i];
82 }
83
84 //______________________________________________________________________________
85 AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
86 {
87   // Assignment operator
88   if(this!=&pid) {
89     // copy stuff
90     fITSsignal=pid.fITSsignal; 
91     fTPCsignal=pid.fTPCsignal;
92     
93     if(pid.fTRDnSlices<=0||(fTRDnSlices!=pid.fTRDnSlices)){
94       // only delete if number changed or is 0
95       delete [] fTRDslices;
96       fTRDslices = 0;
97       if(pid.fTRDnSlices>0) fTRDslices = new Double32_t[fTRDnSlices];
98     }
99     fTRDnSlices=pid.fTRDnSlices;
100     
101     for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
102     fTOFesdsignal=pid.fTOFesdsignal;
103     fHMPIDsignal=pid.fHMPIDsignal;
104     for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
105     for(Int_t i=0; i<6; i++) fTRDmomentum[i]=pid.fTRDmomentum[i];
106     for(Int_t i=0; i<3; i++) {
107       fEMCALPosition[i]=pid.fEMCALPosition[i];
108       fEMCALMomentum[i]=pid.fEMCALMomentum[i];
109     }
110     for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=pid.fTOFpidResolution[i];
111   }
112
113   return *this;
114 }
115 //_______________________________________________________________________________
116 void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES]) const
117 {
118  // Returns the array with integrated times for each particle hypothesis
119 for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i];
120 }
121 //_______________________________________________________________________________
122 void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES])
123 {
124  // Returns the array with integrated times for each particle hypothesis
125 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
126 }
127 //_______________________________________________________________________________
128 void AliAODPid::GetEMCALPosition(Double_t emcalpos[3]) const
129 {
130  // Returns the array with extrapolated track position at the EMCAL surface
131   for(Int_t i=0; i<3; i++) emcalpos[i]=fEMCALPosition[i];
132 }
133 //_______________________________________________________________________________
134 void AliAODPid::SetEMCALPosition(Double_t emcpos[3])
135 {
136  // Sets the array with extrapolated track position at the EMCAL surface
137   for(Int_t i=0; i<3; i++) fEMCALPosition[i]=emcpos[i];
138 }
139 //_______________________________________________________________________________
140 void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3]) const
141 {
142  // Returns the array with extrapolated track momentum at the EMCAL surface
143   for(Int_t i=0; i<3; i++) emcalmom[i]=fEMCALMomentum[i];
144 }
145 //_______________________________________________________________________________
146 void AliAODPid::SetEMCALMomentum(Double_t emcmom[3])
147 {
148  // Sets the array with extrapolated track momentum at the EMCAL surface
149   for(Int_t i=0; i<3; i++) fEMCALMomentum[i]=emcmom[i];
150 }
151 //______________________________________________________________________________
152 void AliAODPid::SetTOFpidResolution(Double_t tofPIDres[5])
153 {
154   for (Int_t i=0; i<5; i++) fTOFpidResolution[i]=tofPIDres[i];
155
156 }
157 //______________________________________________________________________________
158 void AliAODPid::GetTOFpidResolution(Double_t tofRes[5]) const
159 {
160   for (Int_t i=0; i<5; i++) tofRes[i]=fTOFpidResolution[i];
161 }
162