AliPhysics  32b88a8 (32b88a8)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcal.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, 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 #include <RVersion.h>
16 #include <memory>
17 #include "AliAnalysisTaskEmcal.h"
18 
19 #include <TClonesArray.h>
20 #include <AliEmcalList.h>
21 #include <TObject.h>
22 #include <TH1F.h>
23 #include <TProfile.h>
24 #include <TSystem.h>
25 #include <TFile.h>
26 #include <TChain.h>
27 #include <TKey.h>
28 
29 #include "AliStack.h"
30 #include "AliAODEvent.h"
31 #include "AliAnalysisManager.h"
32 #include "AliCentrality.h"
33 #include "AliEMCALGeometry.h"
34 #include "AliESDEvent.h"
35 #include "AliEmcalParticle.h"
36 #include "AliEventplane.h"
37 #include "AliInputEventHandler.h"
38 #include "AliLog.h"
39 #include "AliMCParticle.h"
40 #include "AliVCluster.h"
41 #include "AliVEventHandler.h"
42 #include "AliVParticle.h"
43 #include "AliAODTrack.h"
44 #include "AliVCaloTrigger.h"
45 #include "AliGenPythiaEventHeader.h"
46 #include "AliAODMCHeader.h"
47 #include "AliMCEvent.h"
48 #include "AliAnalysisUtils.h"
49 #include "AliEMCALTriggerPatchInfo.h"
50 #include "AliEmcalPythiaInfo.h"
51 
52 #include "AliMultSelection.h"
53 
55 
59 
64  AliAnalysisTaskSE("AliAnalysisTaskEmcal"),
65  fPythiaInfoName(""),
66  fForceBeamType(kNA),
67  fGeneralHistograms(kFALSE),
68  fInitialized(kFALSE),
69  fCreateHisto(kTRUE),
70  fCaloCellsName(),
71  fCaloTriggersName(),
72  fCaloTriggerPatchInfoName(),
73  fMinCent(-999),
74  fMaxCent(-999),
75  fMinVz(-999),
76  fMaxVz(999),
77  fTrackPtCut(0),
78  fMinNTrack(0),
79  fZvertexDiff(0.5),
80  fUseAliAnaUtils(kFALSE),
81  fRejectPileup(kFALSE),
82  fTklVsClusSPDCut(kFALSE),
83  fOffTrigger(AliVEvent::kAny),
84  fTrigClass(),
85  fTriggerTypeSel(kND),
86  fNbins(250),
87  fMinBinPt(0),
88  fMaxBinPt(250),
89  fMinPtTrackInEmcal(0),
90  fEventPlaneVsEmcal(-1),
91  fMinEventPlane(-1e6),
92  fMaxEventPlane(1e6),
93  fCentEst("V0M"),
94  fIsEmbedded(kFALSE),
95  fIsPythia(kFALSE),
96  fSelectPtHardBin(-999),
97  fMinMCLabel(0),
98  fMCLabelShift(0),
99  fNcentBins(4),
100  fNeedEmcalGeom(kTRUE),
101  fParticleCollArray(),
102  fClusterCollArray(),
103  fTriggers(0),
104  fEMCalTriggerMode(kOverlapWithLowThreshold),
105  fUseNewCentralityEstimation(kFALSE),
106  fGeneratePythiaInfoObject(kFALSE),
107  fUsePtHardBinScaling(kFALSE),
108  fMCRejectFilter(kFALSE),
109  fPtHardAndJetPtFactor(0.),
110  fPtHardAndClusterPtFactor(0.),
111  fPtHardAndTrackPtFactor(0.),
112  fRunNumber(-1),
113  fAliAnalysisUtils(0x0),
114  fIsEsd(kFALSE),
115  fGeom(0),
116  fTracks(0),
117  fCaloClusters(0),
118  fCaloCells(0),
119  fCaloTriggers(0),
120  fTriggerPatchInfo(0),
121  fCent(0),
122  fCentBin(-1),
123  fEPV0(-1.0),
124  fEPV0A(-1.0),
125  fEPV0C(-1.0),
126  fNVertCont(0),
127  fNVertSPDCont(0),
128  fBeamType(kNA),
129  fPythiaHeader(0),
130  fPtHard(0),
131  fPtHardBin(0),
132  fNTrials(0),
133  fXsection(0),
134  fPythiaInfo(0),
135  fOutput(0),
136  fHistEventCount(0),
137  fHistTrialsAfterSel(0),
138  fHistEventsAfterSel(0),
139  fHistXsectionAfterSel(0),
140  fHistTrials(0),
141  fHistEvents(0),
142  fHistXsection(0),
143  fHistPtHard(0),
144  fHistCentrality(0),
145  fHistZVertex(0),
146  fHistEventPlane(0),
147  fHistEventRejection(0),
148  fHistTriggerClasses(0)
149 {
150  fVertex[0] = 0;
151  fVertex[1] = 0;
152  fVertex[2] = 0;
153  fVertexSPD[0] = 0;
154  fVertexSPD[1] = 0;
155  fVertexSPD[2] = 0;
156 
157  fParticleCollArray.SetOwner(kTRUE);
158  fClusterCollArray.SetOwner(kTRUE);
159 }
160 
172  AliAnalysisTaskSE(name),
173  fPythiaInfoName(""),
174  fForceBeamType(kNA),
175  fGeneralHistograms(kFALSE),
176  fInitialized(kFALSE),
177  fCreateHisto(histo),
178  fCaloCellsName(),
179  fCaloTriggersName(),
180  fCaloTriggerPatchInfoName(),
181  fMinCent(-999),
182  fMaxCent(-999),
183  fMinVz(-999),
184  fMaxVz(999),
185  fTrackPtCut(0),
186  fMinNTrack(0),
187  fZvertexDiff(0.5),
188  fUseAliAnaUtils(kFALSE),
189  fRejectPileup(kFALSE),
190  fTklVsClusSPDCut(kFALSE),
191  fOffTrigger(AliVEvent::kAny),
192  fTrigClass(),
193  fTriggerTypeSel(kND),
194  fNbins(250),
195  fMinBinPt(0),
196  fMaxBinPt(250),
197  fMinPtTrackInEmcal(0),
198  fEventPlaneVsEmcal(-1),
199  fMinEventPlane(-1e6),
200  fMaxEventPlane(1e6),
201  fCentEst("V0M"),
202  fIsEmbedded(kFALSE),
203  fIsPythia(kFALSE),
204  fSelectPtHardBin(-999),
205  fMinMCLabel(0),
206  fMCLabelShift(0),
207  fNcentBins(4),
208  fNeedEmcalGeom(kTRUE),
209  fParticleCollArray(),
210  fClusterCollArray(),
211  fTriggers(0),
212  fEMCalTriggerMode(kOverlapWithLowThreshold),
213  fUseNewCentralityEstimation(kFALSE),
214  fGeneratePythiaInfoObject(kFALSE),
215  fUsePtHardBinScaling(kFALSE),
216  fMCRejectFilter(kFALSE),
217  fPtHardAndJetPtFactor(0.),
218  fPtHardAndClusterPtFactor(0.),
219  fPtHardAndTrackPtFactor(0.),
220  fRunNumber(-1),
221  fAliAnalysisUtils(0x0),
222  fIsEsd(kFALSE),
223  fGeom(0),
224  fTracks(0),
225  fCaloClusters(0),
226  fCaloCells(0),
227  fCaloTriggers(0),
228  fTriggerPatchInfo(0),
229  fCent(0),
230  fCentBin(-1),
231  fEPV0(-1.0),
232  fEPV0A(-1.0),
233  fEPV0C(-1.0),
234  fNVertCont(0),
235  fNVertSPDCont(0),
236  fBeamType(kNA),
237  fPythiaHeader(0),
238  fPtHard(0),
239  fPtHardBin(0),
240  fNTrials(0),
241  fXsection(0),
242  fPythiaInfo(0),
243  fOutput(0),
244  fHistEventCount(0),
245  fHistTrialsAfterSel(0),
246  fHistEventsAfterSel(0),
247  fHistXsectionAfterSel(0),
248  fHistTrials(0),
249  fHistEvents(0),
250  fHistXsection(0),
251  fHistPtHard(0),
252  fHistCentrality(0),
253  fHistZVertex(0),
254  fHistEventPlane(0),
255  fHistEventRejection(0),
256  fHistTriggerClasses(0)
257 {
258  fVertex[0] = 0;
259  fVertex[1] = 0;
260  fVertex[2] = 0;
261  fVertexSPD[0] = 0;
262  fVertexSPD[1] = 0;
263  fVertexSPD[2] = 0;
264  fParticleCollArray.SetOwner(kTRUE);
265  fClusterCollArray.SetOwner(kTRUE);
266 
267  if (fCreateHisto) {
268  DefineOutput(1, AliEmcalList::Class());
269  }
270 }
271 
276 {
277 }
278 
286 {
288  if (cont) cont->SetClusPtCut(cut);
289  else AliError(Form("%s in SetClusPtCut(...): container %d not found",GetName(),c));
290 }
291 
300 {
302  if (cont) cont->SetClusTimeCut(min,max);
303  else AliError(Form("%s in SetClusTimeCut(...): container %d not found",GetName(),c));
304 }
305 
313 {
315  if (cont) cont->SetParticlePtCut(cut);
316  else AliError(Form("%s in SetTrackPtCut(...): container %d not found",GetName(),c));
317 
318  fTrackPtCut = cut;
319 }
320 
329 {
331  if (cont) cont->SetParticleEtaLimits(min,max);
332  else AliError(Form("%s in SetTrackPtCut(...): container %d not found",GetName(),c));
333 }
334 
343 {
345  if (cont) cont->SetParticlePhiLimits(min,max);
346  else AliError(Form("%s in SetTrackPhiLimits(...): container %d not found",GetName(),c));
347 }
348 
369 {
370  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
371  if (mgr) {
372  AliVEventHandler *evhand = mgr->GetInputEventHandler();
373  if (evhand) {
374  if (evhand->InheritsFrom("AliESDInputHandler")) {
375  fIsEsd = kTRUE;
376  }
377  else {
378  fIsEsd = kFALSE;
379  }
380  }
381  else {
382  AliError("Event handler not found!");
383  }
384  }
385  else {
386  AliError("Analysis manager not found!");
387  }
388 
389  if (!fCreateHisto)
390  return;
391 
392  OpenFile(1);
393  fOutput = new AliEmcalList();
395  fOutput->SetOwner();
396 
397  if (fForceBeamType == kpp)
398  fNcentBins = 1;
399 
400  if (!fGeneralHistograms)
401  return;
402 
403  if (fIsPythia) {
404  fHistTrialsAfterSel = new TH1F("fHistTrialsAfterSel", "fHistTrialsAfterSel", 11, 0, 11);
405  fHistTrialsAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
406  fHistTrialsAfterSel->GetYaxis()->SetTitle("trials");
408 
409  fHistEventsAfterSel = new TH1F("fHistEventsAfterSel", "fHistEventsAfterSel", 11, 0, 11);
410  fHistEventsAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
411  fHistEventsAfterSel->GetYaxis()->SetTitle("total events");
413 
414  fHistXsectionAfterSel = new TProfile("fHistXsectionAfterSel", "fHistXsectionAfterSel", 11, 0, 11);
415  fHistXsectionAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
416  fHistXsectionAfterSel->GetYaxis()->SetTitle("xsection");
418 
419  fHistTrials = new TH1F("fHistTrials", "fHistTrials", 11, 0, 11);
420  fHistTrials->GetXaxis()->SetTitle("p_{T} hard bin");
421  fHistTrials->GetYaxis()->SetTitle("trials");
422  fOutput->Add(fHistTrials);
423 
424  fHistEvents = new TH1F("fHistEvents", "fHistEvents", 11, 0, 11);
425  fHistEvents->GetXaxis()->SetTitle("p_{T} hard bin");
426  fHistEvents->GetYaxis()->SetTitle("total events");
427  fOutput->Add(fHistEvents);
428 
429  fHistXsection = new TProfile("fHistXsection", "fHistXsection", 11, 0, 11);
430  fHistXsection->GetXaxis()->SetTitle("p_{T} hard bin");
431  fHistXsection->GetYaxis()->SetTitle("xsection");
432  fOutput->Add(fHistXsection);
433 
434  const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
435  const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
436 
437  for (Int_t i = 1; i < 12; i++) {
438  fHistTrialsAfterSel->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
439  fHistEventsAfterSel->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
440 
441  fHistTrials->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
442  fHistXsection->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
443  fHistEvents->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
444  }
445 
446  fHistPtHard = new TH1F("fHistPtHard", "fHistPtHard", fNbins*2, fMinBinPt, fMaxBinPt*4);
447  fHistPtHard->GetXaxis()->SetTitle("p_{T,hard} (GeV/c)");
448  fHistPtHard->GetYaxis()->SetTitle("counts");
449  fOutput->Add(fHistPtHard);
450  }
451 
452  fHistZVertex = new TH1F("fHistZVertex","Z vertex position", 60, -30, 30);
453  fHistZVertex->GetXaxis()->SetTitle("z");
454  fHistZVertex->GetYaxis()->SetTitle("counts");
455  fOutput->Add(fHistZVertex);
456 
457  if (fForceBeamType != kpp) {
458  fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", 200, 0, 100);
459  fHistCentrality->GetXaxis()->SetTitle("Centrality (%)");
460  fHistCentrality->GetYaxis()->SetTitle("counts");
461  fOutput->Add(fHistCentrality);
462 
463  fHistEventPlane = new TH1F("fHistEventPlane","Event plane", 120, -TMath::Pi(), TMath::Pi());
464  fHistEventPlane->GetXaxis()->SetTitle("event plane");
465  fHistEventPlane->GetYaxis()->SetTitle("counts");
466  fOutput->Add(fHistEventPlane);
467  }
468 
469  fHistEventRejection = new TH1F("fHistEventRejection","Reasons to reject event",20,0,20);
470 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
471  fHistEventRejection->SetBit(TH1::kCanRebin);
472 #else
473  fHistEventRejection->SetCanExtend(TH1::kAllAxes);
474 #endif
475  fHistEventRejection->GetXaxis()->SetBinLabel(1,"PhysSel");
476  fHistEventRejection->GetXaxis()->SetBinLabel(2,"trigger");
477  fHistEventRejection->GetXaxis()->SetBinLabel(3,"trigTypeSel");
478  fHistEventRejection->GetXaxis()->SetBinLabel(4,"Cent");
479  fHistEventRejection->GetXaxis()->SetBinLabel(5,"vertex contr.");
480  fHistEventRejection->GetXaxis()->SetBinLabel(6,"Vz");
481  fHistEventRejection->GetXaxis()->SetBinLabel(7,"VzSPD");
482  fHistEventRejection->GetXaxis()->SetBinLabel(8,"trackInEmcal");
483  fHistEventRejection->GetXaxis()->SetBinLabel(9,"minNTrack");
484  fHistEventRejection->GetXaxis()->SetBinLabel(10,"VtxSel2013pA");
485  fHistEventRejection->GetXaxis()->SetBinLabel(11,"PileUp");
486  fHistEventRejection->GetXaxis()->SetBinLabel(12,"EvtPlane");
487  fHistEventRejection->GetXaxis()->SetBinLabel(13,"SelPtHardBin");
488  fHistEventRejection->GetXaxis()->SetBinLabel(14,"Bkg evt");
489  fHistEventRejection->GetYaxis()->SetTitle("counts");
491 
492  fHistTriggerClasses = new TH1F("fHistTriggerClasses","fHistTriggerClasses",3,0,3);
493 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
494  fHistTriggerClasses->SetBit(TH1::kCanRebin);
495 #else
496  fHistTriggerClasses->SetCanExtend(TH1::kAllAxes);
497 #endif
499 
500  fHistEventCount = new TH1F("fHistEventCount","fHistEventCount",2,0,2);
501  fHistEventCount->GetXaxis()->SetBinLabel(1,"Accepted");
502  fHistEventCount->GetXaxis()->SetBinLabel(2,"Rejected");
503  fHistEventCount->GetYaxis()->SetTitle("counts");
504  fOutput->Add(fHistEventCount);
505 
506  PostData(1, fOutput);
507 }
508 
523 {
524  if (fIsPythia) {
528  fHistPtHard->Fill(fPtHard);
529  }
530 
531  fHistZVertex->Fill(fVertex[2]);
532 
533  if (fForceBeamType != kpp) {
534  fHistCentrality->Fill(fCent);
535  fHistEventPlane->Fill(fEPV0);
536  }
537 
538  TObjArray* triggerClasses = InputEvent()->GetFiredTriggerClasses().Tokenize(" ");
539  TIter next(triggerClasses);
540  TObjString* triggerClass = 0;
541  while ((triggerClass = static_cast<TObjString*>(next()))) {
542  fHistTriggerClasses->Fill(triggerClass->GetString(), 1);
543  }
544  delete triggerClasses;
545  triggerClasses = 0;
546 
547  return kTRUE;
548 }
549 
570 {
571  if (!fInitialized){
572  ExecOnce();
573  UserExecOnce();
574  }
575 
576  if (!fInitialized)
577  return;
578 
579  if (!RetrieveEventObjects())
580  return;
581 
582  if(InputEvent()->GetRunNumber() != fRunNumber){
583  fRunNumber = InputEvent()->GetRunNumber();
584  RunChanged();
585  }
586 
587  if (IsEventSelected()) {
588  if (fGeneralHistograms) fHistEventCount->Fill("Accepted",1);
589  }
590  else {
591  if (fGeneralHistograms) fHistEventCount->Fill("Rejected",1);
592  return;
593  }
594 
596  if (!FillGeneralHistograms())
597  return;
598  }
599 
600  if (!Run())
601  return;
602 
603  if (fCreateHisto) {
604  if (!FillHistograms())
605  return;
606  }
607 
608  if (fCreateHisto && fOutput) {
609  // information for this iteration of the UserExec in the container
610  PostData(1, fOutput);
611  }
612 }
613 
623 {
624  AliWarning("AliAnalysisTaskEmcal::AcceptCluster method is deprecated. Please use GetCusterContainer(c)->AcceptCluster(clus).");
625 
626  if (!clus) return kFALSE;
627 
629  if (!cont) {
630  AliError(Form("%s:Container %d not found",GetName(),c));
631  return 0;
632  }
633  UInt_t rejectionReason = 0;
634  return cont->AcceptCluster(clus, rejectionReason);
635 }
636 
645 Bool_t AliAnalysisTaskEmcal::AcceptTrack(AliVParticle *track, Int_t c) const
646 {
647  AliWarning("AliAnalysisTaskEmcal::AcceptTrack method is deprecated. Please use GetParticleContainer(c)->AcceptParticle(clus).");
648 
649  if (!track) return kFALSE;
650 
652  if (!cont) {
653  AliError(Form("%s:Container %d not found",GetName(),c));
654  return 0;
655  }
656 
657  UInt_t rejectionReason = 0;
658  return cont->AcceptParticle(track, rejectionReason);
659 }
660 
672 Bool_t AliAnalysisTaskEmcal::PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
673 {
674 
675  TString file(currFile);
676  fXsec = 0;
677  fTrials = 1;
678 
679  if (file.Contains(".zip#")) {
680  Ssiz_t pos1 = file.Index("root_archive",12,0,TString::kExact);
681  Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
682  Ssiz_t pos2 = file.Index(".root",5,TString::kExact);
683  file.Replace(pos+1,pos2-pos1,"");
684  } else {
685  // not an archive take the basename....
686  file.ReplaceAll(gSystem->BaseName(file.Data()),"");
687  }
688  AliDebug(1,Form("File name: %s",file.Data()));
689 
690  // Get the pt hard bin
691  TString strPthard(file);
692 
693  strPthard.Remove(strPthard.Last('/'));
694  strPthard.Remove(strPthard.Last('/'));
695  if (strPthard.Contains("AOD")) strPthard.Remove(strPthard.Last('/'));
696  strPthard.Remove(0,strPthard.Last('/')+1);
697  if (strPthard.IsDec()) pthard = strPthard.Atoi();
698  else
699  AliWarning(Form("Could not extract file number from path %s", strPthard.Data()));
700 
701  // problem that we cannot really test the existance of a file in a archive so we have to live with open error message from root
702  std::unique_ptr<TFile> fxsec(TFile::Open(Form("%s%s",file.Data(),"pyxsec.root")));
703 
704  if (!fxsec) {
705  // next trial fetch the histgram file
706  fxsec = std::unique_ptr<TFile>(TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root")));
707  if (!fxsec) return kFALSE; // not a severe condition but inciate that we have no information
708  else {
709  // find the tlist we want to be independtent of the name so use the Tkey
710  TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
711  if (!key) return kFALSE;
712  TList *list = dynamic_cast<TList*>(key->ReadObj());
713  if (!list) return kFALSE;
714  fXsec = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
715  fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
716  }
717  } else { // no tree pyxsec.root
718  TTree *xtree = (TTree*)fxsec->Get("Xsection");
719  if (!xtree) return kFALSE;
720  UInt_t ntrials = 0;
721  Double_t xsection = 0;
722  xtree->SetBranchAddress("xsection",&xsection);
723  xtree->SetBranchAddress("ntrials",&ntrials);
724  xtree->GetEntry(0);
725  fTrials = ntrials;
726  fXsec = xsection;
727  }
728  return kTRUE;
729 }
730 
745 {
747  return kTRUE;
748 
749  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
750  if (!tree) {
751  AliError(Form("%s - UserNotify: No current tree!",GetName()));
752  return kFALSE;
753  }
754 
755  Float_t xsection = 0;
756  Float_t trials = 0;
757  Int_t pthardbin = 0;
758 
759  TFile *curfile = tree->GetCurrentFile();
760  if (!curfile) {
761  AliError(Form("%s - UserNotify: No current file!",GetName()));
762  return kFALSE;
763  }
764 
765  TChain *chain = dynamic_cast<TChain*>(tree);
766  if (chain) tree = chain->GetTree();
767 
768  Int_t nevents = tree->GetEntriesFast();
769 
770  PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
771 
772  // TODO: Workaround
773  if ((pthardbin < 0) || (pthardbin > 10)) pthardbin = 0;
774 
775  fHistTrials->Fill(pthardbin, trials);
776  fHistXsection->Fill(pthardbin, xsection);
777  fHistEvents->Fill(pthardbin, nevents);
778 
779  return kTRUE;
780 }
781 
787 {
788  if (!fPythiaInfoName.IsNull() && !fPythiaInfo) {
789  fPythiaInfo = dynamic_cast<AliEmcalPythiaInfo*>(event->FindListObject(fPythiaInfoName));
790  if (!fPythiaInfo) {
791  AliError(Form("%s: Could not retrieve parton infos! %s!", GetName(), fPythiaInfoName.Data()));
792  return;
793  }
794  }
795 }
796 
808 {
809  if (!InputEvent()) {
810  AliError(Form("%s: Could not retrieve event! Returning!", GetName()));
811  return;
812  }
813 
814  LoadPythiaInfo(InputEvent());
815 
816  if (fNeedEmcalGeom) {
817  fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
818  if (!fGeom) {
819  AliFatal(Form("%s: Can not get EMCal geometry instance. If you do not need the EMCal geometry, disable it by setting task->SetNeedEmcalGeometry(kFALSE).", GetName()));
820  return;
821  }
822  }
823 
824  if (fEventPlaneVsEmcal >= 0) {
825  if (fGeom) {
826  Double_t ep = (fGeom->GetArm1PhiMax() + fGeom->GetArm1PhiMin()) / 2 * TMath::DegToRad() + fEventPlaneVsEmcal - TMath::Pi();
827  fMinEventPlane = ep - TMath::Pi() / 4;
828  fMaxEventPlane = ep + TMath::Pi() / 4;
829  }
830  else {
831  AliWarning("Could not set event plane limits because EMCal geometry was not loaded!");
832  }
833  }
834 
835  //Load all requested track branches - each container knows name already
836  for (Int_t i =0; i<fParticleCollArray.GetEntriesFast(); i++) {
837  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
838  cont->SetArray(InputEvent());
839  }
840 
841  if (fParticleCollArray.GetEntriesFast()>0) {
843  if (!fTracks) {
844  AliError(Form("%s: Could not retrieve first track branch!", GetName()));
845  return;
846  }
847  }
848 
849  //Load all requested cluster branches - each container knows name already
850  for (Int_t i =0; i<fClusterCollArray.GetEntriesFast(); i++) {
851  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
852  cont->SetArray(InputEvent());
853  }
854 
855  if (fClusterCollArray.GetEntriesFast()>0) {
857  if (!fCaloClusters) {
858  AliError(Form("%s: Could not retrieve first cluster branch!", GetName()));
859  return;
860  }
861  }
862 
863  if (!fCaloCellsName.IsNull() && !fCaloCells) {
864  fCaloCells = dynamic_cast<AliVCaloCells*>(InputEvent()->FindListObject(fCaloCellsName));
865  if (!fCaloCells) {
866  AliError(Form("%s: Could not retrieve cells %s!", GetName(), fCaloCellsName.Data()));
867  return;
868  }
869  }
870 
871  if (!fCaloTriggersName.IsNull() && !fCaloTriggers) {
872  fCaloTriggers = dynamic_cast<AliVCaloTrigger*>(InputEvent()->FindListObject(fCaloTriggersName));
873  if (!fCaloTriggers) {
874  AliError(Form("%s: Could not retrieve calo triggers %s!", GetName(), fCaloTriggersName.Data()));
875  return;
876  }
877  }
878 
879  if (!fCaloTriggerPatchInfoName.IsNull() && !fTriggerPatchInfo) {
880  fTriggerPatchInfo = GetArrayFromEvent(fCaloTriggerPatchInfoName.Data(),"AliEMCALTriggerPatchInfo");
881  if (!fTriggerPatchInfo) {
882  AliError(Form("%s: Could not retrieve calo trigger patch info %s!", GetName(), fCaloTriggerPatchInfoName.Data()));
883  return;
884  }
885 
886  }
887 
888  fInitialized = kTRUE;
889 }
890 
897 {
898 
899  if (fForceBeamType != kNA)
900  return fForceBeamType;
901 
902  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
903  if (esd) {
904  const AliESDRun *run = esd->GetESDRun();
905  TString beamType = run->GetBeamType();
906  if (beamType == "p-p")
907  return kpp;
908  else if (beamType == "A-A")
909  return kAA;
910  else if (beamType == "p-A")
911  return kpA;
912  else
913  return kNA;
914  } else {
915  Int_t runNumber = InputEvent()->GetRunNumber();
916  if ((runNumber >= 136851 && runNumber <= 139517) || // LHC10h
917  (runNumber >= 166529 && runNumber <= 170593)) { // LHC11h
918  return kAA;
919  } else if ((runNumber>=188365 && runNumber <= 188366) || // LHC12g
920  (runNumber >= 195344 && runNumber <= 196608)) { // LHC13b-f
921  return kpA;
922  } else {
923  return kpp;
924  }
925  }
926 }
927 
935 {
936  if (!fTriggerPatchInfo)
937  return 0;
938 
939  //number of patches in event
940  Int_t nPatch = fTriggerPatchInfo->GetEntries();
941 
942  //loop over patches to define trigger type of event
943  Int_t nG1 = 0;
944  Int_t nG2 = 0;
945  Int_t nJ1 = 0;
946  Int_t nJ2 = 0;
947  Int_t nL0 = 0;
948  AliEMCALTriggerPatchInfo *patch;
949  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
950  patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
951  if (patch->IsGammaHigh()) nG1++;
952  if (patch->IsGammaLow()) nG2++;
953  if (patch->IsJetHigh()) nJ1++;
954  if (patch->IsJetLow()) nJ2++;
955  if (patch->IsLevel0()) nL0++;
956  }
957 
958  AliDebug(2, "Patch summary: ");
959  AliDebug(2, Form("Number of patches: %d", nPatch));
960  AliDebug(2, Form("Jet: low[%d], high[%d]" ,nJ2, nJ1));
961  AliDebug(2, Form("Gamma: low[%d], high[%d]" ,nG2, nG1));
962 
963  ULong_t triggers(0);
964  if (nL0>0) SETBIT(triggers, kL0);
965  if (nG1>0) SETBIT(triggers, kG1);
966  if (nG2>0) SETBIT(triggers, kG2);
967  if (nJ1>0) SETBIT(triggers, kJ1);
968  if (nJ2>0) SETBIT(triggers, kJ2);
969  return triggers;
970 }
971 
979 {
980  //
981  if(trigger==kND) {
982  AliWarning(Form("%s: Requesting undefined trigger type!", GetName()));
983  return kFALSE;
984  }
985  //MV: removing this logic which as far as I can see doesn't make any sense
986  // if(trigger & kND){
987  // return fTriggers == 0;
988  // }
989  return TESTBIT(fTriggers, trigger);
990 }
991 
1014 {
1015  if (fOffTrigger != AliVEvent::kAny) {
1016  UInt_t res = 0;
1017  const AliESDEvent *eev = dynamic_cast<const AliESDEvent*>(InputEvent());
1018  if (eev) {
1019  res = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1020  } else {
1021  const AliAODEvent *aev = dynamic_cast<const AliAODEvent*>(InputEvent());
1022  if (aev) {
1023  res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
1024  }
1025  }
1026  if ((res & fOffTrigger) == 0) {
1027  if (fGeneralHistograms) fHistEventRejection->Fill("PhysSel",1);
1028  return kFALSE;
1029  }
1030  }
1031 
1032  if (!fTrigClass.IsNull()) {
1033  TString fired;
1034  const AliESDEvent *eev = dynamic_cast<const AliESDEvent*>(InputEvent());
1035  if (eev) {
1036  fired = eev->GetFiredTriggerClasses();
1037  } else {
1038  const AliAODEvent *aev = dynamic_cast<const AliAODEvent*>(InputEvent());
1039  if (aev) {
1040  fired = aev->GetFiredTriggerClasses();
1041  }
1042  }
1043  if (!fired.Contains("-B-")) {
1044  if (fGeneralHistograms) fHistEventRejection->Fill("trigger",1);
1045  return kFALSE;
1046  }
1047 
1048  std::unique_ptr<TObjArray> arr(fTrigClass.Tokenize("|"));
1049  if (!arr) {
1050  if (fGeneralHistograms) fHistEventRejection->Fill("trigger",1);
1051  return kFALSE;
1052  }
1053  Bool_t match = 0;
1054  for (Int_t i=0;i<arr->GetEntriesFast();++i) {
1055  TObject *obj = arr->At(i);
1056  if (!obj)
1057  continue;
1058 
1059  //Check if requested trigger was fired
1060  TString objStr = obj->GetName();
1062  (objStr.Contains("J1") || objStr.Contains("J2") || objStr.Contains("G1") || objStr.Contains("G2"))) {
1063  // This is relevant for EMCal triggers with 2 thresholds
1064  // If the kOverlapWithLowThreshold was requested than the overlap between the two triggers goes with the lower threshold trigger
1065  TString trigType1 = "J1";
1066  TString trigType2 = "J2";
1067  if(objStr.Contains("G")) {
1068  trigType1 = "G1";
1069  trigType2 = "G2";
1070  }
1071  if(objStr.Contains(trigType2) && fired.Contains(trigType2.Data())) { //requesting low threshold + overlap
1072  match = 1;
1073  break;
1074  }
1075  else if(objStr.Contains(trigType1) && fired.Contains(trigType1.Data()) && !fired.Contains(trigType2.Data())) { //high threshold only
1076  match = 1;
1077  break;
1078  }
1079  }
1080  else {
1081  // If this is not an EMCal trigger, or no particular treatment of EMCal triggers was requested,
1082  // simply check that the trigger was fired
1083  if (fired.Contains(obj->GetName())) {
1084  match = 1;
1085  break;
1086  }
1087  }
1088  }
1089  if (!match) {
1090  if (fGeneralHistograms) fHistEventRejection->Fill("trigger",1);
1091  return kFALSE;
1092  }
1093  }
1094 
1095  if (fTriggerTypeSel != kND) {
1097  if (fGeneralHistograms) fHistEventRejection->Fill("trigTypeSel",1);
1098  return kFALSE;
1099  }
1100  }
1101 
1102  if ((fMinCent != -999) && (fMaxCent != -999)) {
1103  if (fCent<fMinCent || fCent>fMaxCent) {
1104  if (fGeneralHistograms) fHistEventRejection->Fill("Cent",1);
1105  return kFALSE;
1106  }
1107  }
1108 
1109  if (fUseAliAnaUtils) {
1110  if (!fAliAnalysisUtils)
1111  fAliAnalysisUtils = new AliAnalysisUtils();
1112  fAliAnalysisUtils->SetMinVtxContr(2);
1113  fAliAnalysisUtils->SetMaxVtxZ(999);
1114  if(fMinVz<-998.) fMinVz = -10.;
1115  if(fMaxVz>998.) fMaxVz = 10.;
1116 
1117  if (!fAliAnalysisUtils->IsVertexSelected2013pA(InputEvent())) {
1118  if (fGeneralHistograms) fHistEventRejection->Fill("VtxSel2013pA",1);
1119  return kFALSE;
1120  }
1121 
1122  if (fRejectPileup && fAliAnalysisUtils->IsPileUpEvent(InputEvent())) {
1123  if (fGeneralHistograms) fHistEventRejection->Fill("PileUp",1);
1124  return kFALSE;
1125  }
1126 
1127  if(fTklVsClusSPDCut && fAliAnalysisUtils->IsSPDClusterVsTrackletBG(InputEvent())) {
1128  if (fGeneralHistograms) fHistEventRejection->Fill("Bkg evt",1);
1129  return kFALSE;
1130  }
1131  }
1132 
1133  if ((fMinVz > -998.) && (fMaxVz < 998.)) {
1134  if (fNVertCont == 0 ) {
1135  if (fGeneralHistograms) fHistEventRejection->Fill("vertex contr.",1);
1136  return kFALSE;
1137  }
1138  Double_t vz = fVertex[2];
1139  if (vz < fMinVz || vz > fMaxVz) {
1140  if (fGeneralHistograms) fHistEventRejection->Fill("Vz",1);
1141  return kFALSE;
1142  }
1143 
1144  if (fNVertSPDCont > 0 && fZvertexDiff < 999) {
1145  Double_t vzSPD = fVertexSPD[2];
1146  Double_t dvertex = TMath::Abs(vz-vzSPD);
1147  //if difference larger than fZvertexDiff
1148  if (dvertex > fZvertexDiff) {
1149  if (fGeneralHistograms) fHistEventRejection->Fill("VzSPD",1);
1150  return kFALSE;
1151  }
1152  }
1153  }
1154 
1155  if (fMinPtTrackInEmcal > 0 && fGeom) {
1156  Bool_t trackInEmcalOk = kFALSE;
1157  Int_t ntracks = GetNParticles(0);
1158  for (Int_t i = 0; i < ntracks; i++) {
1159  AliVParticle *track = GetAcceptParticleFromArray(i,0);
1160  if (!track)
1161  continue;
1162 
1163  Double_t phiMin = fGeom->GetArm1PhiMin() * TMath::DegToRad();
1164  Double_t phiMax = fGeom->GetArm1PhiMax() * TMath::DegToRad();
1165  Int_t runNumber = InputEvent()->GetRunNumber();
1166  if (runNumber>=177295 && runNumber<=197470) { //small SM masked in 2012 and 2013
1167  phiMin = 1.4;
1168  phiMax = TMath::Pi();
1169  }
1170 
1171  if (track->Eta() < fGeom->GetArm1EtaMin() || track->Eta() > fGeom->GetArm1EtaMax() || track->Phi() < phiMin || track->Phi() > phiMax)
1172  continue;
1173  if (track->Pt() > fMinPtTrackInEmcal) {
1174  trackInEmcalOk = kTRUE;
1175  break;
1176  }
1177  }
1178  if (!trackInEmcalOk) {
1179  if (fGeneralHistograms) fHistEventRejection->Fill("trackInEmcal",1);
1180  return kFALSE;
1181  }
1182  }
1183 
1184  if (fMinNTrack > 0) {
1185  Int_t nTracksAcc = 0;
1186  Int_t ntracks = GetNParticles(0);
1187  for (Int_t i = 0; i < ntracks; i++) {
1188  AliVParticle *track = GetAcceptParticleFromArray(i,0);
1189  if (!track)
1190  continue;
1191  if (track->Pt() > fTrackPtCut) {
1192  nTracksAcc++;
1193  if (nTracksAcc>=fMinNTrack)
1194  break;
1195  }
1196  }
1197  if (nTracksAcc<fMinNTrack) {
1198  if (fGeneralHistograms) fHistEventRejection->Fill("minNTrack",1);
1199  return kFALSE;
1200  }
1201  }
1202 
1203  if (!(fEPV0 > fMinEventPlane && fEPV0 <= fMaxEventPlane) &&
1204  !(fEPV0 + TMath::Pi() > fMinEventPlane && fEPV0 + TMath::Pi() <= fMaxEventPlane) &&
1205  !(fEPV0 - TMath::Pi() > fMinEventPlane && fEPV0 - TMath::Pi() <= fMaxEventPlane))
1206  {
1207  if (fGeneralHistograms) fHistEventRejection->Fill("EvtPlane",1);
1208  return kFALSE;
1209  }
1210 
1211  if (fSelectPtHardBin != -999 && fSelectPtHardBin != fPtHardBin) {
1212  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
1213  return kFALSE;
1214  }
1215 
1216  // Reject filter for MC data
1217  if (!CheckMCOutliers()) return kFALSE;
1218 
1219  return kTRUE;
1220 }
1221 
1228 {
1229  if (!fPythiaHeader || !fMCRejectFilter) return kTRUE;
1230 
1231  // Condition 1: Pythia jet / pT-hard > factor
1232  if (fPtHardAndJetPtFactor > 0.) {
1233  AliTLorentzVector jet;
1234 
1235  Int_t nTriggerJets = fPythiaHeader->NTriggerJets();
1236 
1237  AliDebug(1,Form("Njets: %d, pT Hard %f",nTriggerJets, fPtHard));
1238 
1239  Float_t tmpjet[]={0,0,0,0};
1240  for (Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1241  fPythiaHeader->TriggerJet(ijet, tmpjet);
1242 
1243  jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1244 
1245  AliDebug(1,Form("jet %d; pycell jet pT %f",ijet, jet.Pt()));
1246 
1247  //Compare jet pT and pt Hard
1248  if (jet.Pt() > fPtHardAndJetPtFactor * fPtHard) {
1249  AliInfo(Form("Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", fPtHard, jet.Pt(), fPtHardAndJetPtFactor));
1250  return kFALSE;
1251  }
1252  }
1253  }
1254  // end condition 1
1255 
1256  // Condition 2 : Reconstructed EMCal cluster pT / pT-hard > factor
1257  if (fPtHardAndClusterPtFactor > 0.) {
1258  AliClusterContainer* mccluscont = GetClusterContainer(0);
1259  if ((Bool_t)mccluscont) {
1260  for (auto cluster : mccluscont->all()) {// Not cuts applied ; use accept for cuts
1261  Float_t ecluster = cluster->E();
1262 
1263  if (ecluster > (fPtHardAndClusterPtFactor * fPtHard)) {
1264  AliInfo(Form("Reject : ecluster %2.2f, calo %d, factor %2.2f, ptHard %f",ecluster,cluster->GetType(),fPtHardAndClusterPtFactor,fPtHard));
1265  return kFALSE;
1266  }
1267  }
1268  }
1269  }
1270  // end condition 2
1271 
1272  // condition 3 : Reconstructed track pT / pT-hard >factor
1273  if (fPtHardAndTrackPtFactor > 0.) {
1274  AliMCParticleContainer* mcpartcont = dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(0));
1275  if ((Bool_t)mcpartcont) {
1276  for (auto mctrack : mcpartcont->all()) {// Not cuts applied ; use accept for cuts
1277  Float_t trackpt = mctrack->Pt();
1278  if (trackpt > (fPtHardAndTrackPtFactor * fPtHard) ) {
1279  AliInfo(Form("Reject : track %2.2f, factor %2.2f, ptHard %f", trackpt, fPtHardAndTrackPtFactor, fPtHard));
1280  return kFALSE;
1281  }
1282  }
1283  }
1284  }
1285  // end condition 3
1286 
1287  return kTRUE;
1288 }
1289 
1298 TClonesArray *AliAnalysisTaskEmcal::GetArrayFromEvent(const char *name, const char *clname)
1299 {
1300  TClonesArray *arr = 0;
1301  TString sname(name);
1302  if (!sname.IsNull()) {
1303  arr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(sname));
1304  if (!arr) {
1305  AliWarning(Form("%s: Could not retrieve array with name %s!", GetName(), name));
1306  return 0;
1307  }
1308  } else {
1309  return 0;
1310  }
1311 
1312  if (!clname)
1313  return arr;
1314 
1315  TString objname(arr->GetClass()->GetName());
1316  TClass cls(objname);
1317  if (!cls.InheritsFrom(clname)) {
1318  AliWarning(Form("%s: Objects of type %s in %s are not inherited from %s!",
1319  GetName(), cls.GetName(), name, clname));
1320  return 0;
1321  }
1322  return arr;
1323 }
1324 
1330 {
1331  fVertex[0] = 0;
1332  fVertex[1] = 0;
1333  fVertex[2] = 0;
1334  fNVertCont = 0;
1335 
1336  fVertexSPD[0] = 0;
1337  fVertexSPD[1] = 0;
1338  fVertexSPD[2] = 0;
1339  fNVertSPDCont = 0;
1340 
1341  if (fGeneratePythiaInfoObject && MCEvent()) {
1342  GeneratePythiaInfoObject(MCEvent());
1343  }
1344 
1345  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1346  if (vert) {
1347  vert->GetXYZ(fVertex);
1348  fNVertCont = vert->GetNContributors();
1349  }
1350 
1351  const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
1352  if (vertSPD) {
1353  vertSPD->GetXYZ(fVertexSPD);
1354  fNVertSPDCont = vertSPD->GetNContributors();
1355  }
1356 
1357  fBeamType = GetBeamType();
1358 
1359  if (fBeamType == kAA || fBeamType == kpA ) {
1361  AliMultSelection *MultSelection = static_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
1362  if (MultSelection) {
1363  fCent = MultSelection->GetMultiplicityPercentile(fCentEst.Data());
1364  }
1365  else {
1366  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1367  }
1368  }
1369  else { // old centrality estimation < 2015
1370  AliCentrality *aliCent = InputEvent()->GetCentrality();
1371  if (aliCent) {
1372  fCent = aliCent->GetCentralityPercentile(fCentEst.Data());
1373  }
1374  else {
1375  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1376  }
1377  }
1378 
1379  if (fNcentBins==4) {
1380  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1381  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1382  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1383  else if (fCent >= 50 && fCent <= 100) fCentBin = 3;
1384  else {
1385  AliWarning(Form("%s: Negative centrality: %f. Assuming 99", GetName(), fCent));
1386  fCentBin = fNcentBins-1;
1387  }
1388  }
1389  else if (fNcentBins==5) { // for PbPb 2015
1390  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1391  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1392  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1393  else if (fCent >= 50 && fCent <= 90) fCentBin = 3;
1394  else if (fCent > 90) {
1395  fCent = 99;
1396  fCentBin = 4;
1397  }
1398  else {
1399  AliWarning(Form("%s: Negative centrality: %f. Assuming 99", GetName(), fCent));
1400  fCentBin = fNcentBins-1;
1401  }
1402  }
1403  else {
1404  Double_t centWidth = (fMaxCent-fMinCent)/(Double_t)fNcentBins;
1405  if(centWidth>0.) {
1406  fCentBin = TMath::FloorNint(fCent/centWidth);
1407  }
1408  else {
1409  fCentBin = 0;
1410  }
1411  if (fCentBin>=fNcentBins) {
1412  AliWarning(Form("%s: fCentBin too large: cent = %f fCentBin = %d. Assuming 99", GetName(),fCent,fCentBin));
1413  fCentBin = fNcentBins-1;
1414  }
1415  }
1416 
1417  AliEventplane *aliEP = InputEvent()->GetEventplane();
1418  if (aliEP) {
1419  fEPV0 = aliEP->GetEventplane("V0" ,InputEvent());
1420  fEPV0A = aliEP->GetEventplane("V0A",InputEvent());
1421  fEPV0C = aliEP->GetEventplane("V0C",InputEvent());
1422  } else {
1423  AliWarning(Form("%s: Could not retrieve event plane information!", GetName()));
1424  }
1425  }
1426  else {
1427  fCent = 99;
1428  fCentBin = 0;
1429  }
1430 
1431  if (fIsPythia) {
1432  if (MCEvent()) {
1433  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
1434  if (!fPythiaHeader) {
1435  // Check if AOD
1436  AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1437 
1438  if (aodMCH) {
1439  for (UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1440  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
1441  if (fPythiaHeader) break;
1442  }
1443  }
1444  }
1445  }
1446  }
1447 
1448  if (fPythiaHeader) {
1449  fPtHard = fPythiaHeader->GetPtHard();
1450 
1451  const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
1452  const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
1453  for (fPtHardBin = 0; fPtHardBin < 11; fPtHardBin++) {
1454  if (fPtHard >= ptHardLo[fPtHardBin] && fPtHard < ptHardHi[fPtHardBin])
1455  break;
1456  }
1457 
1458  fXsection = fPythiaHeader->GetXsection();
1459  fNTrials = fPythiaHeader->Trials();
1460  }
1461 
1463 
1464  AliEmcalContainer* cont = 0;
1465 
1466  TIter nextPartColl(&fParticleCollArray);
1467  while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))) cont->NextEvent();
1468 
1469  TIter nextClusColl(&fClusterCollArray);
1470  while ((cont = static_cast<AliParticleContainer*>(nextClusColl()))) cont->NextEvent();
1471 
1472  return kTRUE;
1473 }
1474 
1483 {
1484  if (TString(n).IsNull()) return 0;
1485 
1487 
1488  fParticleCollArray.Add(cont);
1489 
1490  return cont;
1491 }
1492 
1501 {
1502  if (TString(n).IsNull()) return 0;
1503 
1504  AliTrackContainer* cont = new AliTrackContainer(n);
1505 
1506  fParticleCollArray.Add(cont);
1507 
1508  return cont;
1509 }
1510 
1519 {
1520  if (TString(n).IsNull()) return 0;
1521 
1523 
1524  fParticleCollArray.Add(cont);
1525 
1526  return cont;
1527 }
1528 
1537 {
1538  if (TString(n).IsNull()) return 0;
1539 
1541 
1542  fClusterCollArray.Add(cont);
1543 
1544  return cont;
1545 }
1546 
1553 {
1554  if (i<0 || i>fParticleCollArray.GetEntriesFast()) return 0;
1555  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
1556  return cont;
1557 }
1558 
1565 {
1566  if (i<0 || i>fClusterCollArray.GetEntriesFast()) return 0;
1567  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
1568  return cont;
1569 }
1570 
1577 {
1578  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.FindObject(name));
1579  return cont;
1580 }
1581 
1588 {
1589  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.FindObject(name));
1590  return cont;
1591 }
1592 
1599 {
1601  if (!cont) {
1602  AliError(Form("%s: Particle container %d not found",GetName(),i));
1603  return 0;
1604  }
1605  TString contName = cont->GetArrayName();
1606  return cont->GetArray();
1607 }
1608 
1615 {
1617  if (!cont) {
1618  AliError(Form("%s:Cluster container %d not found",GetName(),i));
1619  return 0;
1620  }
1621  return cont->GetArray();
1622 }
1623 
1632 {
1633 
1635  if (!cont) {
1636  AliError(Form("%s: Particle container %d not found",GetName(),c));
1637  return 0;
1638  }
1639  AliVParticle *vp = cont->GetAcceptParticle(p);
1640 
1641  return vp;
1642 }
1643 
1652 {
1654  if (!cont) {
1655  AliError(Form("%s: Cluster container %d not found",GetName(),c));
1656  return 0;
1657  }
1658  AliVCluster *vc = cont->GetAcceptCluster(cl);
1659 
1660  return vc;
1661 }
1662 
1669 {
1671  if (!cont) {
1672  AliError(Form("%s: Particle container %d not found",GetName(),i));
1673  return 0;
1674  }
1675  return cont->GetNEntries();
1676 }
1677 
1685 {
1687  if (!cont) {
1688  AliError(Form("%s: Cluster container %d not found",GetName(),i));
1689  return 0;
1690  }
1691  return cont->GetNEntries();
1692 }
1693 
1705 AliEMCALTriggerPatchInfo* AliAnalysisTaskEmcal::GetMainTriggerPatch(TriggerCategory trigger, Bool_t doSimpleOffline)
1706 {
1707 
1708  if (!fTriggerPatchInfo) {
1709  AliError(Form("%s: fTriggerPatchInfo not available",GetName()));
1710  return 0;
1711  }
1712 
1713  //number of patches in event
1714  Int_t nPatch = fTriggerPatchInfo->GetEntries();
1715 
1716  //extract main trigger patch(es)
1717  AliEMCALTriggerPatchInfo *patch(NULL), *selected(NULL);
1718  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1719 
1720  patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
1721  if (patch->IsMainTrigger()) {
1722  if(doSimpleOffline){
1723  if(patch->IsOfflineSimple()){
1724  switch(trigger){
1725  case kTriggerLevel0:
1726  // option not yet implemented in the trigger maker
1727  if(patch->IsLevel0()) selected = patch;
1728  break;
1729  case kTriggerLevel1Jet:
1730  if(patch->IsJetHighSimple() || patch->IsJetLowSimple()){
1731  if(!selected) selected = patch;
1732  else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1733  }
1734  break;
1735  case kTriggerLevel1Gamma:
1736  if(patch->IsGammaHighSimple() || patch->IsGammaLowSimple()){
1737  if(!selected) selected = patch;
1738  else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1739  }
1740  break;
1741  default: // Silence compiler warnings
1742  AliError("Untreated case: Main Patch is recalculated; should be in 'else' branch");
1743  };
1744  }
1745  } else { // Not OfflineSimple
1746  switch(trigger){
1747  case kTriggerLevel0:
1748  if(patch->IsLevel0()) selected = patch;
1749  break;
1750  case kTriggerLevel1Jet:
1751  if(patch->IsJetHigh() || patch->IsJetLow()){
1752  if(!selected) selected = patch;
1753  else if (patch->GetADCAmp() > selected->GetADCAmp())
1754  selected = patch;
1755  }
1756  break;
1757  case kTriggerLevel1Gamma:
1758  if(patch->IsGammaHigh() || patch->IsGammaLow()){
1759  if(!selected) selected = patch;
1760  else if (patch->GetADCAmp() > selected->GetADCAmp())
1761  selected = patch;
1762  }
1763  break;
1764  default:
1765  AliError("Untreated case: Main Patch is recalculated; should be in 'else' branch");
1766  };
1767  }
1768  }
1769  else if ((trigger == kTriggerRecalcJet && patch->IsRecalcJet()) ||
1770  (trigger == kTriggerRecalcGamma && patch->IsRecalcGamma())) { // recalculated patches
1771  if (doSimpleOffline && patch->IsOfflineSimple()) {
1772  if(!selected) selected = patch;
1773  else if (patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) // this in fact should not be needed, but we have it in teh other branches as well, so keeping it for compleness
1774  selected = patch;
1775  }
1776  else if (!doSimpleOffline && !patch->IsOfflineSimple()) {
1777  if(!selected) selected = patch;
1778  else if (patch->GetADCAmp() > selected->GetADCAmp())
1779  selected = patch;
1780  }
1781  }
1782  }
1783  return selected;
1784 }
1785 
1792 {
1793  if (!(InputEvent()->FindListObject(obj->GetName()))) {
1794  InputEvent()->AddObject(obj);
1795  }
1796  else {
1797  if (!attempt) {
1798  AliFatal(Form("%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1799  }
1800  }
1801 }
1802 
1811 {
1812 
1813  if (!fGeom) {
1814  AliWarning(Form("%s - AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1815  return kFALSE;
1816  }
1817 
1818  Double_t minPhi = fGeom->GetArm1PhiMin() - edges;
1819  Double_t maxPhi = fGeom->GetArm1PhiMax() + edges;
1820 
1821  if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1822  return kTRUE;
1823  }
1824  else {
1825  return kFALSE;
1826  }
1827 }
1828 
1830 {
1831  axis->SetBinLabel(1, "NullObject");
1832  axis->SetBinLabel(2, "Pt");
1833  axis->SetBinLabel(3, "Acceptance");
1834  axis->SetBinLabel(4, "MCLabel");
1835  axis->SetBinLabel(5, "BitMap");
1836  axis->SetBinLabel(6, "HF cut");
1837  axis->SetBinLabel(7, "Bit6");
1838  axis->SetBinLabel(8, "NotHybridTrack");
1839  axis->SetBinLabel(9, "MCFlag");
1840  axis->SetBinLabel(10, "MCGenerator");
1841  axis->SetBinLabel(11, "ChargeCut");
1842  axis->SetBinLabel(12, "MinDistanceTPCSectorEdge");
1843  axis->SetBinLabel(13, "Bit12");
1844  axis->SetBinLabel(14, "IsEMCal");
1845  axis->SetBinLabel(15, "Time");
1846  axis->SetBinLabel(16, "Energy");
1847  axis->SetBinLabel(17, "ExoticCut");
1848  axis->SetBinLabel(18, "Bit17");
1849  axis->SetBinLabel(19, "Area");
1850  axis->SetBinLabel(20, "AreaEmc");
1851  axis->SetBinLabel(21, "ZLeadingCh");
1852  axis->SetBinLabel(22, "ZLeadingEmc");
1853  axis->SetBinLabel(23, "NEF");
1854  axis->SetBinLabel(24, "MinLeadPt");
1855  axis->SetBinLabel(25, "MaxTrackPt");
1856  axis->SetBinLabel(26, "MaxClusterPt");
1857  axis->SetBinLabel(27, "Flavour");
1858  axis->SetBinLabel(28, "TagStatus");
1859  axis->SetBinLabel(29, "MinNConstituents");
1860  axis->SetBinLabel(30, "Bit29");
1861  axis->SetBinLabel(31, "Bit30");
1862  axis->SetBinLabel(32, "Bit31");
1863 }
1864 
1871 Double_t AliAnalysisTaskEmcal::GetParallelFraction(AliVParticle* part1, AliVParticle* part2)
1872 {
1873  TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1874  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1875  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1876  return z;
1877 }
1878 
1885 Double_t AliAnalysisTaskEmcal::GetParallelFraction(const TVector3& vect1, AliVParticle* part2)
1886 {
1887  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1888  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1889  return z;
1890 }
1891 
1900 void AliAnalysisTaskEmcal::GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
1901 {
1902  phidiff = 999;
1903  etadiff = 999;
1904 
1905  if (!t||!v) return;
1906 
1907  Double_t veta = t->GetTrackEtaOnEMCal();
1908  Double_t vphi = t->GetTrackPhiOnEMCal();
1909 
1910  Float_t pos[3] = {0};
1911  v->GetPosition(pos);
1912  TVector3 cpos(pos);
1913  Double_t ceta = cpos.Eta();
1914  Double_t cphi = cpos.Phi();
1915  etadiff=veta-ceta;
1916  phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1917 }
1918 
1924 Byte_t AliAnalysisTaskEmcal::GetTrackType(const AliVTrack *t)
1925 {
1926  Byte_t ret = 0;
1927  if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1928  ret = 1;
1929  else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1930  ret = 2;
1931  else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1932  ret = 3;
1933  return ret;
1934 }
1935 
1945 Byte_t AliAnalysisTaskEmcal::GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2)
1946 {
1947 
1948  Int_t res = 0;
1949 
1950  if (aodTrack->TestFilterBit(filterBit1)) {
1951  res = 0;
1952  }
1953  else if (aodTrack->TestFilterBit(filterBit2)) {
1954  if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1955  res = 1;
1956  }
1957  else {
1958  res = 2;
1959  }
1960  }
1961  else {
1962  res = 3;
1963  }
1964 
1965  return res;
1966 }
1967 
1973 {
1974  if (!fPythiaInfo) {
1976  }
1977 
1978  AliStack* stack = mcEvent->Stack();
1979 
1980  const Int_t nprim = stack->GetNprimary();
1981  // reject if partons are missing from stack for some reason
1982  if (nprim < 8) return;
1983 
1984  TParticle *part6 = stack->Particle(6);
1985  TParticle *part7 = stack->Particle(7);
1986 
1987  fPythiaInfo->SetPartonFlag6(TMath::Abs(part6->GetPdgCode()));
1988  fPythiaInfo->SetParton6(part6->Pt(), part6->Eta(), part6->Phi(), part6->GetMass());
1989 
1990  fPythiaInfo->SetPartonFlag7(TMath::Abs(part7->GetPdgCode()));
1991  fPythiaInfo->SetParton7(part7->Pt(), part7->Eta(), part7->Phi(), part7->GetMass());
1992 
1993  AliGenPythiaEventHeader *pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(mcEvent->GenEventHeader());
1994  if(pythiaGenHeader){
1995  Float_t ptWeight=pythiaGenHeader->EventWeight();
1996  fPythiaInfo->SetPythiaEventWeight(ptWeight);}
1997 
1998 
1999 }
Bool_t fGeneratePythiaInfoObject
Generate Pythia info object.
TObjArray fClusterCollArray
cluster collection array
Int_t fNVertSPDCont
!event SPD vertex number of contributors
void SetParticlePtCut(Double_t cut)
Bool_t fIsPythia
trigger, if it is a PYTHIA production
double Double_t
Definition: External.C:58
void SetParton7(Float_t pt, Float_t eta, Float_t phi, Float_t mass=0)
TH1 * fHistTrials
!trials from pyxsec.root
EMCAL Level1 gamma trigger, low threshold.
AliEmcalPythiaInfo * fPythiaInfo
!event parton info
Bool_t AcceptTrack(AliVParticle *track, Int_t c=0) const
EMCAL Level1 jet trigger, low threshold.
Bool_t HasTriggerType(TriggerType triggersel)
Int_t fNTrials
!event trials
UInt_t fOffTrigger
offline trigger for event selection
Double_t fVertexSPD[3]
!event Svertex
Double_t fMinCent
min centrality for event selection
Double_t fTrackPtCut
cut on track pt in event selection
Recalculated jet trigger patch; does not need to be above trigger threshold.
Base task in the EMCAL framework.
Bool_t fUsePtHardBinScaling
Use pt hard bin scaling in merging.
void SetPartonFlag7(Int_t flag7)
Container with name, TClonesArray and cuts for particles.
TSystem * gSystem
Double_t fPtHard
!event pt hard
void SetTrackPtCut(Double_t cut, Int_t c=0)
static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
Double_t fMinBinPt
min pt in histograms
Double_t fEPV0
!event plane V0
TList * list
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
Bool_t AcceptCluster(AliVCluster *clus, Int_t c=0) const
TCanvas * c
Definition: TestFitELoss.C:172
Int_t fCentBin
!event centrality bin
TH1 * fHistEventsAfterSel
!total number of events per pt hard bin after selection
const AliMCParticleIterableContainer all() const
Float_t fPtHardAndClusterPtFactor
Factor between ptHard and cluster pT to reject/accept event.
Double_t fMinPtTrackInEmcal
min pt track in emcal
TH1 * fHistEventPlane
!event plane distribution
TH1 * fHistEvents
!total number of events per pt hard bin
void SetClusPtCut(Double_t cut, Int_t c=0)
AliClusterContainer * AddClusterContainer(const char *n)
Double_t fEPV0C
!event plane V0C
void SetParton6(Float_t pt, Float_t eta, Float_t phi, Float_t mass=0)
TH1 * fHistCentrality
!event centrality distribution
Container for particles within the EMCAL framework.
TObjArray fParticleCollArray
particle/track collection array
BeamType
Switch for the beam type.
void SetTrackEtaLimits(Double_t min, Double_t max, Int_t c=0)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
TProfile * fHistXsectionAfterSel
!x section from pythia header
TriggerType
Switch for EMCAL trigger types.
EMCalTriggerMode_t fEMCalTriggerMode
EMCal trigger selection mode.
virtual Bool_t FillHistograms()
Int_t GetNParticles(Int_t i=0) const
TClonesArray * fCaloClusters
!clusters
Bool_t fUseNewCentralityEstimation
Use new centrality estimation (for 2015 data)
Bool_t IsTrackInEmcalAcceptance(AliVParticle *part, Double_t edges=0.9) const
int Int_t
Definition: External.C:63
TH1 * fHistTriggerClasses
!number of events in each trigger class
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
Double_t fMaxVz
max vertex for event selection
void GeneratePythiaInfoObject(AliMCEvent *mcEvent)
AliEMCALGeometry * fGeom
!emcal geometry
The overlap between low and high threshold trigger is assigned to the lower threshold only...
kRecalculated gamma trigger patch; does not need to be above trigger threshold
TString fCaloTriggerPatchInfoName
trigger patch info array name
TString fCaloTriggersName
name of calo triggers collection
AliGenPythiaEventHeader * fPythiaHeader
!event Pythia header
void SetTrackPhiLimits(Double_t min, Double_t max, Int_t c=0)
AliParticleContainer * AddParticleContainer(const char *n)
AliAnalysisUtils * fAliAnalysisUtils
!vertex selection (optional)
BeamType fForceBeamType
forced beam type
void SetUseScaling(Bool_t val)
Definition: AliEmcalList.h:29
Int_t fNcentBins
how many centrality bins
AliClusterContainer * GetClusterContainer(Int_t i=0) const
TriggerType fTriggerTypeSel
trigger type to select based on trigger patches
virtual Bool_t AcceptCluster(Int_t i, UInt_t &rejectionReason) const
virtual Bool_t FillGeneralHistograms()
TString fTrigClass
trigger class name for event selection
Float_t fPtHardAndJetPtFactor
Factor between ptHard and jet pT to reject/accept event.
AliVCluster * GetAcceptCluster(Int_t i) const
TClonesArray * GetParticleArray(Int_t i=0) const
Double_t fMinVz
min vertex for event selection
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
BeamType fBeamType
!event beam type
Float_t fPtHardAndTrackPtFactor
Factor between ptHard and track pT to reject/accept event.
Double_t fCent
!event centrality
Double_t fMinEventPlane
minimum event plane value
TString fCaloCellsName
name of calo cell collection
Int_t GetNClusters(Int_t i=0) const
Int_t fNVertCont
!event vertex number of contributors
Bool_t fMCRejectFilter
enable the filtering of events by tail rejection
unsigned long ULong_t
Definition: External.C:38
Double_t fZvertexDiff
upper limit for distance between primary and SPD vertex
virtual Bool_t AcceptParticle(const AliVParticle *vp, UInt_t &rejectionReason) const
EMCAL Level0 trigger.
EMCAL Level1 jet trigger, high threshold.
Int_t fSelectPtHardBin
select one pt hard bin for analysis
AliMCParticleContainer * AddMCParticleContainer(const char *n)
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
virtual Bool_t RetrieveEventObjects()
Bool_t fRejectPileup
Reject pilup using function AliAnalysisUtils::IsPileUpEvent()
TProfile * fHistXsection
!x section from pyxsec.root
Bool_t PythiaInfoFromFile(const char *currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
void UserExec(Option_t *option)
void SetPartonFlag6(Int_t flag6)
AliVCaloCells * fCaloCells
!cells
TClonesArray * GetArrayFromEvent(const char *name, const char *clname=0)
Enhanced TList-derived class that implements correct merging for pt_hard binned production.
Definition: AliEmcalList.h:23
Double_t fEventPlaneVsEmcal
select events which have a certain event plane wrt the emcal
virtual Bool_t IsEventSelected()
TH1 * fHistPtHard
!pt hard distribution
void SetParticleEtaLimits(Double_t min, Double_t max)
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
Int_t fPtHardBin
!event pt hard bin
TClonesArray * fTracks
!tracks
TH1 * fHistTrialsAfterSel
!total number of trials per pt hard bin after selection
void LoadPythiaInfo(AliVEvent *event)
Bool_t fIsEsd
!whether it's an ESD analysis
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Double_t fVertex[3]
!event vertex
AliTrackContainer * AddTrackContainer(const char *n)
Bool_t fCreateHisto
whether or not create histograms
Store some informaion about a Pythia eventThis class is used to store some information about a Pythia...
TFile * file
TH1 * fHistEventRejection
!book keep reasons for rejecting event
Int_t nevents[nsamples]
TClonesArray * fTriggerPatchInfo
!trigger patch info array
TClonesArray * GetClusterArray(Int_t i=0) const
Double_t fEPV0A
!event plane V0A
TString fCentEst
name of V0 centrality estimator
TString fPythiaInfoName
name of pythia info object
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
Declaration of class AliEmcalPythiaInfo.
const char Option_t
Definition: External.C:48
void SetClusPtCut(Double_t cut)
Int_t fRunNumber
!run number (triggering RunChanged()
EMCAL Level1 gamma trigger, high threshold.
void AddObjectToEvent(TObject *obj, Bool_t attempt=kFALSE)
AliVCaloTrigger * fCaloTriggers
!calo triggers
void SetRejectionReasonLabels(TAxis *axis)
TH1 * fHistZVertex
!z vertex position
Int_t fMinNTrack
minimum nr of tracks in event with pT>fTrackPtCut
static Byte_t GetTrackType(const AliVTrack *t)
Bool_t fUseAliAnaUtils
used for LHC13* data: z-vtx, Ncontributors, z-vtx resolution cuts
void SetClusTimeCut(Double_t min, Double_t max, Int_t c=0)
bool Bool_t
Definition: External.C:53
ULong_t fTriggers
list of fired triggers
Double_t fMaxEventPlane
maximum event plane value
void SetPythiaEventWeight(Float_t ptWeight)
Float_t fXsection
!x-section from pythia header
Bool_t fInitialized
whether or not the task has been already initialized
TH1 * fHistEventCount
!incoming and selected events
Double_t fMaxCent
max centrality for event selection
void SetClusTimeCut(Double_t min, Double_t max)
TriggerCategory
Online trigger categories.
void SetParticlePhiLimits(Double_t min, Double_t max)
AliVParticle * GetAcceptParticleFromArray(Int_t p, Int_t c=0) const
Container structure for EMCAL clusters.
Container for MC-true particles within the EMCAL framework.
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
AliVCluster * GetAcceptClusterFromArray(Int_t cl, Int_t c=0) const
Int_t fNbins
no. of pt bins
Bool_t fTklVsClusSPDCut
Apply tracklet-vs-cluster SPD cut to reject background events in pp.
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
AliEMCALTriggerPatchInfo * GetMainTriggerPatch(TriggerCategory triggersel=kTriggerLevel1Jet, Bool_t doOfflinSimple=kFALSE)
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal