]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add event selection depending on high energy clusters existance in EMCal to speed...
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Nov 2012 16:58:17 +0000 (16:58 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Nov 2012 16:58:17 +0000 (16:58 +0000)
PWGGA/EMCALTasks/AliAnalysisTaskEMCALClusterize.cxx
PWGGA/EMCALTasks/AliAnalysisTaskEMCALClusterize.h
PWGGA/EMCALTasks/macros/AddTaskEMCALClusterize.C

index 31aca71e723bf16ca037838de660ccd5fdb2f7d0..784a8531cb09f835245fc6dfd1a7de438411dcf6 100644 (file)
@@ -84,7 +84,8 @@ AliAnalysisTaskEMCALClusterize::AliAnalysisTaskEMCALClusterize(const char *name)
 , fRemoveLEDEvents(kTRUE),fRemoveExoticEvents(kFALSE)
 , fImportGeometryFromFile(kFALSE), fImportGeometryFilePath("") 
 , fOADBSet(kFALSE),       fAccessOADB(kTRUE),         fOADBFilePath("")
-, fCentralityClass("")
+, fCentralityClass(""),   fSelectEMCALEvent(0)
+, fEMCALEnergyCut(0.),    fEMCALNcellsCut (0)
 {
   // Constructor
   
@@ -172,6 +173,43 @@ AliAnalysisTaskEMCALClusterize::~AliAnalysisTaskEMCALClusterize()
   
 }
 
+//_______________________________________________________
+Bool_t AliAnalysisTaskEMCALClusterize::AcceptEventEMCAL()
+{
+  // Accept event given there is a EMCAL cluster with enough energy, and not noisy, exotic
+  
+  if(!fSelectEMCALEvent)   return kTRUE; // accept
+  
+  if(fEMCALEnergyCut <= 0) return kTRUE; // accept
+  
+  Int_t           nCluster = InputEvent() -> GetNumberOfCaloClusters();
+  AliVCaloCells * caloCell = InputEvent() -> GetEMCALCells();
+  Int_t           bc       = InputEvent() -> GetBunchCrossNumber();
+
+  for(Int_t icalo = 0; icalo < nCluster; icalo++)
+  {
+    AliVCluster *clus = (AliVCluster*) (InputEvent()->GetCaloCluster(icalo));
+    
+    if( ( clus->IsEMCAL() ) && ( clus->GetNCells() > fEMCALNcellsCut ) && ( clus->E() > fEMCALEnergyCut ) &&
+       fRecoUtils->IsGoodCluster(clus,fGeom,caloCell,bc))
+    {
+      
+      if (fDebug > 0)
+        printf("AliAnalysisTaskEMCALClusterize::AcceptEventEMCAL() - Accept :  E %2.2f > %2.2f, nCells %d > %d \n",
+                             clus->E(), fEMCALEnergyCut, clus->GetNCells(), fEMCALNcellsCut);
+      
+      return kTRUE;
+    }
+    
+  }// loop
+  
+  if (fDebug > 0)
+    printf("AliAnalysisTaskEMCALClusterize::AcceptEventEMCAL() - Reject \n");
+  
+  return kFALSE;
+  
+}  
+
 //_______________________________________________
 void AliAnalysisTaskEMCALClusterize::AccessOADB()
 {
@@ -424,6 +462,9 @@ void AliAnalysisTaskEMCALClusterize::CheckAndGetEvent()
   
   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(); 
@@ -1504,6 +1545,8 @@ void AliAnalysisTaskEMCALClusterize::UserExec(Option_t *)
   if(!fCaloClusterArr) fCaloClusterArr    = new TObjArray(10000);
   else                 fCaloClusterArr->Delete();//Clear("C"); it leaks?
 
+  InitGeometry(); // only once, must be done before OADB, geo OADB accessed here
+  
   //Get the event, do some checks and settings
   CheckAndGetEvent() ;
   
@@ -1515,7 +1558,6 @@ void AliAnalysisTaskEMCALClusterize::UserExec(Option_t *)
 
   //Init pointers, geometry, clusterizer, ocdb, aodb
   
-  InitGeometry(); // only once, must be done before OADB, geo OADB accessed here
   
   if(fAccessOCDB) AccessOCDB();
   if(fAccessOADB) AccessOADB(); // only once
index 855fbb861175a7a02ad23371764c1dcafd0f47a7..7a0882842c6b4eeee9a3e0aefe8372ef61035b33 100644 (file)
@@ -35,6 +35,13 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   virtual void   LocalInit()                                    { Init()                       ; }
     
   // Event methods, settings
+  
+  Bool_t         AcceptEventEMCAL();
+  void           SwitchOnSelectEMCALEvent()                    { fSelectEMCALEvent = kTRUE   ; }
+  void           SwitchOffSelectEMCALEvent()                   { fSelectEMCALEvent = kFALSE  ; }
+  void           SetEMCALEnergyCut(Float_t cut)                { fEMCALEnergyCut = cut       ; }
+  void           SetEMCALNcellsCut(Int_t cut)                  { fEMCALNcellsCut = cut       ; }
+
   void           CheckAndGetEvent();
   
   Bool_t         IsExoticEvent();
@@ -192,11 +199,15 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   TString                fCentralityClass;         // Name of selected centrality class     
   Float_t                fCentralityBin[2];        // Minimum and maximum value of the centrality for the analysis
   
-  
+  // Event selection with some signal in EMCAL
+  Bool_t                 fSelectEMCALEvent;       //  Process the event if there is some high energy cluster 
+  Float_t                fEMCALEnergyCut;         //  At least an EMCAL cluster with this energy in the event
+  Int_t                  fEMCALNcellsCut;         //  At least an EMCAL cluster with fNCellsCut cells over fEnergyCut
+
   AliAnalysisTaskEMCALClusterize(           const AliAnalysisTaskEMCALClusterize&); // not implemented
   AliAnalysisTaskEMCALClusterize& operator=(const AliAnalysisTaskEMCALClusterize&); // not implemented
 
-  ClassDef(AliAnalysisTaskEMCALClusterize, 22);
+  ClassDef(AliAnalysisTaskEMCALClusterize, 23);
 
 };
 
index 2364137638e4e037e8f7c612990ac4152d97083e..f34adc59d18e5530c7d141303afc608201c26d7c 100644 (file)
@@ -20,6 +20,7 @@ AliAnalysisTaskEMCALClusterize* AddTaskEMCALClusterize(
                                                        const Bool_t  bNonLine   = kFALSE,
                                                        const Int_t   minCen     = -1,
                                                        const Int_t   maxCen     = -1,
+                                                       const Float_t clusterEnergyCutEvent = -1,
                                                        const Int_t   nRowDiff   = 1,
                                                        const Int_t   nColDiff   = 1
                                                        )
@@ -173,7 +174,7 @@ AliAnalysisTaskEMCALClusterize* AddTaskEMCALClusterize(
   ConfigureEMCALRecoUtils(reco,bMC,exotic,bNonLine,bRecalE,bBad,bRecalT);
   
   //-------------------------------------------------------
-  //Alignment matrices
+  // Alignment matrices
   //-------------------------------------------------------
 
   clusterize->SetImportGeometryFromFile(kTRUE,"$ALICE_ROOT/OADB/EMCAL/geometry_2011.root"); // change only in case 2010 to geometry_2010.root
@@ -183,6 +184,18 @@ AliAnalysisTaskEMCALClusterize* AddTaskEMCALClusterize(
     clusterize->SwitchOnLoadOwnGeometryMatrices();
   }
   
+  //-------------------------------------------------------
+  // Clusterize events with some significant signal
+  //-------------------------------------------------------
+  
+  if(clusterEnergyCutEvent > 0)
+  {
+    clusterize->SwitchOnSelectEMCALEvent();
+    clusterize->SetEMCALEnergyCut(clusterEnergyCutEvent);
+    clusterize->SetEMCALNcellsCut(3);
+  }
+  else clusterize->SwitchOffSelectEMCALEvent();
+  
   //-------------------------------------------------------
   // Trigger options
   //-------------------------------------------------------