]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/PHOSTasks/PHOS_embedding/AliAnalysisTaskPi0DiffEfficiency.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_embedding / AliAnalysisTaskPi0DiffEfficiency.cxx
index 687189cacd81d30e7cb01c3337939372420ba825..2d427903b34f52ffb58113621368b499b93c9e80 100644 (file)
@@ -714,7 +714,8 @@ void AliAnalysisTaskPi0DiffEfficiency::UserExec(Option_t *)
   }
   
   FillHistogram("hSelEvents",1.5) ;
-  AliAODHeader *header = event->GetHeader() ;
+  AliAODHeader *header = dynamic_cast<AliAODHeader*>(event->GetHeader()) ;
+  if(!header) AliFatal("Not a standard AOD");
   
   // Checks if we have a primary vertex
   // Get primary vertices form ESD
@@ -1884,6 +1885,7 @@ Double_t AliAnalysisTaskPi0DiffEfficiency::TestCPV(Double_t dx, Double_t dz, Dou
               6.58365e-01*5.91917e-01*5.91917e-01/((pt-9.61306e-01)*(pt-9.61306e-01)+5.91917e-01*5.91917e-01)+1.59219);
   Double_t sz=TMath::Min(2.75,4.90341e+02*1.91456e-02*1.91456e-02/(pt*pt+1.91456e-02*1.91456e-02)+1.60) ;
   AliAODEvent *event = dynamic_cast<AliAODEvent*>(InputEvent());
+  if(!event)AliFatal("Can not get ESD event") ;
   Double_t mf = event->GetMagneticField(); //Positive for ++ and negative for --
 
   if(mf<0.){ //field --