]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/AliAnalysisTaskEMCALIsoPhoton.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliAnalysisTaskEMCALIsoPhoton.h
1 #ifndef AliAnalysisTaskEMCALIsoPhoton_h
2 #define AliAnalysisTaskEMCALIsoPhoton_h
3
4 // $Id$
5
6 class TH1F;
7 class TH2F;
8 class TH3F;
9 class THnSparse;
10 class TList;
11 class TObjArray;
12 class AliEMCALGeometry;
13 class AliOADBContainer;
14 class AliESDCaloCells;
15 class AliESDEvent;
16 class AliESDtrack;
17 class AliESDtrackCuts;
18 class AliAODEvent;
19 class AliAODCaloCells;
20 class AliVCluster;
21 class AliMCEvent;
22 class AliStack;
23 class TParticle;
24 class TGeoHMatrix;
25
26 #include "AliAnalysisTaskSE.h"
27
28 class AliAnalysisTaskEMCALIsoPhoton : public AliAnalysisTaskSE {
29  public:
30   AliAnalysisTaskEMCALIsoPhoton();
31   AliAnalysisTaskEMCALIsoPhoton(const char *name);
32   virtual ~AliAnalysisTaskEMCALIsoPhoton() {}
33
34   void                   UserCreateOutputObjects();
35   void                   UserExec(Option_t *option);
36   void                   Terminate(Option_t *);
37
38   void                   GetCeIso(TVector3 vec, Int_t maxid, Float_t &iso, Float_t &phiband, Float_t &core);
39   Double_t               GetCrossEnergy(const AliVCluster *cluster, Short_t &idmax);
40   Double_t               GetMaxCellEnergy(const AliVCluster *cluster, Short_t &id) const; 
41   void                   GetTrIso(TVector3 vec, Float_t &iso, Float_t &phiband, Float_t &core);
42   Double_t               GetTrackMatchedPt(Int_t matchIndex);
43   void                   FillClusHists();
44   void                   FillMcHists();
45   void                   FillQA();
46   Float_t                GetClusSource(const AliVCluster *cluster);
47   void                   FollowGamma();
48   void                   GetDaughtersInfo(int firstd, int lastd, int selfid, const char *indputindent);
49   Float_t                GetMcPtSumInCone(Float_t etaclus, Float_t phiclus, Float_t R);
50   void                   LoopOnCells();
51   void                   SetExotCut(Double_t c)                 { fExoticCut          = c;       }
52   void                   SetGeoName(const char *n)              { fGeoName            = n;       }
53   void                   SetIsoConeR(Double_t r)                { fIsoConeR           = r;       }
54   void                   SetPeriod(const char *n)               { fPeriod             = n;       }
55   void                   SetTriggerBit(const char *tb)          { fTrigBit            = tb;      }
56   void                   SetPrimTrackCuts(AliESDtrackCuts *c)   { fPrTrCuts           = c;       }
57   void                   SetTrainMode(Bool_t t)                 { fIsTrain            = t;       }
58   void                   SetMcMode(Bool_t mc)                   { fIsMc               = mc;      }
59   void                   SetDebugOn(Bool_t d)                   { fDebug              = d;       }
60   void                   SetPathStringSelect(char *p)           { fPathStrOpt         = p;       }
61   void                   SetEtCut(Double_t ec)                  { fECut               = ec;      }
62   void                   SetImportGeometryFromFile(Bool_t  im, 
63                                            TString pa = "")     { fImportGeometryFromFile = im ; 
64                                                                   fImportGeometryFilePath = pa ; }    
65   void                  SetTrackFilterBit(ULong_t bit)          { fFilterBit = bit;  }
66   void                  SetHybridOn()                           { fSelHybrid = kTRUE; }
67   void                  SetFillQA()                             { fFillQA = kTRUE; }
68   void                  SelectCPVFromTrack(Bool_t b)            { fCpvFromTrack = b; }
69   void                  SetEtPtHistoBinning(Int_t n, 
70                                             Double_t lowx, 
71                                             Double_t highx)     { fNBinsPt = n; fPtBinLowEdge = lowx; fPtBinHighEdge = highx; }
72
73  protected:
74   TObjArray             *fESDClusters;           //!pointer to EMCal clusters
75   TObjArray             *fAODClusters;           //!pointer to EMCal clusters
76   TObjArray             *fSelPrimTracks;         //!pointer to ESD primary tracks
77   TClonesArray          *fTracks;                //!track input array
78   AliESDCaloCells       *fESDCells;              //!pointer to EMCal cells, esd
79   AliAODCaloCells       *fAODCells;              //!pointer to EMCal cells, aod  
80   AliESDtrackCuts       *fPrTrCuts;              //pointer to hold the prim track cuts
81   AliEMCALGeometry      *fGeom;                  // geometry utils
82   TString                fGeoName;               // geometry name (def = EMCAL_FIRSTYEARV1)
83   AliOADBContainer      *fOADBContainer;         //!OADB container used to load misalignment matrices
84   TString                fPeriod;                // string to the LHC period
85   TString                fTrigBit;               // string to the trigger bit name
86   Bool_t                 fIsTrain;               // variable to set train mode
87   Bool_t                 fIsMc;                  // variable to set mc mode
88   Bool_t                 fDebug;                 // variable to set on/off debugging printouts
89   TString                fPathStrOpt;            // variable to set the name of files to be analyzed (MC only)
90   Double_t               fExoticCut;             // variable to set the cut on exotic clusters
91   Double_t               fIsoConeR;              // variable to set the isolation cone radius
92   Int_t                  fNDimensions;           // variable to set the number of dimensions of n-sparse
93   Double_t               fECut;                  // variable to set the minimum E of a cluster
94   Int_t                  fTrackMult;             // global variable with the event multiplicity        
95   TString                fMcIdFamily;            // string that holds the ids of all particles originated from the prompt photon
96   Int_t                  fNClusForDirPho;        // number of clusters from prompt photon per event
97   Float_t                fDirPhoPt;              // prompt photon pt (assumes only one per event)
98   Float_t                fHigherPtCone;          // higher pt inside the cone around the candidate
99   Bool_t                 fImportGeometryFromFile;  // Import geometry settings in geometry.root file
100   TString                fImportGeometryFilePath;  // path fo geometry.root file
101   Double_t               fMaxPtTrack;            //track with highest pt in event
102   Double_t               fMaxEClus;              //cluster with highest energy in event
103   Int_t                  fNCells50;              // variable to keep the number of cells with E>50 MeV
104   ULong_t                fFilterBit;             // Track selection bit, for AODs 
105   Bool_t                 fSelHybrid;             // bool to select hybrid tracks
106   Bool_t                 fFillQA;                // bool to fill the QA plots
107   TString                fClusIdFromTracks;      // string to hold the list of cluster ids given by tracks
108   Bool_t                 fCpvFromTrack;          // set the track-matching method to track->GetEMCALcluster()
109   Int_t                  fNBinsPt;               // set the number of bins in axis of histograms filled with pt (or Et)
110   Double_t               fPtBinLowEdge;          // low edge of the first pt (Et) bin
111   Double_t               fPtBinHighEdge;         // high edge of the first pt (Et) bin
112
113
114   
115  private:
116   AliESDEvent *fESD;      //! ESD object
117   AliAODEvent *fAOD;      //! AOD object
118   AliVEvent   *fVEvent;   //! AliVEvent
119   AliMCEvent  *fMCEvent;  //! MC event object
120   AliStack    *fStack;    //!MC particles stack object
121   TGeoHMatrix *fGeomMatrix[12];//! Geometry misalignment matrices for EMCal
122   TList       *fOutputList; //! Output list
123   //histograms for events with 1+ track pt>1
124   TH1F        *fEvtSel;                    //!evt selection counter: 0=all trg, 1=pv cut 
125   TH1F        *fNClusEt10;                 //!number of clusters w/ Et>10 in the event
126   TH1F        *fRecoPV;                    //!histogram to record if an event has a prim. vert.
127   TH1F        *fPVtxZ;                     //!primary vertex Z before cut
128   TH1F        *fTrMultDist;                //!track multiplicity distribution
129   TH3F        *fMCDirPhotonPtEtaPhi;       //!direct produced photon pt, eta, phi
130   TH3F        *fMCIsoDirPhotonPtEtaPhi;    //!direct produced photon pt, eta, phi, isolated @ mc level
131   TH1F        *fDecayPhotonPtMC;           //!decay photon pt
132   TH2F        *fCellAbsIdVsAmpl;           //!cell abs id vs cell amplitude (energy)
133   TH2F        *fNClusHighClusE;            //!total number of clusters vs. highest clus energy in the event
134   TH2F        *fHigherPtConeM02;           //!M02 vs. the higher pt of a track inside the cone
135   TH2F        *fClusEtMcPt;                //!cluster et x mc-pt
136   TH2F        *fClusMcDetaDphi;            //!delta-eta x delta-phi(reco-mc)
137   TH2F        *fNClusPerPho;               //!delta-eta x delta-phi(reco-mc)
138   TH2F        *fMcPtInConeBG;              //!sum of mc-pt of "primary" particles inside de cone, as a function of NET-ISO in BG template
139   TH2F        *fMcPtInConeSBG;             //!sum of mc-pt of "primary" particles inside de cone, as a function of NET-ISO in SBG range
140   TH2F        *fMcPtInConeBGnoUE;          //!sum of mc-pt of "primary" particles inside de cone, as a function of NET-ISO in BG template no UE sub
141   TH2F        *fMcPtInConeSBGnoUE;         //!sum of mc-pt of "primary" particles inside de cone, as a function of NET-ISO in SBG range no UE sub
142   TH2F        *fAllIsoEtMcGamma;           //!all iso distribution vs. Et clus for clusters comming from a MC prompt photon
143   TH2F        *fAllIsoNoUeEtMcGamma;       //!all iso distribution (without UE subtraction) vs. Et clus for clusters comming from a MC prompt photon
144   TH3F        *fMCDirPhotonPtEtaPhiNoClus; //!pt x eta x phi for prompt photons that didn't produce clusters
145   THnSparse   *fHnOutput;                  //!Output matrix with 7 dimensions
146
147   //QA histos
148   TList       *fQAList;           //!output list holding QA histos
149   TH1F        *fNTracks;          //!number of tracks from Array->GetEntries()
150   TH1F        *fEmcNCells;        //!number of emcal cells in the event
151   TH1F        *fEmcNClus;         //!# of emcal clusters
152   TH1F        *fEmcNClusCut;      //!# of clusters in an event with at least 1 clus with E > fECut ("triggered event")
153   TH1F        *fNTracksECut;      //!number of tracks from Array->GetEntries() in "triggered event"
154   TH1F        *fEmcNCellsCut;     //!number of emcal cells in a in "triggered event"
155   TH1F        *fEmcClusETM1;      //!emcal track matched cluster energy (TracDx,z method)
156   TH1F        *fEmcClusETM2;      //!emcal track matched cluster energy (track->GetEMCALcluster() method)
157   TH2F        *fEmcClusEPhi;      //!cluster E spectrum vs. phi
158   TH2F        *fEmcClusEPhiCut;   //!cluster E spectrum vs. phi in "triggered event"
159   TH2F        *fEmcClusEEta;      //!cluster E spectrum vs. eta
160   TH2F        *fEmcClusEEtaCut;   //!cluster E spectrum vs. eta in "triggered event"
161   TH2F        *fTrackPtPhi;       //!selected tracks pt vs. phi
162   TH2F        *fTrackPtPhiCut;    //!selected tracks pt vs. phi in "triggered event"
163   TH2F        *fTrackPtEta;       //!selected tracks pt vs. eta
164   TH2F        *fTrackPtEtaCut;    //!selected tracks pt vs. eta in "triggered event"
165   TH2F        *fMaxCellEPhi;      //!max cell energy vs. cell phi
166
167
168   AliAnalysisTaskEMCALIsoPhoton(const AliAnalysisTaskEMCALIsoPhoton&); // not implemented
169   AliAnalysisTaskEMCALIsoPhoton& operator=(const AliAnalysisTaskEMCALIsoPhoton&); // not implemented
170   
171   ClassDef(AliAnalysisTaskEMCALIsoPhoton, 1); // Class to analyse isolated photons
172 };
173 #endif