]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexerCosmics.cxx
A new bunch of Global QA histogramms
[u/mrichter/AliRoot.git] / ITS / AliITSVertexerCosmics.cxx
index e393c550bb6d022028c01c030f90291f52ca3f8d..8c5c177a9b22d76b98fd67a6a58e5483d7abeee1 100644 (file)
@@ -107,22 +107,26 @@ AliESDVertex* AliITSVertexerCosmics::FindVertexForCurrentEvent(Int_t evnumber)
   }
   printf("Building tracklets on layer %d\n",ilayer);
 
-
-  Float_t xclInnLay[100],yclInnLay[100],zclInnLay[100],modclInnLay[100];
-  Float_t e2xclInnLay[100],e2yclInnLay[100],e2zclInnLay[100];
+  const Int_t arrSize = 1000;
+  Float_t xclInnLay[arrSize],yclInnLay[arrSize],zclInnLay[arrSize],modclInnLay[arrSize];
+  Float_t e2xclInnLay[arrSize],e2yclInnLay[arrSize],e2zclInnLay[arrSize];
   Int_t nclInnLayStored=0;
-  Float_t xclOutLay[100],yclOutLay[100],zclOutLay[100],modclOutLay[100];
+  Float_t xclOutLay[arrSize],yclOutLay[arrSize],zclOutLay[arrSize],modclOutLay[arrSize];
   Int_t nclOutLayStored=0;
   Int_t nRecPoints,nRecPointsInnLay=0;
 
   Float_t gc[3],gcov[5];
 
-  Float_t x[100],y[100],z[100],e2x[100],e2y[100],e2z[100];
+  Float_t x[arrSize],y[arrSize],z[arrSize],e2x[arrSize],e2y[arrSize],e2z[arrSize];
   Double_t p1[3],p2[3],p3[3];
   Int_t nvtxs;
   Bool_t good,matchtoOutLay;
   Float_t xvtx,yvtx,zvtx,rvtx;
 
+  Double_t pos[3]={0.,0.,0.};
+  Double_t err[3]={100.,100.,100.};
+  Int_t ncontributors = -1;
+
   // Collect clusters in the selected layer and the outer one
   for(Int_t imodule=fFirst[ilayer]; imodule<=fLast[ilayer+1]; imodule++) {
     rpTree->GetEvent(imodule);
@@ -153,8 +157,16 @@ AliESDVertex* AliITSVertexerCosmics::FindVertexForCurrentEvent(Int_t evnumber)
        modclOutLay[nclOutLayStored]=imodule;
        nclOutLayStored++;
       }
-      if(nclInnLayStored>100 || nclOutLayStored>100) 
-       AliFatal("More than 100 clusters per layer");
+      if(nclInnLayStored>arrSize || nclOutLayStored>arrSize) {
+       //AliFatal("More than arrSize clusters per layer");
+       AliWarning("Too many clusters per layer");
+       delete recpoints;
+       itsLoader->UnloadRecPoints();
+       fCurrentVertex = new AliESDVertex(pos,err,"cosmics");
+       fCurrentVertex->SetTitle("cosmics fake vertex (failed)");
+       fCurrentVertex->SetNContributors(ncontributors);
+       return fCurrentVertex;
+      }
     }// end clusters in a module
   }// end modules
 
@@ -207,10 +219,8 @@ AliESDVertex* AliITSVertexerCosmics::FindVertexForCurrentEvent(Int_t evnumber)
     } // InnLay - second cluster
   } // InnLay - first cluster
 
-
-  Double_t pos[3]={0.,0.,0.};
-  Double_t err[3]={100.,100.,100.};
   if(nvtxs) { 
+    ncontributors = ilayer;
     pos[0]=x[0]; 
     pos[1]=y[0]; 
     pos[2]=z[0];
@@ -218,15 +228,11 @@ AliESDVertex* AliITSVertexerCosmics::FindVertexForCurrentEvent(Int_t evnumber)
     err[1]=TMath::Sqrt(e2y[0]); 
     err[2]=TMath::Sqrt(e2z[0]);
   }
+
   fCurrentVertex = new AliESDVertex(pos,err,"cosmics");
-  if(nvtxs) {
-    fCurrentVertex->SetNContributors(ilayer);
-  } else {
-    fCurrentVertex->SetNContributors(-1);
-  }
   fCurrentVertex->SetTitle("cosmics fake vertex");
-
-  if(nvtxs>=0) fCurrentVertex->Print();
+  fCurrentVertex->SetNContributors(ncontributors);
+  //fCurrentVertex->Print();
 
   delete recpoints;
   itsLoader->UnloadRecPoints();