]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSRecPoint.cxx
Compatibility changes due to recent changes in the underlying classes.
[u/mrichter/AliRoot.git] / ITS / AliITSRecPoint.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 //  Reconstructed space point class for set:ITS   
20 //  Reconstructed points are expressed simultaneously in two different 
21 //  reference frames, both differing from the global system.
22 //  The first is referred to the sensor (see AliITSsegmentation for the
23 //  definition) and each point is represented by two coordinates: fXloc and
24 //  fZloc. This system in the code is referred to as "local"
25 //  The second is used for tracking (V2, SA and MI versions) and the X axis 
26 //  represents the radial coordinate (this system is, in the bending plane, 
27 //  a rotated system w.r.t. the global reference system). 
28 //  Each reaconstructed point is represented by two coordinates: fY and fZ, 
29 //  inherited from AliCluster. This system in the code is referred to as 
30 //  "trackingV2".
31 ///////////////////////////////////////////////////////////////////////////////
32
33
34 #include "AliITSRecPoint.h"
35 #include "AliAlignObj.h"
36
37 ClassImp(AliITSRecPoint)
38
39 //_____________________________________________________________
40 AliITSRecPoint::AliITSRecPoint(): AliCluster(),
41 fXloc(0),
42 fZloc(0),
43 fdEdX(0),
44 fIndex(0),
45 fQ(0),
46 fLayer(0),
47 fNz(0),
48 fNy(0),
49 fChargeRatio(0),
50 fType(0),
51 fDeltaProb(0)
52 {
53     // default constructor
54 }
55
56 //________________________________________________________________________
57 AliITSRecPoint::AliITSRecPoint(Int_t *lab,Float_t *hit, Int_t *info, Bool_t local):
58 AliCluster(AliAlignObj::LayerToVolUID((info[2]+AliAlignObj::kSPD1),lab[3]&0x3FF),hit,0,0,lab),
59 fXloc(0),
60 fZloc(0),
61 fdEdX(0),
62 fIndex(lab[3]),
63 fQ(hit[4]),
64 fLayer(info[2]),
65 fNz(info[1]),
66 fNy(info[0]),
67 fChargeRatio(0),
68 fType(0),
69 fDeltaProb(0)
70 {
71   //standard constructor used in AliITSClusterFinderV2
72
73   if (!local) { // Cluster V2
74     Double_t txyz[3] = {GetX(), GetY(), GetZ()};
75     Double_t lxyz[3] = {0, 0, 0};
76     GetTracking2LocalMatrix()->LocalToMaster(txyz,lxyz);
77     fXloc = lxyz[0]; fZloc = lxyz[2];
78   }
79   else {
80     switch (fLayer) {
81     case 0:
82     case 1:
83       fdEdX = 0;
84       break;
85     case 2:
86     case 3:
87       fdEdX=fQ*1e-6;
88       break;
89     case 4:
90     case 5:
91       fdEdX=fQ*2.16;
92       break;
93     default:
94       AliError(Form("Wrong ITS layer %d (0 -> 5)",fLayer));
95       break;
96     }
97
98     Double_t lxyz[3] = {fXloc, 0, fZloc};
99     Double_t txyz[3] = {0, 0, 0};
100     GetTracking2LocalMatrix()->MasterToLocal(lxyz,txyz);
101
102     SetX(0.); SetY(txyz[1]); SetZ(txyz[2]);
103
104   }
105
106 }
107
108 //_______________________________________________________________________
109 AliITSRecPoint::AliITSRecPoint(const AliITSRecPoint& pt):AliCluster(pt),
110 fXloc(pt.fXloc),
111 fZloc(pt.fZloc),
112 fdEdX(pt.fdEdX),
113 fIndex(pt.fIndex),
114 fQ(pt.fQ),
115 fLayer(pt.fLayer),
116 fNz(pt.fNz),
117 fNy(pt.fNy),
118 fChargeRatio(pt.fChargeRatio),
119 fType(pt.fType),
120 fDeltaProb(pt.fDeltaProb)
121 {
122   //Copy constructor
123
124 }
125
126 //______________________________________________________________________
127 AliITSRecPoint& AliITSRecPoint::operator=(const AliITSRecPoint& source){
128   // Assignment operator
129
130   this->~AliITSRecPoint();
131   new(this) AliITSRecPoint(source);
132   return *this;
133
134 }
135
136 //----------------------------------------------------------------------
137 void AliITSRecPoint::Print(ostream *os){
138     ////////////////////////////////////////////////////////////////////////
139     // Standard output format for this class.
140     ////////////////////////////////////////////////////////////////////////
141 #if defined __GNUC__
142 #if __GNUC__ > 2
143     ios::fmtflags fmt;
144 #else
145     Int_t fmt;
146 #endif
147 #else
148 #if defined __ICC || defined __ECC || defined __xlC__
149     ios::fmtflags fmt;
150 #else
151     Int_t fmt;
152 #endif
153 #endif
154  
155     fmt = os->setf(ios::fixed);  // set fixed floating point output
156     *os << GetLabel(0) << " " << GetLabel(1) << " " << GetLabel(2) << " ";
157     *os << fXloc << " " << fZloc << " " << fQ << " ";
158     fmt = os->setf(ios::scientific); // set scientific for dEdX.
159     *os << fdEdX << " ";
160     fmt = os->setf(ios::fixed); // every fixed
161     *os << GetSigmaY2() << " " << GetSigmaZ2();
162     os->flags(fmt); // reset back to old formating.
163     return;
164 }
165 //----------------------------------------------------------------------
166 void AliITSRecPoint::Read(istream *is){
167 ////////////////////////////////////////////////////////////////////////
168 // Standard input format for this class.
169 ////////////////////////////////////////////////////////////////////////
170  
171   Int_t lab[4];
172   Float_t hit[5];
173   lab[3] = 0; // ??
174   *is >> lab[0] >> lab[1] >> lab[2] >> hit[0] >> hit[1] >> hit[4];
175   *is >> fdEdX >> hit[2] >> hit[3];
176   Int_t info[3] = {0,0,0};
177   AliITSRecPoint rp(lab,hit,info,kTRUE);
178   *this = rp;
179
180   return;
181 }
182 //----------------------------------------------------------------------
183 ostream &operator<<(ostream &os,AliITSRecPoint &p){
184 ////////////////////////////////////////////////////////////////////////
185 // Standard output streaming function.
186 ////////////////////////////////////////////////////////////////////////
187  
188     p.Print(&os);
189     return os;
190 }
191 //----------------------------------------------------------------------
192 istream &operator>>(istream &is,AliITSRecPoint &r){
193 ////////////////////////////////////////////////////////////////////////
194 // Standard input streaming function.
195 ////////////////////////////////////////////////////////////////////////
196  
197     r.Read(&is);
198     return is;
199 }
200 //----------------------------------------------------------------------