]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
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 f9ca2463550d5d67c4590b14a58112f77037d135..976f546dfe37547b0b206bf03a94416f76b740a5 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 1e1f6317e89bedbf626ce0eb83266dfca0539946..fc9731bfab72e6a0f1d105ec32da31d5ac33ef26 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);