]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Some minor coverity corrections
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Jan 2011 16:07:08 +0000 (16:07 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Jan 2011 16:07:08 +0000 (16:07 +0000)
PWG4/CaloCalib/AliAnalysisTaskEMCALClusterize.cxx
PWG4/PartCorrBase/AliCaloTrackReader.cxx
PWG4/PartCorrDep/AliAnaCaloTrigger.cxx

index 2c35fc06b9d233f613e72680a5dbcc17bdc6a83c..493a1ef1f53c77143c683587d0285569c854291a 100644 (file)
@@ -204,12 +204,15 @@ void AliAnalysisTaskEMCALClusterize::UserExec(Option_t *)
       AliVCluster *clus = event->GetCaloCluster(i);
       if(clus->IsEMCAL()){        
         //printf("Org Cluster %d, E %f \n",i, clus->E());
-        if(dynamic_cast<AliESDCaloCluster*> (clus)){
-          fCaloClusterArr->Add( new AliESDCaloCluster(*(dynamic_cast<AliESDCaloCluster*> (clus))) );   
+        AliESDCaloCluster * esdCluster = dynamic_cast<AliESDCaloCluster*> (clus);
+        AliAODCaloCluster * aodCluster = dynamic_cast<AliAODCaloCluster*> (clus);
+        if     (esdCluster){
+          fCaloClusterArr->Add( new AliESDCaloCluster(*esdCluster) );   
         }//ESD
-        else{
-          fCaloClusterArr->Add( new AliAODCaloCluster(*(dynamic_cast<AliAODCaloCluster*> (clus))) );   
+        else if(aodCluster){
+          fCaloClusterArr->Add( new AliAODCaloCluster(*aodCluster) );   
         }//AOD
+        else printf("AliAnalysisTaskEMCALClusterize::UserExec() - Wrong CaloCluster type? \n");
         nClustersOrg++;
       }
     }
index d2fbbd61c48c895aab7a5e55a467b7533270e740..0774eaa23a90aaa9bfb45751001b033a59436cbb 100755 (executable)
@@ -761,7 +761,8 @@ void AliCaloTrackReader::FillInputEMCAL() {
     for (Int_t iclus =  0; iclus <  nclusters; iclus++) {
       AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
       //printf("E %f\n",clus->E());
-      FillInputEMCALAlgorithm(clus, iclus);
+      if (clus) FillInputEMCALAlgorithm(clus, iclus);
+      else printf("AliCaloTrackReader::FillInputEMCAL() - Null cluster in list!\n");
     }// cluster loop
   }
   
index 7953c6847d25554f1ea57bf94f1758fee706f379..596abb38a5054b835ad47a8f0cd07826c4217f79 100755 (executable)
@@ -126,13 +126,13 @@ void AliAnaCaloTrigger::UserExec(Option_t *)
   
   if ( !((Entry()-1)%100) ) 
     printf(" Processing event # %lld\n",  Entry()) ; 
-  AliESDEvent* esd = 0x0;
-  esd = (AliESDEvent*)InputEvent();
-  
-  //Get MC data, if available
-  AliStack* stack = 0x0; 
-  if(MCEvent())
-    stack = MCEvent()->Stack();
+//  AliESDEvent* esd = 0x0;
+//  esd = (AliESDEvent*)InputEvent();
+//  
+//  //Get MC data, if available
+//  AliStack* stack = 0x0; 
+//  if(MCEvent())
+//    stack = MCEvent()->Stack();
   
   // // Get trigger information of fCalorimeter 
   // TArrayF * triggerAmplitudes = 0x0 ;