]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/AliAnalysisTaskEMCALPhotonIsolation.h
New version for photon isolation task
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliAnalysisTaskEMCALPhotonIsolation.h
1 #ifndef ALIANALYSISTASKEMCALPHOTONISOLATION_H
2 #define ALIANALYSISTASKEMCALPHOTONISOLATION_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6     //////////////////////////////////////////////////////////////////////////
7     //                                                                      //
8     //  Task for Isolated Gamma in p-p,p-Pb and eventually g-h Correlation  //
9     //                                                                      //
10     //  Author: Davide Francesco Lodato (Utrecht University)                //
11     //          Lucile Ronflette (Subatech, Nantes)                         //
12     //          Marco Marquard   (University Frankfurt am Main)             //
13     //////////////////////////////////////////////////////////////////////////
14
15     //ROOT System
16
17 class TH1;
18 class TH2;
19 class TH3;
20 class THnSparse;
21 class TList;
22 class TObjArray;
23 class AliEMCALGeometry;
24 class AliESDCaloCells;
25 class AliESDEvent;
26 class AliESDtrack;
27 class TClonesArray;
28 class TList;
29 class TString;
30 class AliVCluster;
31 class AliVParticle;
32 class AliESDtrackCuts;
33 class AliAODEvent;
34 class AliAODCaloCells;
35 class AliVCluster;
36 class AliMCEvent;
37 class AliStack;
38 class TParticle;
39 class AliClusterContainer;
40 class AliParticleContainer;
41 class AliEmcalParticle;
42     //AliRoot System
43 class AliEMCALTrack;
44     //class AliMagF;
45 class AliEMCALRecoUtils;
46     //class AliAnalysisFilter;
47 class AliAODTrack;
48 class AliAODCaloCluster;
49 class AliESDCaloCluster;
50 class AliVCaloCells;
51 class AliAODMCParticle;
52     //class AliEventPoolManager;
53
54 #include "AliAnalysisTaskEmcal.h"
55
56 class AliAnalysisTaskEMCALPhotonIsolation : public AliAnalysisTaskEmcal {
57 public:
58     AliAnalysisTaskEMCALPhotonIsolation();
59     AliAnalysisTaskEMCALPhotonIsolation(const char *name, Bool_t histo=kFALSE);
60     virtual ~AliAnalysisTaskEMCALPhotonIsolation();
61
62     void                     UserCreateOutputObjects();
63
64     void                     SetIsoConeRadius(Float_t r)                                     { fIsoConeRadius = r ;}
65     void                     SetEtIsoThreshold(Float_t r)                                     {fEtIsoThreshold = r ;}
66     void                     SetCTMdeltaEta (Float_t r)                                      { fdetacut = r ;}
67     void                     SetCTMdeltaPhi (Float_t r)                                      { fdphicut = r ;}
68     void                     SetIsoMethod (Int_t r )                                         { fIsoMethod = r ;}
69     void                     SetEtIsoMethod (Int_t r )                                       { fEtIsoMethod = r ;}
70     void                     SetUEMethod (Int_t UE)                                          { fUEMethod = UE;}
71     void                     SetOutputFormat (Int_t iOut)                                    { fWho = iOut;}
72     void                     SetQA (Bool_t QA)                                               { fQA = QA;}
73     void                     SetMC (Bool_t MC)                                               { fIsMC = MC;}
74     void                     SetUSEofTPC (Bool_t TPC)                                        { fTPC4Iso = TPC;}
75     void                     SetLCAnalysis (Bool_t LC)                                       { fisLCAnalysis = LC;}
76
77 protected:
78
79     void                     FillQAHistograms(AliVCluster *coi, TLorentzVector vecCOI); // Fill some QA histograms
80     void                     EtIsoCellPhiBand(TLorentzVector c, Float_t &etIso, Float_t &phiBand);    //EIsoCone via Cells UE via PhiBand EMCAL
81     void                     EtIsoCellEtaBand(TLorentzVector c, Float_t &etIso, Float_t &etaBand);    //EIsoCone via Cells UE via EtaBand EMCAL
82     void                     EtIsoClusPhiBand(TLorentzVector c, Float_t &etIso, Float_t &etaBand, Int_t index);    //EIsoCone via Clusters UE via EtaBand EMCAL
83     void                     EtIsoClusEtaBand(TLorentzVector c, Float_t &etIso, Float_t &etaBand, Int_t index);    //EIsoCone via Clusters UE via EtaBand EMCAL
84     void                     PtIsoTrackPhiBand(TLorentzVector c, Float_t &ptIso, Float_t &phiBand);   //PIsoCone via Track UE via PhiBand TPC
85     void                     PtIsoTrackEtaBand(TLorentzVector c, Float_t &ptIso, Float_t &etaBand);   //PIsoCone via Track UE via EtaBand TPC
86   //  void                     PtIsoTraClusPhiBand(TLorentzVector c, Float_t &ptIso, Float_t &phiBand); //(P+E)IsoCone via Track/Clus UE via PhiBand TPC+EMCAL
87   //  void                     PtIsoTraClusEtaBand(TLorentzVector c, Float_t &ptIso, Float_t &etaBand); //(P+E)IsoCone via Track/Clus UE via EtaBand TPC+EMCAL
88     void                     PtIsoTrackOrthCones(TLorentzVector c, Float_t &ptIso, Float_t &cones);   //PIsoCone via Tracks UE via Orthogonal Cones in Phi
89     void                     PtIsoTrackFullTPC(TLorentzVector c, Float_t &ptIso, Float_t &full);      //PIsoCone via Tracks UE via FullTPC - IsoCone - B2BEtaBand
90 //    Bool_t                   ClustTrackMatching(AliVCluster *cluster);
91     Bool_t                   ClustTrackMatching(AliEmcalParticle *emccluster);
92     Bool_t                   CheckBoundaries(TLorentzVector vecCOI);
93    // void                     FillNCOutput(AliVCluster *COI, TLorentzVector vecCOI, Int_t index);
94
95     Float_t*                 GenerateFixedBinArray(Int_t n, Float_t min, Float_t max) const;
96     void                     ExecOnce();
97     Bool_t                   Run();
98     void                     AnalyzeMC();
99     void                     LookforParticle(Int_t, Double_t, Double_t, Double_t,Double_t,Double_t, Int_t);
100
101
102     using AliAnalysisTaskEmcal::FillGeneralHistograms;
103     Bool_t FillGeneralHistograms(AliVCluster *COI, TLorentzVector VecCOI, Int_t index);
104     //Bool_t                   FillGeneralHistograms(AliVCluster *COI, TLorentzVector VecCOI, Int_t index);
105
106   AliAODEvent *fAOD;       //!
107   AliVEvent *fVevent;      //! AliVEvent
108   //    TObjArray                   fParticleCollArray;              // Neutral Clusters collection array
109   TClonesArray               *fNCluster;                       // Neutral clusters
110   TClonesArray               *fAODMCParticles; //!
111   TClonesArray               *fTracksAna;             //! hybrid track array in
112   AliStack                   *fStack;//!
113
114     Int_t       fWho;           // MODE for the Output Object (TTree or THnSparse)
115
116
117                 //IMPLEMENT ALL THE HISTOGRAMS AND ALL THE OUTPUT OBJECTS WE WANT!!!
118    //    TList       *fOutputList; //! Output list
119 //    TGeoHMatrix *fGeomMatrix[12];//! Geometry misalignment matrices for EMCal
120
121
122     TH1        *fTrackMult;                      //!Track Multiplicity ---QA
123     TH1        *fTrackMultEMCAL;                 //!Track Multiplicity EMCAL ---QA
124     TH1        *fClustMult;                      //!Cluster Multiplicity EMCAL ---QA
125     TH1        *fPVZBefore;                      //!Z Vertex distribution before cuts. ---QA
126     TH2        *fEtaPhiCell;                     //!EMCAL Active Cells Distribution EtaPhi ---QA
127     TH2        *fEtaPhiClus;                     //!EMCAL Cluster Distribution EtaPhi ---QA
128     TH2        *fClusEvsClusT;                   //!Cluster Energy vs Cluster Time ---QA
129     TH1        *fVz;                             //! Veretex Z distribution
130     TH1        *fEvents;                         //! Number of Events
131     TH1        *fPT;                             //!Pt distribution
132     TH1        *fE;                              //!E distribution
133     TH1        *fPtaftTime;                       //!E distribution for clusters after cluster time cut
134     TH1        *fPtaftTM;                         //!E distribution for neutral clusters
135     TH1        *fPtaftFC;                         //!E distribution for clusters after fiducial cut
136     TH1        *fPtaftM02C;                       //!E distribution for clusters after shower shape cut
137     TH1        *fClusTime;                       //!Time distribution for clusters
138     TH2        *fM02;                            //!Squared_Lambda0 distribution
139     TH1        *fNLM;                            //!NLM distribution
140     TH1        *fDeltaETAClusTrack;              //!dEta Cluster-Track!
141     TH1        *fDeltaPHIClusTrack;              //!dPhi Cluster-Track!
142     TH1        *fDeltaETAClusTrackMatch;              //!dEta Cluster-Track matched!
143     TH1        *fDeltaPHIClusTrackMatch;              //!dPhi Cluster-Track matched!
144     TH2        *fDeltaETAClusTrackVSpT;          //!dEta Cluster-Track VS pT!
145     TH2        *fDeltaPHIClusTrackVSpT;          //!dPhi Cluster-Track VS pT!
146     TH1        *fEtIsoCells;                     //!Isolation Energy with EMCAL Cells
147     TH2        *fEtIsoClust;                     //!Isolation Energy with EMCAL Clusters
148     TH2        *fPtIsoTrack;                     //!Isolation Pt with Tracks
149     TH1        *fPtEtIsoTC;                      //!Isolation with Pt from Tracks and Et from NON-Matched Clusters
150     TH2        *fPhiBandUEClust;                 //!UE with Phi Band (Clusters)
151     TH2        *fEtaBandUEClust;                 //!UE with Eta Band (Clusters)
152     TH2        *fPhiBandUECells;                 //!UE with Phi Band (Cells)
153     TH2        *fEtaBandUECells;                 //!UE with Eta Band (Cells)
154     TH2        *fPhiBandUETracks;                //!UE with Phi Band (Tracks)
155     TH2        *fEtaBandUETracks;                //!UE with Eta Band (Tracks)
156     TH2        *fPerpConesUETracks;              //!UE with Cones (Tracks ONLY)
157     TH2        *fTPCWithoutIsoConeB2BbandUE;     //!UE with Full TPC except IsoCone and EtaBand in Back2Back
158     TH1        *fNTotClus10GeV;                  //!number of TOTAL clusters with Energy bigger than 10 GeV
159     TH1        *fRecoPV;                         //! primary vertex reconstruction
160     TH1        *fEtIsolatedCells;                //! Isolated photons, isolation with cells
161     TH1        *fEtIsolatedClust;                //! Isolated photons, isolation with clusters
162     TH1        *fPtIsolatedNClust;               //! Isolated neutral clusters
163     TH1        *fPtIsolatedNTracks;               //! Isolated neutral clusters with tracks
164     TH1        *fEtIsolatedTracks;               //! Isolated photons, isolation with tracks
165     TH2        *fPtvsM02iso;                     //! Isolated clusters, pt distribution vs M02
166     TH2        *fPtvsM02noiso;                   //! Non isolated clusters, pt distribution vs M02
167     TH2        *fTestIndex;                      //! Index and local index test
168     TH2        *fTestIndexE;
169     TH2        *fTestLocalIndexE;
170     TH2        *fTestEnergyCone;                 //! ernergy cone clusters vs tracks
171     TH2        *fTestEtaPhiCone;
172
173     THnSparse   *fOutputTHnS;                    //! 1st Method 4 Output
174     THnSparse   *fOutMCTruth;                    //! 1st Method 4 MC truth Output //Isolation on pTMax
175     THnSparse   *fOutClustMC;                    //! 1st Method 4 MC+Truth Output via Clusterlabel
176
177     TTree       *fOutputQATree;                  //! 2nd method 4 QA Output
178     TTree       *fOutputTree;                    //! 2nd Method 4 Output
179
180     TH3        *fphietaPhotons; //!
181     TH3        *fphietaOthers; //!
182     TH3        *fphietaOthersBis;//!
183
184     Float_t     fIsoConeRadius;                  // Radius for the Isolation Cont
185     Int_t       fEtIsoMethod;                    // Isolation definition 0=SumEt<EtThr, 1=SumEt<%Ephoton, 2=Etmax<EtThr
186     Double_t    fEtIsoThreshold;                 // Et isolation threshold, supposed to be % if method one is choosed
187     Double_t    fdetacut;                        // cut on deta between track and cluster
188     Double_t    fdphicut;                        // cut on dphi between track and cluster
189     Double_t    fM02mincut;                      // lambda0^2 minimum cut
190     Double_t    fM02maxcut;                      // lambda0^2 maximum cut
191     Bool_t      fQA;                             // Flag for few further QA plots wrt the ones already done in the EMCALTask
192     Bool_t      fIsMC;                           // Flag for MC Truth Analysis
193     Bool_t      fTPC4Iso;                        //0=EMCAL_ONLY; 1=EMCAL+TPC
194     Int_t       fIsoMethod;                      //0=Cells, 1=Clusters (EMCAL_ONLY),  2=Tracks (EMCAL w/o TPC)
195     Int_t       fUEMethod;                       //0=PhiBand, 1=EtaBand, (EMCAL or TPC) 2= Ort Cones, 3=FullTPC (only with TPC)
196     Int_t       fNDimensions;                    //!number of Dimensions for the THnSPARSE
197     Int_t       fMCDimensions;
198     Int_t       fMCQAdim;                        //!
199     Bool_t      fisLCAnalysis;                   // Flag to pass from Leading Clusters Analysis to a NC One
200     Int_t       fTest1;
201     Int_t       fTest2;
202
203 // Initialization for TTree variables
204     Double_t    fEClustersT;                     // E for all clusters
205     Double_t    fPtClustersT;                    // Pt for all clusters
206     Double_t    fEtClustersT;                    // Et for all clusters
207     Double_t    fEtaClustersT;                   // Eta for all clusters
208     Double_t    fPhiClustersT;                   // Phi for all clusters
209     Double_t    fM02ClustersT;                   // lamnda0^2 for all clusters
210
211     Int_t       fevents;                         // N events
212     Int_t       fNClustersT;                     // Clusters multiplicity
213     Double_t    flambda0T;                       // M02 for considered clusters (leading one or all depending on flag)
214     Double_t    fM02isoT;                        // M02 for isolated clusters
215     Double_t    fM02noisoT;                      // M02 for non isolated clusters
216     Double_t    fPtnoisoT;                       // Pt for non isolated clusters
217     Double_t    fEtT;                            // Et for considered clusters (leading one or all depending on flag)
218     Double_t    fPtT;                            // Pt for considered clusters (leading one or all depending on flag)
219     Double_t    fPtisoT;                         // Pt for all isolated neutral clusters
220     Double_t    fEtisolatedT;                         // Et for isolated clusters
221     Double_t    fPtisolatedT;                         // Pt for isolated clusters
222     Double_t    fetaT;                           // Eta for considered clusters
223     Double_t    fphiT;                           // Phi for considered clusters
224     Double_t    fsumEtisoconeT;                  // sum Et  in cone
225     Double_t    fsumEtUE;                        // sum UE
226
227
228     //  AliParticleContainer       *fTracksCont;     //!Tracks
229     //  AliParticleContainer       *fclusters;                       //!Container for Particle container 4 clusters
230
231 private:
232    AliAnalysisTaskEMCALPhotonIsolation(const AliAnalysisTaskEMCALPhotonIsolation&);            // not implemented
233    AliAnalysisTaskEMCALPhotonIsolation &operator=(const AliAnalysisTaskEMCALPhotonIsolation&); // not implemented
234
235
236     ClassDef(AliAnalysisTaskEMCALPhotonIsolation, 1)    //EMCAL Neutrals base analysis task
237 };
238 #endif
239