New and improved FMD background map from 1.2M PYTHIA events
[u/mrichter/AliRoot.git] / STEER / AliAODPid.cxx
CommitLineData
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
27ClassImp(AliAODPid)
28
d7bdc804 29
1c28d174 30//______________________________________________________________________________
d7bdc804 31AliAODPid::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;
373fc041 41
1c28d174 42}
43
44//______________________________________________________________________________
45AliAODPid::~AliAODPid()
46{
341952b8 47 delete [] fTRDslices;
48 fTRDslices = 0;
1c28d174 49 // destructor
50}
51
52
53//______________________________________________________________________________
54AliAODPid::AliAODPid(const AliAODPid& pid) :
d7bdc804 55 TObject(pid),
56 fITSsignal(pid.fITSsignal),
57 fTPCsignal(pid.fTPCsignal),
58 fTRDnSlices(pid.fTRDnSlices),
59 fTRDslices(0x0),
60 fTOFesdsignal(pid.fTOFesdsignal),
61 fHMPIDsignal(pid.fHMPIDsignal)
1c28d174 62{
63 // Copy constructor
d7bdc804 64 fTRDslices = new Double32_t[fTRDnSlices];
65 for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
66 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
1c28d174 67}
68
69//______________________________________________________________________________
70AliAODPid& AliAODPid::operator=(const AliAODPid& pid)
71{
72 // Assignment operator
73 if(this!=&pid) {
74 // copy stuff
341952b8 75 fITSsignal=pid.fITSsignal;
76 fTPCsignal=pid.fTPCsignal;
77
78 if(pid.fTRDnSlices<=0||(fTRDnSlices!=pid.fTRDnSlices)){
79 // only delete if number changed or is 0
80 delete [] fTRDslices;
81 fTRDslices = 0;
82 if(pid.fTRDnSlices>0) fTRDslices = new Double32_t[fTRDnSlices];
83 }
84 fTRDnSlices=pid.fTRDnSlices;
85
86 for(Int_t i=0; i< fTRDnSlices; i++) fTRDslices[i]=pid.fTRDslices[i];
87 fTOFesdsignal=pid.fTOFesdsignal;
88 fHMPIDsignal=pid.fHMPIDsignal;
89 for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=pid.fIntTime[i];
1c28d174 90 }
91
92 return *this;
93}
d7bdc804 94//_______________________________________________________________________________
373fc041 95void AliAODPid::GetIntegratedTimes(Double_t timeint[kSPECIES])
d7bdc804 96{
373fc041 97 // Returns the array with integrated times for each particle hypothesis
98for(Int_t i=0; i<kSPECIES; i++) timeint[i]=fIntTime[i];
d7bdc804 99}
373fc041 100//_______________________________________________________________________________
101void AliAODPid::SetIntegratedTimes(Double_t timeint[kSPECIES])
d7bdc804 102{
103 // Returns the array with integrated times for each particle hypothesis
373fc041 104for(Int_t i=0; i<kSPECIES; i++) fIntTime[i]=timeint[i];
d7bdc804 105}