]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSTrackSegment.cxx
New detector numbering scheme (common for DAQ/HLT/Offline). All the subdetectors...
[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  */
21
22 //_________________________________________________________________________
23 //  Track segment in PHOS
24 //  Can be : 1 EmcRecPoint
25 //           1 EmcRecPoint + 1 CPV
26 //           1 EmcRecPoint + 1 CPV + 1 charged track
27 //                  
28 //*-- Author:  Dmitri Peressounko (RRC KI & SUBATECH)
29
30 // --- ROOT system ---
31  
32
33 // --- Standard library ---
34
35 // --- AliRoot header files ---
36 #include "AliPHOSEmcRecPoint.h" 
37 #include "AliPHOSTrackSegment.h" 
38 #include "AliESDtrack.h" 
39
40 ClassImp(AliPHOSTrackSegment)
41
42 //____________________________________________________________________________
43 AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , 
44                                           AliPHOSRecPoint * cpvrp1)
45 {
46   // ctor
47
48   if( emc )   
49     fEmcRecPoint =  emc->GetIndexInList() ;
50   else 
51     fEmcRecPoint = -1 ;
52
53   if( cpvrp1 )  
54     fCpvRecPoint = cpvrp1->GetIndexInList() ;
55  else 
56     fCpvRecPoint = -1 ;
57
58   fTrack = -1 ; 
59
60   fIndexInList = -1 ;
61 }
62
63 //____________________________________________________________________________
64 AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , 
65                                           AliPHOSRecPoint * cpvrp1, 
66                                           Int_t track)
67 {
68   // ctor
69
70   if( emc )   
71     fEmcRecPoint =  emc->GetIndexInList() ;
72   else 
73     fEmcRecPoint = -1 ;
74
75   if( cpvrp1 )  
76     fCpvRecPoint = cpvrp1->GetIndexInList() ;
77  else 
78     fCpvRecPoint = -1 ;
79   
80   fTrack = track ; 
81
82   fIndexInList = -1 ;
83 }
84
85 //____________________________________________________________________________
86 AliPHOSTrackSegment::AliPHOSTrackSegment( const AliPHOSTrackSegment & ts) 
87   : TObject(ts)
88 {
89   // Copy ctor
90
91   ( (AliPHOSTrackSegment &)ts ).Copy(*this) ; 
92 }
93
94
95 //____________________________________________________________________________
96 void AliPHOSTrackSegment::Copy(TObject & obj) const
97 {
98   // Copy of a track segment into another track segment
99
100    TObject::Copy(obj) ;
101    ( (AliPHOSTrackSegment &)obj ).fEmcRecPoint     = fEmcRecPoint ; 
102    ( (AliPHOSTrackSegment &)obj ).fCpvRecPoint     = fCpvRecPoint ; 
103    ( (AliPHOSTrackSegment &)obj ).fIndexInList     = fIndexInList ; 
104    ( (AliPHOSTrackSegment &)obj ).fTrack           = fTrack ;
105
106
107
108 //____________________________________________________________________________
109 void AliPHOSTrackSegment::Print(const Option_t *) const
110 {
111   // Print all information on this track Segment
112   
113
114   Info("Print", "");
115   printf("Stored at position %d\n", fIndexInList) ;
116   printf(" Emc RecPoint #     %d\n", fEmcRecPoint) ;
117   if(fCpvRecPoint >= 0)
118     printf(" CPV RecPoint #     %d\n", fCpvRecPoint) ;
119   else
120     printf(" No CPV RecPoint\n");
121   if (fTrack >= 0) 
122     printf(" Charged track #     %d\n", fTrack) ;
123   else
124     printf(" No Charged track\n");
125 }
126
127 //____________________________________________________________________________
128 void AliPHOSTrackSegment::SetCpvRecPoint(AliPHOSRecPoint * cpvRecPoint) 
129 {
130   // gives an id from its position in the list
131   if( cpvRecPoint )  
132     fCpvRecPoint = cpvRecPoint->GetIndexInList() ;
133  else 
134     fCpvRecPoint = -1 ;
135 }
136