last fit iteration removed, because it used non-accurate selection of tracks.
authorsgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 6 Nov 2010 01:26:45 +0000 (01:26 +0000)
committersgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 6 Nov 2010 01:26:45 +0000 (01:26 +0000)
HLT/global/AliHLTGlobalVertexerComponent.cxx

index f11196c1b11c0d1efe68f4b0345e1c9d25c9fc62..b3a58ac7a710ad69e7b9ef853766328267a8359b 100644 (file)
@@ -481,21 +481,8 @@ void AliHLTGlobalVertexerComponent::FindPrimaryVertex()
     nSelected++;  
   }    
 
-  Int_t nPreSelected = nSelected;
-
-  for( Int_t i = 0; i<nSelected; i++){ 
-    vSelected[i] = &(fTrackInfos[dev[i].fI].fParticle);      
-  }
-
   // fit
 
-  if( nSelected>2 ){ 
-    fPrimaryVtx.Initialize();
-    fPrimaryVtx.SetBeamConstraint( 0, 0, 0, 3., 3., 5.3 );    
-    fPrimaryVtx.SetVtxGuess( 0, 0, 0 );
-    fPrimaryVtx.Construct( vSelected, nSelected, 0, -1, 1 );    
-  }
-
   while( nSelected>2 ){ 
 
     //* Primary vertex finder with rejection of outliers
@@ -503,18 +490,16 @@ void AliHLTGlobalVertexerComponent::FindPrimaryVertex()
     for( Int_t i = 0; i<nSelected; i++){ 
       vSelected[i] = &(fTrackInfos[dev[i].fI].fParticle);      
     }
-    /*
+
+    double xv = fPrimaryVtx.GetX();
+    double yv = fPrimaryVtx.GetY();
+    double zv = fPrimaryVtx.GetZ();          
     fPrimaryVtx.Initialize();
     fPrimaryVtx.SetBeamConstraint( 0, 0, 0, 3., 3., 5.3 );
-    {
-      double xv = fPrimaryVtx.GetX();
-      double yv = fPrimaryVtx.GetY();
-      double zv = fPrimaryVtx.GetZ();      
-      fPrimaryVtx.SetVtxGuess( xv, yv, zv );
-    }
+    fPrimaryVtx.SetVtxGuess( xv, yv, zv );    
 
     fPrimaryVtx.Construct( vSelected, nSelected, 0, -1, 1 );
-    */    
+    
     for( Int_t it=0; it<nSelected; it++ ){ 
       const AliKFParticle &p = fTrackInfos[dev[it].fI].fParticle;
       if( nSelected <= 20 ){
@@ -534,36 +519,9 @@ void AliHLTGlobalVertexerComponent::FindPrimaryVertex()
       firstRemove++;
     }
     if( firstRemove>=nSelected ) break;
-
-    for( int i=firstRemove; i<nSelected; i++ ){
-      fPrimaryVtx -= fTrackInfos[dev[i].fI].fParticle;
-    }
     nSelected = firstRemove;
   }
 
-  if( nSelected>=3 ){// final refit     
-    double xv = fPrimaryVtx.GetX();
-    double yv = fPrimaryVtx.GetY();
-    double zv = fPrimaryVtx.GetZ();
-      
-    nSelected = 0;
-    for( Int_t it=0; it<nPreSelected; it++ ){ 
-      const AliKFParticle &p = fTrackInfos[dev[it].fI].fParticle;
-      dev[nSelected].fI = dev[it].fI;
-      dev[nSelected].fD = p.GetDeviationFromVertex( fPrimaryVtx );
-      vSelected[nSelected] = &p;
-      if( dev[nSelected].fD < fConstrainedTrackDeviation ) nSelected++;
-    }
-
-    fPrimaryVtx.Initialize();
-    fPrimaryVtx.SetVtxGuess( xv, yv, zv );
-    fPrimaryVtx.SetBeamConstraint( 0, 0, 0, 3., 3., 5.3 );
-
-    if( nSelected >= 3 ){
-      fPrimaryVtx.Construct( vSelected, nSelected, 0, -1, 1 );
-    }
-  }
-
   for( Int_t i = 0; i<fNTracks; i++){ 
     fTrackInfos[i].fPrimUsedFlag = 0;
   }
@@ -575,11 +533,14 @@ void AliHLTGlobalVertexerComponent::FindPrimaryVertex()
   }
   
   for( Int_t i = 0; i<nSelected; i++){ 
-    fTrackInfos[dev[i].fI].fPrimUsedFlag = 1;
+    AliESDTrackInfo &info = fTrackInfos[dev[i].fI];
+    info.fPrimUsedFlag = 1;
+    info.fPrimDeviation = dev[i].fD;
   }
 
   for( Int_t i = 0; i<fNTracks; i++ ){
     AliESDTrackInfo &info = fTrackInfos[i];
+    if( info.fPrimUsedFlag ) continue;
     info.fPrimDeviation = info.fParticle.GetDeviationFromVertex( fPrimaryVtx );   
   }