]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSRecPoint.cxx
(martin) pt vs eta correction matrix calculation macro using CorrectionMatrix2D class.
[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     // default creator
41     fXloc=fZloc=fdEdX=0.;
42     fQ=0; fLayer=0; fNz=fNy=1; fType=0; fDeltaProb=0;fChargeRatio=0;
43     fGeom=0;
44 }
45
46 //_____________________________________________________________
47 AliITSRecPoint::AliITSRecPoint(AliITSgeom* geom): AliCluster() {
48     // default creator
49     fXloc=fZloc=fdEdX=0.;
50     fQ=0; fLayer=0; fNz=fNy=1; fType=0; fDeltaProb=0;fChargeRatio=0;
51     fGeom=geom;
52 }
53
54 //________________________________________________________________________
55 AliITSRecPoint::AliITSRecPoint(Int_t module,AliITSgeom* geom,Int_t *lab,Float_t *hit, Int_t *info):AliCluster(lab,hit){
56   //standard constructor used in AliITSClusterFinderV2
57   fIndex=lab[3];
58   fQ=hit[4];
59   fNy    = info[0];
60   fNz    = info[1];
61   fLayer = info[2];
62   fChargeRatio = 0;
63   fType=0;
64   fDeltaProb=0.;
65   
66   fGeom = geom;
67   fGeom->TrackingV2ToDetL(module,fY,fZ,fXloc,fZloc);
68   if(module<fGeom->GetStartSDD()) fdEdX=0.;
69   if(module>=fGeom->GetStartSDD() && module<fGeom->GetStartSSD()){
70     fdEdX=fQ*1e-6;
71   }
72   if(module>=fGeom->GetStartSSD()) fdEdX=fQ*2.16;
73   
74   
75 }
76 //_______________________________________________________________________
77 AliITSRecPoint::AliITSRecPoint(const AliITSRecPoint& pt):AliCluster(pt){
78   //Copy constructor
79   fXloc = pt.fXloc;
80   fZloc = pt.fZloc;
81   fdEdX = pt.fdEdX;
82   fIndex= pt.fIndex;
83   fQ = pt.fQ;
84   fNy = pt.fNy;
85   fNz = pt.fNz;
86   fLayer = pt.fLayer;
87   fChargeRatio = pt.fChargeRatio;
88   fType = pt.fType;
89   fDeltaProb = pt.fDeltaProb;
90   fGeom = pt.fGeom;
91
92 }
93
94 //______________________________________________________________________
95 AliITSRecPoint& AliITSRecPoint::operator=(const AliITSRecPoint& /* source */){
96   // Assignment operator
97   // Assignment is not allowed. The method is protected to avoid misuse.
98   Fatal("= operator","Assignment operator not allowed\n");
99   return *this;
100 }
101
102 //________________________________________________________________________
103 AliITSRecPoint::AliITSRecPoint(Int_t *lab,Float_t *hit, Int_t *info):AliCluster(lab,hit){
104   //standard constructor used in AliITSClusterFinderV2
105   fXloc=fZloc=fdEdX=0.;
106   fIndex=lab[3];
107   fQ=hit[4];
108   fNy    = info[0];
109   fNz    = info[1];
110   fLayer = info[2];
111   fChargeRatio = 0;
112   fType=0;
113   fDeltaProb=0.;  
114   fGeom = 0;
115 }
116
117 //----------------------------------------------------------------------
118 void AliITSRecPoint::Print(ostream *os){
119     ////////////////////////////////////////////////////////////////////////
120     // Standard output format for this class.
121     ////////////////////////////////////////////////////////////////////////
122 #if defined __GNUC__
123 #if __GNUC__ > 2
124     ios::fmtflags fmt;
125 #else
126     Int_t fmt;
127 #endif
128 #else
129 #if defined __ICC || defined __ECC || defined __xlC__
130     ios::fmtflags fmt;
131 #else
132     Int_t fmt;
133 #endif
134 #endif
135  
136     fmt = os->setf(ios::fixed);  // set fixed floating point output
137     *os << fTracks[0]<< " " << fTracks[1] << " " << fTracks[2] << " ";
138     *os << fXloc << " " << fZloc << " " << fQ << " ";
139     fmt = os->setf(ios::scientific); // set scientific for dEdX.
140     *os << fdEdX << " ";
141     fmt = os->setf(ios::fixed); // every fixed
142     *os << fSigmaY2 << " " << fSigmaZ2;
143     os->flags(fmt); // reset back to old formating.
144     return;
145 }
146 //----------------------------------------------------------------------
147 void AliITSRecPoint::Read(istream *is){
148 ////////////////////////////////////////////////////////////////////////
149 // Standard input format for this class.
150 ////////////////////////////////////////////////////////////////////////
151  
152
153     *is >> fTracks[0] >> fTracks[1] >> fTracks[2] >> fXloc >> fZloc >> fQ;
154     *is >> fdEdX >> fSigmaY2 >> fSigmaZ2;
155     return;
156 }
157 //----------------------------------------------------------------------
158 ostream &operator<<(ostream &os,AliITSRecPoint &p){
159 ////////////////////////////////////////////////////////////////////////
160 // Standard output streaming function.
161 ////////////////////////////////////////////////////////////////////////
162  
163     p.Print(&os);
164     return os;
165 }
166 //----------------------------------------------------------------------
167 istream &operator>>(istream &is,AliITSRecPoint &r){
168 ////////////////////////////////////////////////////////////////////////
169 // Standard input streaming function.
170 ////////////////////////////////////////////////////////////////////////
171  
172     r.Read(&is);
173     return is;
174 }
175 //----------------------------------------------------------------------