]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSRecPoint.cxx
Correct formula for phi, in case of current local X <0, in GetLocalXat and GetPhiZat
[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];
80 }
81 else {
82 switch (fLayer) {
83 case 0:
84 case 1:
85 fdEdX = 0;
86 break;
87 case 2:
88 case 3:
89 fdEdX=fQ*1e-6;
90 break;
91 case 4:
92 case 5:
93 fdEdX=fQ*2.16;
94 break;
95 default:
96 AliError(Form("Wrong ITS layer %d (0 -> 5)",fLayer));
97 break;
98 }
e8a76a26 99 fXloc = hit[0];
100 fZloc = hit[1];
75fb37cc 101 Double_t lxyz[3] = {fXloc, 0, fZloc};
102 Double_t txyz[3] = {0, 0, 0};
103 GetTracking2LocalMatrix()->MasterToLocal(lxyz,txyz);
104
105 SetX(0.); SetY(txyz[1]); SetZ(txyz[2]);
e56160b8 106
00a7cc50 107 }
75fb37cc 108
00a7cc50 109}
75fb37cc 110
00a7cc50 111//_______________________________________________________________________
e56160b8 112AliITSRecPoint::AliITSRecPoint(const AliITSRecPoint& pt):AliCluster(pt),
113fXloc(pt.fXloc),
114fZloc(pt.fZloc),
115fdEdX(pt.fdEdX),
116fIndex(pt.fIndex),
117fQ(pt.fQ),
118fLayer(pt.fLayer),
119fNz(pt.fNz),
120fNy(pt.fNy),
121fChargeRatio(pt.fChargeRatio),
122fType(pt.fType),
b2558977 123fDeltaProb(pt.fDeltaProb),
124fDriftTime(pt.fDriftTime)
75fb37cc 125{
00a7cc50 126 //Copy constructor
00a7cc50 127
128}
129
130//______________________________________________________________________
e56160b8 131AliITSRecPoint& AliITSRecPoint::operator=(const AliITSRecPoint& source){
00a7cc50 132 // Assignment operator
e56160b8 133
134 this->~AliITSRecPoint();
135 new(this) AliITSRecPoint(source);
00a7cc50 136 return *this;
e56160b8 137
00a7cc50 138}
139
ee84ac37 140//----------------------------------------------------------------------
141void AliITSRecPoint::Print(ostream *os){
142 ////////////////////////////////////////////////////////////////////////
143 // Standard output format for this class.
144 ////////////////////////////////////////////////////////////////////////
145#if defined __GNUC__
146#if __GNUC__ > 2
147 ios::fmtflags fmt;
148#else
149 Int_t fmt;
150#endif
151#else
9f69211c 152#if defined __ICC || defined __ECC || defined __xlC__
ee84ac37 153 ios::fmtflags fmt;
154#else
155 Int_t fmt;
156#endif
157#endif
158
159 fmt = os->setf(ios::fixed); // set fixed floating point output
75fb37cc 160 *os << GetLabel(0) << " " << GetLabel(1) << " " << GetLabel(2) << " ";
ee84ac37 161 fmt = os->setf(ios::scientific); // set scientific for dEdX.
012f0f4c 162 *os << GetX() <<" " << GetY() << " " << GetZ() << " " ;
163 *os << GetSigmaY2() << " " << GetSigmaZ2() << " " << GetSigmaYZ() << " ";
164 fmt = os->setf(ios::fixed);
165 *os << GetVolumeId() << " "<< Misalign() /*fIsMisaligned*/ << " ";
166 fmt = os->setf(ios::scientific); // set scientific for dEdX.
167 *os << fXloc << " " << fZloc << " " << fdEdX << " ";
ee84ac37 168 fmt = os->setf(ios::fixed); // every fixed
012f0f4c 169 *os << fIndex <<" " << fQ << " "<<fLayer <<" "<<fNz<<" "<<fNy<<" ";
b2558977 170 *os << fChargeRatio<<" " << fType << " " << fDeltaProb << " " << fDriftTime;
ee84ac37 171 os->flags(fmt); // reset back to old formating.
172 return;
173}
174//----------------------------------------------------------------------
175void AliITSRecPoint::Read(istream *is){
176////////////////////////////////////////////////////////////////////////
177// Standard input format for this class.
178////////////////////////////////////////////////////////////////////////
012f0f4c 179 Bool_t mis;
180 Int_t lab[4];
181 Float_t hit[6];
182 lab[3] = 0; // ??
183 *is >> lab[0] >> lab[1] >> lab[2];
184 SetLabel(lab[0],0); SetLabel(lab[1],1); SetLabel(lab[2],2);
185 *is >> hit[0] >> hit[1] >> hit[2] >> hit[3] >> hit[4] >> hit[5];
186 SetX(hit[0]);SetY(hit[1]);SetZ(hit[2]);SetSigmaY2(hit[3]);
187 SetSigmaZ2(hit[4]);//fSigmaYZ=hit[5];
188 *is >> lab[0] >> mis;
189 SetVolumeId(lab[0]);// fIsMisalinged = mis;
190 *is >> fXloc >> fZloc >> fdEdX;
191 *is >> fIndex >> fQ >> fLayer >> fNz >> fNy >> fChargeRatio >> fType;
b2558977 192 *is >> fDeltaProb >> fDriftTime;
012f0f4c 193
194 return;
ee84ac37 195}
196//----------------------------------------------------------------------
197ostream &operator<<(ostream &os,AliITSRecPoint &p){
198////////////////////////////////////////////////////////////////////////
199// Standard output streaming function.
200////////////////////////////////////////////////////////////////////////
201
202 p.Print(&os);
203 return os;
204}
205//----------------------------------------------------------------------
206istream &operator>>(istream &is,AliITSRecPoint &r){
207////////////////////////////////////////////////////////////////////////
208// Standard input streaming function.
209////////////////////////////////////////////////////////////////////////
210
211 r.Read(&is);
212 return is;
213}
214//----------------------------------------------------------------------