]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetTriggerQA.cxx
add multiplicity bins
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / UserTasks / AliAnalysisTaskEmcalJetTriggerQA.cxx
CommitLineData
0531c107 1//
2// Jet trigger QA analysis task.
3//
4// Author: M.Verweij
5
6#include <TClonesArray.h>
7#include <TH1F.h>
8#include <TH2F.h>
9#include <TH3F.h>
10#include <THnSparse.h>
11#include <TList.h>
12#include <TLorentzVector.h>
13
14#include "AliVCluster.h"
15#include "AliVTrack.h"
16#include "AliEmcalJet.h"
17#include "AliRhoParameter.h"
18#include "AliLog.h"
0531c107 19#include "AliEmcalParticle.h"
20#include "AliAODCaloTrigger.h"
21#include "AliEMCALGeometry.h"
22#include "AliVCaloCells.h"
9e5eee5d 23#include "AliJetContainer.h"
24#include "AliClusterContainer.h"
698f34d8 25#include "AliParticleContainer.h"
584095b1 26#include "AliEmcalTriggerPatchInfo.h"
27#include "AliAODHeader.h"
a29bc208 28#include "AliPicoTrack.h"
0531c107 29
30#include "AliAnalysisTaskEmcalJetTriggerQA.h"
31
32ClassImp(AliAnalysisTaskEmcalJetTriggerQA)
33
34//________________________________________________________________________
35AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA() :
9239b066 36 AliAnalysisTaskEmcalJet("AliAnalysisTaskEmcalJetTriggerQA", kTRUE),
0531c107 37 fDebug(kFALSE),
0531c107 38 fTriggerClass(""),
9e5eee5d 39 fContainerFull(0),
40 fContainerCharged(1),
0531c107 41 fMaxPatchEnergy(0),
42 fTriggerType(-1),
43 fNFastOR(16),
44 fhNEvents(0),
2fa783ab 45 fHistRhovsCentFull(0),
46 fHistRhovsCentCharged(0),
698f34d8 47 fh3PtEtaPhiTracks(0),
a29bc208
CL
48 fh3PtEtaPhiTracksOnEmcal(0),
49 fh3PtEtaPhiTracksProp(0),
2d9ab573 50 fh2CentPtJetFull(0),
51 fh2CentPtJetCharged(0),
0531c107 52 fh3PtEtaPhiJetFull(0),
53 fh3PtEtaPhiJetCharged(0),
54 fh2NJetsPtFull(0),
55 fh2NJetsPtCharged(0),
56 fh3PtEtaAreaJetFull(0),
57 fh3PtEtaAreaJetCharged(0),
58 fh2PtNConstituentsCharged(0),
59 fh2PtNConstituents(0),
60 fh2PtMeanPtConstituentsCharged(0),
61 fh2PtMeanPtConstituentsNeutral(0),
62 fh2PtNEF(0),
3c709670 63 fh3NEFEtaPhi(0),
64 fh2NEFNConstituentsCharged(0),
65 fh2NEFNConstituentsNeutral(0),
0531c107 66 fh2Ptz(0),
3c709670 67 fh2PtzCharged(0),
0531c107 68 fh2PtLeadJet1VsLeadJet2(0),
69 fh3EEtaPhiCluster(0),
70 fh3PtLeadJet1VsPatchEnergy(0),
71 fh3PtLeadJet2VsPatchEnergy(0),
584095b1 72 fh3PatchEnergyEtaPhiCenterJ1(0),
73 fh3PatchEnergyEtaPhiCenterJ2(0),
698f34d8
CL
74 fh3PatchEnergyEtaPhiCenterJ1J2(0),
75 fh3PatchADCEnergyEtaPhiCenterJ1(0),
76 fh3PatchADCEnergyEtaPhiCenterJ2(0),
77 fh3PatchADCEnergyEtaPhiCenterJ1J2(0),
0714a353 78 fh2CellEnergyVsTime(0),
fd08af98 79 fh3EClusELeadingCellVsTime(0),
80 fh3JetReacCent(0),
81 fh2FullJetCent(0)
0531c107 82{
83 // Default constructor.
84
0531c107 85 SetMakeGeneralHistograms(kTRUE);
86}
87
88//________________________________________________________________________
89AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA(const char *name) :
9239b066 90 AliAnalysisTaskEmcalJet(name, kTRUE),
0531c107 91 fDebug(kFALSE),
0531c107 92 fTriggerClass(""),
9e5eee5d 93 fContainerFull(0),
94 fContainerCharged(1),
0531c107 95 fMaxPatchEnergy(0),
96 fTriggerType(-1),
97 fNFastOR(16),
98 fhNEvents(0),
2fa783ab 99 fHistRhovsCentFull(0),
100 fHistRhovsCentCharged(0),
698f34d8 101 fh3PtEtaPhiTracks(0),
a29bc208
CL
102 fh3PtEtaPhiTracksOnEmcal(0),
103 fh3PtEtaPhiTracksProp(0),
2d9ab573 104 fh2CentPtJetFull(0),
105 fh2CentPtJetCharged(0),
0531c107 106 fh3PtEtaPhiJetFull(0),
107 fh3PtEtaPhiJetCharged(0),
108 fh2NJetsPtFull(0),
109 fh2NJetsPtCharged(0),
110 fh3PtEtaAreaJetFull(0),
111 fh3PtEtaAreaJetCharged(0),
112 fh2PtNConstituentsCharged(0),
113 fh2PtNConstituents(0),
114 fh2PtMeanPtConstituentsCharged(0),
115 fh2PtMeanPtConstituentsNeutral(0),
116 fh2PtNEF(0),
3c709670 117 fh3NEFEtaPhi(0),
118 fh2NEFNConstituentsCharged(0),
119 fh2NEFNConstituentsNeutral(0),
0531c107 120 fh2Ptz(0),
3c709670 121 fh2PtzCharged(0),
0531c107 122 fh2PtLeadJet1VsLeadJet2(0),
123 fh3EEtaPhiCluster(0),
124 fh3PtLeadJet1VsPatchEnergy(0),
125 fh3PtLeadJet2VsPatchEnergy(0),
584095b1 126 fh3PatchEnergyEtaPhiCenterJ1(0),
127 fh3PatchEnergyEtaPhiCenterJ2(0),
698f34d8
CL
128 fh3PatchEnergyEtaPhiCenterJ1J2(0),
129 fh3PatchADCEnergyEtaPhiCenterJ1(0),
130 fh3PatchADCEnergyEtaPhiCenterJ2(0),
131 fh3PatchADCEnergyEtaPhiCenterJ1J2(0),
0714a353 132 fh2CellEnergyVsTime(0),
fd08af98 133 fh3EClusELeadingCellVsTime(0),
134 fh3JetReacCent(0),
135 fh2FullJetCent(0)
0531c107 136{
137 // Standard constructor.
138
139 SetMakeGeneralHistograms(kTRUE);
140}
141
142//________________________________________________________________________
143AliAnalysisTaskEmcalJetTriggerQA::~AliAnalysisTaskEmcalJetTriggerQA()
144{
145 // Destructor.
fd08af98 146 if (fOutput) {
147 delete fOutput; // delete output object list
148 fOutput = 0;
149 }
150
0531c107 151}
152
0531c107 153//________________________________________________________________________
154Bool_t AliAnalysisTaskEmcalJetTriggerQA::SelectEvent() {
155 //
156 // Decide if event should be selected for analysis
157 //
158
0531c107 159 fhNEvents->Fill(3.5);
160
161 if(!fTriggerClass.IsNull()) {
162 //Check if requested trigger was fired
8a468ef1 163 TString trigType1 = "J1";
164 TString trigType2 = "J2";
165 if(fTriggerClass.Contains("G")) {
166 trigType1 = "G1";
167 trigType1 = "G2";
168 }
169
0531c107 170 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
8a468ef1 171 if(fTriggerClass.Contains(trigType1.Data()) && fTriggerClass.Contains(trigType2.Data())) { //if events with J1&&J2 are requested
172 if(!firedTrigClass.Contains(trigType1.Data()) || !firedTrigClass.Contains(trigType2.Data()) ) //check if both are fired
698f34d8 173 return kFALSE;
24f63577 174 }
2dba7c4c
MV
175 else {
176 if(!firedTrigClass.Contains(fTriggerClass))
177 return kFALSE;
8a468ef1 178 else if(fTriggerClass.Contains(trigType1.Data()) && firedTrigClass.Contains(trigType2.Data())) //if J2 is requested also add triggers which have J1&&J2. Reject if J1 is requested and J2 is fired
2dba7c4c
MV
179 return kFALSE;
180 }
0531c107 181 }
0531c107 182 fhNEvents->Fill(1.5);
183
184 return kTRUE;
0531c107 185}
186
187//________________________________________________________________________
2d9ab573 188void AliAnalysisTaskEmcalJetTriggerQA::FillTriggerPatchHistos() {
0531c107 189
2dba7c4c 190 //Fill trigger patch histos for main trigger
0531c107 191
584095b1 192 AliEmcalTriggerPatchInfo *patch = GetMainTriggerPatch();
193 if(patch) {
194 fMaxPatchEnergy = patch->GetPatchE();
698f34d8 195 Double_t patchADCGeV = patch->GetADCAmpGeVRough();
2dba7c4c 196 if(patch->IsJetLow() && !patch->IsJetHigh()) { //main patch only fired low threshold trigger
584095b1 197 fh3PatchEnergyEtaPhiCenterJ2->Fill(patch->GetPatchE(),patch->GetEtaGeo(),patch->GetPhiGeo());
698f34d8
CL
198 fh3PatchADCEnergyEtaPhiCenterJ2->Fill(patchADCGeV,patch->GetEtaGeo(),patch->GetPhiGeo());
199 }
2dba7c4c 200 else if(patch->IsJetHigh() && !patch->IsJetLow()) { //main patch only fired high threshold trigger - should never happen
584095b1 201 fh3PatchEnergyEtaPhiCenterJ1->Fill(patch->GetPatchE(),patch->GetEtaGeo(),patch->GetPhiGeo());
698f34d8
CL
202 fh3PatchADCEnergyEtaPhiCenterJ1->Fill(patchADCGeV,patch->GetEtaGeo(),patch->GetPhiGeo());
203 }
2dba7c4c 204 else if(patch->IsJetHigh() && patch->IsJetLow()) { //main patch fired both triggers
698f34d8
CL
205 fh3PatchEnergyEtaPhiCenterJ1J2->Fill(patch->GetPatchE(),patch->GetEtaGeo(),patch->GetPhiGeo());
206 fh3PatchADCEnergyEtaPhiCenterJ1J2->Fill(patchADCGeV,patch->GetEtaGeo(),patch->GetPhiGeo());
207 }
584095b1 208 }
0531c107 209}
210
0531c107 211//________________________________________________________________________
212void AliAnalysisTaskEmcalJetTriggerQA::UserCreateOutputObjects()
213{
214 // Create user output.
215
9239b066 216 AliAnalysisTaskEmcalJet::UserCreateOutputObjects();
0531c107 217
218 Bool_t oldStatus = TH1::AddDirectoryStatus();
219 TH1::AddDirectory(kFALSE);
220
221 fhNEvents = new TH1F("fhNEvents","fhNEvents;selection;N_{evt}",5,0,5);
222 fOutput->Add(fhNEvents);
223
2fa783ab 224 fHistRhovsCentFull = new TH2F("fHistRhovsCentFull", "fHistRhovsCentFull", 101, -1, 100, 300, 0., 300.);
225 fHistRhovsCentFull->GetXaxis()->SetTitle("Centrality (%)");
226 fHistRhovsCentFull->GetYaxis()->SetTitle("s#rho_{ch} (GeV/c * rad^{-1})");
227 fOutput->Add(fHistRhovsCentFull);
228
229 fHistRhovsCentCharged = new TH2F("fHistRhovsCentCharged", "fHistRhovsCentCharged", 101, -1, 100, 300, 0., 300.);
230 fHistRhovsCentCharged->GetXaxis()->SetTitle("Centrality (%)");
231 fHistRhovsCentCharged->GetYaxis()->SetTitle("#rho_{ch} (GeV/c * rad^{-1})");
232 fOutput->Add(fHistRhovsCentCharged);
fd08af98 233
2d9ab573 234 Int_t fgkNCentBins = 21;
fd08af98 235 Float_t kMinCent = 0.;
2d9ab573 236 Float_t kMaxCent = 105.;
fd08af98 237 Double_t *binsCent = new Double_t[fgkNCentBins+1];
238 for(Int_t i=0; i<=fgkNCentBins; i++) binsCent[i]=(Double_t)kMinCent + (kMaxCent-kMinCent)/fgkNCentBins*(Double_t)i ;
239
240 Int_t fgkNdEPBins = 18*8;
241 Float_t kMindEP = 0.;
242 Float_t kMaxdEP = 1.*TMath::Pi()/2.;
243 Double_t *binsdEP = new Double_t[fgkNdEPBins+1];
244 for(Int_t i=0; i<=fgkNdEPBins; i++) binsdEP[i]=(Double_t)kMindEP + (kMaxdEP-kMindEP)/fgkNdEPBins*(Double_t)i ;
2fa783ab 245
8e49a788 246 Int_t fgkNPtBins = 200;
247 Float_t kMinPt = -50.;
584095b1 248 Float_t kMaxPt = 150.;
249 Double_t *binsPt = new Double_t[fgkNPtBins+1];
250 for(Int_t i=0; i<=fgkNPtBins; i++) binsPt[i]=(Double_t)kMinPt + (kMaxPt-kMinPt)/fgkNPtBins*(Double_t)i ;
251
2dba7c4c 252 Int_t fgkNPhiBins = 18*8;
584095b1 253 Float_t kMinPhi = 0.;
254 Float_t kMaxPhi = 2.*TMath::Pi();
255 Double_t *binsPhi = new Double_t[fgkNPhiBins+1];
256 for(Int_t i=0; i<=fgkNPhiBins; i++) binsPhi[i]=(Double_t)kMinPhi + (kMaxPhi-kMinPhi)/fgkNPhiBins*(Double_t)i ;
257
258 Int_t fgkNEtaBins = 100;
259 Float_t fgkEtaMin = -1.;
260 Float_t fgkEtaMax = 1.;
261 Double_t *binsEta=new Double_t[fgkNEtaBins+1];
262 for(Int_t i=0; i<=fgkNEtaBins; i++) binsEta[i]=(Double_t)fgkEtaMin + (fgkEtaMax-fgkEtaMin)/fgkNEtaBins*(Double_t)i ;
263
264 Int_t fgkNAreaBins = 100;
265 Float_t kMinArea = 0.;
266 Float_t kMaxArea = 1.;
267 Double_t *binsArea = new Double_t[fgkNAreaBins+1];
268 for(Int_t i=0; i<=fgkNAreaBins; i++) binsArea[i]=(Double_t)kMinArea + (kMaxArea-kMinArea)/fgkNAreaBins*(Double_t)i ;
269
270 Int_t fgkNConstBins = 100;
271 Float_t kMinConst = 0.;
272 Float_t kMaxConst = 100.;
273 Double_t *binsConst = new Double_t[fgkNConstBins+1];
274 for(Int_t i=0; i<=fgkNConstBins; i++) binsConst[i]=(Double_t)kMinConst + (kMaxConst-kMinConst)/fgkNConstBins*(Double_t)i ;
275
6c90d6c8 276 Int_t fgkNMeanPtBins = 100;
584095b1 277 Float_t kMinMeanPt = 0.;
278 Float_t kMaxMeanPt = 20.;
279 Double_t *binsMeanPt = new Double_t[fgkNMeanPtBins+1];
280 for(Int_t i=0; i<=fgkNMeanPtBins; i++) binsMeanPt[i]=(Double_t)kMinMeanPt + (kMaxMeanPt-kMinMeanPt)/fgkNMeanPtBins*(Double_t)i ;
281
282 Int_t fgkNNEFBins = 101;
283 Float_t kMinNEF = 0.;
284 Float_t kMaxNEF = 1.01;
285 Double_t *binsNEF = new Double_t[fgkNNEFBins+1];
286 for(Int_t i=0; i<=fgkNNEFBins; i++) binsNEF[i]=(Double_t)kMinNEF + (kMaxNEF-kMinNEF)/fgkNNEFBins*(Double_t)i ;
287
288 Int_t fgkNzBins = 101;
289 Float_t kMinz = 0.;
290 Float_t kMaxz = 1.01;
291 Double_t *binsz = new Double_t[fgkNzBins+1];
292 for(Int_t i=0; i<=fgkNzBins; i++) binsz[i]=(Double_t)kMinz + (kMaxz-kMinz)/fgkNzBins*(Double_t)i ;
293
294 Int_t fgkNJetTypeBins = 2;
295 Float_t kMinJetType = -0.5;
296 Float_t kMaxJetType = 1.5;
297 Double_t *binsJetType = new Double_t[fgkNJetTypeBins+1];
298 for(Int_t i=0; i<=fgkNJetTypeBins; i++) binsJetType[i]=(Double_t)kMinJetType + (kMaxJetType-kMinJetType)/fgkNJetTypeBins*(Double_t)i ;
299
1e2a9888 300 Int_t fgkNTimeBins = 100;
301 Float_t kMinTime = -200.;
302 Float_t kMaxTime = 200;
584095b1 303 Double_t *binsTime = new Double_t[fgkNTimeBins+1];
304 for(Int_t i=0; i<=fgkNTimeBins; i++) binsTime[i]=(Double_t)kMinTime + (kMaxTime-kMinTime)/fgkNTimeBins*(Double_t)i ;
305
306 Double_t enBinEdges[3][2];
307 enBinEdges[0][0] = 1.; //10 bins
308 enBinEdges[0][1] = 0.1;
309 enBinEdges[1][0] = 5.; //8 bins
310 enBinEdges[1][1] = 0.5;
311 enBinEdges[2][0] = 100.;//95 bins
312 enBinEdges[2][1] = 1.;
313
314 const Float_t enmin1 = 0;
315 const Float_t enmax1 = enBinEdges[0][0];
316 const Float_t enmin2 = enmax1 ;
317 const Float_t enmax2 = enBinEdges[1][0];
318 const Float_t enmin3 = enmax2 ;
319 const Float_t enmax3 = enBinEdges[2][0];//fgkEnMax;
320 const Int_t nbin11 = (int)((enmax1-enmin1)/enBinEdges[0][1]);
321 const Int_t nbin12 = (int)((enmax2-enmin2)/enBinEdges[1][1])+nbin11;
322 const Int_t nbin13 = (int)((enmax3-enmin3)/enBinEdges[2][1])+nbin12;
323
324 Int_t fgkNEnBins=nbin13;
325 Double_t *binsEn=new Double_t[fgkNEnBins+1];
326 for(Int_t i=0; i<=fgkNEnBins; i++) {
327 if(i<=nbin11) binsEn[i]=(Double_t)enmin1 + (enmax1-enmin1)/nbin11*(Double_t)i ;
328 if(i<=nbin12 && i>nbin11) binsEn[i]=(Double_t)enmin2 + (enmax2-enmin2)/(nbin12-nbin11)*((Double_t)i-(Double_t)nbin11) ;
329 if(i<=nbin13 && i>nbin12) binsEn[i]=(Double_t)enmin3 + (enmax3-enmin3)/(nbin13-nbin12)*((Double_t)i-(Double_t)nbin12) ;
330 }
331
698f34d8
CL
332 fh3PtEtaPhiTracks = new TH3F("fh3PtEtaPhiTracks","fh3PtEtaPhiTracks;#it{p}_{T}^{track};#eta;#varphi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
333 fOutput->Add(fh3PtEtaPhiTracks);
584095b1 334
a29bc208
CL
335 fh3PtEtaPhiTracksOnEmcal = new TH3F("fh3PtEtaPhiTracksOnEmcal","fh3PtEtaPhiTracksOnEmcal;#it{p}_{T}^{track};#eta;#varphi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
336 fOutput->Add(fh3PtEtaPhiTracksOnEmcal);
337
338 fh3PtEtaPhiTracksProp = new TH3F("fh3PtEtaPhiTracksProp","fh3PtEtaPhiTracksProp;#it{p}_{T}^{track};#eta;#varphi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
339 fOutput->Add(fh3PtEtaPhiTracksProp);
340
2d9ab573 341 fh2CentPtJetFull = new TH2F("fh2CentPtJetFull","fh2CentPtJetFull;cent;#it{p}_{T}^{jet}",fgkNCentBins,binsCent,fgkNPtBins,binsPt);
342 fOutput->Add(fh2CentPtJetFull);
343
344 fh2CentPtJetCharged = new TH2F("fh2CentPtJetCharged","fh2CentPtJetCharged;cent;#it{p}_{T}^{jet}",fgkNCentBins,binsCent,fgkNPtBins,binsPt);
345 fOutput->Add(fh2CentPtJetCharged);
346
584095b1 347 fh3PtEtaPhiJetFull = new TH3F("fh3PtEtaPhiJetFull","fh3PtEtaPhiJetFull;#it{p}_{T}^{jet};#eta;#varphi",fgkNPtBins,binsPt,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
0531c107 348 fOutput->Add(fh3PtEtaPhiJetFull);
349
584095b1 350 fh3PtEtaPhiJetCharged = new TH3F("fh3PtEtaPhiJetCharged","fh3PtEtaPhiJetCharged;#it{p}_{T}^{jet};#eta;#varphi",fgkNPtBins,binsPt,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
0531c107 351 fOutput->Add(fh3PtEtaPhiJetCharged);
352
584095b1 353 fh2NJetsPtFull = new TH2F("fh2NJetsPtFull","fh2NJetsPtFull;N_{jets};#it{p}_{T}^{jet}",20,-0.5,19.5,fgkNPtBins,binsPt);
0531c107 354 fOutput->Add(fh2NJetsPtFull);
355
584095b1 356 fh2NJetsPtCharged = new TH2F("fh2NJetsPtCharged","fh2NJetsPtCharged;N_{jets};#it{p}_{T}^{jet}",20,-0.5,19.5,fgkNPtBins,binsPt);
0531c107 357 fOutput->Add(fh2NJetsPtCharged);
358
584095b1 359 fh3PtEtaAreaJetFull = new TH3F("fh3PtEtaAreaJetFull","fh3PtEtaAreaJetFull;#it{p}_{T}^{jet};#eta;A",fgkNPtBins,binsPt,fgkNEtaBins,binsEta,fgkNAreaBins,binsArea);
0531c107 360 fOutput->Add(fh3PtEtaAreaJetFull);
361
584095b1 362 fh3PtEtaAreaJetCharged = new TH3F("fh3PtEtaAreaJetCharged","fh3PtEtaAreaJetCharged;#it{p}_{T}^{jet};#eta;A",fgkNPtBins,binsPt,fgkNEtaBins,binsEta,fgkNAreaBins,binsArea);
0531c107 363 fOutput->Add(fh3PtEtaAreaJetCharged);
364
584095b1 365 fh2PtNConstituentsCharged = new TH2F("fh2PtNConstituentsCharged","fh2PtNConstituentsCharged;#it{p}_{T}^{jet};N_{charged constituents}",fgkNPtBins,binsPt,fgkNConstBins,binsConst);
0531c107 366 fOutput->Add(fh2PtNConstituentsCharged);
367
584095b1 368 fh2PtNConstituents = new TH2F("fh2PtNConstituents","fh2PtNConstituents;#it{p}_{T}^{jet};N_{constituents}",fgkNPtBins,binsPt,fgkNConstBins,binsConst);
0531c107 369 fOutput->Add(fh2PtNConstituents);
370
584095b1 371 fh2PtMeanPtConstituentsCharged = new TH2F("fh2PtMeanPtConstituentsCharged","fh2PtMeanPtConstituentsCharged;#it{p}_{T}^{jet};charged #langle #it{p}_{T} #rangle",fgkNPtBins,binsPt,fgkNMeanPtBins,binsMeanPt);
0531c107 372 fOutput->Add(fh2PtMeanPtConstituentsCharged);
373
584095b1 374 fh2PtMeanPtConstituentsNeutral = new TH2F("fh2PtMeanPtConstituentsNeutral","fh2PtMeanPtConstituentsNeutral;#it{p}_{T}^{jet};neutral langle #it{p}_{T} #rangle",fgkNPtBins,binsPt,fgkNMeanPtBins,binsMeanPt);
0531c107 375 fOutput->Add(fh2PtMeanPtConstituentsNeutral);
376
584095b1 377 fh2PtNEF = new TH2F("fh2PtNEF","fh2PtNEF;#it{p}_{T}^{jet};NEF",fgkNPtBins,binsPt,fgkNNEFBins,binsNEF);
0531c107 378 fOutput->Add(fh2PtNEF);
379
584095b1 380 fh3NEFEtaPhi = new TH3F("fh3NEFEtaPhi","fh3NEFEtaPhi;NEF;#eta;#varphi",fgkNNEFBins,binsNEF,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
3c709670 381 fOutput->Add(fh3NEFEtaPhi);
382
584095b1 383 fh2NEFNConstituentsCharged = new TH2F("fh2NEFNConstituentsCharged","fh2NEFNConstituentsCharged;NEF;N_{charged constituents}",fgkNNEFBins,binsNEF,fgkNConstBins,binsConst);
3c709670 384 fOutput->Add(fh2NEFNConstituentsCharged);
385
584095b1 386 fh2NEFNConstituentsNeutral = new TH2F("fh2NEFNConstituentsNeutral","fh2NEFNConstituentsNeutral;NEF;N_{clusters}",fgkNNEFBins,binsNEF,fgkNConstBins,binsConst);
3c709670 387 fOutput->Add(fh2NEFNConstituentsNeutral);
388
584095b1 389 fh2Ptz = new TH2F("fh2Ptz","fh2Ptz;#it{p}_{T}^{jet};z=p_{t,trk}^{proj}/p_{jet}",fgkNPtBins,binsPt,fgkNzBins,binsz);
0531c107 390 fOutput->Add(fh2Ptz);
391
584095b1 392 fh2PtzCharged = new TH2F("fh2PtzCharged","fh2Ptz;#it{p}_{T}^{ch jet};z=p_{t,trk}^{proj}/p_{ch jet}",fgkNPtBins,binsPt,fgkNzBins,binsz);
3c709670 393 fOutput->Add(fh2PtzCharged);
394
584095b1 395 fh2PtLeadJet1VsLeadJet2 = new TH2F("fh2PtLeadJet1VsLeadJet2","fh2PtLeadJet1VsLeadJet2;#it{p}_{T}^{jet 1};#it{p}_{T}^{jet 2}",fgkNPtBins,binsPt,fgkNPtBins,binsPt);
0531c107 396 fOutput->Add(fh2PtLeadJet1VsLeadJet2);
397
584095b1 398 fh3EEtaPhiCluster = new TH3F("fh3EEtaPhiCluster","fh3EEtaPhiCluster;E_{clus};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
0531c107 399 fOutput->Add(fh3EEtaPhiCluster);
400
584095b1 401 fh3PtLeadJet1VsPatchEnergy = new TH3F("fh3PtLeadJet1VsPatchEnergy","fh3PtLeadJet1VsPatchEnergy;#it{p}_{T}^{jet 1};Amplitude_{patch};trig type",fgkNPtBins,binsPt,fgkNPtBins,binsPt,fgkNJetTypeBins,binsJetType);
0531c107 402 fOutput->Add(fh3PtLeadJet1VsPatchEnergy);
584095b1 403 fh3PtLeadJet2VsPatchEnergy = new TH3F("fh3PtLeadJet2VsPatchEnergy","fh3PtLeadJet2VsPatchEnergy;#it{p}_{T}^{jet 1};Amplitude_{patch};trig type",fgkNPtBins,binsPt,fgkNPtBins,binsPt,fgkNJetTypeBins,binsJetType);
0531c107 404 fOutput->Add(fh3PtLeadJet2VsPatchEnergy);
405
2dba7c4c 406 fh3PatchEnergyEtaPhiCenterJ1 = new TH3F("fh3PatchEnergyEtaPhiCenterJ1","fh3PatchEnergyEtaPhiCenterJ1;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
584095b1 407 fOutput->Add(fh3PatchEnergyEtaPhiCenterJ1);
408
2dba7c4c 409 fh3PatchEnergyEtaPhiCenterJ2 = new TH3F("fh3PatchEnergyEtaPhiCenterJ2","fh3PatchEnergyEtaPhiCenterJ2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
584095b1 410 fOutput->Add(fh3PatchEnergyEtaPhiCenterJ2);
0531c107 411
2dba7c4c 412 fh3PatchEnergyEtaPhiCenterJ1J2 = new TH3F("fh3PatchEnergyEtaPhiCenterJ1J2","fh3PatchEnergyEtaPhiCenterJ1J2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
698f34d8
CL
413 fOutput->Add(fh3PatchEnergyEtaPhiCenterJ1J2);
414
2dba7c4c 415 fh3PatchADCEnergyEtaPhiCenterJ1 = new TH3F("fh3PatchADCEnergyEtaPhiCenterJ1","fh3PatchADCEnergyEtaPhiCenterJ1;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
698f34d8
CL
416 fOutput->Add(fh3PatchADCEnergyEtaPhiCenterJ1);
417
2dba7c4c 418 fh3PatchADCEnergyEtaPhiCenterJ2 = new TH3F("fh3PatchADCEnergyEtaPhiCenterJ2","fh3PatchADCEnergyEtaPhiCenterJ2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
698f34d8
CL
419 fOutput->Add(fh3PatchADCEnergyEtaPhiCenterJ2);
420
2dba7c4c 421 fh3PatchADCEnergyEtaPhiCenterJ1J2 = new TH3F("fh3PatchADCEnergyEtaPhiCenterJ1J2","fh3PatchADCEnergyEtaPhiCenterJ1J2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
698f34d8
CL
422 fOutput->Add(fh3PatchADCEnergyEtaPhiCenterJ1J2);
423
584095b1 424 fh2CellEnergyVsTime = new TH2F("fh2CellEnergyVsTime","fh2CellEnergyVsTime;E_{cell};time",fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
992189ac 425 fOutput->Add(fh2CellEnergyVsTime);
426
584095b1 427 fh3EClusELeadingCellVsTime = new TH3F("fh3EClusELeadingCellVsTime","fh3EClusELeadingCellVsTime;E_{cluster};E_{leading cell};time_{leading cell}",fgkNEnBins,binsEn,fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
0714a353 428 fOutput->Add(fh3EClusELeadingCellVsTime);
fd08af98 429
430 fh3JetReacCent = new TH3F("fh3JetReacCent","fh3JetReacCent;E_{Jet};Centrality;dEP",fgkNEnBins,binsEn,fgkNCentBins,binsCent,fgkNdEPBins,binsdEP);
431 fOutput->Add(fh3JetReacCent);
432
433 fh2FullJetCent = new TH2F("fh2FullJetCent","fh2FullJetCent;Centrality;dEP",fgkNCentBins,binsCent,fgkNdEPBins,binsdEP);
434 fOutput->Add(fh2FullJetCent);
0714a353 435
0531c107 436
437 // =========== Switch on Sumw2 for all histos ===========
438 for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
439 TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
440 if (h1){
441 h1->Sumw2();
442 continue;
443 }
444 TH2 *h2 = dynamic_cast<TH2*>(fOutput->At(i));
445 if (h2){
446 h2->Sumw2();
447 continue;
448 }
449 TH3 *h3 = dynamic_cast<TH3*>(fOutput->At(i));
450 if (h3){
451 h3->Sumw2();
452 continue;
453 }
454 THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
455 if(hn)hn->Sumw2();
456 }
457
458 TH1::AddDirectory(oldStatus);
459
460 PostData(1, fOutput); // Post data for ALL output slots > 0 here.
584095b1 461
fd08af98 462 if(binsCent) delete [] binsCent;
463 if(binsdEP) delete [] binsdEP;
584095b1 464 if(binsEn) delete [] binsEn;
465 if(binsPt) delete [] binsPt;
466 if(binsPhi) delete [] binsPhi;
467 if(binsEta) delete [] binsEta;
468 if(binsArea) delete [] binsArea;
469 if(binsConst) delete [] binsConst;
470 if(binsMeanPt) delete [] binsMeanPt;
471 if(binsNEF) delete [] binsNEF;
472 if(binsz) delete [] binsz;
473 if(binsJetType) delete [] binsJetType;
474 if(binsTime) delete [] binsTime;
475
0531c107 476}
477
478//________________________________________________________________________
479Bool_t AliAnalysisTaskEmcalJetTriggerQA::FillHistograms()
480{
481 // Fill histograms.
9e5eee5d 482
2dba7c4c 483 //Tracks
698f34d8
CL
484 AliParticleContainer *partCont = GetParticleContainer(0);
485 if (partCont) {
a29bc208 486 Int_t i = 0;
a29bc208 487 AliPicoTrack *track = dynamic_cast<AliPicoTrack*>(partCont->GetNextAcceptParticle(0));
698f34d8 488 while(track) {
1e2a9888 489 Double_t trkphi = track->Phi()*TMath::RadToDeg();
490 fh3PtEtaPhiTracks->Fill(track->Pt(),track->Eta(),track->Phi());
2dba7c4c 491 fh3PtEtaPhiTracksOnEmcal->Fill(track->GetTrackPtOnEMCal(),track->GetTrackEtaOnEMCal(),track->GetTrackPhiOnEMCal());
1e2a9888 492 if(track->IsEMCAL()) {
493 i++;
1e2a9888 494 if(TMath::Abs(track->Eta())<0.9 && trkphi > 10 && trkphi < 250 )
495 fh3PtEtaPhiTracksProp->Fill(track->Pt(),track->Eta(),track->Phi());
496 }
a29bc208 497 track = dynamic_cast<AliPicoTrack*>(partCont->GetNextAcceptParticle());
698f34d8
CL
498 }
499 }
500
2dba7c4c 501 //Clusters
0714a353 502 AliClusterContainer *clusCont = GetClusterContainer(0);
9e5eee5d 503 if (clusCont) {
504 Int_t nclusters = clusCont->GetNClusters();
0531c107 505 for (Int_t ic = 0; ic < nclusters; ic++) {
9e5eee5d 506 AliVCluster *cluster = static_cast<AliVCluster*>(clusCont->GetCluster(ic));
0531c107 507 if (!cluster) {
0714a353 508 AliDebug(2,Form("Could not receive cluster %d", ic));
0531c107 509 continue;
510 }
9e5eee5d 511 if (!cluster->IsEMCAL()) {
0714a353 512 AliDebug(2,Form("%s: Cluster is not emcal",GetName()));
9e5eee5d 513 continue;
514 }
0531c107 515
516 TLorentzVector lp;
517 cluster->GetMomentum(lp, const_cast<Double_t*>(fVertex));
0531c107 518 fh3EEtaPhiCluster->Fill(lp.E(),lp.Eta(),lp.Phi());
0714a353 519 if(fCaloCells) {
520 Double_t leadCellE = GetEnergyLeadingCell(cluster);
8e49a788 521 Double_t leadCellT = cluster->GetTOF();
0714a353 522 fh3EClusELeadingCellVsTime->Fill(lp.E(),leadCellE,leadCellT*1e9);
523 }
0531c107 524 }
525 }
526
2d9ab573 527 //Cells
992189ac 528 if(fCaloCells) {
529 const Short_t nCells = fCaloCells->GetNumberOfCells();
530
531 for(Int_t iCell=0; iCell<nCells; ++iCell) {
532 Short_t cellId = fCaloCells->GetCellNumber(iCell);
533 Double_t cellE = fCaloCells->GetCellAmplitude(cellId);
534 Double_t cellT = fCaloCells->GetCellTime(cellId);
535
536 AliDebug(2,Form("cell energy = %f time = %f",cellE,cellT*1e9));
537 fh2CellEnergyVsTime->Fill(cellE,cellT*1e9);
992189ac 538 }
992189ac 539 }
540
2fa783ab 541 //Jets
0531c107 542 Double_t ptLeadJet1 = 0.;
543 Double_t ptLeadJet2 = 0.;
2fa783ab 544
545 fHistRhovsCentFull->Fill(fCent,GetRhoVal(fContainerFull));
546 fHistRhovsCentCharged->Fill(fCent,GetRhoVal(fContainerCharged));
0531c107 547
548 TArrayI *nJetsArr = new TArrayI(fh2NJetsPtFull->GetNbinsY()+1);
549 nJetsArr->Reset(0);
550 nJetsArr->Set(fh2NJetsPtFull->GetNbinsY()+1);
551
9e5eee5d 552 if (GetJetContainer(fContainerFull)) {
553 const Int_t njets = GetNJets(fContainerFull);
0531c107 554 for (Int_t ij = 0; ij < njets; ij++) {
555
9e5eee5d 556 AliEmcalJet* jet = GetAcceptJetFromArray(ij,fContainerFull);
557 if (!jet)
558 continue; //jet not selected
2d9ab573 559
8e49a788 560 Double_t jetPt = jet->Pt() - GetRhoVal(fContainerFull)*jet->Area();
2d9ab573 561 if(jetPt>ptLeadJet1) ptLeadJet1=jetPt;
562
563 Double_t dEPJetFull = RelativeEP(jet->Phi() , fEPV0);
fd08af98 564 fh3JetReacCent->Fill(jet->E(),fCent,dEPJetFull);
565 fh2FullJetCent->Fill(fCent,dEPJetFull);
566
2d9ab573 567 fh2CentPtJetFull->Fill(fCent,jetPt);
568 fh2CentPtJetCharged->Fill(fCent,jetPt);
0531c107 569 fh3PtEtaPhiJetFull->Fill(jetPt,jet->Eta(),jet->Phi());
570 fh3PtEtaAreaJetFull->Fill(jetPt,jet->Eta(),jet->Area());
2d9ab573 571
0531c107 572 //count jets above certain pT threshold
573 Int_t ptbin = fh2NJetsPtFull->GetYaxis()->FindBin(jetPt);
574 for(Int_t iptbin = ptbin; iptbin<=fh2NJetsPtFull->GetNbinsY(); iptbin++)
575 nJetsArr->AddAt(nJetsArr->At(iptbin)+1,iptbin);
576
577 fh2PtNConstituentsCharged->Fill(jetPt,jet->GetNumberOfTracks());
578 fh2PtNConstituents->Fill(jetPt,jet->GetNumberOfConstituents());
0531c107 579 fh2PtNEF->Fill(jetPt,jet->NEF());
3c709670 580 fh3NEFEtaPhi->Fill(jet->NEF(),jet->Eta(),jet->Phi());
581 fh2NEFNConstituentsCharged->Fill(jet->NEF(),jet->GetNumberOfTracks());
582 fh2NEFNConstituentsNeutral->Fill(jet->NEF(),jet->GetNumberOfClusters());
0531c107 583
584 AliVParticle *vp;
585 Double_t sumPtCh = 0.;
586 for(Int_t icc=0; icc<jet->GetNumberOfTracks(); icc++) {
587 vp = static_cast<AliVParticle*>(jet->TrackAt(icc, fTracks));
588 if(!vp) continue;
589 fh2Ptz->Fill(jetPt,GetZ(vp,jet));
0531c107 590 sumPtCh+=vp->Pt();
0531c107 591 }
592
593 if(jet->GetNumberOfTracks()>0)
594 fh2PtMeanPtConstituentsCharged->Fill(jetPt,sumPtCh/(double)(jet->GetNumberOfTracks()) );
595
0531c107 596 AliVCluster *vc = 0x0;
597 Double_t sumPtNe = 0.;
9e5eee5d 598 if (clusCont) {
599 for(Int_t icc=0; icc<jet->GetNumberOfClusters(); icc++) {
600 vc = static_cast<AliVCluster*>(clusCont->GetCluster(icc));
601 if(!vc) continue;
9e5eee5d 602 TLorentzVector lp;
603 vc->GetMomentum(lp, const_cast<Double_t*>(fVertex));
604 sumPtNe+=lp.Pt();
9e5eee5d 605 }
0531c107 606
9e5eee5d 607 if(jet->GetNumberOfClusters()>0)
608 fh2PtMeanPtConstituentsNeutral->Fill(jetPt,sumPtNe/(double)(jet->GetNumberOfClusters()) );
0531c107 609 }
0531c107 610 } //full jet loop
611
612 for(Int_t i=1; i<=fh2NJetsPtFull->GetNbinsY(); i++) {
613 Int_t nJetsInEvent = nJetsArr->At(i);
614 fh2NJetsPtFull->Fill(nJetsInEvent,fh2NJetsPtFull->GetYaxis()->GetBinCenter(i));
615 }
0531c107 616 }
617
618 //Reset array to zero to also count charged jets
619 nJetsArr->Reset(0);
620
621 //Loop over charged jets
9e5eee5d 622 if (GetJetContainer(fContainerCharged)) {
623 const Int_t njets = GetNJets(fContainerCharged);
624 for (Int_t ij = 0; ij < njets; ij++) {
0531c107 625
9e5eee5d 626 AliEmcalJet* jet = GetAcceptJetFromArray(ij,fContainerCharged);
627 if (!jet)
628 continue; //jet not selected
0531c107 629
8612dfc8 630 Double_t jetPt = jet->Pt() - GetRhoVal(fContainerCharged)*jet->Area();
0531c107 631 if(jetPt>ptLeadJet2) ptLeadJet2=jetPt;
632 fh3PtEtaPhiJetCharged->Fill(jetPt,jet->Eta(),jet->Phi());
633 fh3PtEtaAreaJetCharged->Fill(jetPt,jet->Eta(),jet->Area());
3c709670 634
635 AliVParticle *vp;
636 for(Int_t icc=0; icc<jet->GetNumberOfTracks(); icc++) {
637 vp = static_cast<AliVParticle*>(jet->TrackAt(icc, fTracks));
638 if(!vp) continue;
639 fh2PtzCharged->Fill(jetPt,GetZ(vp,jet));
640 }
0531c107 641
642 //count jets above certain pT threshold
643 Int_t ptbin = fh2NJetsPtCharged->GetYaxis()->FindBin(jetPt);
644 for(Int_t iptbin = ptbin; iptbin<=fh2NJetsPtCharged->GetNbinsY(); iptbin++)
645 nJetsArr->AddAt(nJetsArr->At(iptbin)+1,iptbin);
646
647 }//ch jet loop
648 for(Int_t i=1; i<=fh2NJetsPtCharged->GetNbinsY(); i++) {
649 Int_t nJetsInEvent = nJetsArr->At(i);
650 fh2NJetsPtCharged->Fill(nJetsInEvent,fh2NJetsPtCharged->GetYaxis()->GetBinCenter(i));
651 }
652 }
653
9e5eee5d 654 if(GetJetContainer(fContainerFull) && GetJetContainer(fContainerCharged)) {
0531c107 655 fh2PtLeadJet1VsLeadJet2->Fill(ptLeadJet1,ptLeadJet2);
656 }
657
658 fh3PtLeadJet1VsPatchEnergy->Fill(ptLeadJet1,fMaxPatchEnergy,fTriggerType);
659 fh3PtLeadJet2VsPatchEnergy->Fill(ptLeadJet2,fMaxPatchEnergy,fTriggerType);
660
661 if(nJetsArr) delete nJetsArr;
662
663 return kTRUE;
664}
665
666//________________________________________________________________________
667Bool_t AliAnalysisTaskEmcalJetTriggerQA::Run()
668{
669 // Run analysis code here, if needed. It will be executed before FillHistograms().
670
671 //Check if event is selected (vertex & pile-up)
672 if(!SelectEvent())
673 return kFALSE;
674
698f34d8 675 if(fTriggerPatchInfo)
2d9ab573 676 FillTriggerPatchHistos();
0531c107 677
678 return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
679}
680
681//_______________________________________________________________________
682void AliAnalysisTaskEmcalJetTriggerQA::Terminate(Option_t *)
683{
684 // Called once at the end of the analysis.
685}
686//________________________________________________________________________
687Double_t AliAnalysisTaskEmcalJetTriggerQA::GetZ(const AliVParticle *trk, const AliEmcalJet *jet) const
688{
689 // Get Z of constituent trk
0531c107 690 return GetZ(trk->Px(),trk->Py(),trk->Pz(),jet->Px(),jet->Py(),jet->Pz());
691}
692
693//________________________________________________________________________
694Double_t AliAnalysisTaskEmcalJetTriggerQA::GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz, const Double_t jetPx, const Double_t jetPy, const Double_t jetPz) const
695{
696 //
697 // Get the z of a constituent inside of a jet
698 //
0531c107 699 Double_t pJetSq = jetPx*jetPx+jetPy*jetPy+jetPz*jetPz;
0531c107 700 if(pJetSq>0.)
701 return (trkPx*jetPx+trkPy*jetPy+trkPz*jetPz)/pJetSq;
702 else {
703 AliWarning(Form("%s: strange, pjet*pjet seems to be zero pJetSq: %f",GetName(), pJetSq));
704 return 0;
705 }
706}
0714a353 707
708//________________________________________________________________________
709Int_t AliAnalysisTaskEmcalJetTriggerQA::GetLeadingCellId(const AliVCluster *clus) const
710{
711 //Get energy of leading cell in cluster
712
713 if(!fCaloCells)
714 return -1;
715
716 Double_t emax = -1.;
717 Int_t iCellAbsIdMax = -1;
718 Int_t nCells = clus->GetNCells();
719 for(Int_t i = 0; i<nCells; i++) {
720 Int_t absId = clus->GetCellAbsId(i);
721 Double_t cellE = fCaloCells->GetCellAmplitude(absId);
722 if(cellE>emax) {
723 emax = cellE;
724 iCellAbsIdMax = absId;
725 }
726 }
727
728 return iCellAbsIdMax;
729}
730
731//________________________________________________________________________
732Double_t AliAnalysisTaskEmcalJetTriggerQA::GetEnergyLeadingCell(const AliVCluster *clus) const
733{
734 //Get energy of leading cell in cluster
735 if(!fCaloCells)
736 return -1.;
737
738 Int_t absID = GetLeadingCellId(clus);
739 if(absID>-1)
740 return fCaloCells->GetCellAmplitude(absID);
741 else
742 return -1.;
0714a353 743}
698f34d8
CL
744
745//________________________________________________________________________
746Double_t AliAnalysisTaskEmcalJetTriggerQA::GetECross(Int_t absID) const {
747
748 //Get Ecross = sum of energy of neighbouring cells (using uncalibrated energy)
749
750 if(!fCaloCells)
751 return -1.;
752
753 Double_t ecross = -1.;
754
755 Int_t absID1 = -1;
756 Int_t absID2 = -1;
757 Int_t absID3 = -1;
758 Int_t absID4 = -1;
759
760 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
761 fGeom->GetCellIndex(absID,imod,iTower,iIphi,iIeta);
762 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
763
764 if( iphi < AliEMCALGeoParams::fgkEMCALRows-1)
765 absID1 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
766 if( iphi > 0 )
767 absID2 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
768
769 if( ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2) ) {
770 absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
771 absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
772 }
773 else if( ieta == 0 && imod%2 ) {
774 absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
775 absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
776 }
777 else {
778 if( ieta < AliEMCALGeoParams::fgkEMCALCols-1 )
779 absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
780 if( ieta > 0 )
781 absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
782 }
783
784 Double_t ecell1 = fCaloCells->GetCellAmplitude(absID1);
785 Double_t ecell2 = fCaloCells->GetCellAmplitude(absID2);
786 Double_t ecell3 = fCaloCells->GetCellAmplitude(absID3);
787 Double_t ecell4 = fCaloCells->GetCellAmplitude(absID4);
788
789 ecross = ecell1+ecell2+ecell3+ecell4;
790
791 return ecross;
792}
fd08af98 793
794//_________________________________________________________________________
2d9ab573 795Float_t AliAnalysisTaskEmcalJetTriggerQA::RelativeEP(Double_t objAng, Double_t EPAng) const
796{
797 // function to calculate angle between object and EP in the 1st quadrant (0,Pi/2)
798 Double_t dphi = EPAng - objAng;
799
800 // ran into trouble with a few dEP<-Pi so trying this...
801 if( dphi<-1*TMath::Pi() )
802 dphi = dphi + 1*TMath::Pi();
803 if( dphi>1*TMath::Pi())
804 dphi = dphi - 1*TMath::Pi();
805
806 if( (dphi>0) && (dphi<1*TMath::Pi()/2) ){
807 // Do nothing! we are in quadrant 1
808 }else if( (dphi>1*TMath::Pi()/2) && (dphi<1*TMath::Pi()) ){
809 dphi = 1*TMath::Pi() - dphi;
810 }else if( (dphi<0) && (dphi>-1*TMath::Pi()/2) ){
811 dphi = fabs(dphi);
812 }else if( (dphi<-1*TMath::Pi()/2) && (dphi>-1*TMath::Pi()) ){
813 dphi = dphi + 1*TMath::Pi();
814 }
fd08af98 815
2d9ab573 816 return dphi; // dphi in [0, Pi/2]
817}