]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG4/CaloCalib/AliAnalysisTaskEMCALClusterize.cxx
Improve LED events rejection, based on Rongrong studies
[u/mrichter/AliRoot.git] / PWG4 / CaloCalib / AliAnalysisTaskEMCALClusterize.cxx
index f1d5c1ed0bdd9bac32146cd79b5fbb30de0e143a..898e891e7388a7cff5b8da02d9e31fbef511e0f6 100644 (file)
@@ -353,26 +353,6 @@ void AliAnalysisTaskEMCALClusterize::UserExec(Option_t *)
   //Remove the contents of output list set in the previous event 
   fOutputAODBranch->Clear("C");
   
-  // Reject event if large clusters with large energy
-  // Use only for LHC11a data for the moment, and if input is clusterizer V1 or V1+unfolding
-  // If clusterzer NxN or V2 it does not help
-  if(fRemoveLEDEvents){
-    for (Int_t i = 0; i < InputEvent()->GetNumberOfCaloClusters(); i++)
-    {
-      AliVCluster *clus = InputEvent()->GetCaloCluster(i);
-      if(clus->IsEMCAL()){    
-        
-        if ((clus->E() > 500 && clus->GetNCells() > 200 ) || clus->GetNCells() > 300) {
-          Int_t absID = clus->GetCellsAbsId()[0];
-          Int_t sm = fGeom->GetSuperModuleNumber(absID);
-          printf("AliAnalysisTaskEMCALClusterize - reject event with cluster : E %f, ncells %d, absId(0) %d, SM %d\n",clus->E(),  clus->GetNCells(),absID, sm);
-          
-          return;
-        }
-      }
-    }
-  }// Remove LED events
-  
   //Magic line to write events to AOD file
   AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(fFillAODFile);
   LoadBranches();
@@ -420,6 +400,48 @@ void AliAnalysisTaskEMCALClusterize::UserExec(Option_t *)
     return;
   }
   
+  //-------------------------------------------------------------------------------------
+  // Reject event if large clusters with large energy
+  // Use only for LHC11a data for the moment, and if input is clusterizer V1 or V1+unfolding
+  // If clusterzer NxN or V2 it does not help
+  //-------------------------------------------------------------------------------------
+  if(fRemoveLEDEvents){
+    for (Int_t i = 0; i < InputEvent()->GetNumberOfCaloClusters(); i++)
+    {
+      AliVCluster *clus = InputEvent()->GetCaloCluster(i);
+      if(clus->IsEMCAL()){    
+        
+        if ((clus->E() > 500 && clus->GetNCells() > 200 ) || clus->GetNCells() > 200) {
+          Int_t absID = clus->GetCellsAbsId()[0];
+          Int_t sm = fGeom->GetSuperModuleNumber(absID);
+          printf("AliAnalysisTaskEMCALClusterize - reject event with cluster : E %f, ncells %d, absId(0) %d, SM %d\n",clus->E(),  clus->GetNCells(),absID, sm);
+          
+          return;
+        }
+      }
+    }
+    
+    // Count number of cells with energy larger than 0.1 in SM3, cut on this number
+    Int_t ncells = 0;
+    for(Int_t icell = 0; icell < event->GetEMCALCells()->GetNumberOfCells(); icell++){
+      if(event->GetEMCALCells()->GetAmplitude(icell) > 0.1 && event->GetEMCALCells()->GetCellNumber(icell)/(24*48)==3) ncells++;
+    }
+    
+    TString triggerclasses = "";
+    if(esdevent) triggerclasses = esdevent             ->GetFiredTriggerClasses();
+    else         triggerclasses = ((AliAODEvent*)event)->GetFiredTriggerClasses();
+    
+    Int_t ncellcut = 21;
+    if(triggerclasses.Contains("EMC")) ncellcut = 35;
+    
+    if(ncells >= ncellcut ){
+      printf("AliAnalysisTaskEMCALClusterize - reject event with cluster  - reject event with ncells in SM3: ncells %d\n",ncells);
+
+      return;
+    }
+    
+  }// Remove LED events
+  
   //-------------------------------------------------------------------------------------
   //Set the geometry matrix, for the first event, skip the rest
   //-------------------------------------------------------------------------------------