1 /**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //-------------------------------------------------------------------------
19 // AOD Pid class to store additional pid information
20 // Author: Annalisa Mastroserio
21 //-------------------------------------------------------------------------
23 #include "AliAODPid.h"
24 #include "AliESDtrack.h"
30 //______________________________________________________________________________
31 AliAODPid::AliAODPid():
40 // default constructor
41 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=0;
42 for(Int_t i=0; i<3; i++) fEMCALPosition[i] = 0.;
46 //______________________________________________________________________________
47 AliAODPid::~AliAODPid()
55 //______________________________________________________________________________
56 AliAODPid::AliAODPid(const AliAODPid& pid) :
58 fITSsignal(pid.fITSsignal),
59 fTPCsignal(pid.fTPCsignal),
60 fTPCmomentum(pid.fTPCmomentum),
61 fTRDnSlices(pid.fTRDnSlices),
63 fTOFesdsignal(pid.fTOFesdsignal),
64 fHMPIDsignal(pid.fHMPIDsignal)
67 fTRDslices = new Double32_t[fTRDnSlices];
68 for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
69 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
70 for(Int_t i=0; i<3; i++) fEMCALPosition[i]=pid.fEMCALPosition[i];
73 //______________________________________________________________________________
74 AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
76 // Assignment operator
79 fITSsignal=pid.fITSsignal;
80 fTPCsignal=pid.fTPCsignal;
82 if(pid.fTRDnSlices<=0||(fTRDnSlices!=pid.fTRDnSlices)){
83 // only delete if number changed or is 0
86 if(pid.fTRDnSlices>0) fTRDslices = new Double32_t[fTRDnSlices];
88 fTRDnSlices=pid.fTRDnSlices;
90 for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
91 fTOFesdsignal=pid.fTOFesdsignal;
92 fHMPIDsignal=pid.fHMPIDsignal;
93 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
94 for(Int_t i=0; i<3; i++) fEMCALPosition[i]=pid.fEMCALPosition[i];
99 //_______________________________________________________________________________
100 void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES]) const
102 // Returns the array with integrated times for each particle hypothesis
103 for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i];
105 //_______________________________________________________________________________
106 void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES])
108 // Returns the array with integrated times for each particle hypothesis
109 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
111 //_______________________________________________________________________________
112 void AliAODPid::GetEMCALPosition(Double_t emcalpos[3]) const
114 // Returns the array with extrapolated track position at the EMCAL surface
115 for(Int_t i=0; i<3; i++) emcalpos[i]=fEMCALPosition[i];
117 //_______________________________________________________________________________
118 void AliAODPid::SetEMCALPosition(Double_t emcpos[3])
120 // Sets the array with extrapolated track position at the EMCAL surface
121 for(Int_t i=0; i<3; i++) fEMCALPosition[i]=emcpos[i];
123 //_______________________________________________________________________________
124 void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3]) const
126 // Returns the array with extrapolated track momentum at the EMCAL surface
127 for(Int_t i=0; i<3; i++) emcalmom[i]=fEMCALMomentum[i];
129 //_______________________________________________________________________________
130 void AliAODPid::SetEMCALMomentum(Double_t emcmom[3])
132 // Sets the array with extrapolated track momentum at the EMCAL surface
133 for(Int_t i=0; i<3; i++) fEMCALMomentum[i]=emcmom[i];