BugFix from Martin
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 2 Feb 2011 12:20:38 +0000 (12:20 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 2 Feb 2011 12:20:38 +0000 (12:20 +0000)
PWG2/RESONANCES/AliRsnAnalysisTask.cxx
PWG2/RESONANCES/AliRsnVAnalysisTask.cxx
PWG2/RESONANCES/AliRsnVAnalysisTask.h

index d694c2f..f3cb77a 100644 (file)
@@ -140,6 +140,8 @@ Bool_t AliRsnAnalysisTask::EventProcess()
 
   // initially, an event is expected to be bad
   fTaskInfo.SetEventUsed(kFALSE);
+       
+       if (!AliRsnVAnalysisTask::EventProcess()) return kFALSE;
   
   // check #1: number of tracks in event (reject empty events)
   Int_t    ntracks = fRsnEvent[0].GetMultiplicity();
@@ -181,5 +183,5 @@ Bool_t AliRsnAnalysisTask::EventProcess()
   // final return value is positive
   // but call the mother class method which updates info object
   fTaskInfo.SetEventUsed(kTRUE);
-  return AliRsnVAnalysisTask::EventProcess();
+  return kTRUE;
 }
index 93a391c..1f897f5 100644 (file)
@@ -36,7 +36,8 @@ AliRsnVAnalysisTask::AliRsnVAnalysisTask
   fMCOnly(mcOnly),
   fInfoList(0x0),
   fTaskInfo(name),
-  fMixedEH(0)
+  fMixedEH(0),
+  fUseMixingRange(kTRUE)
 {
 //
 // Default constructor.
@@ -62,7 +63,8 @@ AliRsnVAnalysisTask::AliRsnVAnalysisTask(const AliRsnVAnalysisTask& copy) :
   fMCOnly(copy.fMCOnly),
   fInfoList(0x0),
   fTaskInfo(copy.fTaskInfo),
-  fMixedEH(copy.fMixedEH)
+  fMixedEH(copy.fMixedEH),
+  fUseMixingRange(copy.fUseMixingRange)
 {
 //
 // Copy constructor.
@@ -172,6 +174,8 @@ void AliRsnVAnalysisTask::UserExec(Option_t* opt)
 // objects obtained from dynamic-casts called in ConnectInputData().
 //
   if (!IsMixing()) {
+               
+               
                if (fMCOnly && fMCEvent)
                {
                        fRsnEvent[0].SetRef  (fMCEvent[0]);
@@ -380,6 +384,20 @@ Bool_t AliRsnVAnalysisTask::EventProcess()
 // need to be done only once for each event.
 //
   
+  // if not using mixing cuts return kTRUE
+  if (!IsUsingMixingRange()) return kTRUE;
+  
+  // cut if event was in range of mixing cuts
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+       AliMultiInputEventHandler *inEvHMain = dynamic_cast<AliMultiInputEventHandler *>(mgr->GetInputEventHandler());
+       if(inEvHMain) {
+               fMixedEH = dynamic_cast<AliMixInputEventHandler *>(inEvHMain->GetFirstMultiInputHandler());
+               if(fMixedEH) {
+                       if (fMixedEH->CurrentBinIndex()<0) return kFALSE;
+               }
+               
+       }
+  
   // in this case, return always a success
   return kTRUE;
 }
index 78a4e40..64cff7d 100644 (file)
@@ -61,6 +61,9 @@ class AliRsnVAnalysisTask : public AliAnalysisTaskSE
     
     void SetMixing(Bool_t doMix = kTRUE) {fIsMixing = doMix;}
     Bool_t IsMixing() { return fIsMixing;}
+    
+    void UseMixingRange(Bool_t useMixRange = kTRUE) {fUseMixingRange = useMixRange;}
+    Bool_t IsUsingMixingRange() { return fUseMixingRange;}
 
   protected:
 
@@ -80,6 +83,7 @@ class AliRsnVAnalysisTask : public AliAnalysisTaskSE
     AliRsnVATProcessInfo    fTaskInfo;         //  task info
     
     AliMixInputEventHandler *fMixedEH;         //! mixed event hadnler
+    Bool_t                                                                     fUseMixingRange;   //
 
     void                    SetupMixingEvents();
     void                    SetDebugForAllClasses();