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