]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODPid.cxx
Changed the handling of the sources / blocks in the xmlRPC message
[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     fTRDnSlices(0),
35     fTRDslices(0x0),
36     fTOFesdsignal(0),
37     fHMPIDsignal(0)
38 {
39   // default constructor
40     for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=0; 
41     for(Int_t i=0; i<3; i++) fEMCALPosition[i] = 0.;
42   
43 }
44
45 //______________________________________________________________________________
46 AliAODPid::~AliAODPid() 
47 {
48   delete [] fTRDslices;
49   fTRDslices = 0;
50   // destructor
51 }
52
53
54 //______________________________________________________________________________
55 AliAODPid::AliAODPid(const AliAODPid& pid) : 
56   TObject(pid),
57   fITSsignal(pid.fITSsignal), 
58   fTPCsignal(pid.fTPCsignal),
59   fTRDnSlices(pid.fTRDnSlices),
60   fTRDslices(0x0),
61   fTOFesdsignal(pid.fTOFesdsignal),
62   fHMPIDsignal(pid.fHMPIDsignal)
63 {
64   // Copy constructor
65     fTRDslices = new Double32_t[fTRDnSlices];
66     for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
67     for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
68     for(Int_t i=0; i<3; i++) fEMCALPosition[i]=pid.fEMCALPosition[i];
69 }
70
71 //______________________________________________________________________________
72 AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
73 {
74   // Assignment operator
75   if(this!=&pid) {
76     // copy stuff
77     fITSsignal=pid.fITSsignal; 
78     fTPCsignal=pid.fTPCsignal;
79     
80     if(pid.fTRDnSlices<=0||(fTRDnSlices!=pid.fTRDnSlices)){
81       // only delete if number changed or is 0
82       delete [] fTRDslices;
83       fTRDslices = 0;
84       if(pid.fTRDnSlices>0) fTRDslices = new Double32_t[fTRDnSlices];
85     }
86     fTRDnSlices=pid.fTRDnSlices;
87     
88     for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
89     fTOFesdsignal=pid.fTOFesdsignal;
90     fHMPIDsignal=pid.fHMPIDsignal;
91     for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
92     for(Int_t i=0; i<3; i++) fEMCALPosition[i]=pid.fEMCALPosition[i];
93   }
94
95   return *this;
96 }
97 //_______________________________________________________________________________
98 void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES])
99 {
100  // Returns the array with integrated times for each particle hypothesis
101 for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i];
102 }
103 //_______________________________________________________________________________
104 void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES])
105 {
106  // Returns the array with integrated times for each particle hypothesis
107 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
108 }
109 //_______________________________________________________________________________
110 void AliAODPid::GetEMCALPosition(Double_t emcalpos[3])
111 {
112  // Returns the array with extrapolated track position at the EMCAL surface
113   for(Int_t i=0; i<3; i++) emcalpos[i]=fEMCALPosition[i];
114 }
115 //_______________________________________________________________________________
116 void AliAODPid::SetEMCALPosition(Double_t emcpos[3])
117 {
118  // Sets the array with extrapolated track position at the EMCAL surface
119   for(Int_t i=0; i<3; i++) fEMCALPosition[i]=emcpos[i];
120 }
121 //_______________________________________________________________________________
122 void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3])
123 {
124  // Returns the array with extrapolated track momentum at the EMCAL surface
125   for(Int_t i=0; i<3; i++) emcalmom[i]=fEMCALMomentum[i];
126 }
127 //_______________________________________________________________________________
128 void AliAODPid::SetEMCALMomentum(Double_t emcmom[3])
129 {
130  // Sets the array with extrapolated track momentum at the EMCAL surface
131   for(Int_t i=0; i<3; i++) fEMCALMomentum[i]=emcmom[i];
132 }