]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDkink.cxx
Fixed warnings
[u/mrichter/AliRoot.git] / STEER / AliESDkink.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, 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 //    Origin: Marian Ivanov marian.ivanov@cern.ch
20 //-------------------------------------------------------------------------
21
22 #include <Riostream.h>
23 #include <TMath.h>
24 #include <TPDGCode.h>
25 #include "AliESDkink.h"
26
27
28 ClassImp(AliESDkink)
29
30 //____________________________________________________________________
31 AliESDkink::AliESDkink() :
32   TObject(),
33   fParamDaughter(),
34   fParamMother(),
35   fDist1(-1),
36   fDist2(-1),
37   fRr(0),
38   fShapeFactor(0),
39   fID(0),
40   fRow0(0)
41 {
42   //
43   //Default constructor
44   //
45   for (Int_t i=0;i<12;i++) fStatus[i]=0;
46   for (Int_t i=0;i<2;i++)
47     for (Int_t j=0;j<2;j++){
48       fTPCdensity[i][j]=0;
49     }
50   fTPCncls[0]=fTPCncls[1]=0;
51
52   for (Int_t i=0; i<3; i++) {
53     fPdr[i] = 0;
54     fXr[i] = 0;
55     fPm[i] = 0;
56     fAngle[i] = 0;
57   }
58   fLab[0]=fLab[1]=0;
59   fIndex[0]=fIndex[1]=-1;
60   fMultiple[0]=fMultiple[1]=0;
61 }
62
63 AliESDkink::AliESDkink(const AliESDkink &source):
64   TObject(source),
65   fParamDaughter(source.fParamDaughter),
66   fParamMother(source.fParamMother),
67   fDist1(source.fDist1),
68   fDist2(source.fDist1),
69   fRr(source.fRr),
70   fShapeFactor(source.fShapeFactor),
71   fID(source.fID),
72   fRow0(source.fRow0)
73 {
74   //
75   //Copy constructor
76   //
77   for (Int_t i=0;i<12;i++) fStatus[i]=source.fStatus[i];
78   for (Int_t i=0;i<2;i++){
79     fTPCncls[i] = source.fTPCncls[i];
80     fLab[i]     = source.fLab[i];
81     fIndex[i]   = source.fIndex[i];
82     fMultiple[i]= source.fMultiple[i];
83     for (Int_t j=0;j<2;j++){
84       fTPCdensity[i][j] = source.fTPCdensity[i][j];
85     }
86   }
87   for (Int_t i=0; i<3; i++) {
88     fPdr[i] = source.fPdr[i];
89     fXr[i] = source.fXr[i];
90     fPm[i] = source.fPm[i];
91     fAngle[i] = source.fAngle[i];
92   }
93 }
94
95 //_____________________________________________________________________________
96 AliESDkink& AliESDkink::operator=(const AliESDkink &source)
97 {
98   //
99   // assignment operator
100   //
101   
102   if (this!=&source) {
103     TObject::operator=(source);
104     fParamDaughter = source.fParamDaughter;
105     fParamMother = source.fParamMother;
106     fDist1 = source.fDist1;
107     fDist2 = source.fDist1;
108     fRr = source.fRr;
109     fShapeFactor = source.fShapeFactor;
110     fID = source.fID;
111     fRow0 = source.fRow0;
112     for (Int_t i=0;i<12;i++) fStatus[i]=source.fStatus[i];
113     for (Int_t i=0;i<2;i++){
114       fTPCncls[i] = source.fTPCncls[i];
115       fLab[i]     = source.fLab[i];
116       fIndex[i]   = source.fIndex[i];
117       fMultiple[i]= source.fMultiple[i];
118       for (Int_t j=0;j<2;j++){
119         fTPCdensity[i][j] = source.fTPCdensity[i][j];
120       }
121     }
122     for (Int_t i=0; i<3; i++) {
123       fPdr[i] = source.fPdr[i];
124       fXr[i] = source.fXr[i];
125       fPm[i] = source.fPm[i];
126       fAngle[i] = source.fAngle[i];
127     }
128   }
129
130   return *this;
131 }
132
133 void AliESDkink::Copy(TObject &obj) const {
134   
135   // this overwrites the virtual TOBject::Copy()
136   // to allow run time copying without casting
137   // in AliESDEvent
138
139   if(this==&obj)return;
140   AliESDkink *robj = dynamic_cast<AliESDkink*>(&obj);
141   if(!robj)return; // not an AliESDkink
142   *robj = *this;
143
144 }
145
146
147 void AliESDkink::SetMother(const AliExternalTrackParam & pmother)  {
148   //
149   // set mother
150   //
151   fParamMother   = pmother;
152 }
153
154 void AliESDkink::SetDaughter(const AliExternalTrackParam & pdaughter){
155   //
156   //set daughter
157   //
158   fParamDaughter = pdaughter;
159
160 }
161   
162 Double_t AliESDkink::GetTPCDensityFactor() const
163 {
164   //
165   //
166   return fTPCdensity[0][0]+fTPCdensity[1][1]-TMath::Max(fTPCdensity[0][1],Double_t(0.0))-TMath::Max(fTPCdensity[1][0],Double_t(0.0)); 
167 }
168
169 Float_t AliESDkink::GetQt() const
170 {
171   Float_t dmomentum = TMath::Sqrt(fPdr[0]*fPdr[0]+fPdr[1]*fPdr[1]+fPdr[2]*fPdr[2]);
172   return TMath::Sin(fAngle[2])*dmomentum;
173 }