]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexerZ.cxx
Changing name according to different EventSpecie, fixing value of fApplyPbPbCuts
[u/mrichter/AliRoot.git] / ITS / AliITSVertexerZ.cxx
index cd5b87357f63941ab247da096d61cbfda8a9802f..5aedc635e4dd4729d6b0245559dea60d36c78e99 100644 (file)
@@ -247,6 +247,7 @@ void AliITSVertexerZ::VertexZFinder(TTree *itsClusterTree){
   static TClonesArray points("AliITSZPoint",maxdim);
   Int_t nopoints =0;
   for(Int_t modul1= fFirstL1; modul1<=fLastL1;modul1++){   // Loop on modules of layer 1
+    if(!fUseModule[modul1]) continue;
     UShort_t ladder=int(modul1/4)+1;  // ladders are numbered starting from 1
     branch->GetEvent(modul1);
     Int_t nrecp1 = itsRec->GetEntries();
@@ -278,6 +279,7 @@ void AliITSVertexerZ::VertexZFinder(TTree *itsClusterTree){
          Int_t ladmod=fLadders[ladder-1]+ladl2;
          if(ladmod>AliITSgeomTGeo::GetNLadders(2)) ladmod=ladmod-AliITSgeomTGeo::GetNLadders(2);
          Int_t modul2=AliITSgeomTGeo::GetModuleIndex(2,ladmod,k+1);
+         if(!fUseModule[modul2]) continue;
          branch->GetEvent(modul2);
          Int_t nrecp2 = itsRec->GetEntries();
          for(Int_t j2=0;j2<nrecp2;j2++){
@@ -332,7 +334,7 @@ void AliITSVertexerZ::VertexZFinder(TTree *itsClusterTree){
   TH1F *hc = fZCombc;
 
   
-  if(hc->GetBinContent(hc->GetMaximumBin())<3)hc->Rebin(3);
+  if(hc->GetBinContent(hc->GetMaximumBin())<3)hc->Rebin(4);
   Int_t binmin,binmax;
   Int_t nPeaks=GetPeakRegion(hc,binmin,binmax);   
   if(nPeaks==2)AliWarning("2 peaks found");
@@ -367,8 +369,10 @@ void AliITSVertexerZ::VertexZFinder(TTree *itsClusterTree){
         ncontr++;
       }
     }
-    zm/=ezm;
-    ezm=TMath::Sqrt(1./ezm);
+    if(ezm>0) {
+      zm/=ezm;
+      ezm=TMath::Sqrt(1./ezm);
+    }
     niter++;
   } while(niter<10 && TMath::Abs((zm-lim1)-(lim2-zm))>fTolerance);
   fCurrentVertex = new AliESDVertex(zm,ezm,ncontr);