It is a fix because the task was crashing on MC (no OADB).
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 May 2012 18:19:44 +0000 (18:19 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 May 2012 18:19:44 +0000 (18:19 +0000)
Robert Grajcarek <grajcarek@physi.uni-heidelberg.de>

ANALYSIS/AliEPSelectionTask.cxx
ANALYSIS/AliEPSelectionTask.h

index f9ca246..976f546 100644 (file)
@@ -635,7 +635,7 @@ Double_t AliEPSelectionTask::GetPhiWeight(TObject* track1)
 //__________________________________________________________________________
 void AliEPSelectionTask::SetPhiDist() 
 {
-  if(!fUserphidist) { // if it's already set and custom class is required, we use the one provided by the user
+  if(!fUserphidist && (fPeriod.CompareTo("LHC10h") == 0 || fPeriod.CompareTo("LHC11h") == 0)) { // if it's already set and custom class is required, we use the one provided by the user
 
     if (fPeriod.CompareTo("LHC10h")==0)
        {
@@ -678,9 +678,7 @@ void AliEPSelectionTask::SetPhiDist()
     if (!fPhiDist[0]) AliFatal(Form("Cannot find OADB phi distribution for run %d", fRunNumber));
 
   } 
-  else {
-    AliInfo("Using Custom Phi Distribution");
-  }
+  
     
   if (fPeriod.CompareTo("LHC10h")==0 || fUserphidist){
      Bool_t emptybins;
@@ -706,6 +704,10 @@ void AliEPSelectionTask::SetPhiDist()
        AliError("After Maximum of rebinning still empty Phi-bins!!!");
      }
   }
+  if (fPeriod.CompareTo("LHC10h") != 0 && fPeriod.CompareTo("LHC11h") != 0 && !fUserphidist){
+  AliInfo("No Phi-weights available. All Phi weights set to 1");
+  SetUsePhiWeight(kFALSE);
+  }
 }
 
 //__________________________________________________________________________
index 1e1f631..fc9731b 100644 (file)
@@ -49,7 +49,7 @@ class AliEPSelectionTask : public AliAnalysisTaskSE {
   virtual void  SetDebugLevel(Int_t level)   {fDebug = level;}
   void SetInput(const char* input)           {fAnalysisInput = input;}
   void SetUseMCRP()                         {fUseMCRP = kTRUE;}
-  void SetUsePhiWeight()                    {fUsePhiWeight = kTRUE;}
+  void SetUsePhiWeight(Bool_t usephi = kTRUE){fUsePhiWeight = usephi;}
   void SetUsePtWeight()                             {fUsePtWeight = kTRUE;}
   void SetSaveTrackContribution()           {fSaveTrackContribution = kTRUE;}
   void SetTrackType(TString tracktype);