]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSRecPoint.cxx
Matrices to go from local RS of alignable volumes to Tracking Reference system (V2...
[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 "AliITSgeom.h"
36 ClassImp(AliITSRecPoint)
37
38 //_____________________________________________________________
39 AliITSRecPoint::AliITSRecPoint(): AliCluster(),
40 fX(0),
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 fGeom(0){
53     // default creator
54 }
55
56 //_____________________________________________________________
57 AliITSRecPoint::AliITSRecPoint(AliITSgeom* geom): AliCluster(),
58 fX(0),
59 fXloc(0),
60 fZloc(0),
61 fdEdX(0),
62 fIndex(0),
63 fQ(0),
64 fLayer(0),
65 fNz(0),
66 fNy(0),
67 fChargeRatio(0),
68 fType(0),
69 fDeltaProb(0),
70 fGeom(geom) {
71     // default creator
72
73 }
74
75 //________________________________________________________________________
76 AliITSRecPoint::AliITSRecPoint(Int_t module,AliITSgeom* geom,Int_t *lab,Float_t *hit, Int_t *info):AliCluster(lab,hit),
77 fX(0),
78 fXloc(0),
79 fZloc(0),
80 fdEdX(0),
81 fIndex(lab[3]),
82 fQ(hit[4]),
83 fLayer(info[2]),
84 fNz(info[1]),
85 fNy(info[0]),
86 fChargeRatio(0),
87 fType(0),
88 fDeltaProb(0),
89 fGeom(geom)
90 {
91   //standard constructor used in AliITSClusterFinderV2
92
93
94   fType=0;
95   fDeltaProb=0.;
96   
97   fGeom = geom;
98   fGeom->TrackingV2ToDetL(module,fY,fZ,fXloc,fZloc);
99   if(module<fGeom->GetStartSDD()) fdEdX=0.;
100   if(module>=fGeom->GetStartSDD() && module<fGeom->GetStartSSD()){
101     fdEdX=fQ*1e-6;
102   }
103   if(module>=fGeom->GetStartSSD()) fdEdX=fQ*2.16;
104   
105   
106 }
107 //_______________________________________________________________________
108 AliITSRecPoint::AliITSRecPoint(const AliITSRecPoint& pt):AliCluster(pt),
109 fX(pt.fX),
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 fGeom(pt.fGeom){
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 AliITSRecPoint::AliITSRecPoint(Int_t *lab,Float_t *hit, Int_t *info):AliCluster(lab,hit),
138 fX(0),
139 fXloc(0),
140 fZloc(0),
141 fdEdX(0),
142 fIndex(lab[3]),
143 fQ(hit[4]),
144 fLayer(info[2]),
145 fNz(info[1]),
146 fNy(info[0]),
147 fChargeRatio(0),
148 fType(0),
149 fDeltaProb(0),
150 fGeom(0){
151   //standard constructor used in AliITSClusterFinderV2
152 }
153
154 //----------------------------------------------------------------------
155 void AliITSRecPoint::Print(ostream *os){
156     ////////////////////////////////////////////////////////////////////////
157     // Standard output format for this class.
158     ////////////////////////////////////////////////////////////////////////
159 #if defined __GNUC__
160 #if __GNUC__ > 2
161     ios::fmtflags fmt;
162 #else
163     Int_t fmt;
164 #endif
165 #else
166 #if defined __ICC || defined __ECC || defined __xlC__
167     ios::fmtflags fmt;
168 #else
169     Int_t fmt;
170 #endif
171 #endif
172  
173     fmt = os->setf(ios::fixed);  // set fixed floating point output
174     *os << fTracks[0]<< " " << fTracks[1] << " " << fTracks[2] << " ";
175     *os << fXloc << " " << fZloc << " " << fQ << " ";
176     fmt = os->setf(ios::scientific); // set scientific for dEdX.
177     *os << fdEdX << " ";
178     fmt = os->setf(ios::fixed); // every fixed
179     *os << fSigmaY2 << " " << fSigmaZ2;
180     os->flags(fmt); // reset back to old formating.
181     return;
182 }
183 //----------------------------------------------------------------------
184 void AliITSRecPoint::Read(istream *is){
185 ////////////////////////////////////////////////////////////////////////
186 // Standard input format for this class.
187 ////////////////////////////////////////////////////////////////////////
188  
189
190     *is >> fTracks[0] >> fTracks[1] >> fTracks[2] >> fXloc >> fZloc >> fQ;
191     *is >> fdEdX >> fSigmaY2 >> fSigmaZ2;
192     return;
193 }
194 //----------------------------------------------------------------------
195 ostream &operator<<(ostream &os,AliITSRecPoint &p){
196 ////////////////////////////////////////////////////////////////////////
197 // Standard output streaming function.
198 ////////////////////////////////////////////////////////////////////////
199  
200     p.Print(&os);
201     return os;
202 }
203 //----------------------------------------------------------------------
204 istream &operator>>(istream &is,AliITSRecPoint &r){
205 ////////////////////////////////////////////////////////////////////////
206 // Standard input streaming function.
207 ////////////////////////////////////////////////////////////////////////
208  
209     r.Read(&is);
210     return is;
211 }
212 //----------------------------------------------------------------------