]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCVertexFinder.cxx
cleaning memory on error condition and loop break
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCVertexFinder.cxx
CommitLineData
a6c02c85 1// @(#) $Id$
4aa41877 2// Original: AliHLTVertexFinder.cxx,v 1.9 2005/06/14 10:55:21 cvetan
a6c02c85 3
4// Author: Uli Frankenfeld <mailto:franken@fi.uib.no>
5//*-- Copyright &copy ALICE HLT Group
6
a6c02c85 7#include "AliHLTTPCSpacePointData.h"
8#include "AliHLTTPCVertexData.h"
9#include "AliHLTTPCLogging.h"
10#include "AliHLTTPCVertexArray.h"
11#include "AliHLTTPCVertex.h"
12#include "AliHLTTPCVertexFinder.h"
13#include "AliHLTTPCSpacePointData.h"
14#include "AliHLTTPCTransform.h"
15
16/** \class AliHLTTPCVertexFinder
17<pre>
18//_____________________________________________________________
19// AliHLTTPCVertexFinder
20//
21// Implementation of AliHLTTPCArray
22// usage:
23//
24// ResetSector();
25// for(n=0;n<NMEMSEC;n++)
26// Read();
27// FindSectorVertex();
28// SetZ(GetZSector());
29// SetZErr(GetZErrSector());
30//
31//
32</pre>
33*/
34
35#if __GNUC__ >= 3
36using namespace std;
37#endif
38
39ClassImp(AliHLTTPCVertexFinder)
40
41AliHLTTPCVertexFinder::AliHLTTPCVertexFinder()
e419b223 42 :
43 fX(0),
44 fY(0),
45 fZ(0),
46 fPhi(0),
47 fR(0),
48 fXErr(1),
49 fYErr(1),
50 fZErr(1),
51 fMWxy(1.)
a6c02c85 52{
53 //
54 // default constructor for the AliHLTTPCVertexFinder class.
55 //
56
57 //Set vertex to zero.
e419b223 58}
59
60AliHLTTPCVertexFinder::AliHLTTPCVertexFinder(AliHLTTPCVertexFinder &vf)
61 :
62 AliHLTTPCVertexArray(vf),
63 fX(0),
64 fY(0),
65 fZ(0),
66 fPhi(0),
67 fR(0),
68 fXErr(1),
69 fYErr(1),
70 fZErr(1),
71 fMWxy(1.)
72{
a6c02c85 73}
74
75AliHLTTPCVertexFinder::~AliHLTTPCVertexFinder()
76{
77 //
78 // destructor
79 //
80}
81
82void AliHLTTPCVertexFinder::Reset()
83{
84 //
85 // Reset
86 //
87 ResetSector();
88}
89
90
91void AliHLTTPCVertexFinder::Read(Int_t ncluster, AliHLTTPCSpacePointData* hits )
92{
93 //
94 // analyze sector
95 //
96
97 const Int_t kseedRow = AliHLTTPCTransform::GetNRows() - 1;
98 const Int_t kfirstRow = kseedRow-32;
99 for(Int_t n=0;n<ncluster;n++){
100 if(hits[n].fPadRow==kseedRow)
101 FillSectorSeed3D(hits[n].fX,hits[n].fY,hits[n].fZ); //copy seeds in 3D
102 if(hits[n].fPadRow<=kseedRow && hits[n].fPadRow>=kfirstRow)
103 FillSector3D(hits[n].fX,hits[n].fY,hits[n].fZ); //copy data in 3D
104 }
105}
106
107void AliHLTTPCVertexFinder::Analyze()
108{
109 //
110 // analyze all
111 //
112 FindSectorVertex();
113 SetZ(GetZSector());
114 SetZErr(GetZSectorErr());
115 LOG(AliHLTTPCLog::kInformational,"AliHLTTPCVertexFinder::Analyze","Result")
116 <<AliHLTTPCLog::kDec<<"Vertex: "<<GetZ()<<" RMS: "<<GetZErr()<<ENDLOG;
117}
118
119void AliHLTTPCVertexFinder::Write(AliHLTTPCVertex *vertex) const
120{
121 //
122 // write
123 //
124 vertex->SetX(GetX());
125 vertex->SetY(GetZ());
126 vertex->SetZ(GetZ());
127 vertex->SetXErr(GetXErr());
128 vertex->SetYErr(GetYErr());
129 vertex->SetZErr(GetZErr());
130
131 vertex->SetXYWeight(GetXYWeight());
132}
133
134void AliHLTTPCVertexFinder::Write(AliHLTTPCVertexData *vertex) const
135{
136 //
137 // write
138 //
139 vertex->fX=GetX();
140 vertex->fY=GetZ();
141 vertex->fZ=GetZ();
142 vertex->fXErr=GetXErr();
143 vertex->fYErr=GetYErr();
144 vertex->fZErr=GetZErr();
145}