]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCVertexFinder.cxx
code changes by Gaute Ovrebekk
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCVertexFinder.cxx
1 // @(#) $Id$
2 // Original: AliL3VertexFinder.cxx,v 1.9 2005/06/14 10:55:21 cvetan 
3
4 // Author: Uli Frankenfeld <mailto:franken@fi.uib.no>
5 //*-- Copyright &copy ALICE HLT Group
6
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
36 using namespace std;
37 #endif
38
39 ClassImp(AliHLTTPCVertexFinder)
40
41 AliHLTTPCVertexFinder::AliHLTTPCVertexFinder()
42 {
43   //
44   // default constructor for the AliHLTTPCVertexFinder class. 
45   //
46
47   //Set vertex to zero.
48   SetX(0);
49   SetY(0);
50   SetZ(0);
51   SetXErr(1);
52   SetYErr(1);
53   SetZErr(1);
54   fR=0;
55   fPhi=0;
56   fMWxy = 1.;
57 }
58
59 AliHLTTPCVertexFinder::~AliHLTTPCVertexFinder()
60 {
61   //
62   // destructor
63   //
64 }
65
66 void AliHLTTPCVertexFinder::Reset()
67 {
68   //
69   // Reset
70   //
71   ResetSector();
72 }
73
74
75 void AliHLTTPCVertexFinder::Read(Int_t ncluster, AliHLTTPCSpacePointData* hits )
76 {
77   //
78   //  analyze sector 
79   // 
80   
81   const Int_t kseedRow = AliHLTTPCTransform::GetNRows() - 1; 
82   const Int_t kfirstRow = kseedRow-32;
83   for(Int_t n=0;n<ncluster;n++){
84     if(hits[n].fPadRow==kseedRow)
85       FillSectorSeed3D(hits[n].fX,hits[n].fY,hits[n].fZ);  //copy seeds in 3D
86     if(hits[n].fPadRow<=kseedRow && hits[n].fPadRow>=kfirstRow)
87       FillSector3D(hits[n].fX,hits[n].fY,hits[n].fZ);  //copy data in 3D
88   }
89 }
90
91 void AliHLTTPCVertexFinder::Analyze()
92 {
93   //
94   // analyze all
95   //
96   FindSectorVertex();
97   SetZ(GetZSector());
98   SetZErr(GetZSectorErr());
99   LOG(AliHLTTPCLog::kInformational,"AliHLTTPCVertexFinder::Analyze","Result")
100   <<AliHLTTPCLog::kDec<<"Vertex: "<<GetZ()<<"  RMS: "<<GetZErr()<<ENDLOG;
101 }
102
103 void AliHLTTPCVertexFinder::Write(AliHLTTPCVertex *vertex) const
104 {
105   //
106   // write
107   //
108   vertex->SetX(GetX());
109   vertex->SetY(GetZ());
110   vertex->SetZ(GetZ());
111   vertex->SetXErr(GetXErr());
112   vertex->SetYErr(GetYErr());
113   vertex->SetZErr(GetZErr());
114
115   vertex->SetXYWeight(GetXYWeight());
116 }
117
118 void AliHLTTPCVertexFinder::Write(AliHLTTPCVertexData *vertex) const
119 {
120   //
121   // write
122   //
123   vertex->fX=GetX();
124   vertex->fY=GetZ();
125   vertex->fZ=GetZ();
126   vertex->fXErr=GetXErr();
127   vertex->fYErr=GetYErr();
128   vertex->fZErr=GetZErr();
129 }