]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSRecPoint.cxx
increased number of channels used in the TOFFEElight data structure, from 157248...
[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 #include <TGeoMatrix.h>
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 fDriftTime(0.)
53 {
54     // default constructor
55 }
56
57 //________________________________________________________________________
58 AliITSRecPoint::AliITSRecPoint(Int_t *lab,Float_t *hit, Int_t *info, Bool_t local):
59 AliCluster(AliGeomManager::LayerToVolUID((info[2]+AliGeomManager::kSPD1),lab[3]&0x3FF),hit,0,0,lab),
60 fXloc(0),
61 fZloc(0),
62 fdEdX(0),
63 fIndex(lab[3]),
64 fQ(hit[4]),
65 fLayer(info[2]),
66 fNz(info[1]),
67 fNy(info[0]),
68 fChargeRatio(0),
69 fType(0),
70 fDeltaProb(0),
71 fDriftTime(0.)
72 {
73   //standard constructor used in AliITSClusterFinderV2
74
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       fdEdX=fQ*2.16;
93       SetSigmaYZ(hit[5]);
94     case 5:
95       fdEdX=fQ*2.16;
96       hit[5]=-hit[5];
97       SetSigmaYZ(hit[5]);
98       break;
99     default:
100       AliError(Form("Wrong ITS layer %d (0 -> 5)",fLayer));
101       break;
102     }
103     fXloc = hit[0];
104     fZloc = hit[1];
105     Double_t lxyz[3] = {fXloc, 0, fZloc};
106     Double_t txyz[3] = {0, 0, 0};
107     GetTracking2LocalMatrix()->MasterToLocal(lxyz,txyz);
108
109     SetX(0.); SetY(txyz[1]); SetZ(txyz[2]);
110
111   }
112
113 }
114
115 //_______________________________________________________________________
116 AliITSRecPoint::AliITSRecPoint(const AliITSRecPoint& pt):AliCluster(pt),
117 fXloc(pt.fXloc),
118 fZloc(pt.fZloc),
119 fdEdX(pt.fdEdX),
120 fIndex(pt.fIndex),
121 fQ(pt.fQ),
122 fLayer(pt.fLayer),
123 fNz(pt.fNz),
124 fNy(pt.fNy),
125 fChargeRatio(pt.fChargeRatio),
126 fType(pt.fType),
127 fDeltaProb(pt.fDeltaProb),
128 fDriftTime(pt.fDriftTime)
129 {
130   //Copy constructor
131
132 }
133
134 //______________________________________________________________________
135 AliITSRecPoint& AliITSRecPoint::operator=(const AliITSRecPoint& source){
136   // Assignment operator
137
138   this->~AliITSRecPoint();
139   new(this) AliITSRecPoint(source);
140   return *this;
141
142 }
143
144 //----------------------------------------------------------------------
145 void AliITSRecPoint::Print(ostream *os){
146     ////////////////////////////////////////////////////////////////////////
147     // Standard output format for this class.
148     ////////////////////////////////////////////////////////////////////////
149 #if defined __GNUC__
150 #if __GNUC__ > 2
151     ios::fmtflags fmt;
152 #else
153     Int_t fmt;
154 #endif
155 #else
156 #if defined __ICC || defined __ECC || defined __xlC__
157     ios::fmtflags fmt;
158 #else
159     Int_t fmt;
160 #endif
161 #endif
162  
163     fmt = os->setf(ios::fixed);  // set fixed floating point output
164     *os << GetLabel(0) << " " << GetLabel(1) << " " << GetLabel(2) << " ";
165     fmt = os->setf(ios::scientific); // set scientific for dEdX.
166     *os << GetX() <<" " << GetY() << " " << GetZ() << " " ;
167     *os << GetSigmaY2() << " " << GetSigmaZ2() << " " << GetSigmaYZ() << " ";
168     fmt = os->setf(ios::fixed);
169     *os << GetVolumeId() << " "<< Misalign() /*fIsMisaligned*/ << " ";
170     fmt = os->setf(ios::scientific); // set scientific for dEdX.
171     *os << fXloc << " " << fZloc << " " << fdEdX << " ";
172     fmt = os->setf(ios::fixed); // every fixed
173     *os << fIndex <<" " << fQ << " "<<fLayer <<" "<<fNz<<" "<<fNy<<" ";
174     *os << fChargeRatio<<" " << fType << " " << fDeltaProb << " " << fDriftTime;
175     os->flags(fmt); // reset back to old formating.
176     return;
177 }
178 //----------------------------------------------------------------------
179 void AliITSRecPoint::Read(istream *is){
180 ////////////////////////////////////////////////////////////////////////
181 // Standard input format for this class.
182 ////////////////////////////////////////////////////////////////////////
183     Bool_t mis;
184     Int_t lab[4];
185     Float_t hit[6];
186     lab[3] = 0; // ??
187     *is >> lab[0] >> lab[1] >> lab[2];
188     SetLabel(lab[0],0); SetLabel(lab[1],1); SetLabel(lab[2],2);
189     *is >> hit[0] >> hit[1] >> hit[2] >> hit[3] >> hit[4] >> hit[5];
190     SetX(hit[0]);SetY(hit[1]);SetZ(hit[2]);SetSigmaY2(hit[3]);
191     SetSigmaZ2(hit[4]);//fSigmaYZ=hit[5];
192     *is >> lab[0] >> mis;
193     SetVolumeId(lab[0]);// fIsMisalinged = mis;
194     *is >> fXloc >> fZloc >> fdEdX;
195     *is >> fIndex >> fQ >> fLayer >> fNz >> fNy >> fChargeRatio >> fType;
196     *is >> fDeltaProb >> fDriftTime;
197
198     return;
199 }
200 //----------------------------------------------------------------------
201 ostream &operator<<(ostream &os,AliITSRecPoint &p){
202 ////////////////////////////////////////////////////////////////////////
203 // Standard output streaming function.
204 ////////////////////////////////////////////////////////////////////////
205  
206     p.Print(&os);
207     return os;
208 }
209 //----------------------------------------------------------------------
210 istream &operator>>(istream &is,AliITSRecPoint &r){
211 ////////////////////////////////////////////////////////////////////////
212 // Standard input streaming function.
213 ////////////////////////////////////////////////////////////////////////
214  
215     r.Read(&is);
216     return is;
217 }
218 //----------------------------------------------------------------------