AliPhysics  cf1a5e2 (cf1a5e2)
AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 #include <TClonesArray.h>
17 #include <TH1F.h>
18 #include <TF1.h>
19 #include <TH2F.h>
20 #include <TH1.h>
21 #include <TH2.h>
22 #include <TH3.h>
23 #include <THnSparse.h>
24 #include <TList.h>
25 #include <array>
26 #include <iostream>
27 #include <map>
28 #include <vector>
29 #include <TRandom3.h>
30 #include <TClonesArray.h>
31 #include <TGrid.h>
32 #include <THistManager.h>
33 #include <THashList.h>
34 #include <TLinearBinning.h>
35 #include <TObjArray.h>
36 #include <TParameter.h>
37 
38 #include <AliVCluster.h>
39 #include <AliVParticle.h>
40 #include <AliLog.h>
41 
42 #include "AliTLorentzVector.h"
43 #include "AliEmcalJet.h"
44 #include "AliRhoParameter.h"
45 #include "AliJetContainer.h"
46 #include "AliParticleContainer.h"
47 #include "AliClusterContainer.h"
48 #include "AliEMCALGeometry.h"
49 #include "AliVCaloCells.h"
50 #include "AliESDCaloCells.h"
51 #include "AliMCEvent.h"
52 #include "AliMCParticle.h"
53 #include "AliGenEventHeader.h"
54 #include "AliGenPythiaEventHeader.h"
55 
56 
57 #include "AliAnalysisUtils.h"
58 #include "AliESDEvent.h"
59 #include "AliAODEvent.h"
60 #include "AliVEvent.h"
61 #include "AliEMCALTriggerPatchInfo.h"
63 #include "AliInputEventHandler.h"
64 #include "AliLog.h"
65 #include "AliMultSelection.h"
66 #include "AliMultEstimator.h"
67 #include "AliOADBContainer.h"
68 
70 
74 
75 using std::cout;
76 using std::endl;
77 
83 fUseRecalcPatches(false),
84 fHistManager(),
85 fRecevent(),
86 fMCevent(),
87 fRecoUtil(0x0), fClusterEResolution(0x0), fVaryTrkPtRes(),
88 fUseSumw2(),
89 fHistNumbJets(),
90 fHistJetPt(),
91 fHistJetJetPatchE(),
92 fHistJetGammaPatchE(),
93 fHistJetJetPatchPt(),
94 fHistJetGammaPatchPt(),
95 fHistTriggerPatchE(),
96 fhnMBJetSpectra()
97 
98 {
99  //Array Initiation
100  for(int i=0;i<9;i++){
101  fHistEMCalTowerMult[i] = NULL;
102 
103  }
104 }
105 
112 AliAnalysisTaskEmcalJet(name, kTRUE),
113 fUseRecalcPatches(false),
114 fHistManager(name),
115 fRecevent(NULL),
116 fMCevent(NULL),
118 fUseSumw2(0),
119 fHistNumbJets(0),
120 fHistJetPt(0),
126 fhnMBJetSpectra(0x0)
127 
128 
129 {
130  //Array Initiation
131  for(int i=0;i<=9;i++){
132  fHistEMCalTowerMult[i] = NULL;
133 
134  }
136  SetCaloTriggerPatchInfoName("EmcalTriggers");
137 }
138 
143 {
144 }
145 
151 {
153 
154  TString histName = "";
155  TString histTitle = "";
156  for(int i=0;i<=9;i++){
157  histName = TString::Format("fHistEMCalTowerMult_%d",i);
158  histTitle = TString::Format("%s;N_{tower};Counts",histName.Data());
159  fHistEMCalTowerMult[i] = new TH1F(histName.Data(),histTitle.Data(),400,0,400);
160  fOutput->Add(fHistEMCalTowerMult[i]);
161  }
162 
167 
168  TIter next(fHistManager.GetListOfHistograms());
169  TObject* obj = 0;
170  while ((obj = next())) {
171  fOutput->Add(obj);
172  }
173  fOutput->Add(fHistNumbJets);
174  fOutput->Add(fHistJetPt);
175 
176 
177  // UInt_t SparseBit = 0;// Bit Code from GetDimParams()
178 
179 
180  //SparseBit = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<10 | 1<<11 | 1<<12 | 1<<13 | 1<<14 | 1<<15 | 1<<16;
181  //fhnMBJetSpectra = NewTHnSparseF("fhnMBJetSpectra", SparseBit);
182  //fhnMBJetSpectra->Sumw2();
183  // fOutput->Add(fhnMBJetSpectra);
184 
185  if(fUseSumw2==0) {
186  // =========== Switch on Sumw2 for all histos ===========
187  for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
188  TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
189  if (h1){
190  h1->Sumw2();
191  continue;
192  }
193  THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
194  if(hn)hn->Sumw2();
195  }
196  }
197 
198  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
199 }
200 
201 /*
202  * This function allocates the histograms for basic EMCal cluster QA.
203  * A set of histograms (energy, eta, phi, number of cluster) is allocated
204  * per each cluster container and per each centrality bin.
205  */
207 {
208  TString histname;
209  TString histtitle;
210  TString groupname;
211  AliClusterContainer* clusCont = 0;
212  TIter next(&fClusterCollArray);
213  while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
214  groupname = clusCont->GetName();
215  fHistManager.CreateHistoGroup(groupname);
216  for (Int_t cent = 0; cent < fNcentBins; cent++) {
217  histname = TString::Format("%s/histClusterEnergy_%d", groupname.Data(), cent);
218  histtitle = TString::Format("%s;#it{E}_{cluster} (GeV);counts", histname.Data());
219  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
220 
221  histname = TString::Format("%s/histClusterEnergyExotic_%d", groupname.Data(), cent);
222  histtitle = TString::Format("%s;#it{E}_{cluster}^{exotic} (GeV);counts", histname.Data());
223  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
224 
225  histname = TString::Format("%s/histClusterNonLinCorrEnergy_%d", groupname.Data(), cent);
226  histtitle = TString::Format("%s;#it{E}_{cluster}^{non-lin.corr.} (GeV);counts", histname.Data());
227  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
228 
229  histname = TString::Format("%s/histClusterHadCorrEnergy_%d", groupname.Data(), cent);
230  histtitle = TString::Format("%s;#it{E}_{cluster}^{had.corr.} (GeV);counts", histname.Data());
231  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
232 
233  histname = TString::Format("%s/histClusterPhi_%d", groupname.Data(), cent);
234  histtitle = TString::Format("%s;#it{#phi}_{custer};counts", histname.Data());
235  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi(), "s");
236 
237  histname = TString::Format("%s/histClusterEta_%d", groupname.Data(), cent);
238  histtitle = TString::Format("%s;#it{#eta}_{custer};counts", histname.Data());
239  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1, "s");
240 
241  histname = TString::Format("%s/fHistFcrossvEonline_%d", groupname.Data(), cent);
242  histtitle = TString::Format("%s;#it{E}_{cluster} (GeV);#it{F}_{cross}", histname.Data());
243  fHistManager.CreateTH2(histname, histtitle, 100, 0, 100, 100, 0, 1.0);
244 
245 
246  histname = TString::Format("%s/histNClusters_%d", groupname.Data(), cent);
247  histtitle = TString::Format("%s;number of clusters;events", histname.Data());
248  if (fForceBeamType != kpp) {
249  fHistManager.CreateTH1(histname, histtitle, 500, 0, 3000, "s");
250  }
251  else {
252  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200, "s");
253  }
254  }
255  }
256 }
257 
258 /*
259  * This function allocates the histograms for basic EMCal QA.
260  * One 2D histogram with the cell energy spectra and the number of cells
261  * per event is allocated per each centrality bin.
262  */
264 {
265  TString histname;
266  TString histtitle;
267  TString groupname(fCaloCellsName);
268 
269  fHistManager.CreateHistoGroup(groupname);
270  for (Int_t cent = 0; cent < fNcentBins; cent++) {
271  histname = TString::Format("%s/histCellEnergy_%d", groupname.Data(), cent);
272  histtitle = TString::Format("%s;#it{E}_{cell} (GeV);counts", histname.Data());
273  fHistManager.CreateTH1(histname, histtitle, 600, 0, 150, "s");
274 
275  histname = TString::Format("%s/histNCells_%d", groupname.Data(), cent);
276  histtitle = TString::Format("%s;number of cells;events", histname.Data());
277  if (fForceBeamType != kpp) {
278  fHistManager.CreateTH1(histname, histtitle, 500, 0, 6000,"s");
279  }
280  else {
281  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200,"s");
282  }
283  }
284 }
285 
286 /*
287  * This function allocates the histograms for basic tracking QA.
288  * A set of histograms (pT, eta, phi, difference between kinematic properties
289  * at the vertex and at the EMCal surface, number of tracks) is allocated
290  * per each particle container and per each centrality bin.
291  */
293 {
294  TString histname;
295  TString histtitle;
296  TString groupname;
297  AliParticleContainer* partCont = 0;
298  TIter next(&fParticleCollArray);
299  while ((partCont = static_cast<AliParticleContainer*>(next()))) {
300  groupname = partCont->GetName();
301  fHistManager.CreateHistoGroup(groupname);
302  for (Int_t cent = 0; cent < fNcentBins; cent++) {
303  histname = TString::Format("%s/histTrackPt_%d", groupname.Data(), cent);
304  histtitle = TString::Format("%s;#it{p}_{T,track} (GeV/#it{c});counts", histname.Data());
305  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
306 
307  histname = TString::Format("%s/histTrackPhi_%d", groupname.Data(), cent);
308  histtitle = TString::Format("%s;#it{#phi}_{track};counts", histname.Data());
309  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi(), "s");
310 
311  histname = TString::Format("%s/histTrackEta_%d", groupname.Data(), cent);
312  histtitle = TString::Format("%s;#it{#eta}_{track};counts", histname.Data());
313  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1, "s");
314 
315  if (TClass(partCont->GetClassName()).InheritsFrom("AliVTrack")) {
316  histname = TString::Format("%s/fHistDeltaEtaPt_%d", groupname.Data(), cent);
317  histtitle = TString::Format("%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#eta}_{track}^{vertex} - #it{#eta}_{track}^{EMCal};counts", histname.Data());
318  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, 50, -0.5, 0.5);
319 
320  histname = TString::Format("%s/fHistDeltaPhiPt_%d", groupname.Data(), cent);
321  histtitle = TString::Format("%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#phi}_{track}^{vertex} - #it{#phi}_{track}^{EMCal};counts", histname.Data());
322  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, 200, -2, 2);
323 
324  histname = TString::Format("%s/fHistDeltaPtvsPt_%d", groupname.Data(), cent);
325  histtitle = TString::Format("%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{p}_{T,track}^{vertex} - #it{p}_{T,track}^{EMCal} (GeV/#it{c});counts", histname.Data());
326  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, fNbins / 2, -fMaxBinPt/2, fMaxBinPt/2);
327 
328  histname = TString::Format("%s/fHistEoverPvsP_%d", groupname.Data(), cent);
329  histtitle = TString::Format("%s;#it{P}_{track} (GeV/#it{c});#it{E}_{cluster} / #it{P}_{track} #it{c};counts", histname.Data());
330  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, fNbins / 2, 0, 4);
331  }
332 
333  histname = TString::Format("%s/histNTracks_%d", groupname.Data(), cent);
334  histtitle = TString::Format("%s;number of tracks;events", histname.Data());
335  if (fForceBeamType != kpp) {
336  fHistManager.CreateTH1(histname, histtitle, 500, 0, 5000, "s");
337  }
338  else {
339  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200, "s");
340  }
341  }
342  }
343 }
344 
345 /*
346  * This function allocates the histograms for basic jet QA.
347  * A set of histograms (pT, eta, phi, area, number of jets, corrected pT) is allocated
348  * per each jet container and per each centrality bin.
349  */
351 {
352  TString histname;
353  TString histtitle;
354  TString groupname;
355  Double_t pi = TMath::Pi();
356  AliJetContainer* jetCont = 0;
357  TIter next(&fJetCollArray);
358  UInt_t SparseBit = 0;// Bit Code from GetDimParams()
359  SparseBit = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<10 | 1<<11 | 1<<12 | 1<<13 | 1<<14 | 1<<15 | 1<<16;
360 
361  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
362  groupname = jetCont->GetName();
363  fHistManager.CreateHistoGroup(groupname);
364 
365  //histname = TString::Format("%s/fhnJetSparse", groupname.Data());
366  //histtitle = histname + TString::Format("%s;#it{p}_{T,jet} (GeV/#it{c});counts", histname.Data());
367  //fHistManager.CreateTHnSparse(histname.Data(), histtitle.Data());
368 
369 
370  histname = TString::Format("%s/fhnJetSparse", groupname.Data());
371  histtitle = histname + ";Multiplicity;#it{p}_{T,jet}^{uncorr} (GeV/#it{c});#it{p}_{T,leading} (GeV/#it{c};#it{E}_{leading} (GeV);#eta_{jet};#phi_{jet};#it{F}_{cross};#it{z}_{leading};#it{A}_{jet};#it{NEF};#it{N}_{constit};it{N}_{neu};it{N}_{chrg}";
372  Int_t nbins13[13] = {300, fNbins, fNbins, fNbins,24,72,20,20,20,20,100,100,100};
373  Double_t min13[13] = {0,fMinBinPt,fMinBinPt,fMinBinPt,-1.2, -0.5*pi,0,0,0,0,0,0,0};
374  Double_t max13[13] = {300,fMaxBinPt, fMaxBinPt, fMaxBinPt,1.2,1.5*pi,1,1,1,1,1,1,1};
375  fHistManager.CreateTHnSparse(histname.Data(), histtitle.Data(), 13, nbins13, min13, max13, "s");
376 
377 
378  for (Int_t cent = 0; cent < fNcentBins; cent++) {
379 
380  histname = TString::Format("%s/histJetPt_%d", groupname.Data(), cent);
381  histtitle = TString::Format("%s;#it{p}_{T,jet} (GeV/#it{c});counts", histname.Data());
382  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
383 
384  histname = TString::Format("%s/histJetClusterEnergy_%d", groupname.Data(), cent);
385  histtitle = TString::Format("%s;#it{E}_{JetClus} (GeV);counts", histname.Data());
386  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
387 
388  histname = TString::Format("%s/histJetTrkPt_%d", groupname.Data(), cent);
389  histtitle = TString::Format("%s;#it{p}_{T,JetTrk} (GeV/#it{c});counts", histname.Data());
390  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
391 
392  histname = TString::Format("%s/histJetNEFvJetPt_%d", groupname.Data(), cent);
393  histtitle = TString::Format("%s;#it{p}_{T,Jet};NEF", histname.Data());
394  fHistManager.CreateTH2(histname, histtitle, 200, 0, 200, 100, 0, 1, "s");
395 
396  histname = TString::Format("%s/histNumbJetConstvJetPt_%d", groupname.Data(), cent);
397  histtitle = TString::Format("%s;#it{p}_{T,Jet};NumberofJetConstit", histname.Data());
398  fHistManager.CreateTH2(histname, histtitle, 200, 0, 200, 20,0,20, "s");
399 
400  histname = TString::Format("%s/histJetFF_%d", groupname.Data(), cent);
401  histtitle = TString::Format("%s;Z=#it{p}_{T,leading} / #it{p}_{T,Jet};counts", histname.Data());
402  fHistManager.CreateTH1(histname, histtitle, 100, 0, 1, "s");
403 
404  histname = TString::Format("%s/histJetZvJetPt_%d", groupname.Data(), cent);
405  histtitle = TString::Format("%s;#it{p}_{T,Jet};Z=#it{p}_{T,Trk} / #it{p}_{T,Jet}", histname.Data());
406  fHistManager.CreateTH2(histname, histtitle, 200, 0, 200, 100,0,1);
407 
408  //histname = TString::Format("%s/histJetNeutralPtvJetPt_%d", groupname.Data(), cent);
409  //histtitle = TString::Format("%s;#it{p}_{T,Jet};#it{p}_{T,NeutralConstituents}", histname.Data());
410  //fHistManager.CreateTH2(histname, histtitle, 200, 0, 200, 200, 0, 200);
411 
412  histname = TString::Format("%s/histFCrossvZleading_%d", groupname.Data(), cent);
413  histtitle = TString::Format("%s;#it{z}_{leading};#it{F}_{Cross}", histname.Data());
414  fHistManager.CreateTH2(histname, histtitle, 100, 0, 1, 100, 0, 1);
415 
416  //Matched Trigger Histos
417  histname = TString::Format("%s/fHistJetJetPatchE_%d", groupname.Data(), cent);
418  histtitle = TString::Format("%s;#it{E}_{JetGammaPatch} (GeV);counts", histname.Data());
419  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
420 
421  histname = TString::Format("%s/fHistJetGammaPatchE_%d", groupname.Data(), cent);
422  histtitle = TString::Format("%s;#it{E}_{JetGammaPatch} (GeV);counts", histname.Data());
423  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
424 
425  histname = TString::Format("%s/fHistJetJetPatchPt_%d", groupname.Data(), cent);
426  histtitle = TString::Format("%s;#it{p}_{T,JetJetPatch} (GeV/#it{c});counts", histname.Data());
427  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
428 
429  histname = TString::Format("%s/fHistJetGammaPatchPt_%d", groupname.Data(), cent);
430  histtitle = TString::Format("%s;#it{p}_{T,JetGammaPatch} (GeV/#it{c});counts", histname.Data());
431  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
432 
433  histname = TString::Format("%s/fHistTriggerPatchE_%d", groupname.Data(), cent);
434  histtitle = TString::Format("%s;#it{E}_{TriggerPatch} (GeV);counts", histname.Data());
435  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
436 
437  histname = TString::Format("%s/fHistDeltaEtaDeltaPhiJE_%d", groupname.Data(), cent);
438  histtitle = TString::Format("%s;#it{#phi}_{jet} - #it{#phi}_{JE,patch};#it{#eta}_{Jet} - #it{#eta}_{JE,patch};counts", histname.Data());
439  fHistManager.CreateTH2(histname, histtitle, 280, -0.7, 0.7, 280, -0.7, 0.7);
440 
441  histname = TString::Format("%s/fHistDeltaEtaDeltaPhiGA_%d", groupname.Data(), cent);
442  histtitle = TString::Format("%s;#it{#phi}_{jet} - #it{#phi}_{GA,patch};#it{#eta}_{Jet} - #it{#eta}_{GA,patch};counts", histname.Data());
443  fHistManager.CreateTH2(histname, histtitle, 280, -0.7, 0.7, 280, -0.7, 0.7);
444 
445  histname = TString::Format("%s/fHistJetEPatchEJE_%d", groupname.Data(), cent);
446  histtitle = TString::Format("%s;#it{E_{JE,patch}}#it{E_{Jet,UnCorr}};counts", histname.Data());
447  fHistManager.CreateTH2(histname, histtitle, 400, 0, 200, 400, 0, 200);
448 
449  histname = TString::Format("%s/fHistJetEPatchEGA_%d", groupname.Data(), cent);
450  histtitle = TString::Format("%s;#it{E_{GA,patch}};#it{E_{Jet,UnCorr}};counts", histname.Data());
451  fHistManager.CreateTH2(histname, histtitle, 400, 0, 200, 400, 0, 200);
452  // End Matched Trigger Histos
453 
454  histname = TString::Format("%s/histJetArea_%d", groupname.Data(), cent);
455  histtitle = TString::Format("%s;#it{A}_{jet};counts", histname.Data());
456  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, 3);
457 
458  histname = TString::Format("%s/histJetPhi_%d", groupname.Data(), cent);
459  histtitle = TString::Format("%s;#it{#phi}_{jet};counts", histname.Data());
460  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi(), "s");
461 
462  histname = TString::Format("%s/histJetEta_%d", groupname.Data(), cent);
463  histtitle = TString::Format("%s;#it{#eta}_{jet};counts", histname.Data());
464  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1, "s");
465 
466  histname = TString::Format("%s/histJetClusterPhi_%d", groupname.Data(), cent);
467  histtitle = TString::Format("%s;#it{#phi}_{JetClus};counts", histname.Data());
468  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi(), "s");
469 
470  histname = TString::Format("%s/histJetClusterEta_%d", groupname.Data(), cent);
471  histtitle = TString::Format("%s;#it{#eta}_{JetClus};counts", histname.Data());
472  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1, "s");
473 
474  histname = TString::Format("%s/histNJets_%d", groupname.Data(), cent);
475  histtitle = TString::Format("%s;number of jets;events", histname.Data());
476  if (fForceBeamType != kpp) {
477  fHistManager.CreateTH1(histname, histtitle, 500, 0, 500, "s");
478  }
479  else {
480  fHistManager.CreateTH1(histname, histtitle, 100, 0, 100, "s");
481  }
482 
483  if (!jetCont->GetRhoName().IsNull()) {
484  histname = TString::Format("%s/histJetCorrPt_%d", groupname.Data(), cent);
485  histtitle = TString::Format("%s;#it{p}_{T,jet}^{corr} (GeV/#it{c});counts", histname.Data());
486  fHistManager.CreateTH1(histname, histtitle, fNbins, -fMaxBinPt / 2, fMaxBinPt / 2);
487  }
488  }
489  }
490 }
491 
499 {
500  DoJetLoop();
501  DoTrackLoop();
502  DoClusterLoop();
503  DoCellLoop();
504 
505  return kTRUE;
506 }
507 
513 {
514  TString histname;
515  TString groupname;
516  AliJetContainer* jetCont = 0;
517  TIter next(&fJetCollArray);
518 
519  //TClonesArray *triggerpatches = dynamic_cast<TClonesArray *>(InputEvent()->FindListObject("EmcalTriggers"));
520  //if(!triggerpatches)
521  // AliErrorStream() << "Trigger patch container EmcalTriggers not found in task " << GetName() << std::endl;
522 
523  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
524  groupname = jetCont->GetName();
525  UInt_t count = 0;
526  for(auto jet : jetCont->accepted()) {
527  if (!jet) continue;
528  count++;
529 
530  TLorentzVector leadPart;
531  jetCont->GetLeadingHadronMomentum(leadPart, jet);
532  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
533  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
534 
535  histname = TString::Format("%s/histJetPt_%d", groupname.Data(), fCentBin);
536  fHistManager.FillTH1(histname, jet->Pt());
537 
538  histname = TString::Format("%s/histJetClusterEnergy_%d", groupname.Data(), fCentBin);
539  fHistManager.FillTH1(histname, jet->E());
540 
541  histname = TString::Format("%s/histJetArea_%d", groupname.Data(), fCentBin);
542  fHistManager.FillTH1(histname, jet->Area());
543 
544  histname = TString::Format("%s/histJetPhi_%d", groupname.Data(), fCentBin);
545  fHistManager.FillTH1(histname, jet->Phi());
546 
547  histname = TString::Format("%s/histJetEta_%d", groupname.Data(), fCentBin);
548  fHistManager.FillTH1(histname, jet->Eta());
549 
550  histname = TString::Format("%s/histJetNEFvJetPt_%d", groupname.Data(), fCentBin);
551  fHistManager.FillTH2(histname,jet->Pt(),jet->NEF() );
552 
553 
554  histname = TString::Format("%s/histNumbJetConstvJetPt_%d", groupname.Data(), fCentBin);
555  fHistManager.FillTH2(histname,jet->Pt(),jet->N());
556 
557  histname = TString::Format("%s/histJetFF_%d", groupname.Data(), fCentBin);
558  fHistManager.FillTH1(histname, z );
559 
560  Double_t MatchedEta = 0.04, MatchedPhi = 0.04;
561  //Look at emcal trigger patches in event and associate with jet
562  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
563 
564  if (fTriggerPatchInfo) {
565  TString objname(fTriggerPatchInfo->GetClass()->GetName());
566  TClass cls(objname);
567  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
568  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",GetName(), cls.GetName(), "EmcalTriggers"));
569  fTriggerPatchInfo = 0;
570  }
571  }
572 
573  if (!fTriggerPatchInfo) {
574  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
575  continue;
576  }
577 
578  //AliEMCALTriggerPatchInfo *currentpatch(nullptr);
579  for(auto p : *fTriggerPatchInfo){
580  AliEMCALTriggerPatchInfo *currentpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
581 
582  //Select Single Shower Patch
583  if(currentpatch->IsGammaLowRecalc() || currentpatch->IsGammaLowSimple()){
584  histname = TString::Format("%s/fHistDeltaEtaDeltaPhiGA_%d", groupname.Data(), fCentBin);
585  fHistManager.FillTH2(histname, jet->Phi() - currentpatch->GetPhiGeo(), jet->Eta() - currentpatch->GetEtaGeo());
586  histname = TString::Format("%s/fHistJetEPatchEGA_%d", groupname.Data(), fCentBin);
587  fHistManager.FillTH2(histname,jet->E(),currentpatch->GetPatchE());
588 
589  if(jet->Phi() - currentpatch->GetPhiGeo() <= MatchedPhi && jet->Eta() - currentpatch->GetEtaGeo() <= MatchedEta){
590  histname = TString::Format("%s/fHistJetGammaPatchE_%d", groupname.Data(), fCentBin);
591  fHistManager.FillTH1(histname, currentpatch->GetPatchE());
592  histname = TString::Format("%s/fHistJetGammaPatchPt_%d", groupname.Data(), fCentBin);
593  fHistManager.FillTH1(histname, jet->Pt());
594  }
595  }
596 
597  //Select Jet Patch
598  if(currentpatch->IsJetLowRecalc() || currentpatch->IsJetLowSimple()){
599  histname = TString::Format("%s/fHistDeltaEtaDeltaPhiJE_%d", groupname.Data(), fCentBin);
600  fHistManager.FillTH2(histname, jet->Phi() - currentpatch->GetPhiGeo(), jet->Eta() - currentpatch->GetEtaGeo());
601  histname = TString::Format("%s/fHistJetEPatchEJE_%d", groupname.Data(), fCentBin);
602  fHistManager.FillTH2(histname,jet->E(),currentpatch->GetPatchE());
603 
604  if(jet->Phi() - currentpatch->GetPhiGeo() <= MatchedPhi && jet->Eta() - currentpatch->GetEtaGeo() <= MatchedEta){
605  histname = TString::Format("%s/fHistJetJetPatchE_%d", groupname.Data(), fCentBin);
606  fHistManager.FillTH1(histname, currentpatch->GetPatchE());
607  histname = TString::Format("%s/fHistJetJetPatchPt_%d", groupname.Data(), fCentBin);
608  fHistManager.FillTH1(histname, jet->Pt());
609  }
610  }
611 
612  }
613 
614  Double_t Z_part = 0.0;
615 
616  //Look at assoc tracks of a given jet
617  AliParticleContainer* tracks = jetCont->GetParticleContainer();
618  if (tracks) {
619  for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
620  AliVParticle *JetTrk = jet->TrackAt(it, tracks->GetArray());
621  if (JetTrk) {
622  //AliVTrack *Vtrack = dynamic_cast<AliVTrack*>(track);
623  histname = TString::Format("%s/histJetTrkPt_%d", groupname.Data(), fCentBin);
624  fHistManager.FillTH1(histname, JetTrk->Pt());
625 
626  Z_part = GetZ(JetTrk->Px(),JetTrk->Py(),JetTrk->Pz(),jet->Px(),jet->Py(),jet->Pz());
627 
628  histname = TString::Format("%s/histJetZvJetPt_%d", groupname.Data(), fCentBin);
629  fHistManager.FillTH2(histname,jet->Pt(),Z_part);
630  }
631  }
632  }
633  //Loop over Clusters in Jet
634  AliClusterContainer* JetCluster = 0;
635  JetCluster = jetCont->GetClusterContainer();
636  if(JetCluster) {
637  for(auto cluster : JetCluster->accepted()) {
638  AliTLorentzVector nPart;
639  cluster->GetMomentum(nPart, fVertex);
640  Double_t JetFCross = GetFcross(cluster, fCaloCells);
641  histname = TString::Format("%s/histJetClusterEnergy_%d", groupname.Data(), fCentBin);
642  fHistManager.FillTH1(histname, cluster->E());
643  histname = TString::Format("%s/histJetClusterPhi_%d", groupname.Data(), fCentBin);
644  fHistManager.FillTH1(histname, nPart.Phi_0_2pi());
645  histname = TString::Format("%s/histJetClusterEta_%d", groupname.Data(), fCentBin);
646  fHistManager.FillTH1(histname, nPart.Eta());
647  histname = TString::Format("%s/histFCrossvZleading_%d", groupname.Data(), fCentBin);
648  fHistManager.FillTH2(histname,jet->MaxTrackPt() / jet->Pt(), JetFCross);
649  }
650 
651 
652  }
653 
654  Double_t leadingtrackpT = 0.0;
655  Double_t leadingclusterE = 0.0;
656  Double_t JetFCrossLeading = 0.0;
657  AliVParticle *leadingParticle = 0x0;
658  AliVCluster *leadingCluster = 0x0;
659 
660 
661  leadingCluster = jet->GetLeadingCluster();
662  if(leadingCluster){
663  leadingclusterE = leadingCluster->E();
664  JetFCrossLeading = GetFcross(leadingCluster, fCaloCells);
665  }
666 
667  AliVParticle* leadingTrk = jet->GetLeadingTrack();
668  if(leadingTrk){
669  leadingtrackpT = leadingTrk->Pt();
670  }
671  AliTrackContainer * Globaltracks = static_cast<AliTrackContainer * >(GetParticleContainer("tracks"));
672 
673  Double_t TrackMultiplicity = Globaltracks->GetNTracks();
674  Double_t Numb = jet->N();
675  Double_t NumbNeu = jet->Nn();
676  Double_t NumbChrg = jet->Nch();
677  //Double_t MBJetSparseFill[13]={TrackMultiplicity,jet->Pt(),jet->MaxTrackPt(),leadingCluster->E(),jet->Eta(),jet->Phi(),JetFCrossLeading,z,jet->Area(),jet->NEF(),Numb,NumbNeu,NumbChrg};
678  //fhnMBJetSpectra->Fill(MBJetSparseFill);
679 
680  Double_t x[13]={TrackMultiplicity,jet->Pt(),leadingtrackpT,leadingclusterE,jet->Eta(),jet->Phi(),JetFCrossLeading,z,jet->Area(),jet->NEF(),Numb,NumbNeu,NumbChrg};
681  histname = TString::Format("%s/fhnJetSparse", groupname.Data());
682  fHistManager.FillTHnSparse(histname, x);
683 
684  if (jetCont->GetRhoParameter()) {
685  histname = TString::Format("%s/histJetCorrPt_%d", groupname.Data(), fCentBin);
686  fHistManager.FillTH1(histname, jet->Pt() - jetCont->GetRhoVal() * jet->Area());
687  }//Background Subtaction in PbPb
688  }// Loop over each jet in a event
689  histname = TString::Format("%s/histNJets_%d", groupname.Data(), fCentBin);
690  fHistManager.FillTH1(histname, count);
691  }
692 }
693 
699 {
701 
702  TString histname;
703  TString groupname;
704  AliParticleContainer* partCont = 0;
705  TIter next(&fParticleCollArray);
706  while ((partCont = static_cast<AliParticleContainer*>(next()))) {
707  groupname = partCont->GetName();
708  UInt_t count = 0;
709  for(auto part : partCont->accepted()) {
710  if (!part) continue;
711  count++;
712 
713  histname = TString::Format("%s/histTrackPt_%d", groupname.Data(), fCentBin);
714  fHistManager.FillTH1(histname, part->Pt());
715 
716  histname = TString::Format("%s/histTrackPhi_%d", groupname.Data(), fCentBin);
717  fHistManager.FillTH1(histname, part->Phi());
718 
719  histname = TString::Format("%s/histTrackEta_%d", groupname.Data(), fCentBin);
720  fHistManager.FillTH1(histname, part->Eta());
721 
722  if (partCont->GetLoadedClass()->InheritsFrom("AliVTrack")) {
723  const AliVTrack* track = static_cast<const AliVTrack*>(part);
724 
725  histname = TString::Format("%s/fHistDeltaEtaPt_%d", groupname.Data(), fCentBin);
726  fHistManager.FillTH1(histname, track->Pt(), track->Eta() - track->GetTrackEtaOnEMCal());
727 
728  histname = TString::Format("%s/fHistDeltaPhiPt_%d", groupname.Data(), fCentBin);
729  fHistManager.FillTH1(histname, track->Pt(), track->Phi() - track->GetTrackPhiOnEMCal());
730 
731  histname = TString::Format("%s/fHistDeltaPtvsPt_%d", groupname.Data(), fCentBin);
732  fHistManager.FillTH1(histname, track->Pt(), track->Pt() - track->GetTrackPtOnEMCal());
733 
734  if (clusCont) {
735  Int_t iCluster = track->GetEMCALcluster();
736  if (iCluster >= 0) {
737  AliVCluster* cluster = clusCont->GetAcceptCluster(iCluster);
738  if (cluster) {
739  histname = TString::Format("%s/fHistEoverPvsP_%d", groupname.Data(), fCentBin);
740  fHistManager.FillTH2(histname, track->P(), cluster->GetNonLinCorrEnergy() / track->P());
741  }
742  }
743  }
744  }
745  }
746 
747  histname = TString::Format("%s/histNTracks_%d", groupname.Data(), fCentBin);
748  fHistManager.FillTH1(histname, count);
749  }
750 }
751 
757 {
758  TString histname;
759  TString groupname;
760  AliClusterContainer* clusCont = 0;
761  TIter next(&fClusterCollArray);
762  while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
763  groupname = clusCont->GetName();
764 
765  //Cluster Exotics
766  for(auto cluster : clusCont->all()) {
767  if (!cluster) continue;
768 
769  Double_t FCross = GetFcross(cluster, fCaloCells);
770  histname = TString::Format("%s/fHistFcrossvEonline_%d", groupname.Data(), fCentBin);
771  fHistManager.FillTH2(histname, cluster->E(), FCross);
772 
773  if (cluster->GetIsExotic()) {
774  histname = TString::Format("%s/histClusterEnergyExotic_%d", groupname.Data(), fCentBin);
775  fHistManager.FillTH1(histname, cluster->E());
776  }
777  }
778 
779  UInt_t count = 0;
780  for(auto cluster : clusCont->accepted()) {
781  if (!cluster) continue;
782  count++;
783 
784  AliTLorentzVector nPart;
785  cluster->GetMomentum(nPart, fVertex);
786 
787  histname = TString::Format("%s/histClusterEnergy_%d", groupname.Data(), fCentBin);
788  fHistManager.FillTH1(histname, cluster->E());
789 
790  histname = TString::Format("%s/histClusterNonLinCorrEnergy_%d", groupname.Data(), fCentBin);
791  fHistManager.FillTH1(histname, cluster->GetNonLinCorrEnergy());
792 
793  histname = TString::Format("%s/histClusterHadCorrEnergy_%d", groupname.Data(), fCentBin);
794  fHistManager.FillTH1(histname, cluster->GetHadCorrEnergy());
795 
796  histname = TString::Format("%s/histClusterPhi_%d", groupname.Data(), fCentBin);
797  fHistManager.FillTH1(histname, nPart.Phi_0_2pi());
798 
799  histname = TString::Format("%s/histClusterEta_%d", groupname.Data(), fCentBin);
800  fHistManager.FillTH1(histname, nPart.Eta());
801  }
802 
803  histname = TString::Format("%s/histNClusters_%d", groupname.Data(), fCentBin);
804  fHistManager.FillTH1(histname, count);
805  }
806 }
807 
813 {
814  if (!fCaloCells) return;
815 
816  TString histname;
817 
818  const Short_t ncells = fCaloCells->GetNumberOfCells();
819 
820  histname = TString::Format("%s/histNCells_%d", fCaloCellsName.Data(), fCentBin);
821  fHistManager.FillTH1(histname, ncells);
822 
823  histname = TString::Format("%s/histCellEnergy_%d", fCaloCellsName.Data(), fCentBin);
824  for (Short_t pos = 0; pos < ncells; pos++) {
825  Double_t amp = fCaloCells->GetAmplitude(pos);
826 
827  fHistManager.FillTH1(histname, amp);
828  }
829 }
830 
836 {
837 
839 }
840 
849 {
850  //Int_t runNum = InputEvent()->GetRunNumber();
851 
852  //Bool_t PileUp = AliVEvent::IsPileupFromSPD();
853 
854  //Double_t zVertex=fVertex[2];
855 
856  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
857 
858  if (fTriggerPatchInfo) {
859  TString objname(fTriggerPatchInfo->GetClass()->GetName());
860  TClass cls(objname);
861  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
862  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",GetName(), cls.GetName(), "EmcalTriggers"));
863  fTriggerPatchInfo = 0;
864  }
865  }
866 
867  if (!fTriggerPatchInfo) {
868  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
869  return kFALSE;
870  }
871  for(auto p : *fTriggerPatchInfo){
872  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
873  if (recpatch) {
874  }
875  }
876 
877  fClusterEResolution = new TF1("fClusterEResolution","sqrt([0]^2+[1]^2*x+([2]*x)^2)*0.01");// 2010 EMCal Test Beam Resolution
878  fClusterEResolution->SetParameters(4.35,9.07,1.63);//Fit to test beam
879 
880 
881 
882 
883  IsLEDEvent();
884 
885  return kTRUE;
886 }
887 
888 /*
889 void AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA::ExtractMainPatch() {
890 
891  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
892 
893  if (fTriggerPatchInfo) {
894  TString objname(fTriggerPatchInfo->GetClass()->GetName());
895  TClass cls(objname);
896  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
897  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",GetName(), cls.GetName(), "EmcalTriggers"));
898  fTriggerPatchInfo = 0;
899  }
900  }
901 
902  if (!fTriggerPatchInfo) {
903  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
904  return;
905  }
906  for(auto p : *fTriggerPatchInfo){
907  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
908  if (recpatch) {
909  cout<<"Pstchphi:"<<recpatch->GetPhiCM()<<endl;
910  }
911  }
912  //Find main trigger
913 
914  (fTriggerPatchInfo) {
915  TString objname(fTriggerPatchInfo->GetClass()->GetName());
916  TClass cls(objname);
917  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
918  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",GetName(), cls.GetName(), "EmcalTriggers"));
919  fTriggerPatchInfo = 0;
920  }
921  if (!fTriggerPatchInfo) {
922  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
923  return;
924  }
925  }
926  //number of patches in event
927  //Int_t nPatch = fTriggerPatchInfo->GetEntriesFast();
928  //extract main trigger patch
929  //Double_t emax = -1.;
930  //for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
931  // AliEMCALTriggerPatchInfo *patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
932  // if (!patch) continue;
933  // cout<<"PstchE:"<<patch->GetPatchE()<<endl;
934  //}
935 
936 }
937 */
938 
943 {
944  cout<<"*****************************"<<endl;
945  cout<<"******* Task Finished *******"<<endl;
946  cout<<"*****************************"<<endl;
947 }
948 Double_t AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA::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
949 {
950  //
951  // Get the z of a constituent inside of a jet
952  //
953 
954  return (trkPx*jetPx+trkPy*jetPy+trkPz*jetPz)/(jetPx*jetPx+jetPy*jetPy+jetPz*jetPz);
955 }
957 {
958  Bool_t isLED = kFALSE;
959  //
960  // Check if the event is contaminated by LED signal
961  //
962  if (!fCaloCells) return kFALSE;
963 
964  TString histname;
965 
966  Int_t nCellCount[10] = {0};
967  const Short_t ncells = fCaloCells->GetNumberOfCells();
968 
969 
970 
971  for (Short_t pos = 0; pos < ncells; pos++) {
972  Int_t cellId = fCaloCells->GetCellNumber(pos);
973  Double_t amp = fCaloCells->GetAmplitude(pos);
974  Int_t sMod = fGeom->GetSuperModuleNumber(cellId);
975 
976  if(amp<0.1) continue;
977  nCellCount[sMod]++;
978 
979  }
980 
981  for(Int_t i=0; i<=9; i++){
982  fHistEMCalTowerMult[i]->Fill(nCellCount[i]);
983  }
984 
985 
986 
987  return isLED;
988 }
989 
990 Double_t AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA::GetFcross(const AliVCluster *cluster, AliVCaloCells *cells)
991 {
992  Int_t AbsIdseed = -1;
993  Double_t Eseed = 0;
994  for (Int_t i = 0; i < cluster->GetNCells(); i++) {
995  if (cells->GetCellAmplitude(cluster->GetCellAbsId(i)) > Eseed) {
996  Eseed = cells->GetCellAmplitude(cluster->GetCellAbsId(i));
997  AbsIdseed = cluster->GetCellAbsId(i);
998  }
999  }
1000 
1001  if (Eseed < 1e-9) {
1002  return 100;
1003  }
1004 
1005  Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1006  fGeom->GetCellIndex(AbsIdseed,imod,iTower,iIphi,iIeta);
1007  fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi,iIeta,iphi,ieta);
1008 
1009  //Get close cells index and energy, not in corners
1010 
1011  Int_t absID1 = -1;
1012  Int_t absID2 = -1;
1013 
1014  if (iphi < AliEMCALGeoParams::fgkEMCALRows-1) {
1015  absID1 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
1016  }
1017  if (iphi > 0) {
1018  absID2 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
1019  }
1020 
1021  // In case of cell in eta = 0 border, depending on SM shift the cross cell index
1022 
1023  Int_t absID3 = -1;
1024  Int_t absID4 = -1;
1025 
1026  if (ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2)) {
1027  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
1028  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
1029  }
1030  else if (ieta == 0 && imod%2) {
1031  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
1032  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
1033  }
1034  else {
1035  if (ieta < AliEMCALGeoParams::fgkEMCALCols-1) {
1036  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
1037  }
1038  if (ieta > 0) {
1039  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
1040  }
1041  }
1042 
1043  Double_t ecell1 = cells->GetCellAmplitude(absID1);
1044  Double_t ecell2 = cells->GetCellAmplitude(absID2);
1045  Double_t ecell3 = cells->GetCellAmplitude(absID3);
1046  Double_t ecell4 = cells->GetCellAmplitude(absID4);
1047 
1048  Double_t Ecross = ecell1 + ecell2 + ecell3 + ecell4;
1049 
1050  Double_t Fcross = 1 - Ecross/Eseed;
1051 
1052  return Fcross;
1053 }
1054 
1055 //Double_t AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA::GetSmearedTrackPt(AliVTrack *track)
1056 //{
1057  //
1058  // Smear track momentum
1059  //
1060 
1061  //Double_t resolution = track->Pt()*track->Pt()*TMath::Sqrt(track->GetSigma1Pt2());
1062  //Double_t smear = resolution*TMath::Sqrt((1+fVaryTrkPtRes)*(1+fVaryTrkPtRes)-1);
1063  // return fRandomGen->Gaus(0, smear);
1064 
1065 //}
1067 {
1068  Int_t count = 0;
1069  UInt_t tmp = entries;
1070  while(tmp!=0){
1071  count++;
1072  tmp = tmp &~ -tmp; // clear lowest bit
1073  }
1074 
1075  TString hnTitle(name);
1076  const Int_t dim = count;
1077  Int_t nbins[dim];
1078  Double_t xmin[dim];
1079  Double_t xmax[dim];
1080 
1081  Int_t i=0;
1082  Int_t c=0;
1083  while(c<dim && i<32){
1084  if(entries&(1<<i)){
1085 
1086  TString label("");
1087  GetDimParams(i, label, nbins[c], xmin[c], xmax[c]);
1088  hnTitle += Form(";%s",label.Data());
1089  c++;
1090  }
1091 
1092  i++;
1093  }
1094  hnTitle += ";";
1095 
1096  return new THnSparseF(name, hnTitle.Data(), dim, nbins, xmin, xmax);
1097 }
1108 {
1109  const Double_t pi = TMath::Pi();
1110 
1111  switch(iEntry){
1112 
1113  case 0:
1114  label = "V0 centrality (%)";
1115  nbins = 30;
1116  xmin = 0.;
1117  xmax = 100.;
1118  // Adjust for pp, since we are retrieving multiplicity instead
1120  label = "Multiplicity";
1121  xmax = 300.;
1122  }
1123  break;
1124 
1125  case 1:
1126  label = "Jet p_{T}";
1127  nbins = 200;
1128  xmin = 0.;
1129  xmax = 200.;
1130  break;
1131 
1132  case 2:
1133  label = "Track p_{T}";
1134  nbins = 100;
1135  xmin = 0.;
1136  xmax = 100;
1137  break;
1138 
1139  case 3:
1140  label = "Cluster E";
1141  nbins = 100;
1142  xmin = 0.;
1143  xmax = 100;
1144  break;
1145 
1146  case 4:
1147  label = "Jet#eta";
1148  nbins = 24;
1149  xmin = -1.2;
1150  xmax = 1.2;
1151  break;
1152 
1153  case 5:
1154  label = "Jet #phi";
1155  nbins = 72;
1156  xmin = -0.5*pi;
1157  xmax = 1.5*pi;
1158  break;
1159 
1160  case 6:
1161  label = "#it{p}_{T,track}^{leading}";
1162  nbins = 100;
1163  xmin = 0;
1164  xmax = 100;
1165  break;
1166 
1167  case 7:
1168  label = "Matched Trigger Amp";
1169  nbins = 10;
1170  xmin = 0;
1171  xmax = 50;
1172  break;
1173 
1174  case 8:
1175  label = "#Delta#eta";
1176  nbins = 48;
1177  xmin = -1.2;
1178  xmax = 1.2;
1179  break;
1180 
1181  case 9:
1182  label = "#Delta#phi";
1183  nbins = 72;
1184  xmin = 0;
1185  xmax = 2*pi;
1186  break;
1187 
1188  case 10:
1189  label = "F_{cross}";
1190  nbins = 20;
1191  xmin = 0;
1192  xmax = 1;
1193  break;
1194 
1195  case 11:
1196  label = "z_{leading}";
1197  nbins = 20;
1198  xmin = 0;
1199  xmax = 1;
1200  break;
1201 
1202  case 12:
1203  label = "#it{A}_{jet}";
1204  nbins = 20;
1205  xmin = 0;
1206  xmax = 1;
1207  break;
1208 
1209  case 13:
1210  label = "Jet NEF";
1211  nbins = 20;
1212  xmin = 0;
1213  xmax = 1;
1214  break;
1215 
1216  case 14:
1217  label = "Numb Constit";
1218  nbins = 50;
1219  xmin = 0;
1220  xmax = 50;
1221  break;
1222 
1223  case 15:
1224  label = "Numb Chrg Constit";
1225  nbins = 50;
1226  xmin = 0;
1227  xmax = 50;
1228  break;
1229 
1230  case 16:
1231  label = "Numb Neu Constit";
1232  nbins = 50;
1233  xmin = 0;
1234  xmax = 50;
1235  break;
1236  }
1237 }
1238 
THashList * CreateHistoGroup(const char *groupname)
Create a new group of histograms within a parent group.
TObjArray fClusterCollArray
cluster collection array
virtual THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
Double_t GetRhoVal() const
const TString & GetRhoName() const
double Double_t
Definition: External.C:58
Int_t GetNTracks() const
TF1 * fClusterEResolution
! Parameterization of cluster energy resolution from 2010 test beam results a = 4.35 b = 9.07 c = 1.63
Container with name, TClonesArray and cuts for particles.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
Declaration of class AliTLorentzVector.
Double_t GetFcross(const AliVCluster *cluster, AliVCaloCells *cells)
Double_t fMinBinPt
min pt in histograms
AliClusterContainer * GetClusterContainer() const
TCanvas * c
Definition: TestFitELoss.C:172
Int_t fCentBin
!event centrality bin
Declaration of class AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA.
TString part
use mixed event to constrain combinatorial background
Definition: InvMassFit.C:52
Container for particles within the EMCAL framework.
void SetCaloTriggerPatchInfoName(const char *n)
TObjArray fParticleCollArray
particle/track collection array
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
const AliClusterIterableContainer all() const
AliParticleContainer * GetParticleContainer() const
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
int Int_t
Definition: External.C:63
Bool_t fUseRecalcPatches
Switch between offline (FEE) and recalc (L1) patches.
unsigned int UInt_t
Definition: External.C:33
THashList * GetListOfHistograms() const
Get the list of histograms.
Definition: THistManager.h:671
AliEMCALGeometry * fGeom
!emcal geometry
Double_t Phi_0_2pi() const
Double_t fVaryTrkPtRes
! Variation of tracking momentum resolution
Implementation of a EMCal spectra task and QA for EMCal triggers.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
BeamType fForceBeamType
forced beam type
Int_t fNcentBins
how many centrality bins
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
AliVCluster * GetAcceptCluster(Int_t i) const
const AliClusterIterableContainer accepted() const
TString fCaloCellsName
name of calo cell collection
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Calculates the fraction of momentum z of part 1 w.r.t. part 2 in the direction of part 2...
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
TObjArray fJetCollArray
jet collection array
short Short_t
Definition: External.C:23
AliVCaloCells * fCaloCells
!cells
AliRhoParameter * GetRhoParameter()
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
Double_t fVertex[3]
!event vertex
void SetMakeGeneralHistograms(Bool_t g)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
const AliParticleIterableContainer accepted() const
const char Option_t
Definition: External.C:48
void UserCreateOutputObjects()
Main initialization function on the worker.
Double_t 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
const Double_t pi
const Int_t nbins
const AliJetIterableContainer accepted() const
bool Bool_t
Definition: External.C:53
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
Container structure for EMCAL clusters.
Container for jet within the EMCAL jet framework.
Definition: External.C:196
Int_t fNbins
no. of pt bins
virtual void GetDimParams(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)