]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/src/AliL3VertexFinder.cxx
Added Gautes changes from Bergen.
[u/mrichter/AliRoot.git] / HLT / src / AliL3VertexFinder.cxx
1 // @(#) $Id$
2
3 // Author: Uli Frankenfeld <mailto:franken@fi.uib.no>
4 //*-- Copyright &copy ALICE HLT Group
5
6 #include "AliL3StandardIncludes.h"
7
8 #include "AliL3Logging.h"
9 #include "AliL3VertexArray.h"
10 #include "AliL3Vertex.h"
11 #include "AliL3VertexFinder.h"
12 #include "AliL3SpacePointData.h"
13 #include "AliL3Transform.h"
14
15 /** \class AliL3VertexFinder
16 <pre>
17 //_____________________________________________________________
18 // AliL3VertexFinder
19 //
20 //   Implementation of AliL3Array 
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 ClassImp(AliL3VertexFinder)
35 AliL3VertexFinder::AliL3VertexFinder(){
36   //
37   // default constructor for the AliL3VertexFinder 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
54 AliL3VertexFinder::~AliL3VertexFinder(){
55   //
56   // destructor
57   //
58 }
59
60 void AliL3VertexFinder::Reset(){
61   ResetSector();
62 }
63
64
65 void AliL3VertexFinder::Read(Int_t ncluster, AliL3SpacePointData* hits ){
66   //
67   //  analyze sector 
68   // 
69   
70   const Int_t seedRow = AliL3Transform::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
80 void AliL3VertexFinder::Analyze(){
81   FindSectorVertex();
82   SetZ(GetZSector());
83   SetZErr(GetZSectorErr());
84   LOG(AliL3Log::kInformational,"AliL3VertexFinder::Analyze","Result")
85   <<AliL3Log::kDec<<"Vertex: "<<GetZ()<<"  RMS: "<<GetZErr()<<ENDLOG;
86 }
87
88 void AliL3VertexFinder::Write(AliL3Vertex *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
99 void AliL3VertexFinder::Write(AliL3VertexData *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 }