Including cmath
[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
33
34#include "AliITSRecPoint.h"
00a7cc50 35#include "AliITSgeom.h"
e8189707 36ClassImp(AliITSRecPoint)
9671cc24 37
00a7cc50 38//_____________________________________________________________
e56160b8 39AliITSRecPoint::AliITSRecPoint(): AliCluster(),
d89cf0f2 40fX(0),
e56160b8 41fXloc(0),
42fZloc(0),
43fdEdX(0),
44fIndex(0),
45fQ(0),
46fLayer(0),
47fNz(0),
48fNy(0),
49fChargeRatio(0),
50fType(0),
51fDeltaProb(0),
52fGeom(0){
9671cc24 53 // default creator
ee84ac37 54}
00a7cc50 55
56//_____________________________________________________________
e56160b8 57AliITSRecPoint::AliITSRecPoint(AliITSgeom* geom): AliCluster(),
d89cf0f2 58fX(0),
e56160b8 59fXloc(0),
60fZloc(0),
61fdEdX(0),
62fIndex(0),
63fQ(0),
64fLayer(0),
65fNz(0),
66fNy(0),
67fChargeRatio(0),
68fType(0),
69fDeltaProb(0),
70fGeom(geom) {
00a7cc50 71 // default creator
e56160b8 72
00a7cc50 73}
74
75//________________________________________________________________________
e56160b8 76AliITSRecPoint::AliITSRecPoint(Int_t module,AliITSgeom* geom,Int_t *lab,Float_t *hit, Int_t *info):AliCluster(lab,hit),
d89cf0f2 77fX(0),
e56160b8 78fXloc(0),
79fZloc(0),
80fdEdX(0),
81fIndex(lab[3]),
82fQ(hit[4]),
83fLayer(info[2]),
84fNz(info[1]),
85fNy(info[0]),
86fChargeRatio(0),
87fType(0),
88fDeltaProb(0),
89fGeom(geom)
90{
00a7cc50 91 //standard constructor used in AliITSClusterFinderV2
e56160b8 92
93
00a7cc50 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//_______________________________________________________________________
e56160b8 108AliITSRecPoint::AliITSRecPoint(const AliITSRecPoint& pt):AliCluster(pt),
d89cf0f2 109fX(pt.fX),
e56160b8 110fXloc(pt.fXloc),
111fZloc(pt.fZloc),
112fdEdX(pt.fdEdX),
113fIndex(pt.fIndex),
114fQ(pt.fQ),
115fLayer(pt.fLayer),
116fNz(pt.fNz),
117fNy(pt.fNy),
118fChargeRatio(pt.fChargeRatio),
119fType(pt.fType),
120fDeltaProb(pt.fDeltaProb),
121fGeom(pt.fGeom){
00a7cc50 122 //Copy constructor
00a7cc50 123
124}
125
126//______________________________________________________________________
e56160b8 127AliITSRecPoint& AliITSRecPoint::operator=(const AliITSRecPoint& source){
00a7cc50 128 // Assignment operator
e56160b8 129
130 this->~AliITSRecPoint();
131 new(this) AliITSRecPoint(source);
00a7cc50 132 return *this;
e56160b8 133
00a7cc50 134}
135
136//________________________________________________________________________
e56160b8 137AliITSRecPoint::AliITSRecPoint(Int_t *lab,Float_t *hit, Int_t *info):AliCluster(lab,hit),
d89cf0f2 138fX(0),
e56160b8 139fXloc(0),
140fZloc(0),
141fdEdX(0),
142fIndex(lab[3]),
143fQ(hit[4]),
144fLayer(info[2]),
145fNz(info[1]),
146fNy(info[0]),
147fChargeRatio(0),
148fType(0),
149fDeltaProb(0),
150fGeom(0){
00a7cc50 151 //standard constructor used in AliITSClusterFinderV2
00a7cc50 152}
153
ee84ac37 154//----------------------------------------------------------------------
155void 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
9f69211c 166#if defined __ICC || defined __ECC || defined __xlC__
ee84ac37 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] << " ";
00a7cc50 175 *os << fXloc << " " << fZloc << " " << fQ << " ";
ee84ac37 176 fmt = os->setf(ios::scientific); // set scientific for dEdX.
177 *os << fdEdX << " ";
178 fmt = os->setf(ios::fixed); // every fixed
00a7cc50 179 *os << fSigmaY2 << " " << fSigmaZ2;
ee84ac37 180 os->flags(fmt); // reset back to old formating.
181 return;
182}
183//----------------------------------------------------------------------
184void AliITSRecPoint::Read(istream *is){
185////////////////////////////////////////////////////////////////////////
186// Standard input format for this class.
187////////////////////////////////////////////////////////////////////////
188
9671cc24 189
00a7cc50 190 *is >> fTracks[0] >> fTracks[1] >> fTracks[2] >> fXloc >> fZloc >> fQ;
191 *is >> fdEdX >> fSigmaY2 >> fSigmaZ2;
ee84ac37 192 return;
193}
194//----------------------------------------------------------------------
195ostream &operator<<(ostream &os,AliITSRecPoint &p){
196////////////////////////////////////////////////////////////////////////
197// Standard output streaming function.
198////////////////////////////////////////////////////////////////////////
199
200 p.Print(&os);
201 return os;
202}
203//----------------------------------------------------------------------
204istream &operator>>(istream &is,AliITSRecPoint &r){
205////////////////////////////////////////////////////////////////////////
206// Standard input streaming function.
207////////////////////////////////////////////////////////////////////////
208
209 r.Read(&is);
210 return is;
211}
212//----------------------------------------------------------------------