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