]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSTrackSegment.cxx
Effective C++ warnings fixed (Timur Pocheptsov)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTrackSegment.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 /* $Id$ */
16
17 /* History of cvs commits:
18  *
19  * $Log$
20  * Revision 1.29  2005/05/28 14:19:05  schutz
21  * Compilation warnings fixed by T.P.
22  *
23  */
24
25 //_________________________________________________________________________
26 //  Track segment in PHOS
27 //  Can be : 1 EmcRecPoint
28 //           1 EmcRecPoint + 1 CPV
29 //           1 EmcRecPoint + 1 CPV + 1 charged track
30 //                  
31 //*-- Author:  Dmitri Peressounko (RRC KI & SUBATECH)
32
33 // --- ROOT system ---
34  
35
36 // --- Standard library ---
37
38 // --- AliRoot header files ---
39 #include "AliPHOSEmcRecPoint.h" 
40 #include "AliPHOSTrackSegment.h" 
41 #include "AliESDtrack.h" 
42
43 ClassImp(AliPHOSTrackSegment)
44
45 //____________________________________________________________________________
46 AliPHOSTrackSegment::AliPHOSTrackSegment()
47                         : fEmcRecPoint(0),
48                           fIndexInList(0),
49                           fCpvRecPoint(0),
50                           fTrack(0)
51 {
52   //def ctor
53 }
54
55 //____________________________________________________________________________
56 AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , 
57                                           AliPHOSRecPoint * cpvrp1)
58                         : fEmcRecPoint(0),
59                           fIndexInList(0),
60                           fCpvRecPoint(0),
61                           fTrack(0)
62 {
63   // ctor
64
65   if( emc )   
66     fEmcRecPoint =  emc->GetIndexInList() ;
67   else 
68     fEmcRecPoint = -1 ;
69
70   if( cpvrp1 )  
71     fCpvRecPoint = cpvrp1->GetIndexInList() ;
72  else 
73     fCpvRecPoint = -1 ;
74
75   fTrack = -1 ; 
76
77   fIndexInList = -1 ;
78 }
79
80 //____________________________________________________________________________
81 AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , 
82                                           AliPHOSRecPoint * cpvrp1, 
83                                           Int_t track)
84                         : fEmcRecPoint(0),
85                           fIndexInList(0),
86                           fCpvRecPoint(0),
87                           fTrack(0)
88 {
89   // ctor
90
91   if( emc )   
92     fEmcRecPoint =  emc->GetIndexInList() ;
93   else 
94     fEmcRecPoint = -1 ;
95
96   if( cpvrp1 )  
97     fCpvRecPoint = cpvrp1->GetIndexInList() ;
98  else 
99     fCpvRecPoint = -1 ;
100   
101   fTrack = track ; 
102
103   fIndexInList = -1 ;
104 }
105
106 //____________________________________________________________________________
107 AliPHOSTrackSegment::AliPHOSTrackSegment( const AliPHOSTrackSegment & ts) 
108   : TObject(ts),
109     fEmcRecPoint(0),
110     fIndexInList(0),
111     fCpvRecPoint(0),
112     fTrack(0)
113 {
114   // Copy ctor
115
116   ( (AliPHOSTrackSegment &)ts ).Copy(*this) ; 
117 }
118
119
120 //____________________________________________________________________________
121 void AliPHOSTrackSegment::Copy(TObject & obj) const
122 {
123   // Copy of a track segment into another track segment
124
125    TObject::Copy(obj) ;
126    ( (AliPHOSTrackSegment &)obj ).fEmcRecPoint     = fEmcRecPoint ; 
127    ( (AliPHOSTrackSegment &)obj ).fCpvRecPoint     = fCpvRecPoint ; 
128    ( (AliPHOSTrackSegment &)obj ).fIndexInList     = fIndexInList ; 
129    ( (AliPHOSTrackSegment &)obj ).fTrack           = fTrack ;
130
131
132
133 //____________________________________________________________________________
134 void AliPHOSTrackSegment::Print(const Option_t *) const
135 {
136   // Print all information on this track Segment
137   
138
139   Info("Print", "");
140   printf("Stored at position %d\n", fIndexInList) ;
141   printf(" Emc RecPoint #     %d\n", fEmcRecPoint) ;
142   if(fCpvRecPoint >= 0)
143     printf(" CPV RecPoint #     %d\n", fCpvRecPoint) ;
144   else
145     printf(" No CPV RecPoint\n");
146   if (fTrack >= 0) 
147     printf(" Charged track #     %d\n", fTrack) ;
148   else
149     printf(" No Charged track\n");
150 }
151
152 //____________________________________________________________________________
153 void AliPHOSTrackSegment::SetCpvRecPoint(AliPHOSRecPoint * cpvRecPoint) 
154 {
155   // gives an id from its position in the list
156   if( cpvRecPoint )  
157     fCpvRecPoint = cpvRecPoint->GetIndexInList() ;
158  else 
159     fCpvRecPoint = -1 ;
160 }
161