]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexer.cxx
-updates (ShinIchi)
[u/mrichter/AliRoot.git] / ITS / AliITSVertexer.cxx
index 6532a12a6d3d5ff35284869dc9cc8e5fc8e285b2..6ecff35c54fe813a2a63e2ebb5f23b8d8417f4f0 100644 (file)
@@ -1,10 +1,12 @@
 #include "AliLog.h"
 #include "AliMultiplicity.h"
 #include "AliITSgeomTGeo.h"
+#include "AliITSDetTypeRec.h"
 #include "AliITSVertexer.h"
 #include "AliITSLoader.h"
 #include "AliITSMultReconstructor.h"
 #include "AliITSRecPointContainer.h"
+#include "AliRunLoader.h"
 
 const Float_t AliITSVertexer::fgkPipeRadius = 3.0;
 
@@ -21,7 +23,7 @@ ClassImp(AliITSVertexer)
 
 //______________________________________________________________________
 AliITSVertexer::AliITSVertexer():AliVertexer(),
-fLadders(), 
+fLadders(NULL), 
 fLadOnLay2(0),
 fComputeMultiplicity(kFALSE),
 fDetTypeRec(NULL),
@@ -43,12 +45,8 @@ fLastEvent(-1)
 //______________________________________________________________________
 AliITSVertexer::~AliITSVertexer() {
   // Destructor
-  if(fLadders) delete [] fLadders;
-  if (fNoVertices > 0){
-    delete []fVertArray;
-    fVertArray = NULL;
-    fNoVertices = 0;
-  }
+  delete [] fLadders;
+  delete []fVertArray;
 }
 
 //______________________________________________________________________
@@ -167,6 +165,7 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){
 void AliITSVertexer::SetLaddersOnLayer2(Int_t ladwid){
   // Calculates the array of ladders on layer 2 to be used with a 
   // given ladder on layer 1
+  if(ladwid == fLadOnLay2 && fLadders)return;
   fLadOnLay2=ladwid;
   Int_t ladtot1=AliITSgeomTGeo::GetNLadders(1);
   if(fLadders) delete [] fLadders;
@@ -202,7 +201,6 @@ void AliITSVertexer::SetLaddersOnLayer2(Int_t ladwid){
   }
 }
 
-#include "AliRunLoader.h"
 
 //______________________________________________________________________
 void AliITSVertexer::Init(TString filename){
@@ -210,7 +208,8 @@ void AliITSVertexer::Init(TString filename){
   // analysis of an entire file
   AliRunLoader *rl = AliRunLoader::Instance();
   if(!rl){
-    Fatal("AliITSVertexer","Run Loader not found");
+    AliFatal("Run Loader not found");
+    return;
   }
   if (fLastEvent < 0) SetLastEvent(rl->GetNumberOfEvents()-1);