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++;
}
}
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
}
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 ;