1 #ifndef ALIANALYSISTASKCALOFILTER_H
2 #define ALIANALYSISTASKCALOFILTER_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 //////////////////////////////////////////////////////////
8 // Filter the ESDCaloClusters and ESDCaloCells of EMCAL,
9 // PHOS or both, creating the corresponing AODCaloClusters
11 // Fill also the AODHeader information and the vertex.
12 // Fill tracks if requested
13 // Copy of AliAnalysisTaskESDfilter.
14 // Author: Gustavo Conesa Balbastre (INFN - Frascati)
15 //////////////////////////////////////////////////////////
17 #include "AliAnalysisTaskSE.h"
18 class AliEMCALRecoUtils;
19 class AliEMCALGeometry;
23 class AliAnalysisTaskCaloFilter : public AliAnalysisTaskSE
27 AliAnalysisTaskCaloFilter();
28 AliAnalysisTaskCaloFilter(const char* name);
29 virtual ~AliAnalysisTaskCaloFilter() ;
31 //General analysis frame methods
33 virtual void UserCreateOutputObjects();
35 virtual void LocalInit() { Init() ; }
36 virtual void UserExec(Option_t *option);
40 Bool_t AcceptEvent() ;
42 Bool_t AcceptEventEMCAL();
44 Bool_t AcceptEventPHOS();
46 Bool_t AcceptEventTrack();
48 Bool_t AcceptEventVertex();
50 Bool_t CheckForPrimaryVertex();
52 void CorrectionsInEMCAL();
56 void FillAODCaloCells();
58 void FillAODCaloClusters();
60 void FillAODCaloTrigger();
62 void FillAODMCParticles();
68 void FillAODVertices();
78 void SetEMCALGeometryName(TString name) { fEMCALGeoName = name ; }
79 TString EMCALGeometryName() const { return fEMCALGeoName ; }
81 void SwitchOnLoadOwnEMCALGeometryMatrices() { fLoadEMCALMatrices = kTRUE ; }
82 void SwitchOffLoadOwnEMCALGeometryMatrices() { fLoadEMCALMatrices = kFALSE ; }
83 void SetEMCALGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i] = m ; }
85 //void SwitchOnLoadOwnPHOSGeometryMatrices() { fLoadPHOSMatrices = kTRUE ; }
86 //void SwitchOffLoadOwnPHOSGeometryMatrices() { fLoadPHOSMatrices = kFALSE ; }
87 //void SetPHOSGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fPHOSMatrix[i] = m ; }
89 void SwitchOnCheckEventPrimaryVertex() { fCheckEventVertex = kTRUE ; }
90 void SwitchOffCheckEventPrimaryVertex() { fCheckEventVertex = kFALSE ; }
92 void SwitchOnFillAODFile() { fFillAODFile = kTRUE ; }
93 void SwitchOffFillAODFile() { fFillAODFile = kFALSE ; }
95 void SwitchOnFillMCParticles() { fFillMCParticles = kTRUE ; }
96 void SwitchOffFillMCParticles() { fFillMCParticles = kFALSE ; }
98 void SwitchOnFillTracks() { fFillTracks = kTRUE ; }
99 void SwitchOffFillTracks() { fFillTracks = kFALSE ; }
101 void SwitchOnFillHybridTracks() { fFillTracks = kTRUE ;
102 fFillHybridTracks = kTRUE ; }
103 void SwitchOffFillHybridTracks() { fFillHybridTracks = kFALSE ; }
105 void SwitchOnFillv0s() { fFillv0s = kTRUE ; }
106 void SwitchOffFillv0s() { fFillv0s = kFALSE ; }
108 void SwitchOnFillVZERO() { fFillVZERO = kTRUE ; }
109 void SwitchOffFillVZERO() { fFillVZERO = kFALSE ; }
111 void SwitchOnFillAllVertices() { fFillAllVertices = kTRUE ; }
112 void SwitchOffFillAllVertices() { fFillAllVertices = kFALSE ; }
114 enum caloFilter {kBoth = 0, kEMCAL = 1, kPHOS=2};
116 void SetCaloFilter(Int_t calo) { fCaloFilter = calo ; }
117 TString GetCaloFilter() const { return fCaloFilter ; }
119 void SetEventSelection(Bool_t emcal, Bool_t phos, Bool_t track) {
120 // Detector involved in event selection
121 fEventSelection[0] = emcal ; fEventSelection[1] = phos ; fEventSelection[2] = track ; }
123 void SwitchOnAcceptAllMBEvent() { fAcceptAllMBEvent = kTRUE ; }
124 void SwitchOffAcceptAllMBEvent() { fAcceptAllMBEvent = kFALSE ; }
126 void SetMBTriggerMask(UInt_t mask) { fMBTriggerMask = mask ; }
128 void SetEMCALRecoUtils(AliEMCALRecoUtils* ru){ fEMCALRecoUtils = ru ; }
129 AliEMCALRecoUtils* GetEMCALRecoUtils() const { return fEMCALRecoUtils ; }
131 void SwitchOnClusterCorrection() { fCorrect = kTRUE ; }
132 void SwitchOffClusterCorrection() { fCorrect = kFALSE ; }
134 void SetConfigFileName(TString name) { fConfigName = name ; }
136 void SetEMCALEnergyCut(Float_t cut) { fEMCALEnergyCut = cut ; }
137 Float_t GetEMCALEnergyCut() const { return fEMCALEnergyCut ; }
138 void SetEMCALNcellsCut(Int_t cut) { fEMCALNcellsCut = cut ; }
139 Int_t GetEMCALNcellsCut() const { return fEMCALNcellsCut ; }
141 void SetPHOSEnergyCut(Float_t cut) { fPHOSEnergyCut = cut ; }
142 Float_t GetPHOSEnergyCut() const { return fPHOSEnergyCut ; }
143 void SetPHOSNcellsCut(Int_t cut) { fPHOSNcellsCut = cut ; }
144 Int_t GetPHOSNcellsCut() const { return fPHOSNcellsCut ; }
146 void SetTrackPtCut(Float_t cut) { fTrackPtCut = cut ; }
147 Float_t GetTrackPtCut() const { return fTrackPtCut ; }
149 void SetVzCut(Float_t cut) { fVzCut = cut ; }
150 Float_t GetVzCut() const { return fVzCut ; }
155 Int_t fCaloFilter; // Calorimeter to filter
156 Bool_t fEventSelection[3]; // Define which detector is used to select the event
157 Bool_t fAcceptAllMBEvent; // Do not select the MB events with same cuts as other triggers
158 UInt_t fMBTriggerMask; // Define the mask for MB events, it should be kMB, but not always defined, use kAnyINT instead
159 Int_t fCorrect; // Recalibrate or recalculate different cluster parameters
162 AliEMCALGeometry * fEMCALGeo; //! EMCAL geometry
163 TString fEMCALGeoName; // Name of geometry to use.
164 AliEMCALRecoUtils * fEMCALRecoUtils; // Pointer to EMCAL utilities for clusterization
167 Bool_t fLoadEMCALMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
168 TGeoHMatrix * fEMCALMatrix[12]; // Geometry matrices with alignments
169 //Bool_t fLoadPHOSMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
170 //TGeoHMatrix * fPHOSMatrix[5]; // Geometry matrices with alignments
171 Bool_t fGeoMatrixSet; // Set geometry matrices only once, for the first event.
173 TString fConfigName; // Name of analysis configuration file
175 Bool_t fFillAODFile; // Fill the output AOD file with clusters
176 Bool_t fFillMCParticles; // Fill tracks
177 Bool_t fFillTracks; // Fill tracks
178 Bool_t fFillHybridTracks; // Fill hybrid tracks
180 Bool_t fFillAllVertices; // Fill all vertices
181 Bool_t fFillv0s; // Fill v0s
182 Bool_t fFillVZERO; // Fill VZERO
184 Float_t fEMCALEnergyCut; // At least an EMCAL cluster with this energy in the event
185 Int_t fEMCALNcellsCut; // At least an EMCAL cluster with fNCellsCut cells over fEnergyCut
187 Float_t fPHOSEnergyCut; // At least a PHOS cluster with this energy in the event
188 Int_t fPHOSNcellsCut; // At least a PHOS cluster with fNCellsCut cells over fEnergyCut
190 Float_t fTrackPtCut; // At least a track with this pT in the event
192 Float_t fVzCut; // At least events with vertex within cut
194 Bool_t fCheckEventVertex; // Check the primary vertex of the event or not
196 AliVEvent* fEvent; //! event pointer
197 AliESDEvent* fESDEvent; //! ESD event pointer
198 AliAODEvent* fAODEvent; //! AOD event pointer
201 AliAnalysisTaskCaloFilter( const AliAnalysisTaskCaloFilter&);
202 AliAnalysisTaskCaloFilter& operator=(const AliAnalysisTaskCaloFilter&);
204 ClassDef(AliAnalysisTaskCaloFilter, 11); // Analysis task for standard ESD filtering