]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/src/AliL3VertexFinder.cxx
Added ASVVERSION define.
[u/mrichter/AliRoot.git] / HLT / src / AliL3VertexFinder.cxx
1 // Author: Uli Frankenfeld <mailto:franken@fi.uib.no>
2 //*-- Copyright &copy Uli
3
4 #include "AliL3StandardIncludes.h"
5
6 #include "AliL3Logging.h"
7 #include "AliL3VertexArray.h"
8 #include "AliL3Vertex.h"
9 #include "AliL3VertexFinder.h"
10 #include "AliL3SpacePointData.h"
11 #include "AliL3Transform.h"
12
13 //_____________________________________________________________
14 // AliL3VertexFinder
15 //
16 //   Implementation of AliL3Array 
17 //   usage:
18 // 
19 //   ResetSector();
20 //   for(n=0;n<NMEMSEC;n++)  
21 //     Read();
22 //   FindSectorVertex();
23 //   SetZ(GetZSector());
24 //   SetZErr(GetZErrSector());
25 // 
26 //
27
28 ClassImp(AliL3VertexFinder)
29 AliL3VertexFinder::AliL3VertexFinder(){
30   //
31   // default constructor for the AliL3VertexFinder class. 
32   //
33
34   //Set vertex to zero.
35   SetX(0);
36   SetY(0);
37   SetZ(0);
38   SetXErr(1);
39   SetYErr(1);
40   SetZErr(1);
41   fR=0;
42   fPhi=0;
43
44   fMWxy = 1.;
45     
46 }
47
48 AliL3VertexFinder::~AliL3VertexFinder(){
49   //
50   // destructor
51   //
52 }
53
54 void AliL3VertexFinder::Reset(){
55   ResetSector();
56 }
57
58
59 void AliL3VertexFinder::Read(Int_t ncluster, AliL3SpacePointData* hits ){
60   //
61   //  analyze sector 
62   // 
63   
64   const Int_t seedRow = AliL3Transform::GetNRows() - 1; 
65   const Int_t firstRow = seedRow-32;
66   for(Int_t n=0;n<ncluster;n++){
67     if(hits[n].fPadRow==seedRow)
68       FillSectorSeed3D(hits[n].fX,hits[n].fY,hits[n].fZ);  //copy seeds in 3D
69     if(hits[n].fPadRow<=seedRow && hits[n].fPadRow>=firstRow)
70       FillSector3D(hits[n].fX,hits[n].fY,hits[n].fZ);  //copy data in 3D
71   }
72 }
73
74 void AliL3VertexFinder::Analyze(){
75   FindSectorVertex();
76   SetZ(GetZSector());
77   SetZErr(GetZSectorErr());
78   LOG(AliL3Log::kInformational,"AliL3VertexFinder::Analyze","Result")
79   <<AliL3Log::kDec<<"Vertex: "<<GetZ()<<"  RMS: "<<GetZErr()<<ENDLOG;
80 }
81
82 void AliL3VertexFinder::Write(AliL3Vertex *vertex){
83   vertex->SetX(GetX());
84   vertex->SetY(GetZ());
85   vertex->SetZ(GetZ());
86   vertex->SetXErr(GetXErr());
87   vertex->SetYErr(GetYErr());
88   vertex->SetZErr(GetZErr());
89
90   vertex->SetXYWeight(GetXYWeight());
91 }
92
93 void AliL3VertexFinder::Write(AliL3VertexData *vertex){
94   vertex->fX=GetX();
95   vertex->fY=GetZ();
96   vertex->fZ=GetZ();
97   vertex->fXErr=GetXErr();
98   vertex->fYErr=GetYErr();
99   vertex->fZErr=GetZErr();
100 }