]> 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 0fccf77700b4384e27a2ecd9403571b173b25b1a..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>
 
 
 ClassImp(AliHLTITSVertexerZ)
 
-AliHLTITSVertexerZ::AliHLTITSVertexerZ():AliITSVertexerZ(){
+AliHLTITSVertexerZ::AliHLTITSVertexerZ():
+  AliITSVertexerZ(),
+  fZCombf(0),
+  fStepFine(0)
+{
   // Constructor in case that there is no runloader
-
-  SetDiffPhiMax();
-  fX0 = 0;
-  fY0 = 0;
-  SetFirstLayerModules();
-  SetSecondLayerModules();
-  fZFound = 0;
-  fZsig = 0.;
-  //fITS = 0;
-  fZCombc = 0;
-  fZCombf = 0;
-  SetLowLimit();
-  SetHighLimit();
-  SetBinWidthCoarse();
   SetBinWidthFine();
-  SetTolerance();
-  SetDebug();
 }
 
-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)
 {
   // Standard Constructor
+  SetBinWidthFine();
 }
 
-//______________________________________________________________________
-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);
+AliHLTITSVertexerZ::~AliHLTITSVertexerZ()
+{
+  // Destructor
+  if (fZCombf) delete fZCombf;
 }
 
 //______________________________________________________________________
-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;
@@ -154,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];
@@ -183,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];