]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Correct error messages and better Hijing header readout
authordkeijden <dkeijden@cern.ch>
Tue, 6 May 2014 13:54:12 +0000 (15:54 +0200)
committermverweij <marta.verweij@cern.ch>
Tue, 6 May 2014 14:54:47 +0000 (16:54 +0200)
PWGJE/AliPWG4HighPtSpectra.cxx
PWGJE/macros/AddTaskPWG4HighPtSpectra.C

index 2acc1224ccd3c40f78b70cee449cc96e69c6207d..8e29f6b4f43dcf6d87a8e36204af58c00504af90 100644 (file)
@@ -902,7 +902,12 @@ AliGenHijingEventHeader*  AliPWG4HighPtSpectra::GetHijingEventHeaderAOD(AliAODEv
   AliGenHijingEventHeader* hijingGenHeader = 0x0;
   if(aodEvent) {
     AliAODMCHeader* mcHeader = (AliAODMCHeader*) aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
-    hijingGenHeader = (AliGenHijingEventHeader*) mcHeader->GetCocktailHeaders()->FindObject("Hijing");
+    TList* headerList = mcHeader->GetCocktailHeaders();
+    for (Int_t i=0; i<headerList->GetEntries(); i++) {
+      hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(headerList->At(i));
+      if (hijingGenHeader)
+        break;
+    }
   }
   return hijingGenHeader;
 }
index febbf032fe88db5cfe0e6cdb65c8700a593f3e18..14551b6722e249412969239ef0ea8af4c0a3cbb4 100644 (file)
@@ -73,8 +73,10 @@ void AddTaskPWG4HighPtSpectraQA_AOD(char *prodType = "LHC11h",Bool_t isPbPb=kTRU
     filterMask2 = 256;
     bIncludeNoITS = kTRUE;
   }
-  else
-    AliFatal("Period string not of predefined type. Add it to the list in this macro.");
+  else {
+    ::Error("AddTaskPWG4HighPtSpectra","Period string not of predefined type. Add it to the list in this macro.");
+    return NULL;
+  }
 
   AliPWG4HighPtSpectra   *taskSpectraSUM   = ConfigureTaskPWG4HighPtSpectra(prodType,isPbPb,10,0,0,triggerMask,bSelectHijingParticles,kTRUE,usePythiaxsec,filterMask ); //Sum: the hybrid tracks.
   AliPWG4HighPtSpectra   *taskSpectraRESTR = ConfigureTaskPWG4HighPtSpectra(prodType,isPbPb,10,0,5,triggerMask,bSelectHijingParticles,kTRUE,usePythiaxsec,filterMask1); //With SPD and ITS refit.
@@ -192,8 +194,10 @@ AliPWG4HighPtSpectra* ConfigureTaskPWG4HighPtSpectra(char *prodType = "LHC10e14"
   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
   const char *analysisType = "ESD";//"TPC"
 
-  if( (type=="AOD" && iAODanalysis==0) || (type=="ESD" && iAODanalysis==1) ) //check if iAODanalysis is configured correctly. TODO: this can be simplified by removing the iAODanalysis variable.
-    AliFatal(Form("Ordering to perform the analysis on wrong datatype. This is an %s!", type))
+  if( (type=="AOD" && iAODanalysis==0) || (type=="ESD" && iAODanalysis==1) ) { //check if iAODanalysis is configured correctly. TODO: this can be simplified by removing the iAODanalysis variable.
+    ::Error("AddTaskPWG4HighPtSpectra", Form("Ordering to perform the analysis on wrong datatype. This is an %s!", type));
+    return NULL;
+  }
 
   // C. Create the task, add it to manager.
   //===========================================================================