// @(#) $Id$ // Original: AliHLTVertexFinder.cxx,v 1.9 2005/06/14 10:55:21 cvetan // Author: Uli Frankenfeld //*-- Copyright © ALICE HLT Group #include "AliHLTTPCSpacePointData.h" #include "AliHLTTPCVertexData.h" #include "AliHLTTPCLogging.h" #include "AliHLTTPCVertexArray.h" #include "AliHLTTPCVertex.h" #include "AliHLTTPCVertexFinder.h" #include "AliHLTTPCSpacePointData.h" #include "AliHLTTPCTransform.h" /** \class AliHLTTPCVertexFinder
//_____________________________________________________________
// AliHLTTPCVertexFinder
//
//   Implementation of AliHLTTPCArray 
//   usage:
// 
//   ResetSector();
//   for(n=0;n
*/

#if __GNUC__ >= 3
using namespace std;
#endif

ClassImp(AliHLTTPCVertexFinder)

AliHLTTPCVertexFinder::AliHLTTPCVertexFinder()
  :
  fX(0),
  fY(0),
  fZ(0),
  fPhi(0),
  fR(0),
  fXErr(1),
  fYErr(1),
  fZErr(1),
  fMWxy(1.)
{
  //
  // default constructor for the AliHLTTPCVertexFinder class. 
  //

  //Set vertex to zero.
}

AliHLTTPCVertexFinder::AliHLTTPCVertexFinder(AliHLTTPCVertexFinder &vf)
  :
  AliHLTTPCVertexArray(vf),
  fX(0),
  fY(0),
  fZ(0),
  fPhi(0),
  fR(0),
  fXErr(1),
  fYErr(1),
  fZErr(1),
  fMWxy(1.)
{
}

AliHLTTPCVertexFinder::~AliHLTTPCVertexFinder()
{
  //
  // destructor
  //
}

void AliHLTTPCVertexFinder::Reset()
{
  //
  // Reset
  //
  ResetSector();
}


void AliHLTTPCVertexFinder::Read(Int_t ncluster, AliHLTTPCSpacePointData* hits )
{
  //
  //  analyze sector 
  // 
  
  const Int_t kseedRow = AliHLTTPCTransform::GetNRows() - 1; 
  const Int_t kfirstRow = kseedRow-32;
  for(Int_t n=0;n=kfirstRow)
      FillSector3D(hits[n].fX,hits[n].fY,hits[n].fZ);  //copy data in 3D
  }
}

void AliHLTTPCVertexFinder::Analyze()
{
  //
  // analyze all
  //
  FindSectorVertex();
  SetZ(GetZSector());
  SetZErr(GetZSectorErr());
  LOG(AliHLTTPCLog::kInformational,"AliHLTTPCVertexFinder::Analyze","Result")
  <SetX(GetX());
  vertex->SetY(GetZ());
  vertex->SetZ(GetZ());
  vertex->SetXErr(GetXErr());
  vertex->SetYErr(GetYErr());
  vertex->SetZErr(GetZErr());

  vertex->SetXYWeight(GetXYWeight());
}

void AliHLTTPCVertexFinder::Write(AliHLTTPCVertexData *vertex) const
{
  //
  // write
  //
  vertex->fX=GetX();
  vertex->fY=GetZ();
  vertex->fZ=GetZ();
  vertex->fXErr=GetXErr();
  vertex->fYErr=GetYErr();
  vertex->fZErr=GetZErr();
}