]>
Commit | Line | Data |
---|---|---|
1c28d174 | 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 | |
d7bdc804 | 20 | // Author: Annalisa Mastroserio |
1c28d174 | 21 | //------------------------------------------------------------------------- |
22 | ||
23 | #include "AliAODPid.h" | |
d7bdc804 | 24 | #include "AliESDtrack.h" |
25 | #include "AliLog.h" | |
1c28d174 | 26 | |
27 | ClassImp(AliAODPid) | |
28 | ||
d7bdc804 | 29 | |
1c28d174 | 30 | //______________________________________________________________________________ |
d7bdc804 | 31 | AliAODPid::AliAODPid(): |
32 | fITSsignal(0), | |
33 | fTPCsignal(0), | |
34 | fTRDnSlices(0), | |
35 | fTRDslices(0x0), | |
36 | fTOFesdsignal(0), | |
37 | fHMPIDsignal(0) | |
1c28d174 | 38 | { |
39 | // default constructor | |
d7bdc804 | 40 | for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=0; |
1c28d174 | 41 | } |
42 | ||
43 | //______________________________________________________________________________ | |
44 | AliAODPid::~AliAODPid() | |
45 | { | |
46 | // destructor | |
47 | } | |
48 | ||
49 | ||
50 | //______________________________________________________________________________ | |
51 | AliAODPid::AliAODPid(const AliAODPid& pid) : | |
d7bdc804 | 52 | TObject(pid), |
53 | fITSsignal(pid.fITSsignal), | |
54 | fTPCsignal(pid.fTPCsignal), | |
55 | fTRDnSlices(pid.fTRDnSlices), | |
56 | fTRDslices(0x0), | |
57 | fTOFesdsignal(pid.fTOFesdsignal), | |
58 | fHMPIDsignal(pid.fHMPIDsignal) | |
1c28d174 | 59 | { |
60 | // Copy constructor | |
d7bdc804 | 61 | fTRDslices = new Double32_t[fTRDnSlices]; |
62 | for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i]; | |
63 | for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i]; | |
1c28d174 | 64 | } |
65 | ||
66 | //______________________________________________________________________________ | |
67 | AliAODPid& AliAODPid::operator=(const AliAODPid& pid) | |
68 | { | |
69 | // Assignment operator | |
70 | if(this!=&pid) { | |
71 | // copy stuff | |
d7bdc804 | 72 | fITSsignal=pid.fITSsignal; |
73 | fTPCsignal=pid.fTPCsignal; | |
74 | fTRDnSlices=pid.fTRDnSlices; | |
75 | for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i]; | |
76 | fTOFesdsignal=pid.fTOFesdsignal; | |
77 | fHMPIDsignal=pid.fHMPIDsignal; | |
78 | for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i]; | |
1c28d174 | 79 | } |
80 | ||
81 | return *this; | |
82 | } | |
d7bdc804 | 83 | //_______________________________________________________________________________ |
84 | void AliAODPid::SetDetectorRawSignals(AliESDtrack *track, Double_t timezero) | |
85 | { | |
86 | // | |
87 | //assignment of the detector signals (AliXXXesdPID inspired) | |
88 | // | |
89 | if(!track){ | |
90 | AliInfo("no ESD track found. .....exiting"); | |
91 | return; | |
92 | } | |
93 | ||
94 | fITSsignal=track->GetITSsignal(); | |
95 | fTPCsignal=track->GetTPCsignal(); | |
96 | fTRDnSlices=track->GetNumberOfTRDslices()*kTRDnPlanes; | |
97 | track->GetIntegratedTimes(fIntTime); | |
98 | fTOFesdsignal=track->GetTOFsignal()-timezero; //TO BE FIXED | |
99 | fHMPIDsignal=track->GetHMPIDsignal(); | |
100 | ||
101 | fTRDslices=new Double32_t[fTRDnSlices]; | |
102 | for(Int_t iSl =0; iSl < track->GetNumberOfTRDslices(); iSl++) { | |
103 | for(Int_t iPl =0; iPl<kTRDnPlanes; iPl++) fTRDslices[iPl*track->GetNumberOfTRDslices()+iSl] = track->GetTRDslice(iPl,iSl); | |
104 | } | |
105 | } | |
106 | //________________________________________________________________________________ | |
107 | void AliAODPid::GetIntegratedTimes(Double_t timeint[5]) | |
108 | { | |
109 | // Returns the array with integrated times for each particle hypothesis | |
110 | for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i]; | |
111 | } |