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