]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexer3DTapan.cxx
minor fix
[u/mrichter/AliRoot.git] / ITS / AliITSVertexer3DTapan.cxx
index 2de134291656d7dbd607cb35f7f9489471191100..88ac10cc38b348e08c690d26d686ce9ed562904a 100644 (file)
 
 #include <AliITSVertexer3DTapan.h>
 #include <AliITSRecPoint.h>
-#include <AliITSgeom.h>
+#include <AliITSgeomTGeo.h>
 #include <AliESDVertex.h>
 
 ClassImp(AliITSVertexer3DTapan)
 
-Int_t AliITSVertexer3DTapan::LoadClusters(TTree *cTree) {
+void AliITSVertexer3DTapan::LoadClusters(TTree *cTree) {
   //--------------------------------------------------------------------
   //This function loads the SPD clusters
   //--------------------------------------------------------------------
@@ -49,24 +49,12 @@ Int_t AliITSVertexer3DTapan::LoadClusters(TTree *cTree) {
        //         local cluster X"-axis
        //
 
-       //       Double_t rot[9];   fITSgeom->GetRotMatrix(i,rot);
-       Int_t    lay,lad,det; fITSgeom->GetModuleId(i,lay,lad,det);
+       Int_t    lay,lad,det; AliITSgeomTGeo::GetModuleId(i,lay,lad,det);
 
        if (lay>2) break;  //load the SPD clusters only
 
-       /*
-       Float_t  tx,ty,tz;  fITSgeom->GetTrans(lay,lad,det,tx,ty,tz);
-
-       Double_t alpha=TMath::ATan2(rot[1],rot[0])+TMath::Pi();
-       Double_t phi=TMath::Pi()/2+alpha;
-
-       if (lay==1) phi+=TMath::Pi();
-       Double_t cp=TMath::Cos(phi), sp=TMath::Sin(phi);
-       Double_t r=tx*cp+ty*sp;
-       */
-
        Int_t ncl=clusters->GetEntriesFast();
-       Float_t hPhi;
+       Float_t hPhi=0.;
        while (ncl--) {
           AliITSRecPoint *c=(AliITSRecPoint*)clusters->UncheckedAt(ncl);
          Float_t pos[3];
@@ -92,17 +80,17 @@ Int_t AliITSVertexer3DTapan::LoadClusters(TTree *cTree) {
    }
    ficlu1 = nc1; ficlu2 = nc2;
    AliInfo(Form("Number of clusters: %d (first layer) and %d (second layer)",ficlu1,ficlu2));
-   return 0;
 }
 
-void AliITSVertexer3DTapan::FindVertexForCurrentEvent(AliESDVertex *vtx) {
+AliESDVertex *AliITSVertexer3DTapan::FindVertexForCurrentEvent(TTree *cTree) {
   //
   // This function reconstructs ....
   //
   //
-  if (vtx==0) return; 
+  LoadClusters(cTree);
 
-  Double_t pos[3], postemp[3], sigpos[3];
+  Double_t pos[3], postemp[3];
+  Double_t sigpos[3]={0.,0.,0.};
   Int_t ncontr, ncontrtemp;
   Float_t cuts[3];
   Int_t vtxstatus=0;
@@ -151,8 +139,12 @@ void AliITSVertexer3DTapan::FindVertexForCurrentEvent(AliESDVertex *vtx) {
   }
   AliInfo(Form("Final step: %d %f %f %f st=%d",ncontr,pos[0],pos[1],pos[2],vtxstatus));
 
-  new(vtx) AliESDVertex(pos,sigpos,(Double_t)vtxstatus,ncontr,"AliITSVertexer3DTapan");
-  return;
+  Double_t covma[6]={0.,0.,0.,0.,0.,0.};
+  covma[0]=sigpos[0];
+  covma[2]=sigpos[1];
+  covma[5]=sigpos[2];
+  return new AliESDVertex(pos,covma,(Double_t)vtxstatus,ncontr,"AliITSVertexer3DTapan");
+
 }