AliPhysics  251aa1e (251aa1e)
 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 
18 #include <TClonesArray.h>
19 #include <AliEmcalList.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 "AliAnalysisTaskEmcal.h"
29 #include "AliAnalysisUtils.h"
30 #include "AliAODEvent.h"
31 #include "AliAODMCHeader.h"
32 #include "AliAODTrack.h"
33 #include "AliAnalysisManager.h"
34 #include "AliCentrality.h"
36 #include "AliEMCALGeometry.h"
37 #include "AliEmcalPythiaInfo.h"
38 #include "AliEMCALTriggerPatchInfo.h"
39 #include "AliESDEvent.h"
40 #include "AliESDInputHandler.h"
41 #include "AliEventplane.h"
42 #include "AliGenPythiaEventHeader.h"
43 #include "AliInputEventHandler.h"
44 #include "AliLog.h"
45 #include "AliMCEvent.h"
46 #include "AliMCParticle.h"
47 #include "AliMultiInputEventHandler.h"
48 #include "AliMultSelection.h"
49 #include "AliStack.h"
50 #include "AliVCaloTrigger.h"
51 #include "AliVCluster.h"
52 #include "AliVEventHandler.h"
53 #include "AliVParticle.h"
54 
56 
60 
65  AliAnalysisTaskSE("AliAnalysisTaskEmcal"),
66  fPythiaInfoName(""),
67  fForceBeamType(kNA),
68  fGeneralHistograms(kFALSE),
69  fLocalInitialized(kFALSE),
70  fCreateHisto(kTRUE),
71  fCaloCellsName(),
72  fCaloTriggersName(),
73  fCaloTriggerPatchInfoName(),
74  fMinCent(-999),
75  fMaxCent(-999),
76  fMinVz(-999),
77  fMaxVz(999),
78  fTrackPtCut(0),
79  fMinNTrack(0),
80  fZvertexDiff(0.5),
81  fUseAliAnaUtils(kFALSE),
82  fRejectPileup(kFALSE),
83  fTklVsClusSPDCut(kFALSE),
84  fOffTrigger(AliVEvent::kAny),
85  fTrigClass(),
86  fMinBiasRefTrigger("CINT7-B-NOPF-ALLNOTRD"),
87  fTriggerTypeSel(kND),
88  fNbins(250),
89  fMinBinPt(0),
90  fMaxBinPt(250),
91  fMinPtTrackInEmcal(0),
92  fEventPlaneVsEmcal(-1),
93  fMinEventPlane(-1e6),
94  fMaxEventPlane(1e6),
95  fCentEst("V0M"),
96  fIsEmbedded(kFALSE),
97  fIsPythia(kFALSE),
98  fSelectPtHardBin(-999),
99  fMinMCLabel(0),
100  fMCLabelShift(0),
101  fNcentBins(4),
102  fNeedEmcalGeom(kTRUE),
103  fParticleCollArray(),
104  fClusterCollArray(),
105  fTriggers(0),
106  fEMCalTriggerMode(kOverlapWithLowThreshold),
107  fUseNewCentralityEstimation(kFALSE),
108  fGeneratePythiaInfoObject(kFALSE),
109  fUsePtHardBinScaling(kFALSE),
110  fMCRejectFilter(kFALSE),
111  fCountDownscaleCorrectedEvents(kFALSE),
112  fPtHardAndJetPtFactor(0.),
113  fPtHardAndClusterPtFactor(0.),
114  fPtHardAndTrackPtFactor(0.),
115  fRunNumber(-1),
116  fAliAnalysisUtils(nullptr),
117  fIsEsd(kFALSE),
118  fGeom(nullptr),
119  fTracks(nullptr),
120  fCaloClusters(nullptr),
121  fCaloCells(nullptr),
122  fCaloTriggers(nullptr),
123  fTriggerPatchInfo(nullptr),
124  fCent(0),
125  fCentBin(-1),
126  fEPV0(-1.0),
127  fEPV0A(-1.0),
128  fEPV0C(-1.0),
129  fNVertCont(0),
130  fNVertSPDCont(0),
131  fBeamType(kNA),
132  fPythiaHeader(nullptr),
133  fPtHard(0),
134  fPtHardBin(0),
135  fNTrials(0),
136  fXsection(0),
137  fPythiaInfo(nullptr),
138  fOutput(nullptr),
139  fHistEventCount(nullptr),
140  fHistTrialsAfterSel(nullptr),
141  fHistEventsAfterSel(nullptr),
142  fHistXsectionAfterSel(nullptr),
143  fHistTrials(nullptr),
144  fHistEvents(nullptr),
145  fHistXsection(nullptr),
146  fHistPtHard(nullptr),
147  fHistCentrality(nullptr),
148  fHistZVertex(nullptr),
149  fHistEventPlane(nullptr),
150  fHistEventRejection(nullptr),
151  fHistTriggerClasses(nullptr),
152  fHistTriggerClassesCorr(nullptr)
153 {
154  fVertex[0] = 0;
155  fVertex[1] = 0;
156  fVertex[2] = 0;
157  fVertexSPD[0] = 0;
158  fVertexSPD[1] = 0;
159  fVertexSPD[2] = 0;
160 
161  fParticleCollArray.SetOwner(kTRUE);
162  fClusterCollArray.SetOwner(kTRUE);
163 }
164 
176  AliAnalysisTaskSE(name),
177  fPythiaInfoName(""),
178  fForceBeamType(kNA),
179  fGeneralHistograms(kFALSE),
180  fLocalInitialized(kFALSE),
181  fCreateHisto(histo),
182  fCaloCellsName(),
183  fCaloTriggersName(),
184  fCaloTriggerPatchInfoName(),
185  fMinCent(-999),
186  fMaxCent(-999),
187  fMinVz(-999),
188  fMaxVz(999),
189  fTrackPtCut(0),
190  fMinNTrack(0),
191  fZvertexDiff(0.5),
192  fUseAliAnaUtils(kFALSE),
193  fRejectPileup(kFALSE),
194  fTklVsClusSPDCut(kFALSE),
195  fOffTrigger(AliVEvent::kAny),
196  fTrigClass(),
197  fMinBiasRefTrigger("CINT7-B-NOPF-ALLNOTRD"),
198  fTriggerTypeSel(kND),
199  fNbins(250),
200  fMinBinPt(0),
201  fMaxBinPt(250),
202  fMinPtTrackInEmcal(0),
203  fEventPlaneVsEmcal(-1),
204  fMinEventPlane(-1e6),
205  fMaxEventPlane(1e6),
206  fCentEst("V0M"),
207  fIsEmbedded(kFALSE),
208  fIsPythia(kFALSE),
209  fSelectPtHardBin(-999),
210  fMinMCLabel(0),
211  fMCLabelShift(0),
212  fNcentBins(4),
213  fNeedEmcalGeom(kTRUE),
214  fParticleCollArray(),
215  fClusterCollArray(),
216  fTriggers(0),
217  fEMCalTriggerMode(kOverlapWithLowThreshold),
218  fUseNewCentralityEstimation(kFALSE),
219  fGeneratePythiaInfoObject(kFALSE),
220  fUsePtHardBinScaling(kFALSE),
221  fMCRejectFilter(kFALSE),
222  fCountDownscaleCorrectedEvents(kFALSE),
223  fPtHardAndJetPtFactor(0.),
224  fPtHardAndClusterPtFactor(0.),
225  fPtHardAndTrackPtFactor(0.),
226  fRunNumber(-1),
227  fAliAnalysisUtils(nullptr),
228  fIsEsd(kFALSE),
229  fGeom(nullptr),
230  fTracks(nullptr),
231  fCaloClusters(nullptr),
232  fCaloCells(nullptr),
233  fCaloTriggers(nullptr),
234  fTriggerPatchInfo(nullptr),
235  fCent(0),
236  fCentBin(-1),
237  fEPV0(-1.0),
238  fEPV0A(-1.0),
239  fEPV0C(-1.0),
240  fNVertCont(0),
241  fNVertSPDCont(0),
242  fBeamType(kNA),
243  fPythiaHeader(nullptr),
244  fPtHard(0),
245  fPtHardBin(0),
246  fNTrials(0),
247  fXsection(0),
248  fPythiaInfo(0),
249  fOutput(nullptr),
250  fHistEventCount(nullptr),
251  fHistTrialsAfterSel(nullptr),
252  fHistEventsAfterSel(nullptr),
253  fHistXsectionAfterSel(nullptr),
254  fHistTrials(nullptr),
255  fHistEvents(nullptr),
256  fHistXsection(nullptr),
257  fHistPtHard(nullptr),
258  fHistCentrality(nullptr),
259  fHistZVertex(nullptr),
260  fHistEventPlane(nullptr),
261  fHistEventRejection(nullptr),
262  fHistTriggerClasses(nullptr),
263  fHistTriggerClassesCorr(nullptr)
264 {
265  fVertex[0] = 0;
266  fVertex[1] = 0;
267  fVertex[2] = 0;
268  fVertexSPD[0] = 0;
269  fVertexSPD[1] = 0;
270  fVertexSPD[2] = 0;
271  fParticleCollArray.SetOwner(kTRUE);
272  fClusterCollArray.SetOwner(kTRUE);
273 
274  if (fCreateHisto) {
275  DefineOutput(1, AliEmcalList::Class());
276  }
277 }
278 
283 {
284 }
285 
293 {
295  if (cont) cont->SetClusPtCut(cut);
296  else AliError(Form("%s in SetClusPtCut(...): container %d not found",GetName(),c));
297 }
298 
307 {
309  if (cont) cont->SetClusTimeCut(min,max);
310  else AliError(Form("%s in SetClusTimeCut(...): container %d not found",GetName(),c));
311 }
312 
320 {
322  if (cont) cont->SetParticlePtCut(cut);
323  else AliError(Form("%s in SetTrackPtCut(...): container %d not found",GetName(),c));
324 
325  fTrackPtCut = cut;
326 }
327 
336 {
338  if (cont) cont->SetParticleEtaLimits(min,max);
339  else AliError(Form("%s in SetTrackPtCut(...): container %d not found",GetName(),c));
340 }
341 
350 {
352  if (cont) cont->SetParticlePhiLimits(min,max);
353  else AliError(Form("%s in SetTrackPhiLimits(...): container %d not found",GetName(),c));
354 }
355 
376 {
377  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
378  if (mgr) {
379  AliVEventHandler *evhand = mgr->GetInputEventHandler();
380  if (evhand) {
381  if (evhand->InheritsFrom("AliESDInputHandler")) {
382  fIsEsd = kTRUE;
383  }
384  else {
385  fIsEsd = kFALSE;
386  }
387  }
388  else {
389  AliError("Event handler not found!");
390  }
391  }
392  else {
393  AliError("Analysis manager not found!");
394  }
395 
396  if (!fCreateHisto)
397  return;
398 
399  OpenFile(1);
400  fOutput = new AliEmcalList();
402  fOutput->SetOwner();
403 
404  if (fForceBeamType == kpp)
405  fNcentBins = 1;
406 
407  if (!fGeneralHistograms)
408  return;
409 
410  if (fIsPythia) {
411  fHistTrialsAfterSel = new TH1F("fHistTrialsAfterSel", "fHistTrialsAfterSel", 11, 0, 11);
412  fHistTrialsAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
413  fHistTrialsAfterSel->GetYaxis()->SetTitle("trials");
415 
416  fHistEventsAfterSel = new TH1F("fHistEventsAfterSel", "fHistEventsAfterSel", 11, 0, 11);
417  fHistEventsAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
418  fHistEventsAfterSel->GetYaxis()->SetTitle("total events");
420 
421  fHistXsectionAfterSel = new TProfile("fHistXsectionAfterSel", "fHistXsectionAfterSel", 11, 0, 11);
422  fHistXsectionAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
423  fHistXsectionAfterSel->GetYaxis()->SetTitle("xsection");
425 
426  fHistTrials = new TH1F("fHistTrials", "fHistTrials", 11, 0, 11);
427  fHistTrials->GetXaxis()->SetTitle("p_{T} hard bin");
428  fHistTrials->GetYaxis()->SetTitle("trials");
429  fOutput->Add(fHistTrials);
430 
431  fHistEvents = new TH1F("fHistEvents", "fHistEvents", 11, 0, 11);
432  fHistEvents->GetXaxis()->SetTitle("p_{T} hard bin");
433  fHistEvents->GetYaxis()->SetTitle("total events");
434  fOutput->Add(fHistEvents);
435 
436  fHistXsection = new TProfile("fHistXsection", "fHistXsection", 11, 0, 11);
437  fHistXsection->GetXaxis()->SetTitle("p_{T} hard bin");
438  fHistXsection->GetYaxis()->SetTitle("xsection");
439  fOutput->Add(fHistXsection);
440 
441  const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
442  const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
443 
444  for (Int_t i = 1; i < 12; i++) {
445  fHistTrialsAfterSel->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
446  fHistEventsAfterSel->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
447 
448  fHistTrials->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
449  fHistXsection->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
450  fHistEvents->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
451  }
452 
453  fHistPtHard = new TH1F("fHistPtHard", "fHistPtHard", fNbins*2, fMinBinPt, fMaxBinPt*4);
454  fHistPtHard->GetXaxis()->SetTitle("p_{T,hard} (GeV/c)");
455  fHistPtHard->GetYaxis()->SetTitle("counts");
456  fOutput->Add(fHistPtHard);
457  }
458 
459  fHistZVertex = new TH1F("fHistZVertex","Z vertex position", 60, -30, 30);
460  fHistZVertex->GetXaxis()->SetTitle("z");
461  fHistZVertex->GetYaxis()->SetTitle("counts");
462  fOutput->Add(fHistZVertex);
463 
464  if (fForceBeamType != kpp) {
465  fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", 200, 0, 100);
466  fHistCentrality->GetXaxis()->SetTitle("Centrality (%)");
467  fHistCentrality->GetYaxis()->SetTitle("counts");
468  fOutput->Add(fHistCentrality);
469 
470  fHistEventPlane = new TH1F("fHistEventPlane","Event plane", 120, -TMath::Pi(), TMath::Pi());
471  fHistEventPlane->GetXaxis()->SetTitle("event plane");
472  fHistEventPlane->GetYaxis()->SetTitle("counts");
473  fOutput->Add(fHistEventPlane);
474  }
475 
476  fHistEventRejection = new TH1F("fHistEventRejection","Reasons to reject event",20,0,20);
477 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
478  fHistEventRejection->SetBit(TH1::kCanRebin);
479 #else
480  fHistEventRejection->SetCanExtend(TH1::kAllAxes);
481 #endif
482  fHistEventRejection->GetXaxis()->SetBinLabel(1,"PhysSel");
483  fHistEventRejection->GetXaxis()->SetBinLabel(2,"trigger");
484  fHistEventRejection->GetXaxis()->SetBinLabel(3,"trigTypeSel");
485  fHistEventRejection->GetXaxis()->SetBinLabel(4,"Cent");
486  fHistEventRejection->GetXaxis()->SetBinLabel(5,"vertex contr.");
487  fHistEventRejection->GetXaxis()->SetBinLabel(6,"Vz");
488  fHistEventRejection->GetXaxis()->SetBinLabel(7,"VzSPD");
489  fHistEventRejection->GetXaxis()->SetBinLabel(8,"trackInEmcal");
490  fHistEventRejection->GetXaxis()->SetBinLabel(9,"minNTrack");
491  fHistEventRejection->GetXaxis()->SetBinLabel(10,"VtxSel2013pA");
492  fHistEventRejection->GetXaxis()->SetBinLabel(11,"PileUp");
493  fHistEventRejection->GetXaxis()->SetBinLabel(12,"EvtPlane");
494  fHistEventRejection->GetXaxis()->SetBinLabel(13,"SelPtHardBin");
495  fHistEventRejection->GetXaxis()->SetBinLabel(14,"Bkg evt");
496  fHistEventRejection->GetYaxis()->SetTitle("counts");
498 
499  fHistTriggerClasses = new TH1F("fHistTriggerClasses","fHistTriggerClasses",3,0,3);
500 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
501  fHistTriggerClasses->SetBit(TH1::kCanRebin);
502 #else
503  fHistTriggerClasses->SetCanExtend(TH1::kAllAxes);
504 #endif
506 
508  fHistTriggerClassesCorr = new TH1F("fHistTriggerClassesCorr","fHistTriggerClassesCorr",3,0,3);
509 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
510  fHistTriggerClassesCorr->SetBit(TH1::kCanRebin);
511 #else
512  fHistTriggerClassesCorr->SetCanExtend(TH1::kAllAxes);
513 #endif
515  }
516 
517  fHistEventCount = new TH1F("fHistEventCount","fHistEventCount",2,0,2);
518  fHistEventCount->GetXaxis()->SetBinLabel(1,"Accepted");
519  fHistEventCount->GetXaxis()->SetBinLabel(2,"Rejected");
520  fHistEventCount->GetYaxis()->SetTitle("counts");
521  fOutput->Add(fHistEventCount);
522 
523  PostData(1, fOutput);
524 }
525 
540 {
541  if (fIsPythia) {
545  fHistPtHard->Fill(fPtHard);
546  }
547 
548  fHistZVertex->Fill(fVertex[2]);
549 
550  if (fForceBeamType != kpp) {
551  fHistCentrality->Fill(fCent);
552  fHistEventPlane->Fill(fEPV0);
553  }
554 
555  std::unique_ptr<TObjArray> triggerClasses(InputEvent()->GetFiredTriggerClasses().Tokenize(" "));
556  TObjString* triggerClass(nullptr);
557  for(auto trg : *triggerClasses){
558  triggerClass = static_cast<TObjString*>(trg);
559  fHistTriggerClasses->Fill(triggerClass->GetString(), 1);
560  }
561 
563  // downscale-corrected number of events are calculated based on the min. bias reference
564  // Formula: N_corr = N_MB * d_Trg/d_{Min_Bias}
565  if(InputEvent()->GetFiredTriggerClasses().Contains(fMinBiasRefTrigger)){
567  Double_t downscaleref = downscalefactors->GetDownscaleFactorForTriggerClass(fMinBiasRefTrigger);
568  for(auto t : downscalefactors->GetTriggerClasses()){
569  Double_t downscaletrg = downscalefactors->GetDownscaleFactorForTriggerClass(t);
570  fHistTriggerClassesCorr->Fill(t, downscaletrg/downscaleref);
571  }
572  }
573  }
574 
575  return kTRUE;
576 }
577 
598 {
599  if (!fLocalInitialized){
600  ExecOnce();
601  UserExecOnce();
602  }
603 
604  if (!fLocalInitialized)
605  return;
606 
607  if (!RetrieveEventObjects())
608  return;
609 
610  if(InputEvent()->GetRunNumber() != fRunNumber){
611  fRunNumber = InputEvent()->GetRunNumber();
614  }
615 
616  if (IsEventSelected()) {
617  if (fGeneralHistograms) fHistEventCount->Fill("Accepted",1);
618  }
619  else {
620  if (fGeneralHistograms) fHistEventCount->Fill("Rejected",1);
621  return;
622  }
623 
625  if (!FillGeneralHistograms())
626  return;
627  }
628 
629  if (!Run())
630  return;
631 
632  if (fCreateHisto) {
633  if (!FillHistograms())
634  return;
635  }
636 
637  if (fCreateHisto && fOutput) {
638  // information for this iteration of the UserExec in the container
639  PostData(1, fOutput);
640  }
641 }
642 
652 {
653  AliWarning("AliAnalysisTaskEmcal::AcceptCluster method is deprecated. Please use GetCusterContainer(c)->AcceptCluster(clus).");
654 
655  if (!clus) return kFALSE;
656 
658  if (!cont) {
659  AliError(Form("%s:Container %d not found",GetName(),c));
660  return 0;
661  }
662  UInt_t rejectionReason = 0;
663  return cont->AcceptCluster(clus, rejectionReason);
664 }
665 
674 Bool_t AliAnalysisTaskEmcal::AcceptTrack(AliVParticle *track, Int_t c) const
675 {
676  AliWarning("AliAnalysisTaskEmcal::AcceptTrack method is deprecated. Please use GetParticleContainer(c)->AcceptParticle(clus).");
677 
678  if (!track) return kFALSE;
679 
681  if (!cont) {
682  AliError(Form("%s:Container %d not found",GetName(),c));
683  return 0;
684  }
685 
686  UInt_t rejectionReason = 0;
687  return cont->AcceptParticle(track, rejectionReason);
688 }
689 
701 Bool_t AliAnalysisTaskEmcal::PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
702 {
703 
704  TString file(currFile);
705  fXsec = 0;
706  fTrials = 1;
707 
708  if (file.Contains(".zip#")) {
709  Ssiz_t pos1 = file.Index("root_archive",12,0,TString::kExact);
710  Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
711  Ssiz_t pos2 = file.Index(".root",5,TString::kExact);
712  file.Replace(pos+1,pos2-pos1,"");
713  } else {
714  // not an archive take the basename....
715  file.ReplaceAll(gSystem->BaseName(file.Data()),"");
716  }
717  AliDebug(1,Form("File name: %s",file.Data()));
718 
719  // Get the pt hard bin
720  TString strPthard(file);
721 
722  strPthard.Remove(strPthard.Last('/'));
723  strPthard.Remove(strPthard.Last('/'));
724  if (strPthard.Contains("AOD")) strPthard.Remove(strPthard.Last('/'));
725  strPthard.Remove(0,strPthard.Last('/')+1);
726  if (strPthard.IsDec()) pthard = strPthard.Atoi();
727  else
728  AliWarning(Form("Could not extract file number from path %s", strPthard.Data()));
729 
730  // 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
731  std::unique_ptr<TFile> fxsec(TFile::Open(Form("%s%s",file.Data(),"pyxsec.root")));
732 
733  if (!fxsec) {
734  // next trial fetch the histgram file
735  fxsec = std::unique_ptr<TFile>(TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root")));
736  if (!fxsec) return kFALSE; // not a severe condition but inciate that we have no information
737  else {
738  // find the tlist we want to be independtent of the name so use the Tkey
739  TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
740  if (!key) return kFALSE;
741  TList *list = dynamic_cast<TList*>(key->ReadObj());
742  if (!list) return kFALSE;
743  fXsec = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
744  fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
745  }
746  } else { // no tree pyxsec.root
747  TTree *xtree = (TTree*)fxsec->Get("Xsection");
748  if (!xtree) return kFALSE;
749  UInt_t ntrials = 0;
750  Double_t xsection = 0;
751  xtree->SetBranchAddress("xsection",&xsection);
752  xtree->SetBranchAddress("ntrials",&ntrials);
753  xtree->GetEntry(0);
754  fTrials = ntrials;
755  fXsec = xsection;
756  }
757  return kTRUE;
758 }
759 
774 {
776  return kTRUE;
777 
778  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
779  if (!tree) {
780  AliError(Form("%s - UserNotify: No current tree!",GetName()));
781  return kFALSE;
782  }
783 
784  Float_t xsection = 0;
785  Float_t trials = 0;
786  Int_t pthardbin = 0;
787 
788  TFile *curfile = tree->GetCurrentFile();
789  if (!curfile) {
790  AliError(Form("%s - UserNotify: No current file!",GetName()));
791  return kFALSE;
792  }
793 
794  TChain *chain = dynamic_cast<TChain*>(tree);
795  if (chain) tree = chain->GetTree();
796 
797  Int_t nevents = tree->GetEntriesFast();
798 
799  PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
800 
801  // TODO: Workaround
802  if ((pthardbin < 0) || (pthardbin > 10)) pthardbin = 0;
803 
804  fHistTrials->Fill(pthardbin, trials);
805  fHistXsection->Fill(pthardbin, xsection);
806  fHistEvents->Fill(pthardbin, nevents);
807 
808  return kTRUE;
809 }
810 
816 {
817  if (!fPythiaInfoName.IsNull() && !fPythiaInfo) {
818  fPythiaInfo = dynamic_cast<AliEmcalPythiaInfo*>(event->FindListObject(fPythiaInfoName));
819  if (!fPythiaInfo) {
820  AliError(Form("%s: Could not retrieve parton infos! %s!", GetName(), fPythiaInfoName.Data()));
821  return;
822  }
823  }
824 }
825 
837 {
838  if (!InputEvent()) {
839  AliError(Form("%s: Could not retrieve event! Returning!", GetName()));
840  return;
841  }
842 
843  LoadPythiaInfo(InputEvent());
844 
845  if (fNeedEmcalGeom) {
846  fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
847  if (!fGeom) {
848  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()));
849  return;
850  }
851  }
852 
853  if (fEventPlaneVsEmcal >= 0) {
854  if (fGeom) {
855  Double_t ep = (fGeom->GetArm1PhiMax() + fGeom->GetArm1PhiMin()) / 2 * TMath::DegToRad() + fEventPlaneVsEmcal - TMath::Pi();
856  fMinEventPlane = ep - TMath::Pi() / 4;
857  fMaxEventPlane = ep + TMath::Pi() / 4;
858  }
859  else {
860  AliWarning("Could not set event plane limits because EMCal geometry was not loaded!");
861  }
862  }
863 
864  //Load all requested track branches - each container knows name already
865  for (Int_t i =0; i<fParticleCollArray.GetEntriesFast(); i++) {
866  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
867  cont->SetArray(InputEvent());
868  }
869 
870  if (fParticleCollArray.GetEntriesFast()>0) {
872  if (!fTracks) {
873  AliError(Form("%s: Could not retrieve first track branch!", GetName()));
874  return;
875  }
876  }
877 
878  //Load all requested cluster branches - each container knows name already
879  for (Int_t i =0; i<fClusterCollArray.GetEntriesFast(); i++) {
880  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
881  cont->SetArray(InputEvent());
882  }
883 
884  if (fClusterCollArray.GetEntriesFast()>0) {
886  if (!fCaloClusters) {
887  AliError(Form("%s: Could not retrieve first cluster branch!", GetName()));
888  return;
889  }
890  }
891 
892  if (!fCaloCellsName.IsNull() && !fCaloCells) {
893  fCaloCells = dynamic_cast<AliVCaloCells*>(InputEvent()->FindListObject(fCaloCellsName));
894  if (!fCaloCells) {
895  AliError(Form("%s: Could not retrieve cells %s!", GetName(), fCaloCellsName.Data()));
896  return;
897  }
898  }
899 
900  if (!fCaloTriggersName.IsNull() && !fCaloTriggers) {
901  fCaloTriggers = dynamic_cast<AliVCaloTrigger*>(InputEvent()->FindListObject(fCaloTriggersName));
902  if (!fCaloTriggers) {
903  AliError(Form("%s: Could not retrieve calo triggers %s!", GetName(), fCaloTriggersName.Data()));
904  return;
905  }
906  }
907 
908  if (!fCaloTriggerPatchInfoName.IsNull() && !fTriggerPatchInfo) {
909  fTriggerPatchInfo = GetArrayFromEvent(fCaloTriggerPatchInfoName.Data(),"AliEMCALTriggerPatchInfo");
910  if (!fTriggerPatchInfo) {
911  AliError(Form("%s: Could not retrieve calo trigger patch info %s!", GetName(), fCaloTriggerPatchInfoName.Data()));
912  return;
913  }
914 
915  }
916 
917  fLocalInitialized = kTRUE;
918 }
919 
926 {
927 
928  if (fForceBeamType != kNA)
929  return fForceBeamType;
930 
931  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
932  if (esd) {
933  const AliESDRun *run = esd->GetESDRun();
934  TString beamType = run->GetBeamType();
935  if (beamType == "p-p")
936  return kpp;
937  else if (beamType == "A-A")
938  return kAA;
939  else if (beamType == "p-A")
940  return kpA;
941  else
942  return kNA;
943  } else {
944  Int_t runNumber = InputEvent()->GetRunNumber();
945  if ((runNumber >= 136851 && runNumber <= 139517) || // LHC10h
946  (runNumber >= 166529 && runNumber <= 170593)) { // LHC11h
947  return kAA;
948  } else if ((runNumber>=188365 && runNumber <= 188366) || // LHC12g
949  (runNumber >= 195344 && runNumber <= 196608)) { // LHC13b-f
950  return kpA;
951  } else {
952  return kpp;
953  }
954  }
955 }
956 
964 {
965  if (!fTriggerPatchInfo)
966  return 0;
967 
968  //number of patches in event
969  Int_t nPatch = fTriggerPatchInfo->GetEntries();
970 
971  //loop over patches to define trigger type of event
972  Int_t nG1 = 0;
973  Int_t nG2 = 0;
974  Int_t nJ1 = 0;
975  Int_t nJ2 = 0;
976  Int_t nL0 = 0;
977  AliEMCALTriggerPatchInfo *patch;
978  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
979  patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
980  if (patch->IsGammaHigh()) nG1++;
981  if (patch->IsGammaLow()) nG2++;
982  if (patch->IsJetHigh()) nJ1++;
983  if (patch->IsJetLow()) nJ2++;
984  if (patch->IsLevel0()) nL0++;
985  }
986 
987  AliDebug(2, "Patch summary: ");
988  AliDebug(2, Form("Number of patches: %d", nPatch));
989  AliDebug(2, Form("Jet: low[%d], high[%d]" ,nJ2, nJ1));
990  AliDebug(2, Form("Gamma: low[%d], high[%d]" ,nG2, nG1));
991 
992  ULong_t triggers(0);
993  if (nL0>0) SETBIT(triggers, kL0);
994  if (nG1>0) SETBIT(triggers, kG1);
995  if (nG2>0) SETBIT(triggers, kG2);
996  if (nJ1>0) SETBIT(triggers, kJ1);
997  if (nJ2>0) SETBIT(triggers, kJ2);
998  return triggers;
999 }
1000 
1008 {
1009  //
1010  if(trigger==kND) {
1011  AliWarning(Form("%s: Requesting undefined trigger type!", GetName()));
1012  return kFALSE;
1013  }
1014  //MV: removing this logic which as far as I can see doesn't make any sense
1015  // if(trigger & kND){
1016  // return fTriggers == 0;
1017  // }
1018  return TESTBIT(fTriggers, trigger);
1019 }
1020 
1043 {
1044  if (fOffTrigger != AliVEvent::kAny) {
1045  UInt_t res = 0;
1046  const AliESDEvent *eev = dynamic_cast<const AliESDEvent*>(InputEvent());
1047  if (eev) {
1048  res = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1049  } else {
1050  const AliAODEvent *aev = dynamic_cast<const AliAODEvent*>(InputEvent());
1051  if (aev) {
1052  res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
1053  }
1054  }
1055  if ((res & fOffTrigger) == 0) {
1056  if (fGeneralHistograms) fHistEventRejection->Fill("PhysSel",1);
1057  return kFALSE;
1058  }
1059  }
1060 
1061  if (!fTrigClass.IsNull()) {
1062  TString fired;
1063  const AliESDEvent *eev = dynamic_cast<const AliESDEvent*>(InputEvent());
1064  if (eev) {
1065  fired = eev->GetFiredTriggerClasses();
1066  } else {
1067  const AliAODEvent *aev = dynamic_cast<const AliAODEvent*>(InputEvent());
1068  if (aev) {
1069  fired = aev->GetFiredTriggerClasses();
1070  }
1071  }
1072  if (!fired.Contains("-B-")) {
1073  if (fGeneralHistograms) fHistEventRejection->Fill("trigger",1);
1074  return kFALSE;
1075  }
1076 
1077  std::unique_ptr<TObjArray> arr(fTrigClass.Tokenize("|"));
1078  if (!arr) {
1079  if (fGeneralHistograms) fHistEventRejection->Fill("trigger",1);
1080  return kFALSE;
1081  }
1082  Bool_t match = 0;
1083  for (Int_t i=0;i<arr->GetEntriesFast();++i) {
1084  TObject *obj = arr->At(i);
1085  if (!obj)
1086  continue;
1087 
1088  //Check if requested trigger was fired
1089  TString objStr = obj->GetName();
1091  (objStr.Contains("J1") || objStr.Contains("J2") || objStr.Contains("G1") || objStr.Contains("G2"))) {
1092  // This is relevant for EMCal triggers with 2 thresholds
1093  // If the kOverlapWithLowThreshold was requested than the overlap between the two triggers goes with the lower threshold trigger
1094  TString trigType1 = "J1";
1095  TString trigType2 = "J2";
1096  if(objStr.Contains("G")) {
1097  trigType1 = "G1";
1098  trigType2 = "G2";
1099  }
1100  if(objStr.Contains(trigType2) && fired.Contains(trigType2.Data())) { //requesting low threshold + overlap
1101  match = 1;
1102  break;
1103  }
1104  else if(objStr.Contains(trigType1) && fired.Contains(trigType1.Data()) && !fired.Contains(trigType2.Data())) { //high threshold only
1105  match = 1;
1106  break;
1107  }
1108  }
1109  else {
1110  // If this is not an EMCal trigger, or no particular treatment of EMCal triggers was requested,
1111  // simply check that the trigger was fired
1112  if (fired.Contains(obj->GetName())) {
1113  match = 1;
1114  break;
1115  }
1116  }
1117  }
1118  if (!match) {
1119  if (fGeneralHistograms) fHistEventRejection->Fill("trigger",1);
1120  return kFALSE;
1121  }
1122  }
1123 
1124  if (fTriggerTypeSel != kND) {
1126  if (fGeneralHistograms) fHistEventRejection->Fill("trigTypeSel",1);
1127  return kFALSE;
1128  }
1129  }
1130 
1131  if ((fMinCent != -999) && (fMaxCent != -999)) {
1132  if (fCent<fMinCent || fCent>fMaxCent) {
1133  if (fGeneralHistograms) fHistEventRejection->Fill("Cent",1);
1134  return kFALSE;
1135  }
1136  }
1137 
1138  if (fUseAliAnaUtils) {
1139  if (!fAliAnalysisUtils)
1140  fAliAnalysisUtils = new AliAnalysisUtils();
1141  fAliAnalysisUtils->SetMinVtxContr(2);
1142  fAliAnalysisUtils->SetMaxVtxZ(999);
1143  if(fMinVz<-998.) fMinVz = -10.;
1144  if(fMaxVz>998.) fMaxVz = 10.;
1145 
1146  if (!fAliAnalysisUtils->IsVertexSelected2013pA(InputEvent())) {
1147  if (fGeneralHistograms) fHistEventRejection->Fill("VtxSel2013pA",1);
1148  return kFALSE;
1149  }
1150 
1151  if (fRejectPileup && fAliAnalysisUtils->IsPileUpEvent(InputEvent())) {
1152  if (fGeneralHistograms) fHistEventRejection->Fill("PileUp",1);
1153  return kFALSE;
1154  }
1155 
1156  if(fTklVsClusSPDCut && fAliAnalysisUtils->IsSPDClusterVsTrackletBG(InputEvent())) {
1157  if (fGeneralHistograms) fHistEventRejection->Fill("Bkg evt",1);
1158  return kFALSE;
1159  }
1160  }
1161 
1162  if ((fMinVz > -998.) && (fMaxVz < 998.)) {
1163  if (fNVertCont == 0 ) {
1164  if (fGeneralHistograms) fHistEventRejection->Fill("vertex contr.",1);
1165  return kFALSE;
1166  }
1167  Double_t vz = fVertex[2];
1168  if (vz < fMinVz || vz > fMaxVz) {
1169  if (fGeneralHistograms) fHistEventRejection->Fill("Vz",1);
1170  return kFALSE;
1171  }
1172 
1173  if (fNVertSPDCont > 0 && fZvertexDiff < 999) {
1174  Double_t vzSPD = fVertexSPD[2];
1175  Double_t dvertex = TMath::Abs(vz-vzSPD);
1176  //if difference larger than fZvertexDiff
1177  if (dvertex > fZvertexDiff) {
1178  if (fGeneralHistograms) fHistEventRejection->Fill("VzSPD",1);
1179  return kFALSE;
1180  }
1181  }
1182  }
1183 
1184  if (fMinPtTrackInEmcal > 0 && fGeom) {
1185  Bool_t trackInEmcalOk = kFALSE;
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 
1192  Double_t phiMin = fGeom->GetArm1PhiMin() * TMath::DegToRad();
1193  Double_t phiMax = fGeom->GetArm1PhiMax() * TMath::DegToRad();
1194  Int_t runNumber = InputEvent()->GetRunNumber();
1195  if (runNumber>=177295 && runNumber<=197470) { //small SM masked in 2012 and 2013
1196  phiMin = 1.4;
1197  phiMax = TMath::Pi();
1198  }
1199 
1200  if (track->Eta() < fGeom->GetArm1EtaMin() || track->Eta() > fGeom->GetArm1EtaMax() || track->Phi() < phiMin || track->Phi() > phiMax)
1201  continue;
1202  if (track->Pt() > fMinPtTrackInEmcal) {
1203  trackInEmcalOk = kTRUE;
1204  break;
1205  }
1206  }
1207  if (!trackInEmcalOk) {
1208  if (fGeneralHistograms) fHistEventRejection->Fill("trackInEmcal",1);
1209  return kFALSE;
1210  }
1211  }
1212 
1213  if (fMinNTrack > 0) {
1214  Int_t nTracksAcc = 0;
1215  Int_t ntracks = GetNParticles(0);
1216  for (Int_t i = 0; i < ntracks; i++) {
1217  AliVParticle *track = GetAcceptParticleFromArray(i,0);
1218  if (!track)
1219  continue;
1220  if (track->Pt() > fTrackPtCut) {
1221  nTracksAcc++;
1222  if (nTracksAcc>=fMinNTrack)
1223  break;
1224  }
1225  }
1226  if (nTracksAcc<fMinNTrack) {
1227  if (fGeneralHistograms) fHistEventRejection->Fill("minNTrack",1);
1228  return kFALSE;
1229  }
1230  }
1231 
1232  if (!(fEPV0 > fMinEventPlane && fEPV0 <= fMaxEventPlane) &&
1233  !(fEPV0 + TMath::Pi() > fMinEventPlane && fEPV0 + TMath::Pi() <= fMaxEventPlane) &&
1234  !(fEPV0 - TMath::Pi() > fMinEventPlane && fEPV0 - TMath::Pi() <= fMaxEventPlane))
1235  {
1236  if (fGeneralHistograms) fHistEventRejection->Fill("EvtPlane",1);
1237  return kFALSE;
1238  }
1239 
1240  if (fSelectPtHardBin != -999 && fSelectPtHardBin != fPtHardBin) {
1241  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
1242  return kFALSE;
1243  }
1244 
1245  // Reject filter for MC data
1246  if (!CheckMCOutliers()) return kFALSE;
1247 
1248  return kTRUE;
1249 }
1250 
1257 {
1258  if (!fPythiaHeader || !fMCRejectFilter) return kTRUE;
1259 
1260  // Condition 1: Pythia jet / pT-hard > factor
1261  if (fPtHardAndJetPtFactor > 0.) {
1262  AliTLorentzVector jet;
1263 
1264  Int_t nTriggerJets = fPythiaHeader->NTriggerJets();
1265 
1266  AliDebug(1,Form("Njets: %d, pT Hard %f",nTriggerJets, fPtHard));
1267 
1268  Float_t tmpjet[]={0,0,0,0};
1269  for (Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1270  fPythiaHeader->TriggerJet(ijet, tmpjet);
1271 
1272  jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1273 
1274  AliDebug(1,Form("jet %d; pycell jet pT %f",ijet, jet.Pt()));
1275 
1276  //Compare jet pT and pt Hard
1277  if (jet.Pt() > fPtHardAndJetPtFactor * fPtHard) {
1278  AliInfo(Form("Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", fPtHard, jet.Pt(), fPtHardAndJetPtFactor));
1279  return kFALSE;
1280  }
1281  }
1282  }
1283  // end condition 1
1284 
1285  // Condition 2 : Reconstructed EMCal cluster pT / pT-hard > factor
1286  if (fPtHardAndClusterPtFactor > 0.) {
1287  AliClusterContainer* mccluscont = GetClusterContainer(0);
1288  if ((Bool_t)mccluscont) {
1289  for (auto cluster : mccluscont->all()) {// Not cuts applied ; use accept for cuts
1290  Float_t ecluster = cluster->E();
1291 
1292  if (ecluster > (fPtHardAndClusterPtFactor * fPtHard)) {
1293  AliInfo(Form("Reject : ecluster %2.2f, calo %d, factor %2.2f, ptHard %f",ecluster,cluster->GetType(),fPtHardAndClusterPtFactor,fPtHard));
1294  return kFALSE;
1295  }
1296  }
1297  }
1298  }
1299  // end condition 2
1300 
1301  // condition 3 : Reconstructed track pT / pT-hard >factor
1302  if (fPtHardAndTrackPtFactor > 0.) {
1303  AliMCParticleContainer* mcpartcont = dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(0));
1304  if ((Bool_t)mcpartcont) {
1305  for (auto mctrack : mcpartcont->all()) {// Not cuts applied ; use accept for cuts
1306  Float_t trackpt = mctrack->Pt();
1307  if (trackpt > (fPtHardAndTrackPtFactor * fPtHard) ) {
1308  AliInfo(Form("Reject : track %2.2f, factor %2.2f, ptHard %f", trackpt, fPtHardAndTrackPtFactor, fPtHard));
1309  return kFALSE;
1310  }
1311  }
1312  }
1313  }
1314  // end condition 3
1315 
1316  return kTRUE;
1317 }
1318 
1327 TClonesArray *AliAnalysisTaskEmcal::GetArrayFromEvent(const char *name, const char *clname)
1328 {
1329  TClonesArray *arr = 0;
1330  TString sname(name);
1331  if (!sname.IsNull()) {
1332  arr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(sname));
1333  if (!arr) {
1334  AliWarning(Form("%s: Could not retrieve array with name %s!", GetName(), name));
1335  return 0;
1336  }
1337  } else {
1338  return 0;
1339  }
1340 
1341  if (!clname)
1342  return arr;
1343 
1344  TString objname(arr->GetClass()->GetName());
1345  TClass cls(objname);
1346  if (!cls.InheritsFrom(clname)) {
1347  AliWarning(Form("%s: Objects of type %s in %s are not inherited from %s!",
1348  GetName(), cls.GetName(), name, clname));
1349  return 0;
1350  }
1351  return arr;
1352 }
1353 
1359 {
1360  fVertex[0] = 0;
1361  fVertex[1] = 0;
1362  fVertex[2] = 0;
1363  fNVertCont = 0;
1364 
1365  fVertexSPD[0] = 0;
1366  fVertexSPD[1] = 0;
1367  fVertexSPD[2] = 0;
1368  fNVertSPDCont = 0;
1369 
1370  if (fGeneratePythiaInfoObject && MCEvent()) {
1371  GeneratePythiaInfoObject(MCEvent());
1372  }
1373 
1374  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1375  if (vert) {
1376  vert->GetXYZ(fVertex);
1377  fNVertCont = vert->GetNContributors();
1378  }
1379 
1380  const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
1381  if (vertSPD) {
1382  vertSPD->GetXYZ(fVertexSPD);
1383  fNVertSPDCont = vertSPD->GetNContributors();
1384  }
1385 
1386  fBeamType = GetBeamType();
1387 
1388  if (fBeamType == kAA || fBeamType == kpA ) {
1390  AliMultSelection *MultSelection = static_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
1391  if (MultSelection) {
1392  fCent = MultSelection->GetMultiplicityPercentile(fCentEst.Data());
1393  }
1394  else {
1395  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1396  }
1397  }
1398  else { // old centrality estimation < 2015
1399  AliCentrality *aliCent = InputEvent()->GetCentrality();
1400  if (aliCent) {
1401  fCent = aliCent->GetCentralityPercentile(fCentEst.Data());
1402  }
1403  else {
1404  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1405  }
1406  }
1407 
1408  if (fNcentBins==4) {
1409  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1410  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1411  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1412  else if (fCent >= 50 && fCent <= 100) fCentBin = 3;
1413  else {
1414  AliWarning(Form("%s: Negative centrality: %f. Assuming 99", GetName(), fCent));
1415  fCentBin = fNcentBins-1;
1416  }
1417  }
1418  else if (fNcentBins==5) { // for PbPb 2015
1419  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1420  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1421  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1422  else if (fCent >= 50 && fCent <= 90) fCentBin = 3;
1423  else if (fCent > 90) {
1424  fCent = 99;
1425  fCentBin = 4;
1426  }
1427  else {
1428  AliWarning(Form("%s: Negative centrality: %f. Assuming 99", GetName(), fCent));
1429  fCentBin = fNcentBins-1;
1430  }
1431  }
1432  else {
1433  Double_t centWidth = (fMaxCent-fMinCent)/(Double_t)fNcentBins;
1434  if(centWidth>0.) {
1435  fCentBin = TMath::FloorNint(fCent/centWidth);
1436  }
1437  else {
1438  fCentBin = 0;
1439  }
1440  if (fCentBin>=fNcentBins) {
1441  AliWarning(Form("%s: fCentBin too large: cent = %f fCentBin = %d. Assuming 99", GetName(),fCent,fCentBin));
1442  fCentBin = fNcentBins-1;
1443  }
1444  }
1445 
1446  AliEventplane *aliEP = InputEvent()->GetEventplane();
1447  if (aliEP) {
1448  fEPV0 = aliEP->GetEventplane("V0" ,InputEvent());
1449  fEPV0A = aliEP->GetEventplane("V0A",InputEvent());
1450  fEPV0C = aliEP->GetEventplane("V0C",InputEvent());
1451  } else {
1452  AliWarning(Form("%s: Could not retrieve event plane information!", GetName()));
1453  }
1454  }
1455  else {
1456  fCent = 99;
1457  fCentBin = 0;
1458  }
1459 
1460  if (fIsPythia) {
1461  if (MCEvent()) {
1462  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
1463  if (!fPythiaHeader) {
1464  // Check if AOD
1465  AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1466 
1467  if (aodMCH) {
1468  for (UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1469  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
1470  if (fPythiaHeader) break;
1471  }
1472  }
1473  }
1474  }
1475  }
1476 
1477  if (fPythiaHeader) {
1478  fPtHard = fPythiaHeader->GetPtHard();
1479 
1480  const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
1481  const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
1482  for (fPtHardBin = 0; fPtHardBin < 11; fPtHardBin++) {
1483  if (fPtHard >= ptHardLo[fPtHardBin] && fPtHard < ptHardHi[fPtHardBin])
1484  break;
1485  }
1486 
1487  fXsection = fPythiaHeader->GetXsection();
1488  fNTrials = fPythiaHeader->Trials();
1489  }
1490 
1492 
1493  AliEmcalContainer* cont = 0;
1494 
1495  TIter nextPartColl(&fParticleCollArray);
1496  while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))) cont->NextEvent();
1497 
1498  TIter nextClusColl(&fClusterCollArray);
1499  while ((cont = static_cast<AliParticleContainer*>(nextClusColl()))) cont->NextEvent();
1500 
1501  return kTRUE;
1502 }
1503 
1512 {
1513  if (TString(n).IsNull()) return 0;
1514 
1516 
1517  fParticleCollArray.Add(cont);
1518 
1519  return cont;
1520 }
1521 
1530 {
1531  if (TString(n).IsNull()) return 0;
1532 
1533  AliTrackContainer* cont = new AliTrackContainer(n);
1534 
1535  fParticleCollArray.Add(cont);
1536 
1537  return cont;
1538 }
1539 
1548 {
1549  if (TString(n).IsNull()) return 0;
1550 
1552 
1553  fParticleCollArray.Add(cont);
1554 
1555  return cont;
1556 }
1557 
1566 {
1567  if (TString(n).IsNull()) return 0;
1568 
1570 
1571  fClusterCollArray.Add(cont);
1572 
1573  return cont;
1574 }
1575 
1582 {
1583  if (i<0 || i>fParticleCollArray.GetEntriesFast()) return 0;
1584  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
1585  return cont;
1586 }
1587 
1594 {
1595  if (i<0 || i>fClusterCollArray.GetEntriesFast()) return 0;
1596  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
1597  return cont;
1598 }
1599 
1606 {
1607  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.FindObject(name));
1608  return cont;
1609 }
1610 
1617 {
1618  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.FindObject(name));
1619  return cont;
1620 }
1621 
1628 {
1630  if (!cont) {
1631  AliError(Form("%s: Particle container %d not found",GetName(),i));
1632  return 0;
1633  }
1634  TString contName = cont->GetArrayName();
1635  return cont->GetArray();
1636 }
1637 
1644 {
1646  if (!cont) {
1647  AliError(Form("%s:Cluster container %d not found",GetName(),i));
1648  return 0;
1649  }
1650  return cont->GetArray();
1651 }
1652 
1661 {
1662 
1664  if (!cont) {
1665  AliError(Form("%s: Particle container %d not found",GetName(),c));
1666  return 0;
1667  }
1668  AliVParticle *vp = cont->GetAcceptParticle(p);
1669 
1670  return vp;
1671 }
1672 
1681 {
1683  if (!cont) {
1684  AliError(Form("%s: Cluster container %d not found",GetName(),c));
1685  return 0;
1686  }
1687  AliVCluster *vc = cont->GetAcceptCluster(cl);
1688 
1689  return vc;
1690 }
1691 
1698 {
1700  if (!cont) {
1701  AliError(Form("%s: Particle container %d not found",GetName(),i));
1702  return 0;
1703  }
1704  return cont->GetNEntries();
1705 }
1706 
1714 {
1716  if (!cont) {
1717  AliError(Form("%s: Cluster container %d not found",GetName(),i));
1718  return 0;
1719  }
1720  return cont->GetNEntries();
1721 }
1722 
1734 AliEMCALTriggerPatchInfo* AliAnalysisTaskEmcal::GetMainTriggerPatch(TriggerCategory trigger, Bool_t doSimpleOffline)
1735 {
1736 
1737  if (!fTriggerPatchInfo) {
1738  AliError(Form("%s: fTriggerPatchInfo not available",GetName()));
1739  return 0;
1740  }
1741 
1742  //number of patches in event
1743  Int_t nPatch = fTriggerPatchInfo->GetEntries();
1744 
1745  //extract main trigger patch(es)
1746  AliEMCALTriggerPatchInfo *patch(NULL), *selected(NULL);
1747  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1748 
1749  patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
1750  if (patch->IsMainTrigger()) {
1751  if(doSimpleOffline){
1752  if(patch->IsOfflineSimple()){
1753  switch(trigger){
1754  case kTriggerLevel0:
1755  // option not yet implemented in the trigger maker
1756  if(patch->IsLevel0()) selected = patch;
1757  break;
1758  case kTriggerLevel1Jet:
1759  if(patch->IsJetHighSimple() || patch->IsJetLowSimple()){
1760  if(!selected) selected = patch;
1761  else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1762  }
1763  break;
1764  case kTriggerLevel1Gamma:
1765  if(patch->IsGammaHighSimple() || patch->IsGammaLowSimple()){
1766  if(!selected) selected = patch;
1767  else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1768  }
1769  break;
1770  default: // Silence compiler warnings
1771  AliError("Untreated case: Main Patch is recalculated; should be in 'else' branch");
1772  };
1773  }
1774  } else { // Not OfflineSimple
1775  switch(trigger){
1776  case kTriggerLevel0:
1777  if(patch->IsLevel0()) selected = patch;
1778  break;
1779  case kTriggerLevel1Jet:
1780  if(patch->IsJetHigh() || patch->IsJetLow()){
1781  if(!selected) selected = patch;
1782  else if (patch->GetADCAmp() > selected->GetADCAmp())
1783  selected = patch;
1784  }
1785  break;
1786  case kTriggerLevel1Gamma:
1787  if(patch->IsGammaHigh() || patch->IsGammaLow()){
1788  if(!selected) selected = patch;
1789  else if (patch->GetADCAmp() > selected->GetADCAmp())
1790  selected = patch;
1791  }
1792  break;
1793  default:
1794  AliError("Untreated case: Main Patch is recalculated; should be in 'else' branch");
1795  };
1796  }
1797  }
1798  else if ((trigger == kTriggerRecalcJet && patch->IsRecalcJet()) ||
1799  (trigger == kTriggerRecalcGamma && patch->IsRecalcGamma())) { // recalculated patches
1800  if (doSimpleOffline && patch->IsOfflineSimple()) {
1801  if(!selected) selected = patch;
1802  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
1803  selected = patch;
1804  }
1805  else if (!doSimpleOffline && !patch->IsOfflineSimple()) {
1806  if(!selected) selected = patch;
1807  else if (patch->GetADCAmp() > selected->GetADCAmp())
1808  selected = patch;
1809  }
1810  }
1811  }
1812  return selected;
1813 }
1814 
1821 {
1822  if (!(InputEvent()->FindListObject(obj->GetName()))) {
1823  InputEvent()->AddObject(obj);
1824  }
1825  else {
1826  if (!attempt) {
1827  AliFatal(Form("%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1828  }
1829  }
1830 }
1831 
1840 {
1841 
1842  if (!fGeom) {
1843  AliWarning(Form("%s - AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1844  return kFALSE;
1845  }
1846 
1847  Double_t minPhi = fGeom->GetArm1PhiMin() - edges;
1848  Double_t maxPhi = fGeom->GetArm1PhiMax() + edges;
1849 
1850  if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1851  return kTRUE;
1852  }
1853  else {
1854  return kFALSE;
1855  }
1856 }
1857 
1859 {
1860  axis->SetBinLabel(1, "NullObject");
1861  axis->SetBinLabel(2, "Pt");
1862  axis->SetBinLabel(3, "Acceptance");
1863  axis->SetBinLabel(4, "MCLabel");
1864  axis->SetBinLabel(5, "BitMap");
1865  axis->SetBinLabel(6, "HF cut");
1866  axis->SetBinLabel(7, "Bit6");
1867  axis->SetBinLabel(8, "NotHybridTrack");
1868  axis->SetBinLabel(9, "MCFlag");
1869  axis->SetBinLabel(10, "MCGenerator");
1870  axis->SetBinLabel(11, "ChargeCut");
1871  axis->SetBinLabel(12, "MinDistanceTPCSectorEdge");
1872  axis->SetBinLabel(13, "Bit12");
1873  axis->SetBinLabel(14, "IsEMCal");
1874  axis->SetBinLabel(15, "Time");
1875  axis->SetBinLabel(16, "Energy");
1876  axis->SetBinLabel(17, "ExoticCut");
1877  axis->SetBinLabel(18, "Bit17");
1878  axis->SetBinLabel(19, "Area");
1879  axis->SetBinLabel(20, "AreaEmc");
1880  axis->SetBinLabel(21, "ZLeadingCh");
1881  axis->SetBinLabel(22, "ZLeadingEmc");
1882  axis->SetBinLabel(23, "NEF");
1883  axis->SetBinLabel(24, "MinLeadPt");
1884  axis->SetBinLabel(25, "MaxTrackPt");
1885  axis->SetBinLabel(26, "MaxClusterPt");
1886  axis->SetBinLabel(27, "Flavour");
1887  axis->SetBinLabel(28, "TagStatus");
1888  axis->SetBinLabel(29, "MinNConstituents");
1889  axis->SetBinLabel(30, "Bit29");
1890  axis->SetBinLabel(31, "Bit30");
1891  axis->SetBinLabel(32, "Bit31");
1892 }
1893 
1900 Double_t AliAnalysisTaskEmcal::GetParallelFraction(AliVParticle* part1, AliVParticle* part2)
1901 {
1902  TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1903  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1904  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1905  return z;
1906 }
1907 
1914 Double_t AliAnalysisTaskEmcal::GetParallelFraction(const TVector3& vect1, AliVParticle* part2)
1915 {
1916  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1917  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1918  return z;
1919 }
1920 
1929 void AliAnalysisTaskEmcal::GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
1930 {
1931  phidiff = 999;
1932  etadiff = 999;
1933 
1934  if (!t||!v) return;
1935 
1936  Double_t veta = t->GetTrackEtaOnEMCal();
1937  Double_t vphi = t->GetTrackPhiOnEMCal();
1938 
1939  Float_t pos[3] = {0};
1940  v->GetPosition(pos);
1941  TVector3 cpos(pos);
1942  Double_t ceta = cpos.Eta();
1943  Double_t cphi = cpos.Phi();
1944  etadiff=veta-ceta;
1945  phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1946 }
1947 
1953 Byte_t AliAnalysisTaskEmcal::GetTrackType(const AliVTrack *t)
1954 {
1955  Byte_t ret = 0;
1956  if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1957  ret = 1;
1958  else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1959  ret = 2;
1960  else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1961  ret = 3;
1962  return ret;
1963 }
1964 
1974 Byte_t AliAnalysisTaskEmcal::GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2)
1975 {
1976 
1977  Int_t res = 0;
1978 
1979  if (aodTrack->TestFilterBit(filterBit1)) {
1980  res = 0;
1981  }
1982  else if (aodTrack->TestFilterBit(filterBit2)) {
1983  if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1984  res = 1;
1985  }
1986  else {
1987  res = 2;
1988  }
1989  }
1990  else {
1991  res = 3;
1992  }
1993 
1994  return res;
1995 }
1996 
2002 {
2003  if (!fPythiaInfo) {
2005  }
2006 
2007  AliStack* stack = mcEvent->Stack();
2008 
2009  const Int_t nprim = stack->GetNprimary();
2010  // reject if partons are missing from stack for some reason
2011  if (nprim < 8) return;
2012 
2013  TParticle *part6 = stack->Particle(6);
2014  TParticle *part7 = stack->Particle(7);
2015 
2016  fPythiaInfo->SetPartonFlag6(TMath::Abs(part6->GetPdgCode()));
2017  fPythiaInfo->SetParton6(part6->Pt(), part6->Eta(), part6->Phi(), part6->GetMass());
2018 
2019  fPythiaInfo->SetPartonFlag7(TMath::Abs(part7->GetPdgCode()));
2020  fPythiaInfo->SetParton7(part7->Pt(), part7->Eta(), part7->Phi(), part7->GetMass());
2021 
2022  AliGenPythiaEventHeader *pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(mcEvent->GenEventHeader());
2023  if(pythiaGenHeader){
2024  Float_t ptWeight=pythiaGenHeader->EventWeight();
2025  fPythiaInfo->SetPythiaEventWeight(ptWeight);}
2026 }
2027 
2033 {
2034  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
2035  if (!mgr) {
2036  ::Error("AddESDHandler", "No analysis manager to connect to.");
2037  return NULL;
2038  }
2039 
2040  AliESDInputHandler *esdHandler = new AliESDInputHandler();
2041 
2042  AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2043  if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2044  AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2045  multiInputHandler->AddInputEventHandler(esdHandler);
2046  }
2047  else {
2048  if (!inputHandler) {
2049  mgr->SetInputEventHandler(esdHandler);
2050  }
2051  else {
2052  ::Error("AddESDHandler", "inputHandler is NOT null. ESD handler was NOT added !!!");
2053  return NULL;
2054  }
2055  }
2056 
2057  return esdHandler;
2058 }
2059 
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
static AliEmcalDownscaleFactorsOCDB * Instance()
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 fLocalInitialized
whether or not the task has been already initialized
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
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
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
Bool_t fCountDownscaleCorrectedEvents
Count event number corrected for downscaling.
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
TH1 * fHistTriggerClassesCorr
!corrected number of events in each trigger class
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:31
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
std::vector< TString > GetTriggerClasses() const
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:25
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
virtual void RunChanged(Int_t)
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)
Handler for downscale factors for various triggers obtained from the OCDB.
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
static AliESDInputHandler * AddESDHandler()
Double_t fMaxEventPlane
maximum event plane value
void SetPythiaEventWeight(Float_t ptWeight)
Float_t fXsection
!x-section from pythia header
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.
TString fMinBiasRefTrigger
Name of the minmum bias reference trigger, used in the calculation of downscale-corrected event numbe...
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