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