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 **************************************************************************/
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
31 ///////////////////////////////////////////////////////////////////////////////
33 #include <TGeoMatrix.h>
34 #include "AliITSRecPoint.h"
35 #include "AliAlignObj.h"
37 ClassImp(AliITSRecPoint)
39 //_____________________________________________________________
40 AliITSRecPoint::AliITSRecPoint():
56 // default constructor
59 //________________________________________________________________________
60 AliITSRecPoint::AliITSRecPoint(Int_t *lab,Float_t *hit, Int_t *info, Bool_t local):
61 AliCluster(AliGeomManager::LayerToVolUID((info[2]+AliGeomManager::kSPD1),lab[3]&0x3FF),hit,0,0,lab),
76 //standard constructor used in AliITSClusterFinderV2
78 if (!local) { // Cluster V2
79 Double_t txyz[3] = {GetX(), GetY(), GetZ()};
80 Double_t lxyz[3] = {0, 0, 0};
81 GetTracking2LocalMatrix()->LocalToMaster(txyz,lxyz);
82 fXloc = lxyz[0]; fZloc = lxyz[2];
83 if(fLayer==4) hit[5]=-hit[5];
84 if( (fLayer==4) || (fLayer==5) ) SetSigmaYZ(hit[5]);
105 AliError(Form("Wrong ITS layer %d (0 -> 5)",fLayer));
110 Double_t lxyz[3] = {fXloc, 0, fZloc};
111 Double_t txyz[3] = {0, 0, 0};
112 GetTracking2LocalMatrix()->MasterToLocal(lxyz,txyz);
114 SetX(0.); SetY(txyz[1]); SetZ(txyz[2]);
120 //_______________________________________________________________________
121 AliITSRecPoint::AliITSRecPoint(const AliITSRecPoint& pt):
131 fChargeRatio(pt.fChargeRatio),
133 fDeltaProb(pt.fDeltaProb),
134 fDriftTime(pt.fDriftTime),
135 fDriftSide(pt.fDriftSide)
141 //______________________________________________________________________
142 AliITSRecPoint& AliITSRecPoint::operator=(const AliITSRecPoint& source){
143 // Assignment operator
145 this->~AliITSRecPoint();
146 new(this) AliITSRecPoint(source);
151 //----------------------------------------------------------------------
152 void AliITSRecPoint::Print(ostream *os){
153 ////////////////////////////////////////////////////////////////////////
154 // Standard output format for this class.
155 ////////////////////////////////////////////////////////////////////////
163 #if defined __ICC || defined __ECC || defined __xlC__
170 fmt = os->setf(ios::fixed); // set fixed floating point output
171 *os << GetLabel(0) << " " << GetLabel(1) << " " << GetLabel(2) << " ";
172 fmt = os->setf(ios::scientific); // set scientific for dEdX.
173 *os << GetX() <<" " << GetY() << " " << GetZ() << " " ;
174 *os << GetSigmaY2() << " " << GetSigmaZ2() << " " << GetSigmaYZ() << " ";
175 fmt = os->setf(ios::fixed);
176 *os << GetVolumeId() << " "<< Misalign() /*fIsMisaligned*/ << " ";
177 fmt = os->setf(ios::scientific); // set scientific for dEdX.
178 *os << fXloc << " " << fZloc << " " << fdEdX << " ";
179 fmt = os->setf(ios::fixed); // every fixed
180 *os << fIndex <<" " << fQ << " "<<fLayer <<" "<<fNz<<" "<<fNy<<" ";
181 *os << fChargeRatio<<" " << fType << " " << fDeltaProb << " " << fDriftTime<< " " << fDriftSide;
182 os->flags(fmt); // reset back to old formating.
186 //----------------------------------------------------------------------
187 Int_t AliITSRecPoint::GetNpixels() const {
189 // returns the number of pixels used for the SPD clusters
192 if(fLayer > 1) return -1;
197 //----------------------------------------------------------------------
198 Int_t AliITSRecPoint::GetSPDclusterType() const {
200 // returns an Int_t with encoded information on cluster size
201 // type <= 16: cluster type identifier according to conventional numbering
202 // type > 16: Npixels+1000*Ny+1000000*Nz
206 if(fLayer > 1) return type;
210 case 1 : type = 1 ;break;
211 case 2 : if(fNy == 2) type = 2;
214 case 3 : if(fNy == 3) type = 4;
215 else if(fNz == 3) type = 6;
218 case 4 : if(fNz == 1) type = 7;
219 else if(fNz == 2 && fNy == 2) type = 8;
220 else if(fNy == 2 && fNz == 3) type = 11;
221 else if(fNy == 3 && fNz == 2) type = 9;
224 case 5 : if(fNy == 3 && fNz == 2) type = 10;
225 if(fNy == 2 && fNz == 3 ) type = 12;
226 if(fNy == 5) type = 16;
227 else type = fType+1000*fNy+1000000*fNz;
229 case 6 : if(fNy ==3 && fNz == 2) type = 13;
230 if(fNy ==2 && fNz == 3) type = 14;
231 else type = fType+1000*fNy+1000000*fNz;
233 default: type = fType+1000*fNy+1000000*fNz;
241 //----------------------------------------------------------------------
242 Int_t AliITSRecPoint::GetSDDclusterType() const {
243 // returns an Int_t with encoded information on cluster size
244 // Byte1 = fNz Byte0=fNy, other two bytes empty for extra information
245 // max. allowed cluster size = 255
246 Int_t typ=(fNz&0xFF)<<8;
248 if(fDriftSide==1) typ+=1<<16;
251 //----------------------------------------------------------------------
252 void AliITSRecPoint::DecodeSDDclusterType(Int_t cluType, Int_t &cluSizAn, Int_t& cluSizTb, Int_t &drSide){
253 // Extract cluster sizes and drift side from cluster type
254 cluSizTb=cluType&0xFF;
255 cluSizAn=(cluType>>8)&0xFF;
256 drSide=(cluType>>16);
259 //----------------------------------------------------------------------
260 Int_t AliITSRecPoint::GetSSDclusterType() const {
261 // returns an Int_t with encoded information on cluster size
262 // Byte1 = fNz Byte0=fNy, other two bytes empty for extra information
263 // max. allowed cluster size = 255
264 Int_t typ=(fNz&0xFF)<<8;
269 //----------------------------------------------------------------------
270 void AliITSRecPoint::Read(istream *is){
271 ////////////////////////////////////////////////////////////////////////
272 // Standard input format for this class.
273 ////////////////////////////////////////////////////////////////////////
278 *is >> lab[0] >> lab[1] >> lab[2];
279 SetLabel(lab[0],0); SetLabel(lab[1],1); SetLabel(lab[2],2);
280 *is >> hit[0] >> hit[1] >> hit[2] >> hit[3] >> hit[4] >> hit[5];
281 SetX(hit[0]);SetY(hit[1]);SetZ(hit[2]);SetSigmaY2(hit[3]);
282 SetSigmaZ2(hit[4]);//fSigmaYZ=hit[5];
283 *is >> lab[0] >> mis;
284 SetVolumeId(lab[0]);// fIsMisalinged = mis;
285 *is >> fXloc >> fZloc >> fdEdX;
286 *is >> fIndex >> fQ >> fLayer >> fNz >> fNy >> fChargeRatio >> fType;
287 *is >> fDeltaProb >> fDriftTime >> fDriftSide;
291 //----------------------------------------------------------------------
292 ostream &operator<<(ostream &os,AliITSRecPoint &p){
293 ////////////////////////////////////////////////////////////////////////
294 // Standard output streaming function.
295 ////////////////////////////////////////////////////////////////////////
300 //----------------------------------------------------------------------
301 istream &operator>>(istream &is,AliITSRecPoint &r){
302 ////////////////////////////////////////////////////////////////////////
303 // Standard input streaming function.
304 ////////////////////////////////////////////////////////////////////////
309 //----------------------------------------------------------------------