]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/TenderSupplies/AliVtxTenderSupply.cxx
Parameters set for centrality selection
[u/mrichter/AliRoot.git] / ANALYSIS / TenderSupplies / AliVtxTenderSupply.cxx
index f50d7f5e612f606baca4abfc8be46dfc5fbd2679..a1d098a46e720a9e53925b1f6d2ba7cd4fa57b07 100644 (file)
 #include <AliCDBId.h>
 #include <AliCDBManager.h>
 #include <AliCDBEntry.h>
+#include <AliESDUtils.h>
 
 #include "AliVtxTenderSupply.h"
 
+ClassImp(AliVtxTenderSupply)
+
 AliVtxTenderSupply::AliVtxTenderSupply() :
   AliTenderSupply(),
-  fDiamond(0x0)
+  fDiamond(0x0),
+  fRefitAlgo(-1)
 {
   //
   // default ctor
@@ -43,7 +47,8 @@ AliVtxTenderSupply::AliVtxTenderSupply() :
 //_____________________________________________________
 AliVtxTenderSupply::AliVtxTenderSupply(const char *name, const AliTender *tender) :
   AliTenderSupply(name,tender),
-  fDiamond(0x0)
+  fDiamond(0x0),
+  fRefitAlgo(-1)
 {
   //
   // named ctor
@@ -60,6 +65,11 @@ void AliVtxTenderSupply::ProcessEvent()
   AliESDEvent *event=fTender->GetEvent();
   if (!event) return;
 
+  //
+  if (fRefitAlgo >=0 ) { // refit with user supplied algo and using the diamond stored in ESD
+    AliESDUtils::RefitESDVertexTracks(event, fRefitAlgo);
+    return;
+  }
   //
 
   if (fTender->RunChanged()){
@@ -80,9 +90,12 @@ void AliVtxTenderSupply::ProcessEvent()
   if ( (fDiamond->GetXRes())<2){ 
     AliVertexerTracks vertexer(event->GetMagneticField());
     vertexer.SetITSMode();
-    vertexer.SetMinClusters(4);
+    vertexer.SetMinClusters(3);
     vertexer.SetVtxStart(fDiamond);
     AliESDVertex *pvertex = vertexer.FindPrimaryVertex(event);
     event->SetPrimaryVertexTracks(pvertex);
+    // write the diamond parameters
+    event->SetDiamond(fDiamond);
+    delete pvertex;
   }  
 }