Allowing to reject events with 0 tracks
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 17 Jun 2013 09:18:03 +0000 (09:18 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 17 Jun 2013 09:18:03 +0000 (09:18 +0000)
PWGCF/Correlations/DPhi/AliAnalysisTaskPhiCorrelations.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskPhiCorrelations.h

index 5cb2e05..6365bd2 100644 (file)
@@ -142,6 +142,7 @@ fRejectResonanceDaughters(-1),
 fFillOnlyStep0(kFALSE),
 fSkipStep6(kFALSE),
 fRejectCentralityOutliers(kFALSE),
+fRejectZeroTrackEvents(kFALSE),
 fRemoveWeakDecays(kFALSE),
 fRemoveDuplicates(kFALSE),
 fSkipFastCluster(kFALSE),
@@ -409,6 +410,7 @@ void  AliAnalysisTaskPhiCorrelations::AddSettingsTree()
   settingsTree->Branch("fSkipTrigger", &fSkipTrigger,"SkipTrigger/O");
   settingsTree->Branch("fInjectedSignals", &fInjectedSignals,"SkipTrigger/O");
   settingsTree->Branch("fRejectCentralityOutliers", &fRejectCentralityOutliers,"RejectCentralityOutliers/O");
+  settingsTree->Branch("fRejectZeroTrackEvents", &fRejectZeroTrackEvents,"RejectZeroTrackEvents/O");
   settingsTree->Branch("fRemoveWeakDecays", &fRemoveWeakDecays,"RemoveWeakDecays/O");
   settingsTree->Branch("fRemoveDuplicates", &fRemoveDuplicates,"RemoveDuplicates/O");
   settingsTree->Branch("fSkipFastCluster", &fSkipFastCluster,"SkipFastCluster/O");
@@ -1021,6 +1023,14 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseDataMode()
     return;
   }
   
+  if (fRejectZeroTrackEvents && tracks->GetEntriesFast() == 0)
+  {
+    AliInfo(Form("Rejecting event because it has no tracks: %f %d", centrality, tracks->GetEntriesFast()));
+    fHistos->FillEvent(centrality, AliUEHist::kCFStepAnaTopology);
+    delete tracks;
+    return;
+  }
+  
   // correlate particles with...
   TObjArray* tracksCorrelate = 0;
   if (fParticleSpeciesAssociated != fParticleSpeciesTrigger)
index 9897f02..aace72f 100644 (file)
@@ -107,6 +107,7 @@ class  AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
     void   SetFillpT(Bool_t flag) { fFillpT = flag; }
     void   SetStepsFillSkip(Bool_t step0, Bool_t step6) { fFillOnlyStep0 = step0; fSkipStep6 = step6; }
     void   SetRejectCentralityOutliers(Bool_t flag = kTRUE) { fRejectCentralityOutliers = flag; }
+    void   SetRejectZeroTrackEvents(Bool_t flag)    { fRejectZeroTrackEvents = flag; }
     void   SetRemoveWeakDecays(Bool_t flag = kTRUE) { fRemoveWeakDecays = flag; }
     void   SetRemoveDuplicates(Bool_t flag = kTRUE) { fRemoveDuplicates = flag; }
     void   SetSkipFastCluster(Bool_t flag = kTRUE)  { fSkipFastCluster = flag; }
@@ -199,6 +200,7 @@ class  AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
     Bool_t fFillOnlyStep0;        // fill only step 0
     Bool_t fSkipStep6;            // skip step 6 when filling
     Bool_t fRejectCentralityOutliers;  // enable rejection of outliers in centrality vs no track correlation
+    Bool_t fRejectZeroTrackEvents;  // reject events which have no tracks (using the eta, pT cuts defined)
     Bool_t fRemoveWeakDecays;     // remove secondaries from weak decays from tracks and particles
     Bool_t fRemoveDuplicates;      // remove particles with the same label (double reconstruction)
     Bool_t fSkipFastCluster;      // skip kFastOnly flagged events (only for data)
@@ -208,7 +210,7 @@ class  AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
     
     Bool_t fFillpT;                // fill sum pT instead of number density
     
-    ClassDef( AliAnalysisTaskPhiCorrelations, 34); // Analysis task for delta phi correlations
+    ClassDef( AliAnalysisTaskPhiCorrelations, 35); // Analysis task for delta phi correlations
   };
 
 class AliDPhiBasicParticle : public AliVParticle