]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexerZ.cxx
update for the NUA
[u/mrichter/AliRoot.git] / ITS / AliITSVertexerZ.cxx
index 7a048fe8c8322bc92aef01a4d7bfc7d295b79b67..798b9fb1b3ed5cc65ddd1a4df9ccc430085d26d5 100644 (file)
@@ -32,6 +32,8 @@
 // It can be used successfully with Pb-Pb collisions
 ////////////////////////////////////////////////////////////////
 
+using std::endl;
+using std::cout;
 ClassImp(AliITSVertexerZ)
 
 
@@ -51,7 +53,9 @@ fHighLim(0.),
 fStepCoarse(0),
 fTolerance(0.),
 fMaxIter(0),
-fWindowWidth(0) {
+fWindowWidth(0),
+fSearchForPileup(kTRUE)
+{
   // Default constructor
   SetDiffPhiMax();
   SetFirstLayerModules();
@@ -80,7 +84,9 @@ fHighLim(0.),
 fStepCoarse(0),
 fTolerance(0.),
 fMaxIter(0),
-fWindowWidth(0) {
+fWindowWidth(0),
+fSearchForPileup(kTRUE)
+{
   // Standard Constructor
   SetDiffPhiMax();
   SetFirstLayerModules();
@@ -187,6 +193,7 @@ AliESDVertex* AliITSVertexerZ::FindVertexForCurrentEvent(TTree *itsClusterTree){
 //______________________________________________________________________
 void AliITSVertexerZ::VertexZFinder(TTree *itsClusterTree){
   // Defines the AliESDVertex for the current event
+  delete fCurrentVertex;
   fCurrentVertex = 0;
   Double_t startPos[3]={GetNominalPos()[0],GetNominalPos()[1],GetNominalPos()[2]};
   Double_t startCov[6]={GetNominalCov()[0],GetNominalCov()[1],GetNominalCov()[2],
@@ -198,7 +205,7 @@ void AliITSVertexerZ::VertexZFinder(TTree *itsClusterTree){
   // lc2 and gc2 are local and global coordinates for layer 2
   Float_t gc2[3]={0.,0.,0.}; //; for(Int_t ii=0; ii<3; ii++) gc2[ii]=0.;
   AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
-  itsRec=rpcont->FetchClusters(0,itsClusterTree);
+  rpcont->FetchClusters(0,itsClusterTree);
   if(!rpcont->IsSPDActive()){
     AliWarning("Null pointer for RecPoints branch, vertex not calculated");
     ResetHistograms();
@@ -347,7 +354,7 @@ void AliITSVertexerZ::VertexZFinder(TTree *itsClusterTree){
     zm=0.;
     ezm=0.;
     ncontr=0;
-    for(Int_t i =0; i<points.GetEntries(); i++){
+    for(Int_t i =0; i<points.GetEntriesFast(); i++){
       AliITSZPoint* p=(AliITSZPoint*)points.UncheckedAt(i);
       if(p->GetZ()>lim1 && p->GetZ()<lim2){
         Float_t deno = p->GetErrZ();
@@ -370,7 +377,7 @@ void AliITSVertexerZ::VertexZFinder(TTree *itsClusterTree){
   fCurrentVertex->SetDispersion(fDiffPhiMax);
   fNoVertices=1;
   points.Clear();
-  if(ncontr>fMinTrackletsForPilup){ 
+  if(fSearchForPileup && ncontr>fMinTrackletsForPilup){ 
     Float_t secPeakPos;
     Int_t ncontr2=FindSecondPeak(fZCombc,binmin,binmax,secPeakPos);
     if(ncontr2>=fMinTrackletsForPilup){ 
@@ -394,7 +401,9 @@ void AliITSVertexerZ::VertexZFinder(TTree *itsClusterTree){
 }
 
 //_____________________________________________________________________
-Int_t AliITSVertexerZ::FindSecondPeak(TH1F* h, Int_t binmin,Int_t binmax, Float_t& secPeakPos){  
+Int_t AliITSVertexerZ::FindSecondPeak(TH1F* h, Int_t binmin,Int_t binmax, Float_t& secPeakPos){ 
+  // Resets bin contents between binmin and binmax and then search 
+  // for a second peak position 
   for(Int_t i=binmin-1;i<=binmax+1;i++){
     h->SetBinContent(i,0.);
   }