]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexer.cxx
Move histogram setting ranges from analysis modules to base class (to be moved to...
[u/mrichter/AliRoot.git] / ITS / AliITSVertexer.cxx
index 4c3ca507b94f048c5800524448c9517bc959abc1..c90cf4aa06ae26543cfd437160786903627df447 100644 (file)
@@ -5,6 +5,7 @@
 #include "AliITSLoader.h"
 #include "AliITSMultReconstructor.h"
 #include "AliITSRecPointContainer.h"
+#include "AliRunLoader.h"
 
 const Float_t AliITSVertexer::fgkPipeRadius = 3.0;
 
@@ -13,7 +14,7 @@ ClassImp(AliITSVertexer)
 //////////////////////////////////////////////////////////////////////
 // Base class for primary vertex reconstruction                     //
 // AliESDVertexer is a class for full 3D primary vertex finding     //
-// derived classes: AliITSVertexerIons AliITSvertexer3D             //
+// derived classes: AliITSvertexer3D, AliITSVertexerZ.              //       
 //                  AliITSVertexerCosmics                           //
 //////////////////////////////////////////////////////////////////////
 
@@ -21,8 +22,9 @@ ClassImp(AliITSVertexer)
 
 //______________________________________________________________________
 AliITSVertexer::AliITSVertexer():AliVertexer(),
-fLadders(), 
+fLadders(NULL), 
 fLadOnLay2(0),
+fComputeMultiplicity(kFALSE),
 fDetTypeRec(NULL),
 fMinTrackletsForPilup(0),
 fIsPileup(0),
@@ -68,6 +70,7 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){
   // Invokes AliITSMultReconstructor to determine the
   // charged multiplicity in the pixel layers
   if(fMult){delete fMult; fMult = 0;}
+
   Bool_t success=kTRUE;
   Bool_t cosmics=kFALSE; 
   if(!fCurrentVertex)success=kFALSE;
@@ -95,7 +98,7 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){
     multReco.LoadClusterFiredChips(itsClusterTree);
     Short_t nfcL1 = multReco.GetNFiredChips(0);
     Short_t nfcL2 = multReco.GetNFiredChips(1);
-    fMult = new AliMultiplicity(0,0,0,0,0,0,0,0,0,0,nfcL1,nfcL2,fastOrFiredMap);
+    fMult = new AliMultiplicity(0,0,0,0,0,0,0,0,0,0,0,nfcL1,nfcL2,fastOrFiredMap);
     fMult->SetFiredChipMap(firedChipMap);
     AliITSRecPointContainer* rcont = AliITSRecPointContainer::Instance();
     fMult->SetITSClusters(0,rcont->GetNClustersInLayer(1,itsClusterTree));
@@ -133,13 +136,15 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){
   Int_t nosingleclus=multReco.GetNSingleClusters();
   Float_t *ths = new Float_t [nosingleclus];
   Float_t *phs = new Float_t [nosingleclus];
+  Int_t *labelss = new Int_t [nosingleclus];
   for(Int_t i=0;i<nosingleclus;i++){
     ths[i] = multReco.GetCluster(i)[0];
     phs[i] = multReco.GetCluster(i)[1];
+    labelss[i] = (Int_t)multReco.GetCluster(i)[2];
   }
   Short_t nfcL1 = multReco.GetNFiredChips(0);
   Short_t nfcL2 = multReco.GetNFiredChips(1);
-  fMult = new AliMultiplicity(notracks,tht,phi,dtht,dphi,labels,labelsL2,nosingleclus,ths,phs,nfcL1,nfcL2,fastOrFiredMap);
+  fMult = new AliMultiplicity(notracks,tht,phi,dtht,dphi,labels,labelsL2,nosingleclus,ths,phs,labelss,nfcL1,nfcL2,fastOrFiredMap);
   fMult->SetFiredChipMap(firedChipMap);
   AliITSRecPointContainer* rcont = AliITSRecPointContainer::Instance();
   fMult->SetITSClusters(0,rcont->GetNClustersInLayer(1,itsClusterTree));
@@ -154,6 +159,7 @@ void AliITSVertexer::FindMultiplicity(TTree *itsClusterTree){
   delete [] phs;
   delete [] labels;
   delete [] labelsL2;
+  delete [] labelss;
 
   return;
 }
@@ -162,6 +168,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;
@@ -197,7 +204,6 @@ void AliITSVertexer::SetLaddersOnLayer2(Int_t ladwid){
   }
 }
 
-#include "AliRunLoader.h"
 
 //______________________________________________________________________
 void AliITSVertexer::Init(TString filename){
@@ -205,7 +211,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);