]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnCutPrimaryVertex.cxx
Added check of pileup in event cuts
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutPrimaryVertex.cxx
index c5ef546def5e4de260a216578411a0f908c57db1..3837637faffe03d3dcd13bed792b73046cee0022 100644 (file)
@@ -16,7 +16,8 @@ ClassImp(AliRsnCutPrimaryVertex)
 AliRsnCutPrimaryVertex::AliRsnCutPrimaryVertex
 (const char *name, Double_t maxVz, Int_t nContributors, Bool_t acceptTPC) :
   AliRsnCut(name, AliRsnCut::kEvent, 0, nContributors - 1, 0.0, maxVz),
-  fAcceptTPC(acceptTPC)
+  fAcceptTPC(acceptTPC),
+  fCheckPileUp(kFALSE)
 {
 //
 // Main constructor.
@@ -55,6 +56,12 @@ Bool_t AliRsnCutPrimaryVertex::IsSelected(TObject *object)
   
   if (esd)
   {
+    // pile-up check
+    if (fCheckPileUp)
+    {
+      if (esd->IsPileupFromSPD()) return kFALSE;
+    }
+    
     // get the best primary vertex:
     // first try the one with tracks
     const AliESDVertex *vTrk  = esd->GetPrimaryVertexTracks();
@@ -95,6 +102,8 @@ Bool_t AliRsnCutPrimaryVertex::IsSelected(TObject *object)
   }
   else if (aod)
   {
+    // pile-up check is not yet available for AODs
+    
     // lines suggested by Andrea to reject TPC-only events
     if(!fAcceptTPC)
     {