AliPhysics  a9863a5 (a9863a5)
 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 "AliAnalysisTaskEmcal.h"
17 
18 #include <TClonesArray.h>
19 #include <TList.h>
20 #include <TObject.h>
21 #include <TH1F.h>
22 #include <TProfile.h>
23 #include <TSystem.h>
24 #include <TFile.h>
25 #include <TChain.h>
26 #include <TKey.h>
27 
28 #include "AliStack.h"
29 #include "AliAODEvent.h"
30 #include "AliAnalysisManager.h"
31 #include "AliCentrality.h"
32 #include "AliEMCALGeometry.h"
33 #include "AliESDEvent.h"
34 #include "AliEmcalParticle.h"
35 #include "AliEventplane.h"
36 #include "AliInputEventHandler.h"
37 #include "AliLog.h"
38 #include "AliMCParticle.h"
39 #include "AliVCluster.h"
40 #include "AliVEventHandler.h"
41 #include "AliVParticle.h"
42 #include "AliAODTrack.h"
43 #include "AliVCaloTrigger.h"
44 #include "AliGenPythiaEventHeader.h"
45 #include "AliAODMCHeader.h"
46 #include "AliMCEvent.h"
47 #include "AliAnalysisUtils.h"
48 #include "AliEMCALTriggerPatchInfo.h"
49 #include "AliEmcalPythiaInfo.h"
50 
51 #include "AliMultSelection.h"
52 
54 
58 
63  AliAnalysisTaskSE("AliAnalysisTaskEmcal"),
64  fPythiaInfoName(""),
65  fForceBeamType(kNA),
66  fGeneralHistograms(kFALSE),
67  fInitialized(kFALSE),
68  fCreateHisto(kTRUE),
69  fCaloCellsName(),
70  fCaloTriggersName(),
71  fCaloTriggerPatchInfoName(),
72  fMinCent(-999),
73  fMaxCent(-999),
74  fMinVz(-999),
75  fMaxVz(999),
76  fTrackPtCut(0),
77  fMinNTrack(0),
78  fZvertexDiff(0.5),
79  fUseAliAnaUtils(kFALSE),
80  fRejectPileup(kFALSE),
81  fTklVsClusSPDCut(kFALSE),
82  fOffTrigger(AliVEvent::kAny),
83  fTrigClass(),
84  fTriggerTypeSel(kND),
85  fNbins(250),
86  fMinBinPt(0),
87  fMaxBinPt(250),
88  fMinPtTrackInEmcal(0),
89  fEventPlaneVsEmcal(-1),
90  fMinEventPlane(-1e6),
91  fMaxEventPlane(1e6),
92  fCentEst("V0M"),
93  fIsEmbedded(kFALSE),
94  fIsPythia(kFALSE),
95  fSelectPtHardBin(-999),
96  fMinMCLabel(0),
97  fMCLabelShift(0),
98  fNcentBins(4),
99  fNeedEmcalGeom(kTRUE),
100  fParticleCollArray(),
101  fClusterCollArray(),
102  fTriggers(0),
103  fEMCalTriggerMode(kOverlapWithLowThreshold),
104  fUseNewCentralityEstimation(kFALSE),
105  fGeneratePythiaInfoObject(kFALSE),
106  fMCRejectFilter(kFALSE),
107  fPtHardAndJetPtFactor(0.),
108  fPtHardAndClusterPtFactor(0.),
109  fPtHardAndTrackPtFactor(0.),
110  fAliAnalysisUtils(0x0),
111  fIsEsd(kFALSE),
112  fGeom(0),
113  fTracks(0),
114  fCaloClusters(0),
115  fCaloCells(0),
116  fCaloTriggers(0),
117  fTriggerPatchInfo(0),
118  fCent(0),
119  fCentBin(-1),
120  fEPV0(-1.0),
121  fEPV0A(-1.0),
122  fEPV0C(-1.0),
123  fNVertCont(0),
124  fNVertSPDCont(0),
125  fBeamType(kNA),
126  fPythiaHeader(0),
127  fPtHard(0),
128  fPtHardBin(0),
129  fNTrials(0),
130  fXsection(0),
131  fPythiaInfo(0),
132  fOutput(0),
133  fHistEventCount(0),
134  fHistTrialsAfterSel(0),
135  fHistEventsAfterSel(0),
136  fHistXsectionAfterSel(0),
137  fHistTrials(0),
138  fHistEvents(0),
139  fHistXsection(0),
140  fHistPtHard(0),
141  fHistCentrality(0),
142  fHistZVertex(0),
143  fHistEventPlane(0),
144  fHistEventRejection(0),
145  fHistTriggerClasses(0)
146 {
147  fVertex[0] = 0;
148  fVertex[1] = 0;
149  fVertex[2] = 0;
150  fVertexSPD[0] = 0;
151  fVertexSPD[1] = 0;
152  fVertexSPD[2] = 0;
153 
154  fParticleCollArray.SetOwner(kTRUE);
155  fClusterCollArray.SetOwner(kTRUE);
156 }
157 
168 AliAnalysisTaskEmcal::AliAnalysisTaskEmcal(const char *name, Bool_t histo) :
169  AliAnalysisTaskSE(name),
170  fPythiaInfoName(""),
171  fForceBeamType(kNA),
172  fGeneralHistograms(kFALSE),
173  fInitialized(kFALSE),
174  fCreateHisto(histo),
175  fCaloCellsName(),
176  fCaloTriggersName(),
177  fCaloTriggerPatchInfoName(),
178  fMinCent(-999),
179  fMaxCent(-999),
180  fMinVz(-999),
181  fMaxVz(999),
182  fTrackPtCut(0),
183  fMinNTrack(0),
184  fZvertexDiff(0.5),
185  fUseAliAnaUtils(kFALSE),
186  fRejectPileup(kFALSE),
187  fTklVsClusSPDCut(kFALSE),
188  fOffTrigger(AliVEvent::kAny),
189  fTrigClass(),
190  fTriggerTypeSel(kND),
191  fNbins(250),
192  fMinBinPt(0),
193  fMaxBinPt(250),
194  fMinPtTrackInEmcal(0),
195  fEventPlaneVsEmcal(-1),
196  fMinEventPlane(-1e6),
197  fMaxEventPlane(1e6),
198  fCentEst("V0M"),
199  fIsEmbedded(kFALSE),
200  fIsPythia(kFALSE),
201  fSelectPtHardBin(-999),
202  fMinMCLabel(0),
203  fMCLabelShift(0),
204  fNcentBins(4),
205  fNeedEmcalGeom(kTRUE),
206  fParticleCollArray(),
207  fClusterCollArray(),
208  fTriggers(0),
209  fEMCalTriggerMode(kOverlapWithLowThreshold),
210  fUseNewCentralityEstimation(kFALSE),
211  fGeneratePythiaInfoObject(kFALSE),
212  fMCRejectFilter(kFALSE),
213  fPtHardAndJetPtFactor(0.),
214  fPtHardAndClusterPtFactor(0.),
215  fPtHardAndTrackPtFactor(0.),
216  fAliAnalysisUtils(0x0),
217  fIsEsd(kFALSE),
218  fGeom(0),
219  fTracks(0),
220  fCaloClusters(0),
221  fCaloCells(0),
222  fCaloTriggers(0),
223  fTriggerPatchInfo(0),
224  fCent(0),
225  fCentBin(-1),
226  fEPV0(-1.0),
227  fEPV0A(-1.0),
228  fEPV0C(-1.0),
229  fNVertCont(0),
230  fNVertSPDCont(0),
231  fBeamType(kNA),
232  fPythiaHeader(0),
233  fPtHard(0),
234  fPtHardBin(0),
235  fNTrials(0),
236  fXsection(0),
237  fPythiaInfo(0),
238  fOutput(0),
239  fHistEventCount(0),
240  fHistTrialsAfterSel(0),
241  fHistEventsAfterSel(0),
242  fHistXsectionAfterSel(0),
243  fHistTrials(0),
244  fHistEvents(0),
245  fHistXsection(0),
246  fHistPtHard(0),
247  fHistCentrality(0),
248  fHistZVertex(0),
249  fHistEventPlane(0),
250  fHistEventRejection(0),
251  fHistTriggerClasses(0)
252 {
253  fVertex[0] = 0;
254  fVertex[1] = 0;
255  fVertex[2] = 0;
256  fVertexSPD[0] = 0;
257  fVertexSPD[1] = 0;
258  fVertexSPD[2] = 0;
259  fParticleCollArray.SetOwner(kTRUE);
260  fClusterCollArray.SetOwner(kTRUE);
261 
262  if (fCreateHisto) {
263  DefineOutput(1, TList::Class());
264  }
265 }
266 
271 {
272 }
273 
280 void AliAnalysisTaskEmcal::SetClusPtCut(Double_t cut, Int_t c)
281 {
283  if (cont) cont->SetClusPtCut(cut);
284  else AliError(Form("%s in SetClusPtCut(...): container %d not found",GetName(),c));
285 }
286 
294 void AliAnalysisTaskEmcal::SetClusTimeCut(Double_t min, Double_t max, Int_t c)
295 {
297  if (cont) cont->SetClusTimeCut(min,max);
298  else AliError(Form("%s in SetClusTimeCut(...): container %d not found",GetName(),c));
299 }
300 
307 void AliAnalysisTaskEmcal::SetTrackPtCut(Double_t cut, Int_t c)
308 {
310  if (cont) cont->SetParticlePtCut(cut);
311  else AliError(Form("%s in SetTrackPtCut(...): container %d not found",GetName(),c));
312 
313  fTrackPtCut = cut;
314 }
315 
323 void AliAnalysisTaskEmcal::SetTrackEtaLimits(Double_t min, Double_t max, Int_t c)
324 {
326  if (cont) cont->SetParticleEtaLimits(min,max);
327  else AliError(Form("%s in SetTrackPtCut(...): container %d not found",GetName(),c));
328 }
329 
337 void AliAnalysisTaskEmcal::SetTrackPhiLimits(Double_t min, Double_t max, Int_t c)
338 {
340  if (cont) cont->SetParticlePhiLimits(min,max);
341  else AliError(Form("%s in SetTrackPhiLimits(...): container %d not found",GetName(),c));
342 }
343 
364 {
365  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
366  if (mgr) {
367  AliVEventHandler *evhand = mgr->GetInputEventHandler();
368  if (evhand) {
369  if (evhand->InheritsFrom("AliESDInputHandler")) {
370  fIsEsd = kTRUE;
371  }
372  else {
373  fIsEsd = kFALSE;
374  }
375  }
376  else {
377  AliError("Event handler not found!");
378  }
379  }
380  else {
381  AliError("Analysis manager not found!");
382  }
383 
384  if (!fCreateHisto)
385  return;
386 
387  OpenFile(1);
388  fOutput = new TList();
389  fOutput->SetOwner();
390 
391  if (fForceBeamType == kpp)
392  fNcentBins = 1;
393 
394  if (!fGeneralHistograms)
395  return;
396 
397  if (fIsPythia) {
398  fHistTrialsAfterSel = new TH1F("fHistTrialsAfterSel", "fHistTrialsAfterSel", 11, 0, 11);
399  fHistTrialsAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
400  fHistTrialsAfterSel->GetYaxis()->SetTitle("trials");
402 
403  fHistEventsAfterSel = new TH1F("fHistEventsAfterSel", "fHistEventsAfterSel", 11, 0, 11);
404  fHistEventsAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
405  fHistEventsAfterSel->GetYaxis()->SetTitle("total events");
407 
408  fHistXsectionAfterSel = new TProfile("fHistXsectionAfterSel", "fHistXsectionAfterSel", 11, 0, 11);
409  fHistXsectionAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
410  fHistXsectionAfterSel->GetYaxis()->SetTitle("xsection");
412 
413  fHistTrials = new TH1F("fHistTrials", "fHistTrials", 11, 0, 11);
414  fHistTrials->GetXaxis()->SetTitle("p_{T} hard bin");
415  fHistTrials->GetYaxis()->SetTitle("trials");
416  fOutput->Add(fHistTrials);
417 
418  fHistEvents = new TH1F("fHistEvents", "fHistEvents", 11, 0, 11);
419  fHistEvents->GetXaxis()->SetTitle("p_{T} hard bin");
420  fHistEvents->GetYaxis()->SetTitle("total events");
421  fOutput->Add(fHistEvents);
422 
423  fHistXsection = new TProfile("fHistXsection", "fHistXsection", 11, 0, 11);
424  fHistXsection->GetXaxis()->SetTitle("p_{T} hard bin");
425  fHistXsection->GetYaxis()->SetTitle("xsection");
426  fOutput->Add(fHistXsection);
427 
428  const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
429  const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
430 
431  for (Int_t i = 1; i < 12; i++) {
432  fHistTrialsAfterSel->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
433  fHistEventsAfterSel->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
434 
435  fHistTrials->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
436  fHistXsection->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
437  fHistEvents->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
438  }
439 
440  fHistPtHard = new TH1F("fHistPtHard", "fHistPtHard", fNbins*2, fMinBinPt, fMaxBinPt*4);
441  fHistPtHard->GetXaxis()->SetTitle("p_{T,hard} (GeV/c)");
442  fHistPtHard->GetYaxis()->SetTitle("counts");
443  fOutput->Add(fHistPtHard);
444  }
445 
446  fHistZVertex = new TH1F("fHistZVertex","Z vertex position", 60, -30, 30);
447  fHistZVertex->GetXaxis()->SetTitle("z");
448  fHistZVertex->GetYaxis()->SetTitle("counts");
449  fOutput->Add(fHistZVertex);
450 
451  if (fForceBeamType != kpp) {
452  fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", 200, 0, 100);
453  fHistCentrality->GetXaxis()->SetTitle("Centrality (%)");
454  fHistCentrality->GetYaxis()->SetTitle("counts");
455  fOutput->Add(fHistCentrality);
456 
457  fHistEventPlane = new TH1F("fHistEventPlane","Event plane", 120, -TMath::Pi(), TMath::Pi());
458  fHistEventPlane->GetXaxis()->SetTitle("event plane");
459  fHistEventPlane->GetYaxis()->SetTitle("counts");
460  fOutput->Add(fHistEventPlane);
461  }
462 
463  fHistEventRejection = new TH1F("fHistEventRejection","Reasons to reject event",20,0,20);
464 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
465  fHistEventRejection->SetBit(TH1::kCanRebin);
466 #else
467  fHistEventRejection->SetCanExtend(TH1::kAllAxes);
468 #endif
469  fHistEventRejection->GetXaxis()->SetBinLabel(1,"PhysSel");
470  fHistEventRejection->GetXaxis()->SetBinLabel(2,"trigger");
471  fHistEventRejection->GetXaxis()->SetBinLabel(3,"trigTypeSel");
472  fHistEventRejection->GetXaxis()->SetBinLabel(4,"Cent");
473  fHistEventRejection->GetXaxis()->SetBinLabel(5,"vertex contr.");
474  fHistEventRejection->GetXaxis()->SetBinLabel(6,"Vz");
475  fHistEventRejection->GetXaxis()->SetBinLabel(7,"VzSPD");
476  fHistEventRejection->GetXaxis()->SetBinLabel(8,"trackInEmcal");
477  fHistEventRejection->GetXaxis()->SetBinLabel(9,"minNTrack");
478  fHistEventRejection->GetXaxis()->SetBinLabel(10,"VtxSel2013pA");
479  fHistEventRejection->GetXaxis()->SetBinLabel(11,"PileUp");
480  fHistEventRejection->GetXaxis()->SetBinLabel(12,"EvtPlane");
481  fHistEventRejection->GetXaxis()->SetBinLabel(13,"SelPtHardBin");
482  fHistEventRejection->GetXaxis()->SetBinLabel(14,"Bkg evt");
483  fHistEventRejection->GetYaxis()->SetTitle("counts");
485 
486  fHistTriggerClasses = new TH1F("fHistTriggerClasses","fHistTriggerClasses",3,0,3);
487 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
488  fHistTriggerClasses->SetBit(TH1::kCanRebin);
489 #else
490  fHistTriggerClasses->SetCanExtend(TH1::kAllAxes);
491 #endif
493 
494  fHistEventCount = new TH1F("fHistEventCount","fHistEventCount",2,0,2);
495  fHistEventCount->GetXaxis()->SetBinLabel(1,"Accepted");
496  fHistEventCount->GetXaxis()->SetBinLabel(2,"Rejected");
497  fHistEventCount->GetYaxis()->SetTitle("counts");
498  fOutput->Add(fHistEventCount);
499 
500  PostData(1, fOutput);
501 }
502 
517 {
518  if (fIsPythia) {
522  fHistPtHard->Fill(fPtHard);
523  }
524 
525  fHistZVertex->Fill(fVertex[2]);
526 
527  if (fForceBeamType != kpp) {
528  fHistCentrality->Fill(fCent);
529  fHistEventPlane->Fill(fEPV0);
530  }
531 
532  TObjArray* triggerClasses = InputEvent()->GetFiredTriggerClasses().Tokenize(" ");
533  TIter next(triggerClasses);
534  TObjString* triggerClass = 0;
535  while ((triggerClass = static_cast<TObjString*>(next()))) {
536  fHistTriggerClasses->Fill(triggerClass->GetString(), 1);
537  }
538  delete triggerClasses;
539  triggerClasses = 0;
540 
541  return kTRUE;
542 }
543 
563 void AliAnalysisTaskEmcal::UserExec(Option_t *option)
564 {
565  if (!fInitialized)
566  ExecOnce();
567 
568  if (!fInitialized)
569  return;
570 
571  if (!RetrieveEventObjects())
572  return;
573 
574  if (IsEventSelected()) {
575  if (fGeneralHistograms) fHistEventCount->Fill("Accepted",1);
576  }
577  else {
578  if (fGeneralHistograms) fHistEventCount->Fill("Rejected",1);
579  return;
580  }
581 
583  if (!FillGeneralHistograms())
584  return;
585  }
586 
587  if (!Run())
588  return;
589 
590  if (fCreateHisto) {
591  if (!FillHistograms())
592  return;
593  }
594 
595  if (fCreateHisto && fOutput) {
596  // information for this iteration of the UserExec in the container
597  PostData(1, fOutput);
598  }
599 }
600 
609 Bool_t AliAnalysisTaskEmcal::AcceptCluster(AliVCluster *clus, Int_t c) const
610 {
611  AliWarning("AliAnalysisTaskEmcal::AcceptCluster method is deprecated. Please use GetCusterContainer(c)->AcceptCluster(clus).");
612 
613  if (!clus) return kFALSE;
614 
616  if (!cont) {
617  AliError(Form("%s:Container %d not found",GetName(),c));
618  return 0;
619  }
620  UInt_t rejectionReason = 0;
621  return cont->AcceptCluster(clus, rejectionReason);
622 }
623 
632 Bool_t AliAnalysisTaskEmcal::AcceptTrack(AliVParticle *track, Int_t c) const
633 {
634  AliWarning("AliAnalysisTaskEmcal::AcceptTrack method is deprecated. Please use GetParticleContainer(c)->AcceptParticle(clus).");
635 
636  if (!track) return kFALSE;
637 
639  if (!cont) {
640  AliError(Form("%s:Container %d not found",GetName(),c));
641  return 0;
642  }
643 
644  UInt_t rejectionReason = 0;
645  return cont->AcceptParticle(track, rejectionReason);
646 }
647 
659 Bool_t AliAnalysisTaskEmcal::PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
660 {
661 
662  TString file(currFile);
663  fXsec = 0;
664  fTrials = 1;
665 
666  if (file.Contains(".zip#")) {
667  Ssiz_t pos1 = file.Index("root_archive",12,0,TString::kExact);
668  Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
669  Ssiz_t pos2 = file.Index(".root",5,TString::kExact);
670  file.Replace(pos+1,pos2-pos1,"");
671  } else {
672  // not an archive take the basename....
673  file.ReplaceAll(gSystem->BaseName(file.Data()),"");
674  }
675  AliDebug(1,Form("File name: %s",file.Data()));
676 
677  // Get the pt hard bin
678  TString strPthard(file);
679 
680  strPthard.Remove(strPthard.Last('/'));
681  strPthard.Remove(strPthard.Last('/'));
682  if (strPthard.Contains("AOD")) strPthard.Remove(strPthard.Last('/'));
683  strPthard.Remove(0,strPthard.Last('/')+1);
684  if (strPthard.IsDec())
685  pthard = strPthard.Atoi();
686  else
687  AliWarning(Form("Could not extract file number from path %s", strPthard.Data()));
688 
689  // 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
690  TFile *fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec.root"));
691 
692  if (!fxsec) {
693  // next trial fetch the histgram file
694  fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
695  if (!fxsec) {
696  // not a severe condition but inciate that we have no information
697  return kFALSE;
698  } else {
699  // find the tlist we want to be independtent of the name so use the Tkey
700  TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
701  if (!key) {
702  fxsec->Close();
703  return kFALSE;
704  }
705  TList *list = dynamic_cast<TList*>(key->ReadObj());
706  if (!list) {
707  fxsec->Close();
708  return kFALSE;
709  }
710  fXsec = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
711  fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
712  fxsec->Close();
713  }
714  } else { // no tree pyxsec.root
715  TTree *xtree = (TTree*)fxsec->Get("Xsection");
716  if (!xtree) {
717  fxsec->Close();
718  return kFALSE;
719  }
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  fxsec->Close();
728  }
729  return kTRUE;
730 }
731 
746 {
748  return kTRUE;
749 
750  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
751  if (!tree) {
752  AliError(Form("%s - UserNotify: No current tree!",GetName()));
753  return kFALSE;
754  }
755 
756  Float_t xsection = 0;
757  Float_t trials = 0;
758  Int_t pthardbin = 0;
759 
760  TFile *curfile = tree->GetCurrentFile();
761  if (!curfile) {
762  AliError(Form("%s - UserNotify: No current file!",GetName()));
763  return kFALSE;
764  }
765 
766  TChain *chain = dynamic_cast<TChain*>(tree);
767  if (chain) tree = chain->GetTree();
768 
769  Int_t nevents = tree->GetEntriesFast();
770 
771  PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
772 
773  // TODO: Workaround
774  if ((pthardbin < 0) || (pthardbin > 10)) pthardbin = 0;
775 
776  fHistTrials->Fill(pthardbin, trials);
777  fHistXsection->Fill(pthardbin, xsection);
778  fHistEvents->Fill(pthardbin, nevents);
779 
780  return kTRUE;
781 }
782 
788 {
789  if (!fPythiaInfoName.IsNull() && !fPythiaInfo) {
790  fPythiaInfo = dynamic_cast<AliEmcalPythiaInfo*>(event->FindListObject(fPythiaInfoName));
791  if (!fPythiaInfo) {
792  AliError(Form("%s: Could not retrieve parton infos! %s!", GetName(), fPythiaInfoName.Data()));
793  return;
794  }
795  }
796 }
797 
809 {
810  if (!InputEvent()) {
811  AliError(Form("%s: Could not retrieve event! Returning!", GetName()));
812  return;
813  }
814 
815  LoadPythiaInfo(InputEvent());
816 
817  if (fIsPythia) {
818  if (MCEvent()) {
819  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
820  if (!fPythiaHeader) {
821  // Check if AOD
822  AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
823 
824  if (aodMCH) {
825  for (UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
826  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
827  if (fPythiaHeader) break;
828  }
829  }
830  }
831  }
832  }
833 
834  if (fNeedEmcalGeom) {
835  fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
836  if (!fGeom) {
837  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()));
838  return;
839  }
840  }
841 
842  if (fEventPlaneVsEmcal >= 0) {
843  if (fGeom) {
844  Double_t ep = (fGeom->GetArm1PhiMax() + fGeom->GetArm1PhiMin()) / 2 * TMath::DegToRad() + fEventPlaneVsEmcal - TMath::Pi();
845  fMinEventPlane = ep - TMath::Pi() / 4;
846  fMaxEventPlane = ep + TMath::Pi() / 4;
847  }
848  else {
849  AliWarning("Could not set event plane limits because EMCal geometry was not loaded!");
850  }
851  }
852 
853  //Load all requested track branches - each container knows name already
854  for (Int_t i =0; i<fParticleCollArray.GetEntriesFast(); i++) {
855  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
856  cont->SetArray(InputEvent());
857  }
858 
859  if (fParticleCollArray.GetEntriesFast()>0) {
861  if (!fTracks) {
862  AliError(Form("%s: Could not retrieve first track branch!", GetName()));
863  return;
864  }
865  }
866 
867  //Load all requested cluster branches - each container knows name already
868  for (Int_t i =0; i<fClusterCollArray.GetEntriesFast(); i++) {
869  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
870  cont->SetArray(InputEvent());
871  }
872 
873  if (fClusterCollArray.GetEntriesFast()>0) {
875  if (!fCaloClusters) {
876  AliError(Form("%s: Could not retrieve first cluster branch!", GetName()));
877  return;
878  }
879  }
880 
881  if (!fCaloCellsName.IsNull() && !fCaloCells) {
882  fCaloCells = dynamic_cast<AliVCaloCells*>(InputEvent()->FindListObject(fCaloCellsName));
883  if (!fCaloCells) {
884  AliError(Form("%s: Could not retrieve cells %s!", GetName(), fCaloCellsName.Data()));
885  return;
886  }
887  }
888 
889  if (!fCaloTriggersName.IsNull() && !fCaloTriggers) {
890  fCaloTriggers = dynamic_cast<AliVCaloTrigger*>(InputEvent()->FindListObject(fCaloTriggersName));
891  if (!fCaloTriggers) {
892  AliError(Form("%s: Could not retrieve calo triggers %s!", GetName(), fCaloTriggersName.Data()));
893  return;
894  }
895  }
896 
897  if (!fCaloTriggerPatchInfoName.IsNull() && !fTriggerPatchInfo) {
898  fTriggerPatchInfo = GetArrayFromEvent(fCaloTriggerPatchInfoName.Data(),"AliEMCALTriggerPatchInfo");
899  if (!fTriggerPatchInfo) {
900  AliError(Form("%s: Could not retrieve calo trigger patch info %s!", GetName(), fCaloTriggerPatchInfoName.Data()));
901  return;
902  }
903 
904  }
905 
906  fInitialized = kTRUE;
907 }
908 
915 {
916 
917  if (fForceBeamType != kNA)
918  return fForceBeamType;
919 
920  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
921  if (esd) {
922  const AliESDRun *run = esd->GetESDRun();
923  TString beamType = run->GetBeamType();
924  if (beamType == "p-p")
925  return kpp;
926  else if (beamType == "A-A")
927  return kAA;
928  else if (beamType == "p-A")
929  return kpA;
930  else
931  return kNA;
932  } else {
933  Int_t runNumber = InputEvent()->GetRunNumber();
934  if ((runNumber >= 136851 && runNumber <= 139517) || // LHC10h
935  (runNumber >= 166529 && runNumber <= 170593)) { // LHC11h
936  return kAA;
937  } else if ((runNumber>=188365 && runNumber <= 188366) || // LHC12g
938  (runNumber >= 195344 && runNumber <= 196608)) { // LHC13b-f
939  return kpA;
940  } else {
941  return kpp;
942  }
943  }
944 }
945 
953 {
954  if (!fTriggerPatchInfo)
955  return 0;
956 
957  //number of patches in event
958  Int_t nPatch = fTriggerPatchInfo->GetEntries();
959 
960  //loop over patches to define trigger type of event
961  Int_t nG1 = 0;
962  Int_t nG2 = 0;
963  Int_t nJ1 = 0;
964  Int_t nJ2 = 0;
965  Int_t nL0 = 0;
966  AliEMCALTriggerPatchInfo *patch;
967  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
968  patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
969  if (patch->IsGammaHigh()) nG1++;
970  if (patch->IsGammaLow()) nG2++;
971  if (patch->IsJetHigh()) nJ1++;
972  if (patch->IsJetLow()) nJ2++;
973  if (patch->IsLevel0()) nL0++;
974  }
975 
976  AliDebug(2, "Patch summary: ");
977  AliDebug(2, Form("Number of patches: %d", nPatch));
978  AliDebug(2, Form("Jet: low[%d], high[%d]" ,nJ2, nJ1));
979  AliDebug(2, Form("Gamma: low[%d], high[%d]" ,nG2, nG1));
980 
981  ULong_t triggers(0);
982  if (nL0>0) SETBIT(triggers, kL0);
983  if (nG1>0) SETBIT(triggers, kG1);
984  if (nG2>0) SETBIT(triggers, kG2);
985  if (nJ1>0) SETBIT(triggers, kJ1);
986  if (nJ2>0) SETBIT(triggers, kJ2);
987  return triggers;
988 }
989 
997 {
998  //
999  if(trigger==kND) {
1000  AliWarning(Form("%s: Requesting undefined trigger type!", GetName()));
1001  return kFALSE;
1002  }
1003  //MV: removing this logic which as far as I can see doesn't make any sense
1004  // if(trigger & kND){
1005  // return fTriggers == 0;
1006  // }
1007  return TESTBIT(fTriggers, trigger);
1008 }
1009 
1032 {
1033  if (fOffTrigger != AliVEvent::kAny) {
1034  UInt_t res = 0;
1035  const AliESDEvent *eev = dynamic_cast<const AliESDEvent*>(InputEvent());
1036  if (eev) {
1037  res = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1038  } else {
1039  const AliAODEvent *aev = dynamic_cast<const AliAODEvent*>(InputEvent());
1040  if (aev) {
1041  res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
1042  }
1043  }
1044  if ((res & fOffTrigger) == 0) {
1045  if (fGeneralHistograms) fHistEventRejection->Fill("PhysSel",1);
1046  return kFALSE;
1047  }
1048  }
1049 
1050  if (!fTrigClass.IsNull()) {
1051  TString fired;
1052  const AliESDEvent *eev = dynamic_cast<const AliESDEvent*>(InputEvent());
1053  if (eev) {
1054  fired = eev->GetFiredTriggerClasses();
1055  } else {
1056  const AliAODEvent *aev = dynamic_cast<const AliAODEvent*>(InputEvent());
1057  if (aev) {
1058  fired = aev->GetFiredTriggerClasses();
1059  }
1060  }
1061  if (!fired.Contains("-B-")) {
1062  if (fGeneralHistograms) fHistEventRejection->Fill("trigger",1);
1063  return kFALSE;
1064  }
1065 
1066  TObjArray *arr = fTrigClass.Tokenize("|");
1067  if (!arr) {
1068  if (fGeneralHistograms) fHistEventRejection->Fill("trigger",1);
1069  return kFALSE;
1070  }
1071  Bool_t match = 0;
1072  for (Int_t i=0;i<arr->GetEntriesFast();++i) {
1073  TObject *obj = arr->At(i);
1074  if (!obj)
1075  continue;
1076 
1077  //Check if requested trigger was fired
1078  TString objStr = obj->GetName();
1080  (objStr.Contains("J1") || objStr.Contains("J2") || objStr.Contains("G1") || objStr.Contains("G2"))) {
1081  // This is relevant for EMCal triggers with 2 thresholds
1082  // If the kOverlapWithLowThreshold was requested than the overlap between the two triggers goes with the lower threshold trigger
1083  TString trigType1 = "J1";
1084  TString trigType2 = "J2";
1085  if(objStr.Contains("G")) {
1086  trigType1 = "G1";
1087  trigType2 = "G2";
1088  }
1089  if(objStr.Contains(trigType2) && fired.Contains(trigType2.Data())) { //requesting low threshold + overlap
1090  match = 1;
1091  break;
1092  }
1093  else if(objStr.Contains(trigType1) && fired.Contains(trigType1.Data()) && !fired.Contains(trigType2.Data())) { //high threshold only
1094  match = 1;
1095  break;
1096  }
1097  }
1098  else {
1099  // If this is not an EMCal trigger, or no particular treatment of EMCal triggers was requested,
1100  // simply check that the trigger was fired
1101  if (fired.Contains(obj->GetName())) {
1102  match = 1;
1103  break;
1104  }
1105  }
1106  }
1107  delete arr;
1108  if (!match) {
1109  if (fGeneralHistograms) fHistEventRejection->Fill("trigger",1);
1110  return kFALSE;
1111  }
1112  }
1113 
1114  if (fTriggerTypeSel != kND) {
1116  if (fGeneralHistograms) fHistEventRejection->Fill("trigTypeSel",1);
1117  return kFALSE;
1118  }
1119  }
1120 
1121  if ((fMinCent != -999) && (fMaxCent != -999)) {
1122  if (fCent<fMinCent || fCent>fMaxCent) {
1123  if (fGeneralHistograms) fHistEventRejection->Fill("Cent",1);
1124  return kFALSE;
1125  }
1126  }
1127 
1128  if (fUseAliAnaUtils) {
1129  if (!fAliAnalysisUtils)
1130  fAliAnalysisUtils = new AliAnalysisUtils();
1131  fAliAnalysisUtils->SetMinVtxContr(2);
1132  fAliAnalysisUtils->SetMaxVtxZ(999);
1133  if(fMinVz<-998.) fMinVz = -10.;
1134  if(fMaxVz>998.) fMaxVz = 10.;
1135 
1136  if (!fAliAnalysisUtils->IsVertexSelected2013pA(InputEvent())) {
1137  if (fGeneralHistograms) fHistEventRejection->Fill("VtxSel2013pA",1);
1138  return kFALSE;
1139  }
1140 
1141  if (fRejectPileup && fAliAnalysisUtils->IsPileUpEvent(InputEvent())) {
1142  if (fGeneralHistograms) fHistEventRejection->Fill("PileUp",1);
1143  return kFALSE;
1144  }
1145 
1146  if(fTklVsClusSPDCut && fAliAnalysisUtils->IsSPDClusterVsTrackletBG(InputEvent())) {
1147  if (fGeneralHistograms) fHistEventRejection->Fill("Bkg evt",1);
1148  return kFALSE;
1149  }
1150  }
1151 
1152  if ((fMinVz > -998.) && (fMaxVz < 998.)) {
1153  if (fNVertCont == 0 ) {
1154  if (fGeneralHistograms) fHistEventRejection->Fill("vertex contr.",1);
1155  return kFALSE;
1156  }
1157  Double_t vz = fVertex[2];
1158  if (vz < fMinVz || vz > fMaxVz) {
1159  if (fGeneralHistograms) fHistEventRejection->Fill("Vz",1);
1160  return kFALSE;
1161  }
1162 
1163  if (fNVertSPDCont > 0 && fZvertexDiff < 999) {
1164  Double_t vzSPD = fVertexSPD[2];
1165  Double_t dvertex = TMath::Abs(vz-vzSPD);
1166  //if difference larger than fZvertexDiff
1167  if (dvertex > fZvertexDiff) {
1168  if (fGeneralHistograms) fHistEventRejection->Fill("VzSPD",1);
1169  return kFALSE;
1170  }
1171  }
1172  }
1173 
1174  if (fMinPtTrackInEmcal > 0 && fGeom) {
1175  Bool_t trackInEmcalOk = kFALSE;
1176  Int_t ntracks = GetNParticles(0);
1177  for (Int_t i = 0; i < ntracks; i++) {
1178  AliVParticle *track = GetAcceptParticleFromArray(i,0);
1179  if (!track)
1180  continue;
1181 
1182  Double_t phiMin = fGeom->GetArm1PhiMin() * TMath::DegToRad();
1183  Double_t phiMax = fGeom->GetArm1PhiMax() * TMath::DegToRad();
1184  Int_t runNumber = InputEvent()->GetRunNumber();
1185  if (runNumber>=177295 && runNumber<=197470) { //small SM masked in 2012 and 2013
1186  phiMin = 1.4;
1187  phiMax = TMath::Pi();
1188  }
1189 
1190  if (track->Eta() < fGeom->GetArm1EtaMin() || track->Eta() > fGeom->GetArm1EtaMax() || track->Phi() < phiMin || track->Phi() > phiMax)
1191  continue;
1192  if (track->Pt() > fMinPtTrackInEmcal) {
1193  trackInEmcalOk = kTRUE;
1194  break;
1195  }
1196  }
1197  if (!trackInEmcalOk) {
1198  if (fGeneralHistograms) fHistEventRejection->Fill("trackInEmcal",1);
1199  return kFALSE;
1200  }
1201  }
1202 
1203  if (fMinNTrack > 0) {
1204  Int_t nTracksAcc = 0;
1205  Int_t ntracks = GetNParticles(0);
1206  for (Int_t i = 0; i < ntracks; i++) {
1207  AliVParticle *track = GetAcceptParticleFromArray(i,0);
1208  if (!track)
1209  continue;
1210  if (track->Pt() > fTrackPtCut) {
1211  nTracksAcc++;
1212  if (nTracksAcc>=fMinNTrack)
1213  break;
1214  }
1215  }
1216  if (nTracksAcc<fMinNTrack) {
1217  if (fGeneralHistograms) fHistEventRejection->Fill("minNTrack",1);
1218  return kFALSE;
1219  }
1220  }
1221 
1222  if (!(fEPV0 > fMinEventPlane && fEPV0 <= fMaxEventPlane) &&
1223  !(fEPV0 + TMath::Pi() > fMinEventPlane && fEPV0 + TMath::Pi() <= fMaxEventPlane) &&
1224  !(fEPV0 - TMath::Pi() > fMinEventPlane && fEPV0 - TMath::Pi() <= fMaxEventPlane))
1225  {
1226  if (fGeneralHistograms) fHistEventRejection->Fill("EvtPlane",1);
1227  return kFALSE;
1228  }
1229 
1230  if (fSelectPtHardBin != -999 && fSelectPtHardBin != fPtHardBin) {
1231  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
1232  return kFALSE;
1233  }
1234 
1235  // Reject filter for MC data
1236  if (!CheckMCOutliers()) return kFALSE;
1237 
1238  return kTRUE;
1239 }
1240 
1247 {
1248  if (!fPythiaHeader || !fMCRejectFilter) return kTRUE;
1249 
1250  // Condition 1: Pythia jet / pT-hard > factor
1251  if (fPtHardAndJetPtFactor > 0.) {
1252  AliTLorentzVector jet;
1253 
1254  Int_t nTriggerJets = fPythiaHeader->NTriggerJets();
1255 
1256  AliDebug(1,Form("Njets: %d, pT Hard %f",nTriggerJets, fPtHard));
1257 
1258  Float_t tmpjet[]={0,0,0,0};
1259  for (Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1260  fPythiaHeader->TriggerJet(ijet, tmpjet);
1261 
1262  jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1263 
1264  AliDebug(1,Form("jet %d; pycell jet pT %f",ijet, jet.Pt()));
1265 
1266  //Compare jet pT and pt Hard
1267  if (jet.Pt() > fPtHardAndJetPtFactor * fPtHard) {
1268  AliInfo(Form("Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", fPtHard, jet.Pt(), fPtHardAndJetPtFactor));
1269  return kFALSE;
1270  }
1271  }
1272  }
1273  // end condition 1
1274 
1275  // Condition 2 : Reconstructed EMCal cluster pT / pT-hard > factor
1276  if (fPtHardAndClusterPtFactor > 0.) {
1277  AliClusterContainer* mccluscont = GetClusterContainer(0);
1278  if ((Bool_t)mccluscont) {
1279  for (auto obj : mccluscont->all()) {// Not cuts applied ; use accept for cuts
1280  AliVCluster* cluster = static_cast<AliVCluster*>(obj);
1281  Float_t ecluster = cluster->E();
1282 
1283  if (ecluster > (fPtHardAndClusterPtFactor * fPtHard)) {
1284  AliInfo(Form("Reject : ecluster %2.2f, calo %d, factor %2.2f, ptHard %f",ecluster,cluster->GetType(),fPtHardAndClusterPtFactor,fPtHard));
1285  return kFALSE;
1286  }
1287  }
1288  }
1289  }
1290  // end condition 2
1291 
1292  // condition 3 : Reconstructed track pT / pT-hard >factor
1293  if (fPtHardAndTrackPtFactor > 0.) {
1295  if ((Bool_t)mcpartcont) {
1296  for (auto obj : mcpartcont->all()) {// Not cuts applied ; use accept for cuts
1297  AliAODMCParticle* mctrack = static_cast<AliAODMCParticle*>(obj);
1298  Float_t trackpt = mctrack->Pt();
1299  if (trackpt > (fPtHardAndTrackPtFactor * fPtHard) ) {
1300  AliInfo(Form("Reject : track %2.2f, factor %2.2f, ptHard %f", trackpt, fPtHardAndTrackPtFactor, fPtHard));
1301  return kFALSE;
1302  }
1303  }
1304  }
1305  }
1306  // end condition 3
1307 
1308  return kTRUE;
1309 }
1310 
1319 TClonesArray *AliAnalysisTaskEmcal::GetArrayFromEvent(const char *name, const char *clname)
1320 {
1321  TClonesArray *arr = 0;
1322  TString sname(name);
1323  if (!sname.IsNull()) {
1324  arr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(sname));
1325  if (!arr) {
1326  AliWarning(Form("%s: Could not retrieve array with name %s!", GetName(), name));
1327  return 0;
1328  }
1329  } else {
1330  return 0;
1331  }
1332 
1333  if (!clname)
1334  return arr;
1335 
1336  TString objname(arr->GetClass()->GetName());
1337  TClass cls(objname);
1338  if (!cls.InheritsFrom(clname)) {
1339  AliWarning(Form("%s: Objects of type %s in %s are not inherited from %s!",
1340  GetName(), cls.GetName(), name, clname));
1341  return 0;
1342  }
1343  return arr;
1344 }
1345 
1351 {
1352  fVertex[0] = 0;
1353  fVertex[1] = 0;
1354  fVertex[2] = 0;
1355  fNVertCont = 0;
1356 
1357  fVertexSPD[0] = 0;
1358  fVertexSPD[1] = 0;
1359  fVertexSPD[2] = 0;
1360  fNVertSPDCont = 0;
1361 
1362  if (fGeneratePythiaInfoObject && MCEvent()) {
1363  GeneratePythiaInfoObject(MCEvent());
1364  }
1365 
1366  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1367  if (vert) {
1368  vert->GetXYZ(fVertex);
1369  fNVertCont = vert->GetNContributors();
1370  }
1371 
1372  const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
1373  if (vertSPD) {
1374  vertSPD->GetXYZ(fVertexSPD);
1375  fNVertSPDCont = vertSPD->GetNContributors();
1376  }
1377 
1378  fBeamType = GetBeamType();
1379 
1380  if (fBeamType == kAA || fBeamType == kpA ) {
1382  AliMultSelection *MultSelection = static_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
1383  if (MultSelection) {
1384  fCent = MultSelection->GetMultiplicityPercentile(fCentEst.Data());
1385  }
1386  else {
1387  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1388  }
1389  }
1390  else { // old centrality estimation < 2015
1391  AliCentrality *aliCent = InputEvent()->GetCentrality();
1392  if (aliCent) {
1393  fCent = aliCent->GetCentralityPercentile(fCentEst.Data());
1394  }
1395  else {
1396  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1397  }
1398  }
1399 
1400  if (fNcentBins==4) {
1401  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1402  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1403  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1404  else if (fCent >= 50 && fCent <= 100) fCentBin = 3;
1405  else {
1406  AliWarning(Form("%s: Negative centrality: %f. Assuming 99", GetName(), fCent));
1407  fCentBin = fNcentBins-1;
1408  }
1409  }
1410  else if (fNcentBins==5) { // for PbPb 2015
1411  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1412  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1413  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1414  else if (fCent >= 50 && fCent <= 90) fCentBin = 3;
1415  else if (fCent > 90) {
1416  fCent = 99;
1417  fCentBin = 4;
1418  }
1419  else {
1420  AliWarning(Form("%s: Negative centrality: %f. Assuming 99", GetName(), fCent));
1421  fCentBin = fNcentBins-1;
1422  }
1423  }
1424  else {
1425  Double_t centWidth = (fMaxCent-fMinCent)/(Double_t)fNcentBins;
1426  if(centWidth>0.) {
1427  fCentBin = TMath::FloorNint(fCent/centWidth);
1428  }
1429  else {
1430  fCentBin = 0;
1431  }
1432  if (fCentBin>=fNcentBins) {
1433  AliWarning(Form("%s: fCentBin too large: cent = %f fCentBin = %d. Assuming 99", GetName(),fCent,fCentBin));
1434  fCentBin = fNcentBins-1;
1435  }
1436  }
1437 
1438  AliEventplane *aliEP = InputEvent()->GetEventplane();
1439  if (aliEP) {
1440  fEPV0 = aliEP->GetEventplane("V0" ,InputEvent());
1441  fEPV0A = aliEP->GetEventplane("V0A",InputEvent());
1442  fEPV0C = aliEP->GetEventplane("V0C",InputEvent());
1443  } else {
1444  AliWarning(Form("%s: Could not retrieve event plane information!", GetName()));
1445  }
1446  }
1447  else {
1448  fCent = 99;
1449  fCentBin = 0;
1450  }
1451 
1452  if (fPythiaHeader) {
1453  fPtHard = fPythiaHeader->GetPtHard();
1454 
1455  const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
1456  const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
1457  for (fPtHardBin = 0; fPtHardBin < 11; fPtHardBin++) {
1458  if (fPtHard >= ptHardLo[fPtHardBin] && fPtHard < ptHardHi[fPtHardBin])
1459  break;
1460  }
1461 
1462  fXsection = fPythiaHeader->GetXsection();
1463  fNTrials = fPythiaHeader->Trials();
1464  }
1465 
1467 
1468  AliEmcalContainer* cont = 0;
1469 
1470  TIter nextPartColl(&fParticleCollArray);
1471  while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))) cont->NextEvent();
1472 
1473  TIter nextClusColl(&fClusterCollArray);
1474  while ((cont = static_cast<AliParticleContainer*>(nextClusColl()))) cont->NextEvent();
1475 
1476  return kTRUE;
1477 }
1478 
1487 {
1488  if (TString(n).IsNull()) return 0;
1489 
1491 
1492  fParticleCollArray.Add(cont);
1493 
1494  return cont;
1495 }
1496 
1505 {
1506  if (TString(n).IsNull()) return 0;
1507 
1508  AliTrackContainer* cont = new AliTrackContainer(n);
1509 
1510  fParticleCollArray.Add(cont);
1511 
1512  return cont;
1513 }
1514 
1523 {
1524  if (TString(n).IsNull()) return 0;
1525 
1527 
1528  fParticleCollArray.Add(cont);
1529 
1530  return cont;
1531 }
1532 
1541 {
1542  if (TString(n).IsNull()) return 0;
1543 
1545 
1546  fClusterCollArray.Add(cont);
1547 
1548  return cont;
1549 }
1550 
1557 {
1558  if (i<0 || i>fParticleCollArray.GetEntriesFast()) return 0;
1559  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
1560  return cont;
1561 }
1562 
1569 {
1570  if (i<0 || i>fClusterCollArray.GetEntriesFast()) return 0;
1571  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
1572  return cont;
1573 }
1574 
1581 {
1582  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.FindObject(name));
1583  return cont;
1584 }
1585 
1592 {
1593  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.FindObject(name));
1594  return cont;
1595 }
1596 
1602 TClonesArray* AliAnalysisTaskEmcal::GetParticleArray(Int_t i) const
1603 {
1605  if (!cont) {
1606  AliError(Form("%s: Particle container %d not found",GetName(),i));
1607  return 0;
1608  }
1609  TString contName = cont->GetArrayName();
1610  return cont->GetArray();
1611 }
1612 
1618 TClonesArray* AliAnalysisTaskEmcal::GetClusterArray(Int_t i) const
1619 {
1621  if (!cont) {
1622  AliError(Form("%s:Cluster container %d not found",GetName(),i));
1623  return 0;
1624  }
1625  return cont->GetArray();
1626 }
1627 
1635 AliVParticle* AliAnalysisTaskEmcal::GetAcceptParticleFromArray(Int_t p, Int_t c) const
1636 {
1637 
1639  if (!cont) {
1640  AliError(Form("%s: Particle container %d not found",GetName(),c));
1641  return 0;
1642  }
1643  AliVParticle *vp = cont->GetAcceptParticle(p);
1644 
1645  return vp;
1646 }
1647 
1655 AliVCluster* AliAnalysisTaskEmcal::GetAcceptClusterFromArray(Int_t cl, Int_t c) const
1656 {
1658  if (!cont) {
1659  AliError(Form("%s: Cluster container %d not found",GetName(),c));
1660  return 0;
1661  }
1662  AliVCluster *vc = cont->GetAcceptCluster(cl);
1663 
1664  return vc;
1665 }
1666 
1673 {
1675  if (!cont) {
1676  AliError(Form("%s: Particle container %d not found",GetName(),i));
1677  return 0;
1678  }
1679  return cont->GetNEntries();
1680 }
1681 
1689 {
1691  if (!cont) {
1692  AliError(Form("%s: Cluster container %d not found",GetName(),i));
1693  return 0;
1694  }
1695  return cont->GetNEntries();
1696 }
1697 
1709 AliEMCALTriggerPatchInfo* AliAnalysisTaskEmcal::GetMainTriggerPatch(TriggerCategory trigger, Bool_t doSimpleOffline)
1710 {
1711 
1712  if (!fTriggerPatchInfo) {
1713  AliError(Form("%s: fTriggerPatchInfo not available",GetName()));
1714  return 0;
1715  }
1716 
1717  //number of patches in event
1718  Int_t nPatch = fTriggerPatchInfo->GetEntries();
1719 
1720  //extract main trigger patch(es)
1721  AliEMCALTriggerPatchInfo *patch(NULL), *selected(NULL);
1722  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1723 
1724  patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
1725  if (patch->IsMainTrigger()) {
1726  if(doSimpleOffline){
1727  if(patch->IsOfflineSimple()){
1728  switch(trigger){
1729  case kTriggerLevel0:
1730  // option not yet implemented in the trigger maker
1731  if(patch->IsLevel0()) selected = patch;
1732  break;
1733  case kTriggerLevel1Jet:
1734  if(patch->IsJetHighSimple() || patch->IsJetLowSimple()){
1735  if(!selected) selected = patch;
1736  else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1737  }
1738  break;
1739  case kTriggerLevel1Gamma:
1740  if(patch->IsGammaHighSimple() || patch->IsGammaLowSimple()){
1741  if(!selected) selected = patch;
1742  else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1743  }
1744  break;
1745  default: // Silence compiler warnings
1746  AliError("Untreated case: Main Patch is recalculated; should be in 'else' branch");
1747  };
1748  }
1749  } else { // Not OfflineSimple
1750  switch(trigger){
1751  case kTriggerLevel0:
1752  if(patch->IsLevel0()) selected = patch;
1753  break;
1754  case kTriggerLevel1Jet:
1755  if(patch->IsJetHigh() || patch->IsJetLow()){
1756  if(!selected) selected = patch;
1757  else if (patch->GetADCAmp() > selected->GetADCAmp())
1758  selected = patch;
1759  }
1760  break;
1761  case kTriggerLevel1Gamma:
1762  if(patch->IsGammaHigh() || patch->IsGammaLow()){
1763  if(!selected) selected = patch;
1764  else if (patch->GetADCAmp() > selected->GetADCAmp())
1765  selected = patch;
1766  }
1767  break;
1768  default:
1769  AliError("Untreated case: Main Patch is recalculated; should be in 'else' branch");
1770  };
1771  }
1772  }
1773  else if ((trigger == kTriggerRecalcJet && patch->IsRecalcJet()) ||
1774  (trigger == kTriggerRecalcGamma && patch->IsRecalcGamma())) { // recalculated patches
1775  if (doSimpleOffline && patch->IsOfflineSimple()) {
1776  if(!selected) selected = patch;
1777  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
1778  selected = patch;
1779  }
1780  else if (!doSimpleOffline && !patch->IsOfflineSimple()) {
1781  if(!selected) selected = patch;
1782  else if (patch->GetADCAmp() > selected->GetADCAmp())
1783  selected = patch;
1784  }
1785  }
1786  }
1787  return selected;
1788 }
1789 
1795 void AliAnalysisTaskEmcal::AddObjectToEvent(TObject *obj, Bool_t attempt)
1796 {
1797  if (!(InputEvent()->FindListObject(obj->GetName()))) {
1798  InputEvent()->AddObject(obj);
1799  }
1800  else {
1801  if (!attempt) {
1802  AliFatal(Form("%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1803  }
1804  }
1805 }
1806 
1814 Bool_t AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance(AliVParticle* part, Double_t edges) const
1815 {
1816 
1817  if (!fGeom) {
1818  AliWarning(Form("%s - AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1819  return kFALSE;
1820  }
1821 
1822  Double_t minPhi = fGeom->GetArm1PhiMin() - edges;
1823  Double_t maxPhi = fGeom->GetArm1PhiMax() + edges;
1824 
1825  if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1826  return kTRUE;
1827  }
1828  else {
1829  return kFALSE;
1830  }
1831 }
1832 
1834 {
1835  axis->SetBinLabel(1, "NullObject");
1836  axis->SetBinLabel(2, "Pt");
1837  axis->SetBinLabel(3, "Acceptance");
1838  axis->SetBinLabel(4, "MCLabel");
1839  axis->SetBinLabel(5, "BitMap");
1840  axis->SetBinLabel(6, "HF cut");
1841  axis->SetBinLabel(7, "Bit6");
1842  axis->SetBinLabel(8, "NotHybridTrack");
1843  axis->SetBinLabel(9, "MCFlag");
1844  axis->SetBinLabel(10, "MCGenerator");
1845  axis->SetBinLabel(11, "ChargeCut");
1846  axis->SetBinLabel(12, "MinDistanceTPCSectorEdge");
1847  axis->SetBinLabel(13, "Bit12");
1848  axis->SetBinLabel(14, "IsEMCal");
1849  axis->SetBinLabel(15, "Time");
1850  axis->SetBinLabel(16, "Energy");
1851  axis->SetBinLabel(17, "ExoticCut");
1852  axis->SetBinLabel(18, "Bit17");
1853  axis->SetBinLabel(19, "Area");
1854  axis->SetBinLabel(20, "AreaEmc");
1855  axis->SetBinLabel(21, "ZLeadingCh");
1856  axis->SetBinLabel(22, "ZLeadingEmc");
1857  axis->SetBinLabel(23, "NEF");
1858  axis->SetBinLabel(24, "MinLeadPt");
1859  axis->SetBinLabel(25, "MaxTrackPt");
1860  axis->SetBinLabel(26, "MaxClusterPt");
1861  axis->SetBinLabel(27, "Flavour");
1862  axis->SetBinLabel(28, "TagStatus");
1863  axis->SetBinLabel(29, "MinNConstituents");
1864  axis->SetBinLabel(30, "Bit29");
1865  axis->SetBinLabel(31, "Bit30");
1866  axis->SetBinLabel(32, "Bit31");
1867 }
1868 
1875 Double_t AliAnalysisTaskEmcal::GetParallelFraction(AliVParticle* part1, AliVParticle* part2)
1876 {
1877  TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1878  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1879  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1880  return z;
1881 }
1882 
1889 Double_t AliAnalysisTaskEmcal::GetParallelFraction(const TVector3& vect1, AliVParticle* part2)
1890 {
1891  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1892  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1893  return z;
1894 }
1895 
1904 void AliAnalysisTaskEmcal::GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
1905 {
1906  phidiff = 999;
1907  etadiff = 999;
1908 
1909  if (!t||!v) return;
1910 
1911  Double_t veta = t->GetTrackEtaOnEMCal();
1912  Double_t vphi = t->GetTrackPhiOnEMCal();
1913 
1914  Float_t pos[3] = {0};
1915  v->GetPosition(pos);
1916  TVector3 cpos(pos);
1917  Double_t ceta = cpos.Eta();
1918  Double_t cphi = cpos.Phi();
1919  etadiff=veta-ceta;
1920  phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1921 }
1922 
1928 Byte_t AliAnalysisTaskEmcal::GetTrackType(const AliVTrack *t)
1929 {
1930  Byte_t ret = 0;
1931  if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1932  ret = 1;
1933  else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1934  ret = 2;
1935  else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1936  ret = 3;
1937  return ret;
1938 }
1939 
1949 Byte_t AliAnalysisTaskEmcal::GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2)
1950 {
1951 
1952  Int_t res = 0;
1953 
1954  if (aodTrack->TestFilterBit(filterBit1)) {
1955  res = 0;
1956  }
1957  else if (aodTrack->TestFilterBit(filterBit2)) {
1958  if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1959  res = 1;
1960  }
1961  else {
1962  res = 2;
1963  }
1964  }
1965  else {
1966  res = 3;
1967  }
1968 
1969  return res;
1970 }
1971 
1977 {
1978  if (!fPythiaInfo) {
1980  }
1981 
1982  AliStack* stack = mcEvent->Stack();
1983 
1984  const Int_t nprim = stack->GetNprimary();
1985  // reject if partons are missing from stack for some reason
1986  if (nprim < 8) return;
1987 
1988  TParticle *part6 = stack->Particle(6);
1989  TParticle *part7 = stack->Particle(7);
1990 
1991  fPythiaInfo->SetPartonFlag6(TMath::Abs(part6->GetPdgCode()));
1992  fPythiaInfo->SetParton6(part6->Pt(), part6->Eta(), part6->Phi(), part6->GetMass());
1993 
1994  fPythiaInfo->SetPartonFlag7(TMath::Abs(part7->GetPdgCode()));
1995  fPythiaInfo->SetParton7(part7->Pt(), part7->Eta(), part7->Phi(), part7->GetMass());
1996 
1997  AliGenPythiaEventHeader *pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(mcEvent->GenEventHeader());
1998  if(pythiaGenHeader){
1999  Float_t ptWeight=pythiaGenHeader->EventWeight();
2000  fPythiaInfo->SetPythiaEventWeight(ptWeight);}
2001 
2002 
2003 }
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
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
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.
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
Int_t fCentBin
!event centrality bin
TH1 * fHistEventsAfterSel
!total number of events per pt hard bin after selection
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
TList * fOutput
!output list
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
TH1 * fHistTriggerClasses
!number of events in each trigger class
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
Int_t fNcentBins
how many centrality bins
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Base class for container structures within the EMCAL framework.
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
TClonesArray * GetArray() const
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
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
const TString & GetArrayName() const
TClonesArray * GetArrayFromEvent(const char *name, const char *clname=0)
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)
Double_t fMaxBinPt
max pt in histograms
Int_t fPtHardBin
!event pt hard bin
AliMCParticleContainer * GetMCParticleContainer(Int_t i=0) const
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
Double_t fVertex[3]
!event vertex
AliTrackContainer * AddTrackContainer(const char *n)
virtual void SetArray(const AliVEvent *event)
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.
void SetClusPtCut(Double_t cut)
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
Int_t GetNEntries() const
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)
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.
virtual void NextEvent()
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.
AliEMCALTriggerPatchInfo * GetMainTriggerPatch(TriggerCategory triggersel=kTriggerLevel1Jet, Bool_t doOfflinSimple=kFALSE)
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal