AliPhysics  vAN-20151012 (2287573)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskCaloFilter.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKCALOFILTER_H
2 #define ALIANALYSISTASKCALOFILTER_H
3 
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 //_________________________________________________________________________
29 //_________________________________________________________________________
30 
31 #include "AliAnalysisTaskSE.h"
32 class AliEMCALRecoUtils;
33 class AliEMCALGeometry;
34 class AliESDEvent;
35 class AliAODEvent;
36 
37 class AliAnalysisTaskCaloFilter : public AliAnalysisTaskSE
38 {
39  public:
40 
42  AliAnalysisTaskCaloFilter(const char* name);
43  virtual ~AliAnalysisTaskCaloFilter() ;
44 
45  // * General analysis frame methods *
46 
47  virtual void UserCreateOutputObjects();
48  virtual void Init();
49  virtual void LocalInit() { Init() ; }
50  virtual void UserExec(Option_t *option);
51 
52  // * Task own methods *
53 
54  Bool_t AcceptEvent() ;
55 
56  Bool_t AcceptEventEMCAL();
57 
58  Bool_t AcceptEventPHOS();
59 
60  Bool_t AcceptEventTrack();
61 
62  Bool_t AcceptEventVertex();
63 
64  Bool_t CheckForPrimaryVertex();
67 
68  void CorrectionsInEMCAL();
69 
70  void FillAODHeader();
71 
72  void FillAODCaloCells();
73 
74  void FillAODCaloClusters();
75 
76  void FillAODCaloTrigger();
77 
78  void FillAODMCParticles();
79 
80  void FillAODTracks();
81 
82  void FillAODv0s();
83 
84  void FillAODVertices();
85 
86  void FillAODVZERO();
87 
88  void PrintInfo();
89 
90  // * Task settings *
91 
92  // Geometry methods
93 
94  void SetEMCALGeometryName(TString name) { fEMCALGeoName = name ; }
95  TString EMCALGeometryName() const { return fEMCALGeoName ; }
96 
99  void SetEMCALGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i] = m ; }
100 
101  //void SwitchOnLoadOwnPHOSGeometryMatrices() { fLoadPHOSMatrices = kTRUE ; }
102  //void SwitchOffLoadOwnPHOSGeometryMatrices() { fLoadPHOSMatrices = kFALSE ; }
103  //void SetPHOSGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fPHOSMatrix[i] = m ; }
104 
107 
108  void SwitchOnFillAODFile() { fFillAODFile = kTRUE ; }
109  void SwitchOffFillAODFile() { fFillAODFile = kFALSE ; }
110 
113 
114  void SwitchOnFillTracks() { fFillTracks = kTRUE ; }
115  void SwitchOffFillTracks() { fFillTracks = kFALSE ; }
116 
118  fFillHybridTracks = kTRUE ; }
120 
121  void SwitchOnFillv0s() { fFillv0s = kTRUE ; }
122  void SwitchOffFillv0s() { fFillv0s = kFALSE ; }
123 
124  void SwitchOnFillVZERO() { fFillVZERO = kTRUE ; }
125  void SwitchOffFillVZERO() { fFillVZERO = kFALSE ; }
126 
129 
134  enum caloFilter { kBoth = 0, kEMCAL = 1, kPHOS = 2 } ;
135 
136  void SetCaloFilter(Int_t calo) { fCaloFilter = calo ; }
137  TString GetCaloFilter() const { return fCaloFilter ; }
138 
141  void SetEventSelection(Bool_t emcal, Bool_t phos, Bool_t track) {
142  fEventSelection[0] = emcal ; fEventSelection[1] = phos ; fEventSelection[2] = track ; }
143 
146 
147  void SetMBTriggerMask(UInt_t mask) { fMBTriggerMask = mask ; }
148 
149  void SetEMCALRecoUtils(AliEMCALRecoUtils* ru){ fEMCALRecoUtils = ru ; }
150  AliEMCALRecoUtils* GetEMCALRecoUtils() const { return fEMCALRecoUtils ; }
151 
152  void SwitchOnClusterCorrection() { fCorrect = kTRUE ; }
153  void SwitchOffClusterCorrection() { fCorrect = kFALSE ; }
154 
155  void SetConfigFileName(TString name) { fConfigName = name ; }
156 
157  void SetEMCALEnergyCut(Float_t cut) { fEMCALEnergyCut = cut ; }
158  Float_t GetEMCALEnergyCut() const { return fEMCALEnergyCut ; }
159  void SetEMCALNcellsCut(Int_t cut) { fEMCALNcellsCut = cut ; }
160  Int_t GetEMCALNcellsCut() const { return fEMCALNcellsCut ; }
161 
162  void SetPHOSEnergyCut(Float_t cut) { fPHOSEnergyCut = cut ; }
163  Float_t GetPHOSEnergyCut() const { return fPHOSEnergyCut ; }
164  void SetPHOSNcellsCut(Int_t cut) { fPHOSNcellsCut = cut ; }
165  Int_t GetPHOSNcellsCut() const { return fPHOSNcellsCut ; }
166 
167  void SetTrackPtCut(Float_t cut) { fTrackPtCut = cut ; }
168  Float_t GetTrackPtCut() const { return fTrackPtCut ; }
169 
170  void SetVzCut(Float_t cut) { fVzCut = cut ; }
171  Float_t GetVzCut() const { return fVzCut ; }
172 
173 
174 private:
175 
176  Int_t fCaloFilter;
177  Bool_t fEventSelection[3];
179  UInt_t fMBTriggerMask;
180  Int_t fCorrect;
181 
182  //EMCAL specific
183  AliEMCALGeometry * fEMCALGeo;
184  TString fEMCALGeoName;
185  AliEMCALRecoUtils * fEMCALRecoUtils;
186 
187  //Geometry
189  TGeoHMatrix * fEMCALMatrix[22];
190  //Bool_t fLoadPHOSMatrices; ///< Matrices set from configuration, not get from geometry.root or from ESDs/AODs.
191  //TGeoHMatrix * fPHOSMatrix[5]; ///< Geometry matrices with alignments.
192  Bool_t fGeoMatrixSet;
193 
194  TString fConfigName;
195 
196  Bool_t fFillAODFile;
198  Bool_t fFillTracks;
200 
202  Bool_t fFillv0s;
203  Bool_t fFillVZERO;
204 
205  Float_t fEMCALEnergyCut;
207 
208  Float_t fPHOSEnergyCut;
210 
211  Float_t fTrackPtCut;
212 
213  Float_t fVzCut;
214 
216 
217  AliVEvent* fEvent;
218  AliESDEvent* fESDEvent;
219  AliAODEvent* fAODEvent;
220 
223 
226 
228  ClassDef(AliAnalysisTaskCaloFilter, 12) ;
230 
231 };
232 
233 #endif
AliEMCALGeometry * fEMCALGeo
! EMCAL geometry.
Bool_t fEventSelection[3]
Define which detector is used to select the event: {EMCAL,PHOS,Tracks}.
Int_t fPHOSNcellsCut
At least a PHOS cluster with fNCellsCut cells over fEnergyCut.
Float_t fTrackPtCut
Select events with at least a track with this pT.
void SetEventSelection(Bool_t emcal, Bool_t phos, Bool_t track)
Bool_t fFillVZERO
Fill the output AOD file with VZERO input.
virtual void UserExec(Option_t *option)
Bool_t fFillTracks
Fill the output AOD file with tracks.
Bool_t fCheckEventVertex
Check the primary vertex of the event or not.
Bool_t fAcceptAllMBEvent
Do not select the MB events with same Event selection cuts as other triggers.
Int_t fCorrect
Recalibrate or recalculate different cluster parameters, only for EMCal.
AliAnalysisTaskCaloFilter()
Default constructor.
Bool_t fFillHybridTracks
Fill the output AOD file with hybrid tracks, only when fFillTracks = kTRUE.
void FillAODCaloTrigger()
AliAODCaloTrigger direct copy.
AliEMCALRecoUtils * GetEMCALRecoUtils() const
Int_t fCaloFilter
Calorimeter to filter: kBoth, kEMCAL, kPHOS.
virtual void UserCreateOutputObjects()
Init EMCal geometry and create the AOD MC particles branch.
AliAODEvent * fAODEvent
! AOD event pointer (cast of fEvent).
TString fEMCALGeoName
Name of geometry to use.
TString fConfigName
Name of analysis configuration file.
Filter Calorimeter ESDs into AODs.
Bool_t fLoadEMCALMatrices
Matrices set from configuration, not get from geometry.root or from ESDs/AODs.
AliEMCALRecoUtils * fEMCALRecoUtils
Pointer to EMCAL utilities for clusterization.
Int_t fEMCALNcellsCut
At least an EMCAL cluster with fNCellsCut cells over fEnergyCut.
AliAnalysisTaskCaloFilter & operator=(const AliAnalysisTaskCaloFilter &)
Assignment operator not implemented.
Float_t fEMCALEnergyCut
At least an EMCAL cluster with this energy in the event.
void FillAODHeader()
AOD Header copy.
AliESDEvent * fESDEvent
! ESD event pointer (cast of fEvent).
AliVEvent * fEvent
! Event pointer.
void FillAODMCParticles()
Copy AOD MC particles.
Bool_t fFillv0s
Fill the output AOD file with v0s.
Float_t fVzCut
At least events with vertex within cut.
Bool_t fFillMCParticles
Fill the output AOD file with MC particles.
UInt_t fMBTriggerMask
Define the mask for MB events, it should be kMB, but not always defined, use kAnyINT instead...
void SetEMCALRecoUtils(AliEMCALRecoUtils *ru)
Float_t fPHOSEnergyCut
At least a PHOS cluster with this energy in the event.
virtual ~AliAnalysisTaskCaloFilter()
Destructor.
void SetEMCALGeometryMatrixInSM(TGeoHMatrix *m, Int_t i)
Bool_t fFillAODFile
Fill the output AOD file with clusters.
TGeoHMatrix * fEMCALMatrix[22]
Geometry matrices with alignments.
Bool_t fFillAllVertices
Fill the output AOD file with all vertices.
void FillAODCaloCells()
Fill EMCAL/PHOS cell info.
Bool_t fGeoMatrixSet
Set geometry matrices only once, for the first event.