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