]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnAnalysisTask.cxx
Clean way to get input from clusterizer and event
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnAnalysisTask.cxx
index e90eceec4f411ca6a8e59939292782723c75d6a5..8f8f57b142a170721963f4dcc9bc5d0b01efe9a6 100644 (file)
@@ -10,6 +10,8 @@
 
 #include <Riostream.h>
 #include <TList.h>
+#include <TH1.h>
+
 #include "AliESDEvent.h"
 #include "AliMCEvent.h"
 #include "AliAODEvent.h"
@@ -79,10 +81,13 @@ void AliRsnAnalysisTask::RsnUserCreateOutputObjects()
 // is then linked to the TList data member of this, which will contain all the output.
 //
 
+   // initialize the list
    if (!fOutList) fOutList = new TList;
    fOutList->Clear();
+   fOutList->SetOwner(kTRUE);
 
-   fRsnAnalysisManager.InitAllPairs(fOutList);
+   // initialize all pairs
+   fRsnAnalysisManager.InitAllPairs(fOutList);   
 
    PostData(2, fOutList);
 }
@@ -95,31 +100,29 @@ void AliRsnAnalysisTask::RsnUserExec(Option_t*)
 // Recovers the input event and processes it with all included pair objects,
 // using 'reconstructed' or 'MonteCarlo' functions depending on MC-only flag.
 //
+
    if (IsMixing()) return;
 
-   if (fMCOnly) {
-      fRsnAnalysisManager.ProcessAllMonitorsMC();
-      fRsnAnalysisManager.ProcessAllPairsMC();
-   }
-   else {
-      fRsnAnalysisManager.ProcessAllMonitors();
-      fRsnAnalysisManager.ProcessAllPairs();
-   }
+   fRsnAnalysisManager.ProcessAll(&fRsnEvent[0], 0x0, fMCOnly);
 
    PostData(2, fOutList);
 }
 
+//_____________________________________________________________________________
 void AliRsnAnalysisTask::RsnUserExecMix(Option_t* /*opt*/)
 {
+//
+// Execution of the analysis task with event mixing.
+// Recovers the input event and processes it with all included pair objects,
+// using 'reconstructed' or 'MonteCarlo' functions depending on MC-only flag.
+//
+
    if (!IsMixing()) return;
    AliDebug(AliLog::kDebug, Form("RSN Mixing %lld %d [%lld,%lld] %d", fMixedEH->CurrentEntry(), fMixedEH->NumberMixed(), fMixedEH->CurrentEntryMain(), fMixedEH->CurrentEntryMix(), fMixedEH->CurrentBinIndex()));
 
    // the virtual class has already sorted tracks in the PID index
    // so we need here just to call the execution of analysis
-   if (!fMCOnly)
-      fRsnAnalysisManager.ProcessAllPairs();
-   else
-      fRsnAnalysisManager.ProcessAllPairsMC();
+   fRsnAnalysisManager.ProcessAll(&fRsnEvent[0], &fRsnEvent[1], fMCOnly);
 }
 
 //_____________________________________________________________________________
@@ -132,7 +135,7 @@ void AliRsnAnalysisTask::RsnTerminate(Option_t*)
 }
 
 //______________________________________________________________________________
-Bool_t AliRsnAnalysisTask::EventProcess()
+Bool_t AliRsnAnalysisTask::RsnEventProcess()
 {
 //
 // Customized event pre-processing.
@@ -145,10 +148,10 @@ Bool_t AliRsnAnalysisTask::EventProcess()
    // initially, an event is expected to be bad
    fTaskInfo.SetEventUsed(kFALSE);
 
-   if (!AliRsnVAnalysisTask::EventProcess()) return kFALSE;
+   if (!AliRsnVAnalysisTask::RsnEventProcess()) return kFALSE;
 
    // check #1: number of tracks in event (reject empty events)
-   Int_t    ntracks = fRsnEvent[0].GetMultiplicity();
+   Int_t    ntracks = fRsnEvent[0].GetMultiplicityFromTracks();
    Double_t zeroEventPercent = 0.0;
    if (ntracks < 1) {
       // if using the checker for amount of empty events, update it