]>
Commit | Line | Data |
---|---|---|
e3990982 | 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 | ////////////////////////////////////////////////////////// | |
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 | |
21 | // | |
22 | // Author: Gustavo Conesa Balbastre (LPSC - Grenoble) | |
23 | ////////////////////////////////////////////////////////// | |
24 | ||
25 | #include "AliESDCaloCluster.h" | |
26 | ||
27 | #include "AliAnalysisTaskESDfilterEMCALEventSelect.h" | |
28 | ||
29 | ClassImp(AliAnalysisTaskESDfilterEMCALEventSelect) | |
30 | ||
31 | //____________________________________________________________________________________ | |
32 | AliAnalysisTaskESDfilterEMCALEventSelect::AliAnalysisTaskESDfilterEMCALEventSelect() : | |
33 | AliAnalysisTaskESDfilter("ESD Filte : EMCAL selected events"), | |
34 | fEnergyCut(10), fNcellsCut (2), | |
35 | fRecoUtils(0x0), | |
36 | fGeometry(0), fGeoName("EMCAL_COMPLETE12SMV1") | |
37 | { | |
38 | // Default constructor | |
39 | ||
40 | fRecoUtils = new AliEMCALRecoUtils; | |
41 | ||
42 | } | |
43 | ||
44 | //____________________________________________________________________________________________________ | |
45 | AliAnalysisTaskESDfilterEMCALEventSelect::AliAnalysisTaskESDfilterEMCALEventSelect(const char *name) : | |
46 | AliAnalysisTaskESDfilter(name), | |
47 | fEnergyCut(10), fNcellsCut (2), | |
48 | fRecoUtils(0x0), | |
49 | fGeometry(0), fGeoName("EMCAL_COMPLETE12SMV1") | |
50 | { | |
51 | // Constructor | |
52 | ||
53 | fRecoUtils = new AliEMCALRecoUtils; | |
54 | ||
55 | } | |
56 | ||
57 | //_________________________________________________________________ | |
58 | Bool_t AliAnalysisTaskESDfilterEMCALEventSelect::AcceptEventEMCAL() | |
59 | { | |
60 | // Accept event given there is a cluster with enough energy | |
61 | ||
62 | if(!fGeometry) fGeometry = AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1"); | |
63 | ||
64 | Int_t nCluster = InputEvent() -> GetNumberOfCaloClusters(); | |
65 | AliVCaloCells * caloCell = InputEvent() -> GetEMCALCells(); | |
66 | Int_t bc = InputEvent() -> GetBunchCrossNumber(); | |
67 | ||
68 | for(Int_t icalo = 0; icalo < nCluster; icalo++) | |
69 | { | |
70 | AliESDCaloCluster *clus = (AliESDCaloCluster*) (InputEvent()->GetCaloCluster(icalo)); | |
71 | ||
72 | if( ( clus->IsEMCAL() ) && ( clus->GetNCells() > fNcellsCut ) && ( clus->E() > fEnergyCut ) && | |
73 | fRecoUtils->IsGoodCluster(clus,fGeometry,caloCell,bc)) | |
74 | { | |
75 | ||
76 | // printf("Accept event %d, E %2.2f > %2.2f, nCells %d > %d \n", | |
77 | // (Int_t) Entry(),clus->E(), fEnergyCut, clus->GetNCells(), fNcellsCut); | |
78 | ||
79 | return kTRUE; | |
80 | } | |
81 | ||
82 | }// loop | |
83 | ||
84 | return kFALSE; | |
85 | ||
86 | } | |
87 | ||
88 | //_________________________________________________________________ | |
89 | void AliAnalysisTaskESDfilterEMCALEventSelect::UserExec(Option_t *) | |
90 | { | |
91 | // Main loop | |
92 | ||
93 | // Check if the events contains what we want in EMCAL, if not, | |
94 | // do not copy the ESD into AOD | |
95 | ||
96 | if(!AcceptEventEMCAL()) return ; | |
97 | ||
98 | // Continue the processing in the same way as in the ESD filter | |
99 | ||
100 | AliAnalysisTaskESDfilter::UserExec(""); | |
101 | ||
102 | } |