]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSRecPoint.cxx
Improve kITSrefit efficiency at low pt (A. Dainese)
[u/mrichter/AliRoot.git] / ITS / AliITSRecPoint.cxx
CommitLineData
ee84ac37 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
88cb7938 16/* $Id$ */
d9f43611 17
00a7cc50 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///////////////////////////////////////////////////////////////////////////////
e8189707 32
2499b21b 33#include <TGeoMatrix.h>
e8189707 34#include "AliITSRecPoint.h"
75fb37cc 35#include "AliAlignObj.h"
36
e8189707 37ClassImp(AliITSRecPoint)
9671cc24 38
00a7cc50 39//_____________________________________________________________
e56160b8 40AliITSRecPoint::AliITSRecPoint(): AliCluster(),
e56160b8 41fXloc(0),
42fZloc(0),
43fdEdX(0),
44fIndex(0),
45fQ(0),
46fLayer(0),
47fNz(0),
48fNy(0),
49fChargeRatio(0),
50fType(0),
b2558977 51fDeltaProb(0),
52fDriftTime(0.)
75fb37cc 53{
54 // default constructor
00a7cc50 55}
56
57//________________________________________________________________________
75fb37cc 58AliITSRecPoint::AliITSRecPoint(Int_t *lab,Float_t *hit, Int_t *info, Bool_t local):
ae079791 59AliCluster(AliGeomManager::LayerToVolUID((info[2]+AliGeomManager::kSPD1),lab[3]&0x3FF),hit,0,0,lab),
e56160b8 60fXloc(0),
61fZloc(0),
62fdEdX(0),
63fIndex(lab[3]),
64fQ(hit[4]),
65fLayer(info[2]),
66fNz(info[1]),
67fNy(info[0]),
68fChargeRatio(0),
69fType(0),
b2558977 70fDeltaProb(0),
71fDriftTime(0.)
e56160b8 72{
00a7cc50 73 //standard constructor used in AliITSClusterFinderV2
e56160b8 74
75fb37cc 75 if (!local) { // Cluster V2
76 Double_t txyz[3] = {GetX(), GetY(), GetZ()};
77 Double_t lxyz[3] = {0, 0, 0};
78 GetTracking2LocalMatrix()->LocalToMaster(txyz,lxyz);
79 fXloc = lxyz[0]; fZloc = lxyz[2];
465c1533 80 if(fLayer==4) hit[5]=-hit[5];
0a56760a 81 if( (fLayer==4) || (fLayer==5) ) SetSigmaYZ(hit[5]);
75fb37cc 82 }
83 else {
84 switch (fLayer) {
85 case 0:
86 case 1:
87 fdEdX = 0;
88 break;
89 case 2:
90 case 3:
91 fdEdX=fQ*1e-6;
92 break;
93 case 4:
d695268b 94 fdEdX=fQ*2.16;
95 SetSigmaYZ(hit[5]);
75fb37cc 96 case 5:
97 fdEdX=fQ*2.16;
d695268b 98 hit[5]=-hit[5];
99 SetSigmaYZ(hit[5]);
75fb37cc 100 break;
101 default:
102 AliError(Form("Wrong ITS layer %d (0 -> 5)",fLayer));
103 break;
104 }
e8a76a26 105 fXloc = hit[0];
106 fZloc = hit[1];
75fb37cc 107 Double_t lxyz[3] = {fXloc, 0, fZloc};
108 Double_t txyz[3] = {0, 0, 0};
109 GetTracking2LocalMatrix()->MasterToLocal(lxyz,txyz);
110
111 SetX(0.); SetY(txyz[1]); SetZ(txyz[2]);
e56160b8 112
00a7cc50 113 }
75fb37cc 114
00a7cc50 115}
75fb37cc 116
00a7cc50 117//_______________________________________________________________________
e56160b8 118AliITSRecPoint::AliITSRecPoint(const AliITSRecPoint& pt):AliCluster(pt),
119fXloc(pt.fXloc),
120fZloc(pt.fZloc),
121fdEdX(pt.fdEdX),
122fIndex(pt.fIndex),
123fQ(pt.fQ),
124fLayer(pt.fLayer),
125fNz(pt.fNz),
126fNy(pt.fNy),
127fChargeRatio(pt.fChargeRatio),
128fType(pt.fType),
b2558977 129fDeltaProb(pt.fDeltaProb),
130fDriftTime(pt.fDriftTime)
75fb37cc 131{
00a7cc50 132 //Copy constructor
00a7cc50 133
134}
135
136//______________________________________________________________________
e56160b8 137AliITSRecPoint& AliITSRecPoint::operator=(const AliITSRecPoint& source){
00a7cc50 138 // Assignment operator
e56160b8 139
140 this->~AliITSRecPoint();
141 new(this) AliITSRecPoint(source);
00a7cc50 142 return *this;
e56160b8 143
00a7cc50 144}
145
ee84ac37 146//----------------------------------------------------------------------
147void AliITSRecPoint::Print(ostream *os){
148 ////////////////////////////////////////////////////////////////////////
149 // Standard output format for this class.
150 ////////////////////////////////////////////////////////////////////////
151#if defined __GNUC__
152#if __GNUC__ > 2
153 ios::fmtflags fmt;
154#else
155 Int_t fmt;
156#endif
157#else
9f69211c 158#if defined __ICC || defined __ECC || defined __xlC__
ee84ac37 159 ios::fmtflags fmt;
160#else
161 Int_t fmt;
162#endif
163#endif
164
165 fmt = os->setf(ios::fixed); // set fixed floating point output
75fb37cc 166 *os << GetLabel(0) << " " << GetLabel(1) << " " << GetLabel(2) << " ";
ee84ac37 167 fmt = os->setf(ios::scientific); // set scientific for dEdX.
012f0f4c 168 *os << GetX() <<" " << GetY() << " " << GetZ() << " " ;
169 *os << GetSigmaY2() << " " << GetSigmaZ2() << " " << GetSigmaYZ() << " ";
170 fmt = os->setf(ios::fixed);
171 *os << GetVolumeId() << " "<< Misalign() /*fIsMisaligned*/ << " ";
172 fmt = os->setf(ios::scientific); // set scientific for dEdX.
173 *os << fXloc << " " << fZloc << " " << fdEdX << " ";
ee84ac37 174 fmt = os->setf(ios::fixed); // every fixed
012f0f4c 175 *os << fIndex <<" " << fQ << " "<<fLayer <<" "<<fNz<<" "<<fNy<<" ";
b2558977 176 *os << fChargeRatio<<" " << fType << " " << fDeltaProb << " " << fDriftTime;
ee84ac37 177 os->flags(fmt); // reset back to old formating.
178 return;
179}
98a86dff 180
181//----------------------------------------------------------------------
182Int_t AliITSRecPoint::GetNpixels() const {
183//
184// returns the number of pixels used for the SPD clusters
185//
186
187 if(fLayer > 1) return -1;
188 else return fType;
189
190}
191
8bab7823 192//----------------------------------------------------------------------
193Int_t AliITSRecPoint::GetSPDclusterType() const {
194//
e3901fd8 195// returns an Int_t with encoded information on cluster size
196// type <= 16: cluster type identifier according to conventional numbering
197// type > 16: Npixels+1000*Ny+1000000*Nz
8bab7823 198//
199
200 Int_t type = -1;
201 if(fLayer > 1) return type;
202 else {
203
204 switch (fType) {
205 case 1 : type = 1 ;break;
206 case 2 : if(fNy == 2) type = 2;
207 else type = 3;
208 break;
209 case 3 : if(fNy == 3) type = 4;
210 else if(fNz == 3) type = 6;
211 else type = 5;
212 break;
213 case 4 : if(fNz == 1) type = 7;
214 else if(fNz == 2 && fNy == 2) type = 8;
215 else if(fNy == 2 && fNz == 3) type = 11;
216 else if(fNy == 3 && fNz == 2) type = 9;
e3901fd8 217 else type = 15;
8bab7823 218 break;
219 case 5 : if(fNy == 3 && fNz == 2) type = 10;
220 if(fNy == 2 && fNz == 3 ) type = 12;
221 if(fNy == 5) type = 16;
e3901fd8 222 else type = fType+1000*fNy+1000000*fNz;
8bab7823 223 break;
224 case 6 : if(fNy ==3 && fNz == 2) type = 13;
225 if(fNy ==2 && fNz == 3) type = 14;
e3901fd8 226 else type = fType+1000*fNy+1000000*fNz;
227 break;
228 default: type = fType+1000*fNy+1000000*fNz;
229 break;
8bab7823 230 }
231
232 return type;
233 }
e3901fd8 234}
235
236//----------------------------------------------------------------------
237Int_t AliITSRecPoint::GetSDDclusterType() const {
238// returns an Int_t with encoded information on cluster size
239// Byte1 = fNz Byte0=fNy, other two bytes empty for extra information
240// max. allowed cluster size = 255
241 Int_t typ=(fNz&0xFF)<<8;
242 typ+=fNy&0xFF;
243 return typ;
244}
8bab7823 245
e3901fd8 246//----------------------------------------------------------------------
247Int_t AliITSRecPoint::GetSSDclusterType() const {
248// returns an Int_t with encoded information on cluster size
249// Byte1 = fNz Byte0=fNy, other two bytes empty for extra information
250// max. allowed cluster size = 255
251 Int_t typ=(fNz&0xFF)<<8;
252 typ+=fNy&0xFF;
253 return typ;
254}
8bab7823 255
ee84ac37 256//----------------------------------------------------------------------
257void AliITSRecPoint::Read(istream *is){
258////////////////////////////////////////////////////////////////////////
259// Standard input format for this class.
260////////////////////////////////////////////////////////////////////////
012f0f4c 261 Bool_t mis;
262 Int_t lab[4];
263 Float_t hit[6];
264 lab[3] = 0; // ??
265 *is >> lab[0] >> lab[1] >> lab[2];
266 SetLabel(lab[0],0); SetLabel(lab[1],1); SetLabel(lab[2],2);
267 *is >> hit[0] >> hit[1] >> hit[2] >> hit[3] >> hit[4] >> hit[5];
268 SetX(hit[0]);SetY(hit[1]);SetZ(hit[2]);SetSigmaY2(hit[3]);
269 SetSigmaZ2(hit[4]);//fSigmaYZ=hit[5];
270 *is >> lab[0] >> mis;
271 SetVolumeId(lab[0]);// fIsMisalinged = mis;
272 *is >> fXloc >> fZloc >> fdEdX;
273 *is >> fIndex >> fQ >> fLayer >> fNz >> fNy >> fChargeRatio >> fType;
b2558977 274 *is >> fDeltaProb >> fDriftTime;
012f0f4c 275
276 return;
ee84ac37 277}
278//----------------------------------------------------------------------
279ostream &operator<<(ostream &os,AliITSRecPoint &p){
280////////////////////////////////////////////////////////////////////////
281// Standard output streaming function.
282////////////////////////////////////////////////////////////////////////
283
284 p.Print(&os);
285 return os;
286}
287//----------------------------------------------------------------------
288istream &operator>>(istream &is,AliITSRecPoint &r){
289////////////////////////////////////////////////////////////////////////
290// Standard input streaming function.
291////////////////////////////////////////////////////////////////////////
292
293 r.Read(&is);
294 return is;
295}
0a56760a 296//----------------------------------------------------------------------