1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //////////////////////////////////////////////////////////
17 // Calls derived from AliAnalysisTaskESDfilter
18 // Filter the ESD Events to AODs, only those events with
19 // some signal in EMCAL, righ now at least a
20 // cluster of high energy
22 // Author: Gustavo Conesa Balbastre (LPSC - Grenoble)
26 //////////////////////////////////////////////////////////
28 #include "AliESDCaloCluster.h"
30 #include "AliAnalysisTaskESDfilterEMCALEventSelect.h"
32 ClassImp(AliAnalysisTaskESDfilterEMCALEventSelect)
34 //____________________________________________________________________________________
35 AliAnalysisTaskESDfilterEMCALEventSelect::AliAnalysisTaskESDfilterEMCALEventSelect() :
36 AliAnalysisTaskESDfilter("ESD Filte : EMCAL selected events"),
37 fEnergyCut(10), fNcellsCut (2),
39 fGeometry(0), fGeoName("EMCAL_COMPLETE12SMV1")
41 // Default constructor
43 fRecoUtils = new AliEMCALRecoUtils;
47 //____________________________________________________________________________________________________
48 AliAnalysisTaskESDfilterEMCALEventSelect::AliAnalysisTaskESDfilterEMCALEventSelect(const char *name) :
49 AliAnalysisTaskESDfilter(name),
50 fEnergyCut(10), fNcellsCut (2),
52 fGeometry(0), fGeoName("EMCAL_COMPLETE12SMV1")
56 fRecoUtils = new AliEMCALRecoUtils;
60 //_________________________________________________________________
61 Bool_t AliAnalysisTaskESDfilterEMCALEventSelect::AcceptEventEMCAL()
63 // Accept event given there is a cluster with enough energy
65 if(!fGeometry) fGeometry = AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1");
67 Int_t nCluster = InputEvent() -> GetNumberOfCaloClusters();
68 AliVCaloCells * caloCell = InputEvent() -> GetEMCALCells();
69 Int_t bc = InputEvent() -> GetBunchCrossNumber();
71 for(Int_t icalo = 0; icalo < nCluster; icalo++)
73 AliESDCaloCluster *clus = (AliESDCaloCluster*) (InputEvent()->GetCaloCluster(icalo));
75 if( ( clus->IsEMCAL() ) && ( clus->GetNCells() > fNcellsCut ) && ( clus->E() > fEnergyCut ) &&
76 fRecoUtils->IsGoodCluster(clus,fGeometry,caloCell,bc))
79 // printf("Accept event %d, E %2.2f > %2.2f, nCells %d > %d \n",
80 // (Int_t) Entry(),clus->E(), fEnergyCut, clus->GetNCells(), fNcellsCut);
91 //_________________________________________________________________
92 void AliAnalysisTaskESDfilterEMCALEventSelect::UserExec(Option_t *)
96 // Check if the events contains what we want in EMCAL, if not,
97 // do not copy the ESD into AOD
99 if(!AcceptEventEMCAL()) return ;
101 // Continue the processing in the same way as in the ESD filter
103 AliAnalysisTaskESDfilter::UserExec("");