AliPhysics  v5-06-21-01 (1eac791)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskESDfilterEMCALEventSelect.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
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  **************************************************************************/
15 
16 #include "AliESDCaloCluster.h"
17 
19 
23 
24 //____________________________________________________________________________________
26 //____________________________________________________________________________________
28 AliAnalysisTaskESDfilter("ESD Filte : EMCAL selected events"),
29 fEnergyCut(10), fNcellsCut (2),
30 fRecoUtils(0x0),
31 fGeometry(0), fGeoName("EMCAL_COMPLETE12SMV1")
32 {
33  fRecoUtils = new AliEMCALRecoUtils;
34 }
35 
36 //____________________________________________________________________________________________________
38 //____________________________________________________________________________________________________
40 AliAnalysisTaskESDfilter(name),
41 fEnergyCut(10), fNcellsCut (2),
42 fRecoUtils(0x0),
43 fGeometry(0), fGeoName("EMCAL_COMPLETE12SMV1")
44 {
45  fRecoUtils = new AliEMCALRecoUtils;
46 }
47 
48 //_________________________________________________________________
52 //_________________________________________________________________
54 {
55  if(!fGeometry) fGeometry = AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1");
56 
57  Int_t nCluster = InputEvent() -> GetNumberOfCaloClusters();
58  AliVCaloCells * caloCell = InputEvent() -> GetEMCALCells();
59  Int_t bc = InputEvent() -> GetBunchCrossNumber();
60 
61  for(Int_t icalo = 0; icalo < nCluster; icalo++)
62  {
63  AliESDCaloCluster *clus = (AliESDCaloCluster*) (InputEvent()->GetCaloCluster(icalo));
64 
65  if( ( clus->IsEMCAL() ) && ( clus->GetNCells() > fNcellsCut ) && ( clus->E() > fEnergyCut ) &&
66  fRecoUtils->IsGoodCluster(clus,fGeometry,caloCell,bc))
67  {
68 
69  // printf("Accept event %d, E %2.2f > %2.2f, nCells %d > %d \n",
70  // (Int_t) Entry(),clus->E(), fEnergyCut, clus->GetNCells(), fNcellsCut);
71 
72  return kTRUE;
73  }
74 
75  }// loop
76 
77  return kFALSE;
78 }
79 
80 //_________________________________________________________________
84 //_________________________________________________________________
86 {
87  if(!AcceptEventEMCAL()) return ;
88 
89  AliAnalysisTaskESDfilter::UserExec("");
90 }
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Int_t fNcellsCut
At least a cluster with fNCellsCut cells over fEnergyCut.
AliEMCALRecoUtils * fRecoUtils
AliEMCALRecoUtils pointer.
AliEMCALGeometry * fGeometry
Access to EMCAL geometry utils.
Float_t fEnergyCut
At least a cluster with this energy in the event.
Filter ESDs events into AODs with some significant calorimeter signal.