1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 /* History of cvs commits:
20 * Revision 1.30 2006/08/28 10:01:56 kharlov
21 * Effective C++ warnings fixed (Timur Pocheptsov)
23 * Revision 1.29 2005/05/28 14:19:05 schutz
24 * Compilation warnings fixed by T.P.
28 //_________________________________________________________________________
29 // Track segment in PHOS
30 // Can be : 1 EmcRecPoint
31 // 1 EmcRecPoint + 1 CPV
32 // 1 EmcRecPoint + 1 CPV + 1 charged track
34 //*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
36 // --- ROOT system ---
39 // --- Standard library ---
41 // --- AliRoot header files ---
42 #include "AliPHOSEmcRecPoint.h"
43 #include "AliPHOSTrackSegment.h"
44 #include "AliESDtrack.h"
47 ClassImp(AliPHOSTrackSegment)
49 //____________________________________________________________________________
50 AliPHOSTrackSegment::AliPHOSTrackSegment()
61 //____________________________________________________________________________
62 AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc ,
63 AliPHOSRecPoint * cpvrp1)
72 fEmcRecPoint = emc->GetIndexInList() ;
77 fCpvRecPoint = cpvrp1->GetIndexInList() ;
88 //____________________________________________________________________________
89 AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc ,
90 AliPHOSRecPoint * cpvrp1,
100 fEmcRecPoint = emc->GetIndexInList() ;
105 fCpvRecPoint = cpvrp1->GetIndexInList() ;
116 //____________________________________________________________________________
117 AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc ,
118 AliPHOSRecPoint * cpvrp1,
119 Int_t track, Float_t dx,Float_t dz)
128 fEmcRecPoint = emc->GetIndexInList() ;
133 fCpvRecPoint = cpvrp1->GetIndexInList() ;
145 //____________________________________________________________________________
146 AliPHOSTrackSegment::AliPHOSTrackSegment( const AliPHOSTrackSegment & ts)
155 ( (AliPHOSTrackSegment &)ts ).Copy(*this) ;
159 //____________________________________________________________________________
160 AliPHOSTrackSegment & AliPHOSTrackSegment::operator = (const AliPHOSTrackSegment &)
162 Fatal("operator =", "not implemented");
166 //____________________________________________________________________________
167 void AliPHOSTrackSegment::Copy(TObject & obj) const
169 // Copy of a track segment into another track segment
172 ( (AliPHOSTrackSegment &)obj ).fEmcRecPoint = fEmcRecPoint ;
173 ( (AliPHOSTrackSegment &)obj ).fCpvRecPoint = fCpvRecPoint ;
174 ( (AliPHOSTrackSegment &)obj ).fIndexInList = fIndexInList ;
175 ( (AliPHOSTrackSegment &)obj ).fTrack = fTrack ;
176 ( (AliPHOSTrackSegment &)obj ).fDcpv[0] = fDcpv[0] ;
177 ( (AliPHOSTrackSegment &)obj ).fDcpv[1] = fDcpv[1] ;
181 //____________________________________________________________________________
182 void AliPHOSTrackSegment::Print(const Option_t *) const
184 // Print all information on this track Segment
187 AliInfo("Track segment");
188 printf("Stored at position %d\n", fIndexInList) ;
189 printf(" Emc RecPoint # %d\n", fEmcRecPoint) ;
190 if(fCpvRecPoint >= 0)
191 printf(" CPV RecPoint # %d\n", fCpvRecPoint) ;
193 printf(" No CPV RecPoint\n");
195 printf(" Charged track # %d\n", fTrack) ;
197 printf(" No Charged track\n");
198 printf(" Distance to CPV: x=%f, z=%f\n",fDcpv[0],fDcpv[1]) ;
201 //____________________________________________________________________________
202 void AliPHOSTrackSegment::SetCpvRecPoint(AliPHOSRecPoint * cpvRecPoint)
204 // gives an id from its position in the list
206 fCpvRecPoint = cpvRecPoint->GetIndexInList() ;
210 //____________________________________________________________________________
211 Float_t AliPHOSTrackSegment::GetCpvDistance(const Option_t* dr) const
213 if(strcmp(dr,"x")==0||strcmp(dr,"X")==0) return fDcpv[0] ;
214 if(strcmp(dr,"z")==0||strcmp(dr,"Z")==0) return fDcpv[1] ;
215 if(strcmp(dr,"r")==0||strcmp(dr,"R")==0) return TMath::Sqrt(fDcpv[0]*fDcpv[0]+fDcpv[1]*fDcpv[1]) ;