]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODPid.cxx
use Terminate function for producing summary plots (Markus)
[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     fTPCmomentum(0),
35     fTRDnSlices(0),
36     fTRDslices(0x0),
37     fTOFesdsignal(0),
38     fHMPIDsignal(0)
39 {
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.;
43   
44 }
45
46 //______________________________________________________________________________
47 AliAODPid::~AliAODPid() 
48 {
49   delete [] fTRDslices;
50   fTRDslices = 0;
51   // destructor
52 }
53
54
55 //______________________________________________________________________________
56 AliAODPid::AliAODPid(const AliAODPid& pid) : 
57   TObject(pid),
58   fITSsignal(pid.fITSsignal), 
59   fTPCsignal(pid.fTPCsignal),
60   fTPCmomentum(pid.fTPCmomentum),
61   fTRDnSlices(pid.fTRDnSlices),
62   fTRDslices(0x0),
63   fTOFesdsignal(pid.fTOFesdsignal),
64   fHMPIDsignal(pid.fHMPIDsignal)
65 {
66   // Copy constructor
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];
71 }
72
73 //______________________________________________________________________________
74 AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
75 {
76   // Assignment operator
77   if(this!=&pid) {
78     // copy stuff
79     fITSsignal=pid.fITSsignal; 
80     fTPCsignal=pid.fTPCsignal;
81     
82     if(pid.fTRDnSlices<=0||(fTRDnSlices!=pid.fTRDnSlices)){
83       // only delete if number changed or is 0
84       delete [] fTRDslices;
85       fTRDslices = 0;
86       if(pid.fTRDnSlices>0) fTRDslices = new Double32_t[fTRDnSlices];
87     }
88     fTRDnSlices=pid.fTRDnSlices;
89     
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];
95   }
96
97   return *this;
98 }
99 //_______________________________________________________________________________
100 void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES]) const
101 {
102  // Returns the array with integrated times for each particle hypothesis
103 for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i];
104 }
105 //_______________________________________________________________________________
106 void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES])
107 {
108  // Returns the array with integrated times for each particle hypothesis
109 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
110 }
111 //_______________________________________________________________________________
112 void AliAODPid::GetEMCALPosition(Double_t emcalpos[3]) const
113 {
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];
116 }
117 //_______________________________________________________________________________
118 void AliAODPid::SetEMCALPosition(Double_t emcpos[3])
119 {
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];
122 }
123 //_______________________________________________________________________________
124 void AliAODPid::GetEMCALMomentum(Double_t emcalmom[3]) const
125 {
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];
128 }
129 //_______________________________________________________________________________
130 void AliAODPid::SetEMCALMomentum(Double_t emcmom[3])
131 {
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];
134 }