2 // Original: AliHLTConfMapPoint.cxx,v 1.10 2005/06/23 17:46:55 hristov
4 /**************************************************************************
5 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * Authors: Anders Vestbo *
8 * Matthias Richter <Matthias.Richter@ift.uib.no> *
9 * for The ALICE Off-line Project. *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
20 /** @file AliHLTTPCConfMapPoint.cxx
21 @author Anders Vestbo, maintained by Matthias Richter
23 @brief Hit class for conformal mapper
26 #include "AliHLTTPCLogging.h"
27 #include "AliHLTTPCConfMapPoint.h"
28 #include "AliHLTTPCSpacePointData.h"
29 #include "AliHLTTPCVertex.h"
30 #include "AliHLTTPCConfMapTrack.h"
34 //_____________________________________________________________
35 // AliHLTTPCConfMapPoint
37 // Hit class for conformal mapper
41 /** ROOT macro for the implementation of ROOT specific class methods */
42 ClassImp(AliHLTTPCConfMapPoint);
44 Bool_t AliHLTTPCConfMapPoint::fgDontMap=kFALSE;
46 AliHLTTPCConfMapPoint::AliHLTTPCConfMapPoint()
66 SetIntPoint(0., 0., 0., 0., 0., 0.);
71 AliHLTTPCConfMapPoint::AliHLTTPCConfMapPoint(const AliHLTTPCConfMapPoint&)
73 // dummy copy constructor
74 //HLTFatal("copy constructor untested");
77 AliHLTTPCConfMapPoint& AliHLTTPCConfMapPoint::operator=(const AliHLTTPCConfMapPoint&)
79 // dummy assignment operator
80 //HLTFatal("assignment operator untested");
84 AliHLTTPCConfMapPoint::~AliHLTTPCConfMapPoint()
89 Bool_t AliHLTTPCConfMapPoint::ReadHits(AliHLTTPCSpacePointData* hits )
92 SetHitNumber(hits->fID);
93 SetPadRow(hits->fPadRow);
94 Int_t slice = (hits->fID>>25) & 0x7f;
99 SetXerr(sqrt(hits->fSigmaY2));
100 SetYerr(sqrt(hits->fSigmaY2));
101 SetZerr(sqrt(hits->fSigmaZ2));
105 void AliHLTTPCConfMapPoint::Reset()
115 void AliHLTTPCConfMapPoint::Setup(AliHLTTPCVertex *vertex)
117 //Setup. Sets the vertex, conformal coordinates,
118 //and phi and eta of each hit.
120 SetIntPoint(vertex->GetX(), vertex->GetY(), vertex->GetZ(),
121 vertex->GetXErr(), vertex->GetYErr(), vertex->GetZErr());
124 // The angles are set properly if they are set after
125 // the interaction point and the shifted coordinates
131 void AliHLTTPCConfMapPoint::SetIntPoint(Double_t inx, Double_t iny, Double_t inz,
132 Double_t inxerr, Double_t inyerr, Double_t inzerr)
134 // Defines a new interaction point. This point is needed to calculate
135 // the conformal coordinates.
147 void AliHLTTPCConfMapPoint::SetAllCoord(const AliHLTTPCConfMapPoint *precedinghit)
149 // Sets the interaction point, the shifted coordinates, and the conformal mapping coordinates.
150 // These values are calculated from the interaction point of the given cluster which should be a
151 // already found cluster on the same track.
153 if (this == precedinghit) {
154 SetIntPoint(precedinghit->GetX(), precedinghit->GetY(), precedinghit->GetZ(),
155 precedinghit->GetXerr(), precedinghit->GetYerr(), precedinghit->GetZerr());
159 SetIntPoint(precedinghit->GetXt(), precedinghit->GetYt(), precedinghit->GetZt(),
160 precedinghit->GetXterr(), precedinghit->GetYterr(), precedinghit->GetZterr());
169 void AliHLTTPCConfMapPoint::SetShiftedCoord()
171 // Sets the coordinates with resepct to the given vertex point
177 SetXverr(TMath::Sqrt(GetXerr()*GetXerr() + fXterr*fXterr));
178 SetYverr(TMath::Sqrt(GetYerr()*GetYerr() + fYterr*fYterr));
179 SetZverr(TMath::Sqrt(GetZerr()*GetZerr() + fZterr*fZterr));
184 void AliHLTTPCConfMapPoint::SetConfCoord()
186 // Calculates the conformal coordinates of one cluster.
187 // If the option "vertex_constraint" applies the interaction point is
188 // assumed to be at (0, 0, 0). Otherwise the function will use the
189 // interaction point specified by fXt and fYt.
195 fs = 0; //track trajectory
201 Double_t xyErrorScale = 1;
202 Double_t szErrorScale = 1;
204 if ((r2 = fXv*fXv + fYv*fYv))
210 fWxy = r2*r2 / ((xyErrorScale*xyErrorScale)*((fxerr*fxerr)+(fyerr*fyerr)));
211 fs = 0; //track trajectory
212 fWz = (Double_t)(1./(szErrorScale*fzerr*fzerr));
226 void AliHLTTPCConfMapPoint::SetAngles()
228 // Calculates the angle phi and the pseudorapidity eta for each cluster.
230 Double_t r = TMath::Sqrt(x*x + y*y);
232 fPhi = TMath::ATan2(y,x);
233 if(fPhi<0) fPhi = fPhi + 2*TMath::Pi();
234 fEta = 3.*z/(TMath::Abs(z)+2.*r);
237 // Double_t r3dim = TMath::Sqrt(fXv*fXv + fYv*fYv + fZv*fZv);
238 Double_t r3dim = sqrt(fXv*fXv + fYv*fYv + fZv*fZv);
239 //Double_t r2dim = TMath::Sqrt(fXv*fXv + fYv*fYv);
242 // If r2dim == 0 the pseudorapidity eta cannot be calculated (division by zero)!
243 // This can only happen if the point is lying on the z-axis and this should never be possible.
244 cerr << "The pseudorapidity eta cannot be calculated (division by zero)! Set to 1.e-10." << endl;
249 fPhi = (fYv > 0.) ? TMath::Pi() / 2. : - TMath::Pi() / 2.;
253 fPhi = (fXv > 0.) ? TMath::ASin(fYv/r2dim) : TMath::Pi() - TMath::ASin(fYv/r2dim);
257 fPhi += 2. * TMath::Pi();
260 //fPhi = TMath::ATan2(y,x);
262 //if(fPhi<0) fPhi = fPhi + 2*TMath::Pi();
264 //fEta = 0.5 * TMath::Log((r3dim + fZv)/(r3dim - fZv));
265 fEta = 0.5 * log((r3dim + fZv)/(r3dim - fZv));
270 AliHLTTPCConfMapTrack *AliHLTTPCConfMapPoint::GetTrack(TClonesArray *tracks) const
272 // Returns the pointer to the track to which this hit belongs.
274 return (AliHLTTPCConfMapTrack*)tracks->At(this->GetTrackNumber());