]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
eliminating possible logic bug in the cluster array name identification
authormcosenti <mcosenti@cern.ch>
Mon, 8 Dec 2014 18:08:22 +0000 (16:08 -0200)
committermcosenti <mcosenti@cern.ch>
Mon, 8 Dec 2014 18:09:29 +0000 (16:09 -0200)
PWGGA/EMCALTasks/AliAnalysisTaskEMCALIsoPhoton.cxx

index 41dd52e5a28eed32a76a8169ba117d13eef86a3a..9f8b38a47c612d06baa201e9fbc71b60138977dc 100644 (file)
@@ -654,11 +654,23 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
   TString clusArrayName = "";
   if(fESD){
     l = fESD->GetList();
+    if(fDebug)
+      l->Print();
     for(int nk=0;nk<l->GetEntries();nk++){
       TObject *obj = (TObject*)l->At(nk);
       TString oname = obj->GetName();
       if(oname.Contains("CaloClus"))
        clusArrayName = oname;
+      else
+       continue;
+      if(clusArrayName=="CaloClusters")
+       fClusArrayNames->Fill(0);
+      else{
+       if(clusArrayName=="EmcCaloClusters")
+         fClusArrayNames->Fill(1);
+       else
+         fClusArrayNames->Fill(2);
+      }
     }
     fESDClusters =  dynamic_cast<TClonesArray*>(l->FindObject(clusArrayName));
     fESDCells = fESD->GetEMCALCells();
@@ -667,32 +679,35 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
   }
   else if(fAOD){
     l = fAOD->GetList();
-    //l->Print();
+    if(fDebug)
+      l->Print();
     //fAODClusters = dynamic_cast<TClonesArray*>(fAOD->GetCaloClusters());
     for(int nk=0;nk<l->GetEntries();nk++){
       TObject *obj = (TObject*)l->At(nk);
       TString oname = obj->GetName();
       if(oname.Contains("aloClus"))
        clusArrayName = oname;
+      else
+       continue;
+      if(clusArrayName=="caloClusters")
+       fClusArrayNames->Fill(0);
+      else{
+       if(clusArrayName=="EmcCaloClusters")
+         fClusArrayNames->Fill(1);
+       else
+         fClusArrayNames->Fill(2);
+      }
     }
     fAODClusters = dynamic_cast<TClonesArray*>(l->FindObject(clusArrayName));
     fAODCells = fAOD->GetEMCALCells();
     if(fDebug)
       printf("AOD cluster mult= %d\n",fAODClusters->GetEntriesFast());
   }
-  if(clusArrayName=="CaloClusters")
-    fClusArrayNames->Fill(0);
-  else{
-    if(clusArrayName=="EmcCaloClusters")
-      fClusArrayNames->Fill(1);
-    else
-      fClusArrayNames->Fill(2);
-  }
   if(fDebug){
-       printf("clus array is named %s +++++++++\n",clusArrayName.Data());
+    printf("clus array is named %s +++++++++\n",clusArrayName.Data());
   }
-    
-
+  
+  
   fMCEvent = MCEvent();
   if(fMCEvent){
     if(fDebug)