]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/Ref/AliHLTTPCVertexFinder.cxx
Effective c++ corrections (T.Pocheptsov)
[u/mrichter/AliRoot.git] / HLT / TPCLib / Ref / AliHLTTPCVertexFinder.cxx
CommitLineData
78001a73 1// @(#) $Id$
2
3// Author: Uli Frankenfeld <mailto:franken@fi.uib.no>
4//*-- Copyright &copy ALICE HLT Group
5
6#include "AliHLTTPCStandardIncludes.h"
7
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
34ClassImp(AliHLTTPCVertexFinder)
35AliHLTTPCVertexFinder::AliHLTTPCVertexFinder(){
36 //
37 // default constructor for the AliHLTTPCVertexFinder class.
38 //
39
40 //Set vertex to zero.
41 SetX(0);
42 SetY(0);
43 SetZ(0);
44 SetXErr(1);
45 SetYErr(1);
46 SetZErr(1);
47 fR=0;
48 fPhi=0;
49
50 fMWxy = 1.;
51
52}
53
54AliHLTTPCVertexFinder::~AliHLTTPCVertexFinder(){
55 //
56 // destructor
57 //
58}
59
60void AliHLTTPCVertexFinder::Reset(){
61 ResetSector();
62}
63
64
65void AliHLTTPCVertexFinder::Read(Int_t ncluster, AliHLTTPCSpacePointData* hits ){
66 //
67 // analyze sector
68 //
69
70 const Int_t seedRow = AliHLTTPCTransform::GetNRows() - 1;
71 const Int_t firstRow = seedRow-32;
72 for(Int_t n=0;n<ncluster;n++){
73 if(hits[n].fPadRow==seedRow)
74 FillSectorSeed3D(hits[n].fX,hits[n].fY,hits[n].fZ); //copy seeds in 3D
75 if(hits[n].fPadRow<=seedRow && hits[n].fPadRow>=firstRow)
76 FillSector3D(hits[n].fX,hits[n].fY,hits[n].fZ); //copy data in 3D
77 }
78}
79
80void AliHLTTPCVertexFinder::Analyze(){
81 FindSectorVertex();
82 SetZ(GetZSector());
83 SetZErr(GetZSectorErr());
84 LOG(AliHLTTPCLog::kInformational,"AliHLTTPCVertexFinder::Analyze","Result")
85 <<AliHLTTPCLog::kDec<<"Vertex: "<<GetZ()<<" RMS: "<<GetZErr()<<ENDLOG;
86}
87
88void AliHLTTPCVertexFinder::Write(AliHLTTPCVertex *vertex){
89 vertex->SetX(GetX());
90 vertex->SetY(GetZ());
91 vertex->SetZ(GetZ());
92 vertex->SetXErr(GetXErr());
93 vertex->SetYErr(GetYErr());
94 vertex->SetZErr(GetZErr());
95
96 vertex->SetXYWeight(GetXYWeight());
97}
98
99void AliHLTTPCVertexFinder::Write(AliHLTTPCVertexData *vertex){
100 vertex->fX=GetX();
101 vertex->fY=GetZ();
102 vertex->fZ=GetZ();
103 vertex->fXErr=GetXErr();
104 vertex->fYErr=GetYErr();
105 vertex->fZErr=GetZErr();
106}