AliPhysics  eb0e5d9 (eb0e5d9)
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 <TH2F.h>
19 #include <THnSparse.h>
20 #include <TList.h>
21 #include <array>
22 #include <iostream>
23 #include <map>
24 #include <vector>
25 #include <TClonesArray.h>
26 #include <TGrid.h>
27 #include <THistManager.h>
28 #include <THashList.h>
29 #include <TLinearBinning.h>
30 #include <TObjArray.h>
31 #include <TParameter.h>
32 
33 #include <AliVCluster.h>
34 #include <AliVParticle.h>
35 #include "AliAODTrack.h"
36 #include <AliLog.h>
37 
38 #include "AliTLorentzVector.h"
39 #include "AliEmcalJet.h"
40 #include "AliRhoParameter.h"
41 #include "AliJetContainer.h"
42 #include "AliParticleContainer.h"
43 #include "AliClusterContainer.h"
44 
45 
46 #include "AliAnalysisUtils.h"
47 #include "AliESDEvent.h"
48 #include "AliEMCALTriggerPatchInfo.h"
50 #include "AliInputEventHandler.h"
51 #include "AliLog.h"
52 #include "AliMultSelection.h"
53 #include "AliMultEstimator.h"
54 #include "AliOADBContainer.h"
55 
56 
58 
62 
63 using std::cout;
64 using std::endl;
65 
71 fUseRecalcPatches(false),
72 fHistManager(),
73 //fRecevent(),
74 //fMCevent(),
75 //fGeneratorLevel(0),
76 //fMCJetContainer(nullptr),
77 //fRecoUtil(0x0), fClusterEResolution(0x0), fVaryTrkPtRes(),
78 fUseSumw2(0),
79 fHistNumbJets(0x0),
80 fHistJetPt(0x0),
81 fHistJetJetPatchE(0x0),
82 fHistJetGammaPatchE(0x0),
83 fHistJetJetPatchPt(0x0),
84 fHistJetGammaPatchPt(0x0),
85 fHistTriggerPatchE(0x0)
86 //fhnMBJetSpectra(),
87 //fhnTrkQA(),
88 //fhnClusQA()
89 
90 {
91  //Array Initiation
92  for(int i=0;i<9;i++){
93  //fHistEMCalTowerMult[i] = NULL;
94 
95  }
96 }
97 
104 AliAnalysisTaskEmcalJet(name, kTRUE),
105 fUseRecalcPatches(0x0),
106 fHistManager(name),
107 //fRecevent(NULL),
108 //fMCevent(NULL),
109 //fGeneratorLevel(0),
110 //fMCJetContainer(nullptr),
111 //fRecoUtil(0x0), fClusterEResolution(0x0), fVaryTrkPtRes(0),
112 fUseSumw2(0),
113 fHistNumbJets(0x0),
114 fHistJetPt(0x0),
115 fHistJetJetPatchE(0x0),
117 fHistJetJetPatchPt(0x0),
120 //fhnMBJetSpectra(0x0),
121 //fhnTrkQA(0x0),
122 //fhnClusQA(0x0)
123 
124 
125 {
126  //Array Initiation
127  for(int i=0;i<=9;i++){
128  //fHistEMCalTowerMult[i] = NULL;
129 
130  }
132  SetCaloTriggerPatchInfoName("EmcalTriggers");
133 }
134 
139 {
140 }
141 
147 {
149 
150  TString histName = "";
151  TString histTitle = "";
152  for(int i=0;i<=9;i++){
153  histName = TString::Format("fHistEMCalTowerMult_%d",i);
154  histTitle = TString::Format("%s;N_{tower};Counts",histName.Data());
155  //fHistEMCalTowerMult[i] = new TH1F(histName.Data(),histTitle.Data(),400,0,400);
156  //fOutput->Add(fHistEMCalTowerMult[i]);
157  }
158 
159  // Get the MC particle branch, in case it exists
160 
161  AliJetContainer* jetMCCont = GetJetContainer();
162  TString jetMCContName = jetMCCont->GetName();
163 
164  //fGeneratorLevel = GetMCParticleContainer("mcparticles");
165  // if(fGeneratorLevel)
166  //{
167  // Printf("MCparticleContainer: %s", fGeneratorLevel->GetName());
168  //}
169  //if(jetMCContName.Contains("mcparticles"))
170  //{
171  // fMCJetContainer = jetMCCont;
172  //}
173 
174 
179  //AllocateParticleHistograms();
180 
181 
182  TIter next(fHistManager.GetListOfHistograms());
183  TObject* obj = 0;
184  while ((obj = next())) {
185  fOutput->Add(obj);
186  }
187  fOutput->Add(fHistNumbJets);
188  fOutput->Add(fHistJetPt);
189 
190 
191  // UInt_t SparseBit = 0;// Bit Code from GetDimParams()
192 
193 
194  //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;
195  //fhnMBJetSpectra = NewTHnSparseF("fhnMBJetSpectra", SparseBit);
196  //fhnMBJetSpectra->Sumw2();
197  // fOutput->Add(fhnMBJetSpectra);
198 
199  if(fUseSumw2==0) {
200  // =========== Switch on Sumw2 for all histos ===========
201  for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
202  TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
203  if (h1){
204  h1->Sumw2();
205  continue;
206  }
207  THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
208  if(hn)hn->Sumw2();
209  }
210  }
211 
212  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
213 }
214 
215 /*
216  * This function allocates the histograms for basic EMCal cluster QA.
217  * A set of histograms (energy, eta, phi, number of cluster) is allocated
218  * per each cluster container and per each centrality bin.
219  */
221 {
222  TString histname;
223  TString histtitle;
224  TString groupname;
225  AliClusterContainer* clusCont = 0;
226  TIter next(&fClusterCollArray);
227  while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
228  groupname = clusCont->GetName();
229  fHistManager.CreateHistoGroup(groupname);
230 
231 
232  for (Int_t cent = 0; cent < fNcentBins; cent++) {
233  histname = TString::Format("%s/histClusterEnergy_%d", groupname.Data(), cent);
234  histtitle = TString::Format("%s;#it{E}_{cluster} (GeV);counts", histname.Data());
235  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
236 
237  histname = TString::Format("%s/histClusterEnergyExotic_%d", groupname.Data(), cent);
238  histtitle = TString::Format("%s;#it{E}_{cluster}^{exotic} (GeV);counts", histname.Data());
239  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
240 
241  histname = TString::Format("%s/histClusterNonLinCorrEnergy_%d", groupname.Data(), cent);
242  histtitle = TString::Format("%s;#it{E}_{cluster}^{non-lin.corr.} (GeV);counts", histname.Data());
243  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
244 
245  histname = TString::Format("%s/histClusterHadCorrEnergy_%d", groupname.Data(), cent);
246  histtitle = TString::Format("%s;#it{E}_{cluster}^{had.corr.} (GeV);counts", histname.Data());
247  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
248 
249  histname = TString::Format("%s/histClusterPhi_%d", groupname.Data(), cent);
250  histtitle = TString::Format("%s;#it{#phi}_{custer};counts", histname.Data());
251  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi(), "s");
252 
253  histname = TString::Format("%s/histClusterEta_%d", groupname.Data(), cent);
254  histtitle = TString::Format("%s;#it{#eta}_{custer};counts", histname.Data());
255  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1, "s");
256 
257  histname = TString::Format("%s/fHistFcrossvEonline_%d", groupname.Data(), cent);
258  histtitle = TString::Format("%s;#it{E}_{cluster} (GeV);#it{F}_{cross}", histname.Data());
259  fHistManager.CreateTH2(histname, histtitle, 100, 0, 100, 100, 0, 1.0);
260 
261 
262  histname = TString::Format("%s/histNClusters_%d", groupname.Data(), cent);
263  histtitle = TString::Format("%s;number of clusters;events", histname.Data());
264  if (fForceBeamType != kpp) {
265  fHistManager.CreateTH1(histname, histtitle, 500, 0, 3000, "s");
266  }
267  else {
268  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200, "s");
269  }
270  }
271  }
272 }
273 
274 /*
275  * This function allocate histograms to the particle level MC event
276  * before the particles are propagated through GEANT.
277  * This function also has adaptability for the jet finder.
278  *
279  */
280 
281 /*
282 void AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA::AllocateParticleHistograms()
283 {
284  // If MC, get the MC event
285  // const AliMCEvent* mcevent = nullptr;
286  //if (fGeneratorLevel) {
287  // mcevent = MCEvent();
288  //}
289  //else {
290  // return;
291  //}
292  TString histname;
293  TString histtitle;
294  TString groupname;
295  Double_t pi = TMath::Pi();
296  //AliParticleContainer* MCCont = 0;
297  //MCCont = AddMCParticleContainer("mcparticles");
298  //groupname = MCCont->GetName();
299  fHistManager.CreateHistoGroup(groupname);
300 
301  for (Int_t cent = 0; cent < fNcentBins; cent++) {
302  histname = TString::Format("%s/fHistParticleLvlpT_%d", groupname.Data(), cent);
303  histtitle = TString::Format("%s;#it{p}_{T} (GeV);counts", histname.Data());
304  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
305  }
306 
307 }
308 */
309 
310 /*
311  * This function allocates the histograms for basic EMCal QA.
312  * One 2D histogram with the cell energy spectra and the number of cells
313  * per event is allocated per each centrality bin.
314  */
316 {
317  TString histname;
318  TString histtitle;
319  TString groupname(fCaloCellsName);
320 
321  fHistManager.CreateHistoGroup(groupname);
322  for (Int_t cent = 0; cent < fNcentBins; cent++) {
323  histname = TString::Format("%s/histCellEnergy_%d", groupname.Data(), cent);
324  histtitle = TString::Format("%s;#it{E}_{cell} (GeV);counts", histname.Data());
325  fHistManager.CreateTH1(histname, histtitle, 600, 0, 150, "s");
326 
327  histname = TString::Format("%s/histNCells_%d", groupname.Data(), cent);
328  histtitle = TString::Format("%s;number of cells;events", histname.Data());
329  if (fForceBeamType != kpp) {
330  fHistManager.CreateTH1(histname, histtitle, 500, 0, 6000,"s");
331  }
332  else {
333  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200,"s");
334  }
335  }
336 }
337 
338 /*
339  * This function allocates the histograms for basic tracking QA.
340  * A set of histograms (pT, eta, phi, difference between kinematic properties
341  * at the vertex and at the EMCal surface, number of tracks) is allocated
342  * per each particle container and per each centrality bin.
343  */
345 {
346  TString histname;
347  TString histtitle;
348  TString groupname;
349  AliParticleContainer* partCont = 0;
350  TIter next(&fParticleCollArray);
351  while ((partCont = static_cast<AliParticleContainer*>(next()))) {
352  groupname = partCont->GetName();
353  fHistManager.CreateHistoGroup(groupname);
354 
355 
356  for (Int_t cent = 0; cent < fNcentBins; cent++) {
357  histname = TString::Format("%s/histTrackPt_%d", groupname.Data(), cent);
358  histtitle = TString::Format("%s;#it{p}_{T,track} (GeV/#it{c});counts", histname.Data());
359  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
360 
361  histname = TString::Format("%s/histTrackPhi_%d", groupname.Data(), cent);
362  histtitle = TString::Format("%s;#it{#phi}_{track};counts", histname.Data());
363  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi(), "s");
364 
365  histname = TString::Format("%s/histTrackEta_%d", groupname.Data(), cent);
366  histtitle = TString::Format("%s;#it{#eta}_{track};counts", histname.Data());
367  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1, "s");
368 
369  if (TClass(partCont->GetClassName()).InheritsFrom("AliVTrack")) {
370 
371  histname = TString::Format("%s/fHistTrackResolution_%d", groupname.Data(), cent);
372  histtitle = TString::Format("%s;#sigma(#it{p}_{T}) / #it{p}_{T};counts", histname.Data());
373  fHistManager.CreateTH1(histname, histtitle, 100, 0, 1);
374 
375  histname = TString::Format("%s/fHistCovMatrix_%d", groupname.Data(), cent);
376  histtitle = TString::Format("%s; #it{p}_{T}; #sigma(#it{p}_{T}) / #it{p}_{T}; counts", histname.Data());
377  fHistManager.CreateTH2(histname, histtitle, 150, 0, 150, 100,0,1);
378 
379  histname = TString::Format("%s/fHistDeltaEtaPt_%d", groupname.Data(), cent);
380  histtitle = TString::Format("%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#eta}_{track}^{vertex} - #it{#eta}_{track}^{EMCal};counts", histname.Data());
381  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, 50, -0.5, 0.5);
382 
383  histname = TString::Format("%s/fHistDeltaPhiPt_%d", groupname.Data(), cent);
384  histtitle = TString::Format("%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#phi}_{track}^{vertex} - #it{#phi}_{track}^{EMCal};counts", histname.Data());
385  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, 200, -2, 2);
386 
387  histname = TString::Format("%s/fHistDeltaPtvsPt_%d", groupname.Data(), cent);
388  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());
389  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, fNbins / 2, -fMaxBinPt/2, fMaxBinPt/2);
390 
391  histname = TString::Format("%s/fHistEoverPvsP_%d", groupname.Data(), cent);
392  histtitle = TString::Format("%s;#it{P}_{track} (GeV/#it{c});#it{E}_{cluster} / #it{P}_{track} #it{c};counts", histname.Data());
393  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, fNbins / 2, 0, 4);
394  }
395 
396  histname = TString::Format("%s/histNTracks_%d", groupname.Data(), cent);
397  histtitle = TString::Format("%s;number of tracks;events", histname.Data());
398  if (fForceBeamType != kpp) {
399  fHistManager.CreateTH1(histname, histtitle, 500, 0, 5000, "s");
400  }
401  else {
402  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200, "s");
403  }
404  }
405  }
406 }
407 
408 /*
409  * This function allocates the histograms for basic jet QA.
410  * A set of histograms (pT, eta, phi, area, number of jets, corrected pT) is allocated
411  * per each jet container and per each centrality bin.
412  */
414 {
415  TString histname;
416  TString histtitle;
417  TString groupname;
418  Double_t pi = TMath::Pi();
419  AliJetContainer* jetCont = 0;
420  TIter next(&fJetCollArray);
421  UInt_t SparseBit = 0;// Bit Code from GetDimParams()
422  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;
423 
424  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
425  groupname = jetCont->GetName();
426  fHistManager.CreateHistoGroup(groupname);
427 
428  histname = TString::Format("%s/fhnJetSparse", groupname.Data());
429  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};m#it{z}_{leading};#it{A}_{jet};#it{NEF};#it{N}_{constit}";
430  Int_t nbins13[10] = {300, fNbins, fNbins, fNbins,24,36,20,20,20,100};
431  Double_t min13[10] = {0,fMinBinPt,fMinBinPt,fMinBinPt,-1.2, -0.5*pi,0,0,0,0};
432  Double_t max13[10] = {300,fMaxBinPt, fMaxBinPt, fMaxBinPt,1.2,1.5*pi,1,1,1,1};
433  fHistManager.CreateTHnSparse(histname.Data(), histtitle.Data(), 10, nbins13, min13, max13, "s");
434 
435 
436  for (Int_t cent = 0; cent < fNcentBins; cent++) {
437 
438  histname = TString::Format("%s/histJetPt_%d", groupname.Data(), cent);
439  histtitle = TString::Format("%s;#it{p}_{T,jet} (GeV/#it{c});counts", histname.Data());
440  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
441 
442  histname = TString::Format("%s/histJetClusterEnergy_%d", groupname.Data(), cent);
443  histtitle = TString::Format("%s;#it{E}_{JetClus} (GeV);counts", histname.Data());
444  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2, "s");
445 
446  histname = TString::Format("%s/histJetTrkPt_%d", groupname.Data(), cent);
447  histtitle = TString::Format("%s;#it{p}_{T,JetTrk} (GeV/#it{c});counts", histname.Data());
448  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
449 
450  histname = TString::Format("%s/histJetNEFvJetPt_%d", groupname.Data(), cent);
451  histtitle = TString::Format("%s;#it{p}_{T,Jet};NEF", histname.Data());
452  fHistManager.CreateTH2(histname, histtitle, 200, 0, 200, 100, 0, 1, "s");
453 
454  histname = TString::Format("%s/histNumbJetConstvJetPt_%d", groupname.Data(), cent);
455  histtitle = TString::Format("%s;#it{p}_{T,Jet};NumberofJetConstit", histname.Data());
456  fHistManager.CreateTH2(histname, histtitle, 200, 0, 200, 20,0,20, "s");
457 
458  histname = TString::Format("%s/histJetFF_%d", groupname.Data(), cent);
459  histtitle = TString::Format("%s;Z=#it{p}_{T,leading} / #it{p}_{T,Jet};counts", histname.Data());
460  fHistManager.CreateTH1(histname, histtitle, 100, 0, 1, "s");
461 
462  histname = TString::Format("%s/histJetZvJetPt_%d", groupname.Data(), cent);
463  histtitle = TString::Format("%s;#it{p}_{T,Jet};Z=#it{p}_{T,Trk} / #it{p}_{T,Jet}", histname.Data());
464  fHistManager.CreateTH2(histname, histtitle, 200, 0, 200, 100,0,1);
465 
466  //histname = TString::Format("%s/histJetNeutralPtvJetPt_%d", groupname.Data(), cent);
467  //histtitle = TString::Format("%s;#it{p}_{T,Jet};#it{p}_{T,NeutralConstituents}", histname.Data());
468  //fHistManager.CreateTH2(histname, histtitle, 200, 0, 200, 200, 0, 200);
469 
470  histname = TString::Format("%s/histFCrossvZleading_%d", groupname.Data(), cent);
471  histtitle = TString::Format("%s;#it{z}_{leading};#it{F}_{Cross}", histname.Data());
472  fHistManager.CreateTH2(histname, histtitle, 100, 0, 1, 100, 0, 1);
473 
474  //Matched Trigger Histos
475  histname = TString::Format("%s/fHistNumbJETrigger_%d", groupname.Data(), cent);
476  histtitle = TString::Format("%s;JE Trigger Normaliztion;counts", histname.Data());
477  fHistManager.CreateTH1(histname, histtitle, 1, 0, 1, "s");
478 
479  histname = TString::Format("%s/fHistNumbGATrigger_%d", groupname.Data(), cent);
480  histtitle = TString::Format("%s;GA Trigger Normaliztion;counts", histname.Data());
481  fHistManager.CreateTH1(histname, histtitle, 1, 0, 1, "s");
482 
483  histname = TString::Format("%s/fHistJetJetPatchE_%d", groupname.Data(), cent);
484  histtitle = TString::Format("%s;#it{E}_{JetGammaPatch} (GeV);counts", histname.Data());
485  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
486 
487  histname = TString::Format("%s/fHistJetGammaPatchE_%d", groupname.Data(), cent);
488  histtitle = TString::Format("%s;#it{E}_{JetGammaPatch} (GeV);counts", histname.Data());
489  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
490 
491  histname = TString::Format("%s/fHistJetJetPatchPt_%d", groupname.Data(), cent);
492  histtitle = TString::Format("%s;#it{p}_{T,JetJetPatch} (GeV/#it{c});counts", histname.Data());
493  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
494 
495  histname = TString::Format("%s/fHistJetGammaPatchPt_%d", groupname.Data(), cent);
496  histtitle = TString::Format("%s;#it{p}_{T,JetGammaPatch} (GeV/#it{c});counts", histname.Data());
497  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
498 
499  histname = TString::Format("%s/fHistTriggerPatchE_%d", groupname.Data(), cent);
500  histtitle = TString::Format("%s;#it{E}_{TriggerPatch} (GeV);counts", histname.Data());
501  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt, "s");
502 
503  histname = TString::Format("%s/fHistDeltaEtaDeltaPhiJE_%d", groupname.Data(), cent);
504  histtitle = TString::Format("%s;#it{#phi}_{jet} - #it{#phi}_{JE,patch};#it{#eta}_{Jet} - #it{#eta}_{JE,patch};counts", histname.Data());
505  fHistManager.CreateTH2(histname, histtitle, 280, -0.7, 0.7, 280, -0.7, 0.7);
506 
507  histname = TString::Format("%s/fHistDeltaEtaDeltaPhiGA_%d", groupname.Data(), cent);
508  histtitle = TString::Format("%s;#it{#phi}_{jet} - #it{#phi}_{GA,patch};#it{#eta}_{Jet} - #it{#eta}_{GA,patch};counts", histname.Data());
509  fHistManager.CreateTH2(histname, histtitle, 280, -0.7, 0.7, 280, -0.7, 0.7);
510 
511  histname = TString::Format("%s/fHistJetEPatchEJE_%d", groupname.Data(), cent);
512  histtitle = TString::Format("%s;#it{E_{JE,patch}}#it{E_{Jet,UnCorr}};counts", histname.Data());
513  fHistManager.CreateTH2(histname, histtitle, 400, 0, 200, 400, 0, 200);
514 
515  histname = TString::Format("%s/fHistJetEPatchEGA_%d", groupname.Data(), cent);
516  histtitle = TString::Format("%s;#it{E_{GA,patch}};#it{E_{Jet,UnCorr}};counts", histname.Data());
517  fHistManager.CreateTH2(histname, histtitle, 400, 0, 200, 400, 0, 200);
518  // End Matched Trigger Histos
519 
520  histname = TString::Format("%s/fHistJetTrackResolution_%d", groupname.Data(), cent);
521  histtitle = TString::Format("%s;#sigma(#it{p}_{T}) / #it{p}_{T};counts", histname.Data());
522  fHistManager.CreateTH1(histname, histtitle, 100, 0, 1);
523 
524  histname = TString::Format("%s/fHistJetCovMatrix_%d", groupname.Data(), cent);
525  histtitle = TString::Format("%s; #it{p}_{T}; #sigma(#it{p}_{T}) / #it{p}_{T}; counts", histname.Data());
526  fHistManager.CreateTH2(histname, histtitle, 150, 0, 150, 100,0,1);
527 
528  histname = TString::Format("%s/histJetArea_%d", groupname.Data(), cent);
529  histtitle = TString::Format("%s;#it{A}_{jet};counts", histname.Data());
530  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, 3);
531 
532  histname = TString::Format("%s/histJetPhi_%d", groupname.Data(), cent);
533  histtitle = TString::Format("%s;#it{#phi}_{jet};counts", histname.Data());
534  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi(), "s");
535 
536  histname = TString::Format("%s/histJetEta_%d", groupname.Data(), cent);
537  histtitle = TString::Format("%s;#it{#eta}_{jet};counts", histname.Data());
538  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1, "s");
539 
540  histname = TString::Format("%s/histJetClusterPhi_%d", groupname.Data(), cent);
541  histtitle = TString::Format("%s;#it{#phi}_{JetClus};counts", histname.Data());
542  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi(), "s");
543 
544  histname = TString::Format("%s/histJetClusterEta_%d", groupname.Data(), cent);
545  histtitle = TString::Format("%s;#it{#eta}_{JetClus};counts", histname.Data());
546  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1, "s");
547 
548  histname = TString::Format("%s/histNJets_%d", groupname.Data(), cent);
549  histtitle = TString::Format("%s;number of jets;events", histname.Data());
550  if (fForceBeamType != kpp) {
551  fHistManager.CreateTH1(histname, histtitle, 500, 0, 500, "s");
552  }
553  else {
554  fHistManager.CreateTH1(histname, histtitle, 100, 0, 100, "s");
555  }
556 
557  if (!jetCont->GetRhoName().IsNull()) {
558  histname = TString::Format("%s/histJetCorrPt_%d", groupname.Data(), cent);
559  histtitle = TString::Format("%s;#it{p}_{T,jet}^{corr} (GeV/#it{c});counts", histname.Data());
560  fHistManager.CreateTH1(histname, histtitle, fNbins, -fMaxBinPt / 2, fMaxBinPt / 2);
561  }
562  }
563  }
564 }
565 
573 {
574  DoJetLoop();
575  DoTrackLoop();
576  DoClusterLoop();
577  DoCellLoop();
578  //DoParticleLoop();
579 
580  return kTRUE;
581 }
582 
588 {
589  TString histname;
590  TString groupname;
591  AliJetContainer* jetCont = 0;
592  TIter next(&fJetCollArray);
593 
594  //TClonesArray *triggerpatches = dynamic_cast<TClonesArray *>(InputEvent()->FindListObject("EmcalTriggers"));
595  //if(!triggerpatches)
596  // AliErrorStream() << "Trigger patch container EmcalTriggers not found in task " << GetName() << std::endl;
597 
598  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
599  groupname = jetCont->GetName();
600  UInt_t count = 0;
601  for(auto jet : jetCont->accepted()) {
602  if (!jet) continue;
603  count++;
604 
605  TLorentzVector leadPart;
606  jetCont->GetLeadingHadronMomentum(leadPart, jet);
607  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
608  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
609 
610  histname = TString::Format("%s/histJetPt_%d", groupname.Data(), fCentBin);
611  fHistManager.FillTH1(histname, jet->Pt());
612 
613  histname = TString::Format("%s/histJetClusterEnergy_%d", groupname.Data(), fCentBin);
614  fHistManager.FillTH1(histname, jet->E());
615 
616  histname = TString::Format("%s/histJetArea_%d", groupname.Data(), fCentBin);
617  fHistManager.FillTH1(histname, jet->Area());
618 
619  histname = TString::Format("%s/histJetPhi_%d", groupname.Data(), fCentBin);
620  fHistManager.FillTH1(histname, jet->Phi());
621 
622  histname = TString::Format("%s/histJetEta_%d", groupname.Data(), fCentBin);
623  fHistManager.FillTH1(histname, jet->Eta());
624 
625  histname = TString::Format("%s/histJetNEFvJetPt_%d", groupname.Data(), fCentBin);
626  fHistManager.FillTH2(histname,jet->Pt(),jet->NEF() );
627 
628 
629  histname = TString::Format("%s/histNumbJetConstvJetPt_%d", groupname.Data(), fCentBin);
630  fHistManager.FillTH2(histname,jet->Pt(),jet->N());
631 
632  histname = TString::Format("%s/histJetFF_%d", groupname.Data(), fCentBin);
633  fHistManager.FillTH1(histname, z );
634 
635  Double_t MatchedEta = 0.04, MatchedPhi = 0.04;
636  //Look at emcal trigger patches in event and associate with jet
637  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
638 
639  if (fTriggerPatchInfo) {
640  TString objname(fTriggerPatchInfo->GetClass()->GetName());
641  TClass cls(objname);
642  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
643  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",GetName(), cls.GetName(), "EmcalTriggers"));
644  fTriggerPatchInfo = 0;
645  }
646  }
647 
648  if (!fTriggerPatchInfo) {
649  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
650  continue;
651  }
652 
653  //AliEMCALTriggerPatchInfo *currentpatch(nullptr);
654  for(auto p : *fTriggerPatchInfo){
655  AliEMCALTriggerPatchInfo *currentpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
656 
657  //Select Single Shower Patch
658  if(currentpatch->IsGammaLowRecalc() || currentpatch->IsGammaLowSimple()){
659  histname = TString::Format("%s/fHistDeltaEtaDeltaPhiGA_%d", groupname.Data(), fCentBin);
660  fHistManager.FillTH2(histname, jet->Phi() - currentpatch->GetPhiGeo(), jet->Eta() - currentpatch->GetEtaGeo());
661  histname = TString::Format("%s/fHistJetEPatchEGA_%d", groupname.Data(), fCentBin);
662  fHistManager.FillTH2(histname,jet->E(),currentpatch->GetPatchE());
663 
664  if(jet->Phi() - currentpatch->GetPhiGeo() <= MatchedPhi && jet->Eta() - currentpatch->GetEtaGeo() <= MatchedEta){
665  histname = TString::Format("%s/fHistNumbGATrigger_%d", groupname.Data(), fCentBin);
666  fHistManager.FillTH1(histname, 0.5);
667  histname = TString::Format("%s/fHistJetGammaPatchE_%d", groupname.Data(), fCentBin);
668  fHistManager.FillTH1(histname, currentpatch->GetPatchE());
669  histname = TString::Format("%s/fHistJetGammaPatchPt_%d", groupname.Data(), fCentBin);
670  fHistManager.FillTH1(histname, jet->Pt());
671  }
672  }
673 
674  //Select Jet Patch
675  if(currentpatch->IsJetLowRecalc() || currentpatch->IsJetLowSimple()){
676  histname = TString::Format("%s/fHistDeltaEtaDeltaPhiJE_%d", groupname.Data(), fCentBin);
677  fHistManager.FillTH2(histname, jet->Phi() - currentpatch->GetPhiGeo(), jet->Eta() - currentpatch->GetEtaGeo());
678  histname = TString::Format("%s/fHistJetEPatchEJE_%d", groupname.Data(), fCentBin);
679  fHistManager.FillTH2(histname,jet->E(),currentpatch->GetPatchE());
680 
681  if(jet->Phi() - currentpatch->GetPhiGeo() <= MatchedPhi && jet->Eta() - currentpatch->GetEtaGeo() <= MatchedEta){
682  histname = TString::Format("%s/fHistNumbJETrigger_%d", groupname.Data(), fCentBin);
683  fHistManager.FillTH1(histname, 0.5);
684  histname = TString::Format("%s/fHistJetJetPatchE_%d", groupname.Data(), fCentBin);
685  fHistManager.FillTH1(histname, currentpatch->GetPatchE());
686  histname = TString::Format("%s/fHistJetJetPatchPt_%d", groupname.Data(), fCentBin);
687  fHistManager.FillTH1(histname, jet->Pt());
688  }
689  }
690 
691  }
692 
693  Double_t Z_part = 0.0;
694 
695  //Look at assoc tracks of a given jet
696  AliParticleContainer* tracks = jetCont->GetParticleContainer();
697  if (tracks) {
698  for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
699  AliVParticle *JetTrk = jet->TrackAt(it, tracks->GetArray());
700  if (JetTrk) {
701 
702  AliVTrack *Vtrack = dynamic_cast<AliVTrack*>(JetTrk);
703  const AliAODTrack* AODJetTrack = static_cast<const AliAODTrack*>(Vtrack);
704 
705  if(!AODJetTrack) AliFatal("Not a standard AOD");
706 
707  AliExternalTrackParam exParam;
708  Double_t sigma = 0;
709 
710  //get covariance matrix
711  Double_t cov[21] = {0,};
712  AODJetTrack->GetCovMatrix(cov);
713  Double_t pxpypz[3] = {0,};
714  AODJetTrack->PxPyPz(pxpypz);
715  Double_t xyz[3] = {0,};
716  AODJetTrack->GetXYZ(xyz);
717  Short_t sign = AODJetTrack->Charge();
718  exParam.Set(xyz,pxpypz,cov,sign);
719  sigma = TMath::Sqrt(exParam.GetSigma1Pt2());
720  Z_part = Vtrack->Pt() / jet->Pt();
721 
722  histname = TString::Format("%s/fHistJetTrackResolution_%d", groupname.Data(), fCentBin);
723  fHistManager.FillTH1(histname, sigma);
724  histname = TString::Format("%s/fHistJetCovMatrix_%d", groupname.Data(), fCentBin);
725  fHistManager.FillTH2(histname, Vtrack->Pt(), sigma);
726  histname = TString::Format("%s/histJetTrkPt_%d", groupname.Data(), fCentBin);
727  fHistManager.FillTH1(histname, JetTrk->Pt());
728  histname = TString::Format("%s/histJetZvJetPt_%d", groupname.Data(), fCentBin);
729  fHistManager.FillTH2(histname,jet->Pt(),Z_part);
730 
731  //if(jetContName.Contains("mcparticles")){
732  // fMCJetContainer
733  // Double_t jetPID = 0;
734  // jetPID->PID();
735  // cout<<"PID of trk in Jet: "<<jetPID<<endl;
736  //}
737  }
738  }
739  }
740  //Loop over Clusters in Jet
741  AliClusterContainer* JetCluster = 0;
742  JetCluster = jetCont->GetClusterContainer();
743  if(JetCluster) {
744  for(auto cluster : JetCluster->accepted()) {
745  AliTLorentzVector nPart;
746  cluster->GetMomentum(nPart, fVertex);
747  //Double_t JetFCross = GetFcross(cluster, fCaloCells);
748  Double_t JetFCross = 1.;
749  histname = TString::Format("%s/histJetClusterEnergy_%d", groupname.Data(), fCentBin);
750  fHistManager.FillTH1(histname, cluster->E());
751  histname = TString::Format("%s/histJetClusterPhi_%d", groupname.Data(), fCentBin);
752  fHistManager.FillTH1(histname, nPart.Phi_0_2pi());
753  histname = TString::Format("%s/histJetClusterEta_%d", groupname.Data(), fCentBin);
754  fHistManager.FillTH1(histname, nPart.Eta());
755  histname = TString::Format("%s/histFCrossvZleading_%d", groupname.Data(), fCentBin);
756  fHistManager.FillTH2(histname,jet->MaxTrackPt() / jet->Pt(), JetFCross);
757  }
758 
759 
760  }
761 
762  Double_t leadingtrackpT = 0.0;
763  Double_t leadingclusterE = 0.0;
764  Double_t JetFCrossLeading = 0.0;
765  //AliVParticle *leadingParticle = 0x0;
766  AliVCluster *leadingCluster = 0x0;
767 
768 
769  leadingCluster = jet->GetLeadingCluster();
770  if(leadingCluster){
771  leadingclusterE = leadingCluster->E();
772  //JetFCrossLeading = GetFcross(leadingCluster, fCaloCells);
773  JetFCrossLeading = 1.;
774  }
775 
776  AliVParticle* leadingTrk = jet->GetLeadingTrack();
777  if(leadingTrk){
778  leadingtrackpT = leadingTrk->Pt();
779  }
780  AliTrackContainer * Globaltracks = static_cast<AliTrackContainer * >(GetParticleContainer("tracks"));
781  Double_t TrackMultiplicity = Globaltracks->GetNTracks();
782  Double_t Numb = jet->N();
783  Double_t x[10]={TrackMultiplicity,jet->Pt(),leadingtrackpT,leadingclusterE,jet->Eta(),jet->Phi(),z,jet->Area(),jet->NEF(),Numb};
784  histname = TString::Format("%s/fhnJetSparse", groupname.Data());
785  fHistManager.FillTHnSparse(histname, x);
786 
787  if (jetCont->GetRhoParameter()) {
788  histname = TString::Format("%s/histJetCorrPt_%d", groupname.Data(), fCentBin);
789  fHistManager.FillTH1(histname, jet->Pt() - jetCont->GetRhoVal() * jet->Area());
790  }//Background Subtaction in PbPb
791  }// Loop over each jet in a event
792  histname = TString::Format("%s/histNJets_%d", groupname.Data(), fCentBin);
793  fHistManager.FillTH1(histname, count);
794  }
795 }
796 
802 {
804 
805  AliTrackContainer* trackCont = GetTrackContainer("tracks");
806 
807  TString histname;
808  TString groupname;
809  AliParticleContainer* partCont = 0;
810  TIter next(&fParticleCollArray);
811 
812  //for (auto trackIt : trackCont->accepted_momentum() ) {
813  //}
814 
815  while ((partCont = static_cast<AliParticleContainer*>(next()))) {
816  groupname = partCont->GetName();
817  UInt_t count = 0;
818 
819 
820  for(auto part : partCont->accepted()) {
821  if (!part) continue;
822  count++;
823 
824 
825  histname = TString::Format("%s/histTrackPt_%d", groupname.Data(), fCentBin);
826  fHistManager.FillTH1(histname, part->Pt());
827 
828  histname = TString::Format("%s/histTrackPhi_%d", groupname.Data(), fCentBin);
829  fHistManager.FillTH1(histname, part->Phi());
830 
831  histname = TString::Format("%s/histTrackEta_%d", groupname.Data(), fCentBin);
832  fHistManager.FillTH1(histname, part->Eta());
833 
834 
835 
836  if (partCont->GetLoadedClass()->InheritsFrom("AliVTrack")) {
837  const AliVTrack* track = static_cast<const AliVTrack*>(part);
838  const AliAODTrack* AODTrack = static_cast<const AliAODTrack*>(track);
839 
840  if(!AODTrack) AliFatal("Not a standard AOD");
841 
842  AliExternalTrackParam exParam;
843  Double_t sigma = 0;
844 
845  //get covariance matrix
846  Double_t cov[21] = {0,};
847  AODTrack->GetCovMatrix(cov);
848  Double_t pxpypz[3] = {0,};
849  AODTrack->PxPyPz(pxpypz);
850  Double_t xyz[3] = {0,};
851  AODTrack->GetXYZ(xyz);
852  Short_t sign = AODTrack->Charge();
853  exParam.Set(xyz,pxpypz,cov,sign);
854  sigma = TMath::Sqrt(exParam.GetSigma1Pt2());
855 
856  histname = TString::Format("%s/fHistTrackResolution_%d", groupname.Data(), fCentBin);
857  fHistManager.FillTH1(histname, sigma);
858 
859  histname = TString::Format("%s/fHistCovMatrix_%d", groupname.Data(), fCentBin);
860  fHistManager.FillTH2(histname, track->Pt(), sigma);
861 
862  histname = TString::Format("%s/fHistDeltaEtaPt_%d", groupname.Data(), fCentBin);
863  fHistManager.FillTH1(histname, track->Pt(), track->Eta() - track->GetTrackEtaOnEMCal());
864 
865  histname = TString::Format("%s/fHistDeltaPhiPt_%d", groupname.Data(), fCentBin);
866  fHistManager.FillTH1(histname, track->Pt(), track->Phi() - track->GetTrackPhiOnEMCal());
867 
868  histname = TString::Format("%s/fHistDeltaPtvsPt_%d", groupname.Data(), fCentBin);
869  fHistManager.FillTH1(histname, track->Pt(), track->Pt() - track->GetTrackPtOnEMCal());
870 
871 
872  if (clusCont) {
873  Int_t iCluster = track->GetEMCALcluster();
874  if (iCluster >= 0) {
875  AliVCluster* cluster = clusCont->GetAcceptCluster(iCluster);
876  if (cluster) {
877  histname = TString::Format("%s/fHistEoverPvsP_%d", groupname.Data(), fCentBin);
878  fHistManager.FillTH2(histname, track->P(), cluster->GetNonLinCorrEnergy() / track->P());
879 
880  }
881  }
882  }
883  }
884  }
885 
886  histname = TString::Format("%s/histNTracks_%d", groupname.Data(), fCentBin);
887  fHistManager.FillTH1(histname, count);
888  }
889 }
890 
896 {
897  Double_t TrkPt = 0.0, EovP = 0.0, trkpSum = 0.0;
898  TString histname;
899  TString groupname;
900  AliClusterContainer* clusCont = 0;
901  TIter next(&fClusterCollArray);
902  while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
903  groupname = clusCont->GetName();
904 
905  //Cluster Exotics
906  for(auto cluster : clusCont->all()) {
907  if (!cluster) continue;
908 
909  //Double_t FCross = GetFcross(cluster, fCaloCells);
910  Double_t FCross = 1.;
911  histname = TString::Format("%s/fHistFcrossvEonline_%d", groupname.Data(), fCentBin);
912  fHistManager.FillTH2(histname, cluster->E(), FCross);
913 
914  if (cluster->GetIsExotic()) {
915  histname = TString::Format("%s/histClusterEnergyExotic_%d", groupname.Data(), fCentBin);
916  fHistManager.FillTH1(histname, cluster->E());
917  }
918  }
919 
920  UInt_t count = 0;
921  for(auto cluster : clusCont->accepted()) {
922  if (!cluster) continue;
923  count++;
924 
925  AliTLorentzVector nPart;
926  cluster->GetMomentum(nPart, fVertex);
927 
928  histname = TString::Format("%s/histClusterEnergy_%d", groupname.Data(), fCentBin);
929  fHistManager.FillTH1(histname, cluster->E());
930 
931  histname = TString::Format("%s/histClusterNonLinCorrEnergy_%d", groupname.Data(), fCentBin);
932  fHistManager.FillTH1(histname, cluster->GetNonLinCorrEnergy());
933 
934  histname = TString::Format("%s/histClusterHadCorrEnergy_%d", groupname.Data(), fCentBin);
935  fHistManager.FillTH1(histname, cluster->GetHadCorrEnergy());
936 
937  histname = TString::Format("%s/histClusterPhi_%d", groupname.Data(), fCentBin);
938  fHistManager.FillTH1(histname, nPart.Phi_0_2pi());
939 
940  histname = TString::Format("%s/histClusterEta_%d", groupname.Data(), fCentBin);
941  fHistManager.FillTH1(histname, nPart.Eta());
942 
943  //Int_t nTracksMatched = 0;
944  const AliVTrack* track = 0x0;
945 
946  for (Int_t itrack=0; itrack < cluster->GetNTracksMatched(); itrack++){
947  track = dynamic_cast<AliVTrack*>(cluster->GetTrackMatched(itrack));
948  if(track){
949  TrkPt = track->Pt();
950  trkpSum += track->P();
951  EovP = cluster->GetNonLinCorrEnergy() / trkpSum;
952 
953  }
954  }
955 
956 
957 
958  }
959 
960  histname = TString::Format("%s/histNClusters_%d", groupname.Data(), fCentBin);
961  fHistManager.FillTH1(histname, count);
962  }
963 }
964 
970 {
971  if (!fCaloCells) return;
972 
973  TString histname;
974 
975  const Short_t ncells = fCaloCells->GetNumberOfCells();
976 
977  histname = TString::Format("%s/histNCells_%d", fCaloCellsName.Data(), fCentBin);
978  fHistManager.FillTH1(histname, ncells);
979 
980  histname = TString::Format("%s/histCellEnergy_%d", fCaloCellsName.Data(), fCentBin);
981  for (Short_t pos = 0; pos < ncells; pos++) {
982  Double_t amp = fCaloCells->GetAmplitude(pos);
983 
984  fHistManager.FillTH1(histname, amp);
985  }
986 }
987 
1000 {
1001 
1003 }
1004 
1013 {
1014  //Int_t runNum = InputEvent()->GetRunNumber();
1015 
1016  //Bool_t PileUp = AliVEvent::IsPileupFromSPD();
1017 
1018  //Double_t zVertex=fVertex[2];
1019 
1020  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
1021 
1022  if (fTriggerPatchInfo) {
1023  TString objname(fTriggerPatchInfo->GetClass()->GetName());
1024  TClass cls(objname);
1025  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
1026  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",GetName(), cls.GetName(), "EmcalTriggers"));
1027  fTriggerPatchInfo = 0;
1028  }
1029  }
1030 
1031  if (!fTriggerPatchInfo) {
1032  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
1033  return kFALSE;
1034  }
1035  for(auto p : *fTriggerPatchInfo){
1036  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
1037  if (recpatch) {
1038  }
1039  }
1040 
1041  //fClusterEResolution = new TF1("fClusterEResolution","sqrt([0]^2+[1]^2*x+([2]*x)^2)*0.01");// 2010 EMCal Test Beam Resolution
1042  //fClusterEResolution->SetParameters(4.35,9.07,1.63);//Fit to test beam
1043 
1044 
1045 
1046 
1047  //IsLEDEvent();
1048 
1049  return kTRUE;
1050 }
1051 
1052 /*
1053 void AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA::ExtractMainPatch() {
1054 
1055  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
1056 
1057  if (fTriggerPatchInfo) {
1058  TString objname(fTriggerPatchInfo->GetClass()->GetName());
1059  TClass cls(objname);
1060  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
1061  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",GetName(), cls.GetName(), "EmcalTriggers"));
1062  fTriggerPatchInfo = 0;
1063  }
1064  }
1065 
1066  if (!fTriggerPatchInfo) {
1067  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
1068  return;
1069  }
1070  for(auto p : *fTriggerPatchInfo){
1071  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
1072  if (recpatch) {
1073  cout<<"Pstchphi:"<<recpatch->GetPhiCM()<<endl;
1074  }
1075  }
1076  //Find main trigger
1077 
1078  (fTriggerPatchInfo) {
1079  TString objname(fTriggerPatchInfo->GetClass()->GetName());
1080  TClass cls(objname);
1081  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
1082  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",GetName(), cls.GetName(), "EmcalTriggers"));
1083  fTriggerPatchInfo = 0;
1084  }
1085  if (!fTriggerPatchInfo) {
1086  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
1087  return;
1088  }
1089  }
1090  //number of patches in event
1091  //Int_t nPatch = fTriggerPatchInfo->GetEntriesFast();
1092  //extract main trigger patch
1093  //Double_t emax = -1.;
1094  //for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1095  // AliEMCALTriggerPatchInfo *patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
1096  // if (!patch) continue;
1097  // cout<<"PstchE:"<<patch->GetPatchE()<<endl;
1098  //}
1099 
1100 }
1101 */
1102 
1107 {
1108  cout<<"*****************************"<<endl;
1109  cout<<"******* Task Finished *******"<<endl;
1110  cout<<"*****************************"<<endl;
1111 }
1112 /*
1113 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
1114 {
1115  //
1116  // Get the z of a constituent inside of a jet
1117  //
1118 
1119  return (trkPx*jetPx+trkPy*jetPy+trkPz*jetPz)/(jetPx*jetPx+jetPy*jetPy+jetPz*jetPz);
1120 }
1121  */
1122 /*
1123 Bool_t AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA::IsLEDEvent() const
1124 {
1125  Bool_t isLED = kFALSE;
1126  //
1127  // Check if the event is contaminated by LED signal
1128  //
1129  if (!fCaloCells) return kFALSE;
1130 
1131  TString histname;
1132 
1133  Int_t nCellCount[10] = {0};
1134  const Short_t ncells = fCaloCells->GetNumberOfCells();
1135 
1136 
1137 
1138  for (Short_t pos = 0; pos < ncells; pos++) {
1139  Int_t cellId = fCaloCells->GetCellNumber(pos);
1140  Double_t amp = fCaloCells->GetAmplitude(pos);
1141  Int_t sMod = fGeom->GetSuperModuleNumber(cellId);
1142 
1143  if(amp<0.1) continue;
1144  nCellCount[sMod]++;
1145 
1146  }
1147 
1148  for(Int_t i=0; i<=9; i++){
1149  fHistEMCalTowerMult[i]->Fill(nCellCount[i]);
1150  }
1151 
1152 
1153 
1154  return isLED;
1155 }
1156 */
1157 /*
1158 Double_t AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA::GetFcross(const AliVCluster *cluster, AliVCaloCells *cells)
1159 {
1160  Int_t AbsIdseed = -1;
1161  Double_t Eseed = 0;
1162  for (Int_t i = 0; i < cluster->GetNCells(); i++) {
1163  if (cells->GetCellAmplitude(cluster->GetCellAbsId(i)) > Eseed) {
1164  Eseed = cells->GetCellAmplitude(cluster->GetCellAbsId(i));
1165  AbsIdseed = cluster->GetCellAbsId(i);
1166  }
1167  }
1168 
1169  if (Eseed < 1e-9) {
1170  return 100;
1171  }
1172 
1173  Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1174  fGeom->GetCellIndex(AbsIdseed,imod,iTower,iIphi,iIeta);
1175  fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi,iIeta,iphi,ieta);
1176 
1177  //Get close cells index and energy, not in corners
1178 
1179  Int_t absID1 = -1;
1180  Int_t absID2 = -1;
1181 
1182  if (iphi < AliEMCALGeoParams::fgkEMCALRows-1) {
1183  absID1 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
1184  }
1185  if (iphi > 0) {
1186  absID2 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
1187  }
1188 
1189  // In case of cell in eta = 0 border, depending on SM shift the cross cell index
1190 
1191  Int_t absID3 = -1;
1192  Int_t absID4 = -1;
1193 
1194  if (ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2)) {
1195  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
1196  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
1197  }
1198  else if (ieta == 0 && imod%2) {
1199  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
1200  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
1201  }
1202  else {
1203  if (ieta < AliEMCALGeoParams::fgkEMCALCols-1) {
1204  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
1205  }
1206  if (ieta > 0) {
1207  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
1208  }
1209  }
1210 
1211  Double_t ecell1 = cells->GetCellAmplitude(absID1);
1212  Double_t ecell2 = cells->GetCellAmplitude(absID2);
1213  Double_t ecell3 = cells->GetCellAmplitude(absID3);
1214  Double_t ecell4 = cells->GetCellAmplitude(absID4);
1215 
1216  Double_t Ecross = ecell1 + ecell2 + ecell3 + ecell4;
1217 
1218  Double_t Fcross = 1 - Ecross/Eseed;
1219 
1220  return Fcross;
1221 }
1222 
1223 */
1225 {
1226  Int_t count = 0;
1227  UInt_t tmp = entries;
1228  while(tmp!=0){
1229  count++;
1230  tmp = tmp &~ -tmp; // clear lowest bit
1231  }
1232 
1233  TString hnTitle(name);
1234  const Int_t dim = count;
1235  Int_t nbins[dim];
1236  Double_t xmin[dim];
1237  Double_t xmax[dim];
1238 
1239  Int_t i=0;
1240  Int_t c=0;
1241  while(c<dim && i<32){
1242  if(entries&(1<<i)){
1243 
1244  TString label("");
1245  GetDimParams(i, label, nbins[c], xmin[c], xmax[c]);
1246  hnTitle += Form(";%s",label.Data());
1247  c++;
1248  }
1249 
1250  i++;
1251  }
1252  hnTitle += ";";
1253 
1254  return new THnSparseF(name, hnTitle.Data(), dim, nbins, xmin, xmax);
1255 }
1266 {
1267  const Double_t pi = TMath::Pi();
1268 
1269  switch(iEntry){
1270 
1271  case 0:
1272  label = "V0 centrality (%)";
1273  nbins = 30;
1274  xmin = 0.;
1275  xmax = 100.;
1276  // Adjust for pp, since we are retrieving multiplicity instead
1278  label = "Multiplicity";
1279  xmax = 300.;
1280  }
1281  break;
1282 
1283  case 1:
1284  label = "Jet p_{T}";
1285  nbins = 200;
1286  xmin = 0.;
1287  xmax = 200.;
1288  break;
1289 
1290  case 2:
1291  label = "Track p_{T}";
1292  nbins = 100;
1293  xmin = 0.;
1294  xmax = 100;
1295  break;
1296 
1297  case 3:
1298  label = "Cluster E";
1299  nbins = 100;
1300  xmin = 0.;
1301  xmax = 100;
1302  break;
1303 
1304  case 4:
1305  label = "Jet#eta";
1306  nbins = 24;
1307  xmin = -1.2;
1308  xmax = 1.2;
1309  break;
1310 
1311  case 5:
1312  label = "Jet #phi";
1313  nbins = 72;
1314  xmin = -0.5*pi;
1315  xmax = 1.5*pi;
1316  break;
1317 
1318  case 6:
1319  label = "#it{p}_{T,track}^{leading}";
1320  nbins = 100;
1321  xmin = 0;
1322  xmax = 100;
1323  break;
1324 
1325  case 7:
1326  label = "Matched Trigger Amp";
1327  nbins = 10;
1328  xmin = 0;
1329  xmax = 50;
1330  break;
1331 
1332  case 8:
1333  label = "#Delta#eta";
1334  nbins = 48;
1335  xmin = -1.2;
1336  xmax = 1.2;
1337  break;
1338 
1339  case 9:
1340  label = "#Delta#phi";
1341  nbins = 72;
1342  xmin = 0;
1343  xmax = 2*pi;
1344  break;
1345 
1346  case 10:
1347  label = "F_{cross}";
1348  nbins = 20;
1349  xmin = 0;
1350  xmax = 1;
1351  break;
1352 
1353  case 11:
1354  label = "z_{leading}";
1355  nbins = 20;
1356  xmin = 0;
1357  xmax = 1;
1358  break;
1359 
1360  case 12:
1361  label = "#it{A}_{jet}";
1362  nbins = 20;
1363  xmin = 0;
1364  xmax = 1;
1365  break;
1366 
1367  case 13:
1368  label = "Jet NEF";
1369  nbins = 20;
1370  xmin = 0;
1371  xmax = 1;
1372  break;
1373 
1374  case 14:
1375  label = "Numb Constit";
1376  nbins = 50;
1377  xmin = 0;
1378  xmax = 50;
1379  break;
1380 
1381  case 15:
1382  label = "Numb Chrg Constit";
1383  nbins = 50;
1384  xmin = 0;
1385  xmax = 50;
1386  break;
1387 
1388  case 16:
1389  label = "Numb Neu Constit";
1390  nbins = 50;
1391  xmin = 0;
1392  xmax = 50;
1393  break;
1394  }
1395 }
1396 
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
AliJetContainer * GetJetContainer(Int_t i=0) const
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 fMinBinPt
min pt in histograms
AliClusterContainer * GetClusterContainer() const
TCanvas * c
Definition: TestFitELoss.C:172
Int_t fCentBin
!event centrality bin
Declaration of class AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA.
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
Double_t * sigma
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
Double_t Phi_0_2pi() const
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
AliTrackContainer * GetTrackContainer(Int_t i=0) const
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.
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)