]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Modified primary vtx cut to activate pile-up cut also for AOD analysis
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Sep 2013 11:16:16 +0000 (11:16 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Sep 2013 11:16:16 +0000 (11:16 +0000)
PWGLF/RESONANCES/AliRsnCutPrimaryVertex.cxx
PWGLF/RESONANCES/AliRsnCutPrimaryVertex.h

index 7dd93e63b51a06ce6ef2b3804914f4ed3aeebd26..6c4354861587ffe1680892cce87926fb6fb1b744 100644 (file)
@@ -9,6 +9,7 @@
 //
 
 #include "AliRsnCutPrimaryVertex.h"
+#include "AliAnalysisUtils.h"
 
 ClassImp(AliRsnCutPrimaryVertex)
 
@@ -41,7 +42,6 @@ Bool_t AliRsnCutPrimaryVertex::IsSelected(TObject *object)
 //
 // Cut checker
 //
-
    // coherence check
    // which also fills data member objects
    if (!TargetOK(object)) return kFALSE;
@@ -49,13 +49,14 @@ Bool_t AliRsnCutPrimaryVertex::IsSelected(TObject *object)
    // retrieve ESD event
    AliESDEvent *esd = dynamic_cast<AliESDEvent *>(fEvent->GetRef());
    AliAODEvent *aod = dynamic_cast<AliAODEvent *>(fEvent->GetRef());
-
+   AliVEvent *vevt = dynamic_cast<AliVEvent *>(fEvent->GetRef());
+   // pile-up check
+   if (fCheckPileUp) {
+     AliAnalysisUtils * utils = new AliAnalysisUtils();
+     if (utils->IsPileUpSPD(vevt)) return kFALSE;
+   }
+   
    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();
@@ -136,3 +137,17 @@ void AliRsnCutPrimaryVertex::Print(const Option_t *) const
    AliInfo(Form("Contributors range (outside) : %d - %d", fMinI, fMaxI));
    AliInfo(Form("Z-vertex     range (inside)  : %f - %f", fMinD, fMaxD));
 }
+
+//__________________________________________________________________________________________________
+Bool_t AliRsnCutPrimaryVertex::CheckVertex(AliVVertex *vertex)
+{
+//
+// Checks if a candidate primary vertex is good,
+// which is true if it is not null and has at
+// least one contributor
+//
+
+   if (!vertex) return kFALSE;
+   if (vertex->GetNContributors() < 1) return kFALSE;
+   return kTRUE;
+}
index 88cf51a917f49fdebdfe5f3742c92a68f0830ddb..7a583d447d4232fd20476f373e36f7f8ce237348 100644 (file)
@@ -12,7 +12,6 @@
 #define ALIRSNCUTPRIMARYVERTEX_H
 
 #include "AliRsnCut.h"
-
 class AliVVertex;
 
 class AliRsnCutPrimaryVertex : public AliRsnCut {
@@ -31,22 +30,7 @@ protected:
 
    Bool_t fAcceptTPC;   // if kTRUE, the TPC primary vertexes are accepted
    Bool_t fCheckPileUp; // check and reject pileupped events (pp)
-
    ClassDef(AliRsnCutPrimaryVertex, 1)
 };
 
-//__________________________________________________________________________________________________
-inline Bool_t AliRsnCutPrimaryVertex::CheckVertex(AliVVertex *vertex)
-{
-//
-// Checks if a candidate primary vertex is good,
-// which is true if it is not null and has at
-// least one contributor
-//
-
-   if (!vertex) return kFALSE;
-   if (vertex->GetNContributors() < 1) return kFALSE;
-   return kTRUE;
-}
-
 #endif