]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/CaloTasks/AliAnalysisTaskCaloFilter.h
apply shower shape cut for decays
[u/mrichter/AliRoot.git] / PWGGA / CaloTasks / AliAnalysisTaskCaloFilter.h
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 //////////////////////////////////////////////////////////
8 // Filter the ESDCaloClusters and ESDCaloCells of EMCAL,
9 // PHOS or both, creating the corresponing AODCaloClusters
10 // and AODCaloCells.
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 //////////////////////////////////////////////////////////
16
17 #include "AliAnalysisTaskSE.h"
18 class AliEMCALRecoUtils;
19 class AliEMCALGeometry;
20 class AliESDEvent;
21 class AliAODEvent;
22
23 class AliAnalysisTaskCaloFilter : public AliAnalysisTaskSE
24 {
25  public:
26   
27   AliAnalysisTaskCaloFilter();
28   AliAnalysisTaskCaloFilter(const char* name);
29   virtual ~AliAnalysisTaskCaloFilter() ;
30     
31   //General analysis frame methods
32   
33   virtual void   UserCreateOutputObjects();
34   virtual void   Init();
35   virtual void   LocalInit() { Init() ; }
36   virtual void   UserExec(Option_t *option);
37         
38   // Task own methods
39   
40   Bool_t  AcceptEvent() ;
41   
42   Bool_t  AcceptEventEMCAL();
43
44   Bool_t  AcceptEventPHOS();
45   
46   Bool_t  AcceptEventTrack();
47   
48   Bool_t  AcceptEventVertex();
49   
50   Bool_t  CheckForPrimaryVertex();
51   
52   void    CorrectionsInEMCAL();
53   
54   void    FillAODHeader();
55
56   void    FillAODCaloCells();
57   
58   void    FillAODCaloClusters();
59   
60   void    FillAODCaloTrigger();
61
62   void    FillAODMCParticles();
63   
64   void    FillAODTracks();
65
66   void    FillAODv0s();
67   
68   void    FillAODVertices();
69   
70   void    FillAODVZERO();
71   
72   void    PrintInfo();
73   
74   // * Task settings *
75   
76   // Geometry methods
77   
78   void    SetEMCALGeometryName(TString name)                  { fEMCALGeoName = name        ; }
79   TString    EMCALGeometryName()                       const  { return fEMCALGeoName        ; }
80   
81   void    SwitchOnLoadOwnEMCALGeometryMatrices()              { fLoadEMCALMatrices = kTRUE  ; }
82   void    SwitchOffLoadOwnEMCALGeometryMatrices()             { fLoadEMCALMatrices = kFALSE ; }
83   void    SetEMCALGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i]    = m      ; }
84   
85   //void    SwitchOnLoadOwnPHOSGeometryMatrices()               { fLoadPHOSMatrices = kTRUE  ; }
86   //void    SwitchOffLoadOwnPHOSGeometryMatrices()              { fLoadPHOSMatrices = kFALSE ; }
87   //void    SetPHOSGeometryMatrixInSM(TGeoHMatrix* m, Int_t i)  { fPHOSMatrix[i]    = m      ; }
88     
89   void    SwitchOnCheckEventPrimaryVertex()       { fCheckEventVertex = kTRUE   ; }
90   void    SwitchOffCheckEventPrimaryVertex()      { fCheckEventVertex = kFALSE  ; }
91
92   void    SwitchOnFillAODFile()                   { fFillAODFile = kTRUE        ; }
93   void    SwitchOffFillAODFile()                  { fFillAODFile = kFALSE       ; }
94
95   void    SwitchOnFillMCParticles()               { fFillMCParticles = kTRUE    ; }
96   void    SwitchOffFillMCParticles()              { fFillMCParticles = kFALSE   ; }
97   
98   void    SwitchOnFillTracks()                    { fFillTracks  = kTRUE        ; }
99   void    SwitchOffFillTracks()                   { fFillTracks  = kFALSE       ; }
100   
101   void    SwitchOnFillHybridTracks()              { fFillTracks  = kTRUE        ;
102                                                     fFillHybridTracks  = kTRUE  ; }
103   void    SwitchOffFillHybridTracks()             { fFillHybridTracks  = kFALSE ; }
104   
105   void    SwitchOnFillv0s()                       { fFillv0s     = kTRUE        ; }
106   void    SwitchOffFillv0s()                      { fFillv0s     = kFALSE       ; }
107   
108   void    SwitchOnFillVZERO()                     { fFillVZERO   = kTRUE        ; }
109   void    SwitchOffFillVZERO()                    { fFillVZERO   = kFALSE       ; }
110   
111   void    SwitchOnFillAllVertices()               { fFillAllVertices = kTRUE    ; }
112   void    SwitchOffFillAllVertices()              { fFillAllVertices = kFALSE   ; }
113   
114   enum    caloFilter {kBoth = 0, kEMCAL = 1, kPHOS=2};
115   
116   void    SetCaloFilter(Int_t calo)               { fCaloFilter = calo          ; }
117   TString GetCaloFilter()                  const  { return fCaloFilter          ; }  
118   
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 ; }
122   
123   void    SwitchOnAcceptAllMBEvent()              { fAcceptAllMBEvent = kTRUE   ; }
124   void    SwitchOffAcceptAllMBEvent()             { fAcceptAllMBEvent = kFALSE  ; }
125
126   void    SetMBTriggerMask(UInt_t mask)           { fMBTriggerMask    = mask    ; }
127   
128   void    SetEMCALRecoUtils(AliEMCALRecoUtils* ru){ fEMCALRecoUtils = ru        ; }
129   AliEMCALRecoUtils* GetEMCALRecoUtils()   const  { return fEMCALRecoUtils      ; }
130
131   void    SwitchOnClusterCorrection()             { fCorrect = kTRUE            ; }
132   void    SwitchOffClusterCorrection()            { fCorrect = kFALSE           ; }
133   
134   void    SetConfigFileName(TString name)         { fConfigName = name          ; }
135   
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      ; }
140   
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       ; }
145   
146   void    SetTrackPtCut(Float_t cut)              { fTrackPtCut = cut           ; }
147   Float_t GetTrackPtCut()                   const { return fTrackPtCut          ; }
148   
149   void    SetVzCut(Float_t cut)                   { fVzCut = cut                ; }
150   Float_t GetVzCut()                        const { return fVzCut               ; }
151   
152   
153 private:
154     
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
160   
161   //EMCAL specific
162   AliEMCALGeometry  * fEMCALGeo;          //! EMCAL geometry
163   TString             fEMCALGeoName;      // Name of geometry to use.
164   AliEMCALRecoUtils * fEMCALRecoUtils;    // Pointer to EMCAL utilities for clusterization
165   
166   //Geometry
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.   
172   
173   TString             fConfigName;        // Name of analysis configuration file
174   
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
179
180   Bool_t              fFillAllVertices;   // Fill all vertices
181   Bool_t              fFillv0s;           // Fill v0s
182   Bool_t              fFillVZERO;         // Fill VZERO
183
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
186
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
189   
190   Float_t             fTrackPtCut;        //  At least a track with this pT in the event
191   
192   Float_t             fVzCut;             //  At least events with vertex within cut
193   
194   Bool_t              fCheckEventVertex;  // Check the primary vertex of the event or not
195
196   AliVEvent*          fEvent;             //! event pointer
197   AliESDEvent*        fESDEvent;          //! ESD event pointer
198   AliAODEvent*        fAODEvent;          //! AOD event pointer
199
200   
201   AliAnalysisTaskCaloFilter(           const AliAnalysisTaskCaloFilter&);
202   AliAnalysisTaskCaloFilter& operator=(const AliAnalysisTaskCaloFilter&);
203   
204   ClassDef(AliAnalysisTaskCaloFilter, 11); // Analysis task for standard ESD filtering
205   
206 };
207
208 #endif