]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
move EMCAL event rejection after event setting is done
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 May 2013 20:51:31 +0000 (20:51 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 May 2013 20:51:31 +0000 (20:51 +0000)
PWGGA/EMCALTasks/AliAnalysisTaskEMCALClusterize.cxx

index cb5be0ac8994651bc1cc77fe904333ee9762ed39..a737059efe2c5944f091aa61ccff2335e6feba94 100644 (file)
@@ -182,13 +182,13 @@ Bool_t AliAnalysisTaskEMCALClusterize::AcceptEventEMCAL()
   
   if(fEMCALEnergyCut <= 0) return kTRUE; // accept
   
-  Int_t           nCluster = InputEvent() -> GetNumberOfCaloClusters();
-  AliVCaloCells * caloCell = InputEvent() -> GetEMCALCells();
-  Int_t           bc       = InputEvent() -> GetBunchCrossNumber();
-
+  Int_t           nCluster = fEvent -> GetNumberOfCaloClusters();
+  AliVCaloCells * caloCell = fEvent -> GetEMCALCells();
+  Int_t           bc       = fEvent -> GetBunchCrossNumber();
+  
   for(Int_t icalo = 0; icalo < nCluster; icalo++)
   {
-    AliVCluster *clus = (AliVCluster*) (InputEvent()->GetCaloCluster(icalo));
+    AliVCluster *clus = (AliVCluster*) (fEvent->GetCaloCluster(icalo));
     
     if( ( clus->IsEMCAL() ) && ( clus->GetNCells() > fEMCALNcellsCut ) && ( clus->E() > fEMCALEnergyCut ) &&
        fRecoUtils->IsGoodCluster(clus,fGeom,caloCell,bc))
@@ -196,7 +196,7 @@ Bool_t AliAnalysisTaskEMCALClusterize::AcceptEventEMCAL()
       
       if (fDebug > 0)
         printf("AliAnalysisTaskEMCALClusterize::AcceptEventEMCAL() - Accept :  E %2.2f > %2.2f, nCells %d > %d \n",
-                             clus->E(), fEMCALEnergyCut, clus->GetNCells(), fEMCALNcellsCut);
+               clus->E(), fEMCALEnergyCut, clus->GetNCells(), fEMCALNcellsCut);
       
       return kTRUE;
     }
@@ -208,7 +208,7 @@ Bool_t AliAnalysisTaskEMCALClusterize::AcceptEventEMCAL()
   
   return kFALSE;
   
-}  
+}
 
 //_______________________________________________
 void AliAnalysisTaskEMCALClusterize::AccessOADB()
@@ -483,10 +483,7 @@ void AliAnalysisTaskEMCALClusterize::CheckAndGetEvent()
   // Also check if the quality of the event is good if not reject it
   
   fEvent = 0x0;
-  
-  //Process events if there is a high energy cluster
-  if(!AcceptEventEMCAL())  return ; 
-    
+      
   AliAODInputHandler* aodIH = dynamic_cast<AliAODInputHandler*>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
   Int_t eventN = Entry();
   if(aodIH) eventN = aodIH->GetReadEntry(); 
@@ -543,6 +540,9 @@ void AliAnalysisTaskEMCALClusterize::CheckAndGetEvent()
     return ;
   }
   
+  //Process events if there is a high energy cluster
+  if(!AcceptEventEMCAL())  { fEvent = 0x0 ; return ; }
+  
   //-------------------------------------------------------------------------------------
   // Reject events if LED was firing, use only for LHC11a data 
   // Reject event if triggered by exotic cell and remove exotic cells if not triggered