]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/ITS/AliHLTITSVertexerZ.cxx
automatically added data sink components are now added directly to the internal insta...
[u/mrichter/AliRoot.git] / HLT / ITS / AliHLTITSVertexerZ.cxx
index 76f1e40f64f6b413955b747e72d576aee9a63188..5c476f348f4e1af2b70a59e693c84bdd114c1ae2 100644 (file)
@@ -1,3 +1,5 @@
+// $Id$
+
 /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
@@ -13,6 +15,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 #include "AliHLTITSVertexerZ.h"
+#include <TTree.h>
 #include<TString.h>
 #include<TH1.h>
 #include<TMath.h>
@@ -20,6 +23,7 @@
 #include <AliITS.h>
 #include "AliITSLoader.h"
 #include <AliITSgeom.h>
+#include <AliITSgeomTGeo.h>
 #include <AliITSRecPoint.h>
 #include <AliITSclusterV2.h>
 
@@ -40,8 +44,8 @@ AliHLTITSVertexerZ::AliHLTITSVertexerZ():
   SetBinWidthFine();
 }
 
-AliHLTITSVertexerZ::AliHLTITSVertexerZ(TString filename,Float_t x0, Float_t y0):
-  AliITSVertexerZ(filename,x0,y0),
+AliHLTITSVertexerZ::AliHLTITSVertexerZ(Float_t x0, Float_t y0):
+  AliITSVertexerZ(x0,y0),
   fZCombf(0),
   fStepFine(0)
 {
@@ -56,64 +60,15 @@ AliHLTITSVertexerZ::~AliHLTITSVertexerZ()
 }
 
 //______________________________________________________________________
-AliHLTITSVertexerZ::AliHLTITSVertexerZ(const AliHLTITSVertexerZ &vtxr) :
-  AliITSVertexerZ(vtxr),
-  fZCombf(vtxr.fZCombf),
-  fStepFine(vtxr.fStepFine)
-{
-  // Copy constructor
-
-}
-
-//______________________________________________________________________
-AliHLTITSVertexerZ& AliHLTITSVertexerZ::operator=(const AliHLTITSVertexerZ&  vtxr )
-{
-  // Assignment operator
-  this->~AliHLTITSVertexerZ();
-  new(this) AliHLTITSVertexerZ(vtxr);
-  fZCombf = vtxr.fZCombf;
-  fStepFine = vtxr.fStepFine;
-
-  return *this;
-}
-//______________________________________________________________________
-AliESDVertex* AliHLTITSVertexerZ::FindVertexForCurrentEvent(Int_t evnumber){
-  // Defines the AliESDVertex for the current event
-
-  fCurrentVertex = 0;
-  AliRunLoader *rl =AliRunLoader::GetRunLoader();
-  AliITSLoader* itsLoader =  (AliITSLoader*) rl->GetLoader("ITSLoader");
-  itsLoader->LoadRecPoints();
-  rl->GetEvent(evnumber);
-
-  /*  if(!fITS)  {
-    fITS = (AliITS*)gAlice->GetModule("ITS");
-    if(!fITS) {
-      Error("FindVertexForCurrentEvent","AliITS object was not found");
-      return fCurrentVertex;
-    }
-  }
-  */
-
-  // fITS->SetTreeAddress();
-  rl->CdGAFile();
-
-  AliITSgeom* geom=itsLoader->GetITSgeom();
-  TTree *tR = itsLoader->TreeR();
-  
-  return FindVertexForCurrentEvent(geom,tR);
-}
-
-//______________________________________________________________________
-AliESDVertex* AliHLTITSVertexerZ::FindVertexForCurrentEvent(AliITSgeom *geom,TTree *tR){
+AliESDVertex* AliHLTITSVertexerZ::FindVertexForCurrentEvent(AliITSgeom* /* geom */,TTree *tR){
   // Defines the AliESDVertex for the current event
 
   fCurrentVertex = 0;
 
-  Float_t lc[3]; for(Int_t ii=0; ii<3; ii++) lc[ii]=0.;
-  Float_t gc[3]; for(Int_t ii=0; ii<3; ii++) gc[ii]=0.;
-  Float_t lc2[3]; for(Int_t ii=0; ii<3; ii++) lc2[ii]=0.;
-  Float_t gc2[3]; for(Int_t ii=0; ii<3; ii++) gc2[ii]=0.;
+  Double_t lc[3]; for(Int_t ii=0; ii<3; ii++) lc[ii]=0.;
+  Double_t gc[3]; for(Int_t ii=0; ii<3; ii++) gc[ii]=0.;
+  //Float_t lc2[3]; for(Int_t ii=0; ii<3; ii++) lc2[ii]=0.;
+  //Float_t gc2[3]; for(Int_t ii=0; ii<3; ii++) gc2[ii]=0.;
 
   TClonesArray dummy("AliITSclusterV2",10000), *clusters=&dummy;
   TBranch *branch;
@@ -173,9 +128,10 @@ AliESDVertex* AliHLTITSVertexerZ::FindVertexForCurrentEvent(AliITSgeom *geom,TTr
       AliITSclusterV2 *recp = (AliITSclusterV2*)clusters->UncheckedAt(j);
       lc[0]=-recp->GetY()+yshift;
       lc[2]=-recp->GetZ()+zshift[module%4];
-      geom->LtoG(module,lc,gc);
-      gc[0]-=fX0;
-      gc[1]-=fY0;
+      AliITSgeomTGeo::LocalToGlobal(module,lc,gc);
+      //      geom->LtoG(module,lc,gc);
+      gc[0]-=GetNominalPos()[0];
+      gc[1]-=GetNominalPos()[1];
       Float_t xc1,yc1;
       xc1=gc[0];
       yc1=gc[1];
@@ -202,9 +158,10 @@ AliESDVertex* AliHLTITSVertexerZ::FindVertexForCurrentEvent(AliITSgeom *geom,TTr
       AliITSclusterV2 *recp = (AliITSclusterV2*)clusters->UncheckedAt(j);
       lc[0]=recp->GetY()+yshift;
       lc[2]=-recp->GetZ()+zshift[module%4];
-      geom->LtoG(module,lc,gc);
-      gc[0]-=fX0;
-      gc[1]-=fY0;
+      AliITSgeomTGeo::LocalToGlobal(module,lc,gc);
+      //      geom->LtoG(module,lc,gc);
+      gc[0]-=GetNominalPos()[0];
+      gc[1]-=GetNominalPos()[1];
       Float_t xc2,yc2;
       xc2=gc[0];
       yc2=gc[1];