protection against non embedding analysis
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 26 Apr 2011 14:08:01 +0000 (14:08 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 26 Apr 2011 14:08:01 +0000 (14:08 +0000)
PWG4/CaloCalib/AliAnalysisTaskEMCALClusterize.cxx

index 59c50f1..e46875b 100644 (file)
@@ -494,13 +494,15 @@ void AliAnalysisTaskEMCALClusterize::UserExec(Option_t *)
 //    }
     
     Int_t nClusters = event->GetNumberOfCaloClusters();
-    if(aodIH) 
+    if(aodIH && aodIH->GetEventToMerge())  //Embedding
       nClusters = aodIH->GetEventToMerge()->GetNumberOfCaloClusters(); //Get clusters directly from embedded signal
     for (Int_t i = 0; i < nClusters; i++)
     {
       AliVCluster *clus = 0;
-      if(aodIH) clus = aodIH->GetEventToMerge()->GetCaloCluster(i); //Get clusters directly from embedded signal
-      else      clus = event->GetCaloCluster(i);
+      if(aodIH && aodIH->GetEventToMerge()) //Embedding
+        clus = aodIH->GetEventToMerge()->GetCaloCluster(i); //Get clusters directly from embedded signal
+      else      
+        clus = event->GetCaloCluster(i);
 
       if(!clus) {
         printf("AliEMCALReclusterize::UserExec() - No Clusters\n");