AliPhysics  07fddbf (07fddbf)
 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 "AliAODInputHandler.h"
41 #include "AliESDInputHandler.h"
42 #include "AliEventplane.h"
43 #include "AliGenPythiaEventHeader.h"
44 #include "AliInputEventHandler.h"
45 #include "AliLog.h"
46 #include "AliMCEvent.h"
47 #include "AliMCParticle.h"
48 #include "AliMultiInputEventHandler.h"
49 #include "AliMultSelection.h"
50 #include "AliStack.h"
51 #include "AliVCaloTrigger.h"
52 #include "AliVCluster.h"
53 #include "AliVEventHandler.h"
54 #include "AliVParticle.h"
55 
57 
61 
66  AliAnalysisTaskSE("AliAnalysisTaskEmcal"),
67  fPythiaInfoName(""),
68  fForceBeamType(kNA),
69  fGeneralHistograms(kFALSE),
70  fLocalInitialized(kFALSE),
71  fCreateHisto(kTRUE),
72  fCaloCellsName(),
73  fCaloTriggersName(),
74  fCaloTriggerPatchInfoName(),
75  fMinCent(-999),
76  fMaxCent(-999),
77  fMinVz(-999),
78  fMaxVz(999),
79  fTrackPtCut(0),
80  fMinNTrack(0),
81  fZvertexDiff(0.5),
82  fUseAliAnaUtils(kFALSE),
83  fRejectPileup(kFALSE),
84  fTklVsClusSPDCut(kFALSE),
85  fOffTrigger(AliVEvent::kAny),
86  fTrigClass(),
87  fMinBiasRefTrigger("CINT7-B-NOPF-ALLNOTRD"),
88  fTriggerTypeSel(kND),
89  fNbins(250),
90  fMinBinPt(0),
91  fMaxBinPt(250),
92  fMinPtTrackInEmcal(0),
93  fEventPlaneVsEmcal(-1),
94  fMinEventPlane(-1e6),
95  fMaxEventPlane(1e6),
96  fCentEst("V0M"),
97  fIsEmbedded(kFALSE),
98  fIsPythia(kFALSE),
99  fSelectPtHardBin(-999),
100  fMinMCLabel(0),
101  fMCLabelShift(0),
102  fNcentBins(4),
103  fNeedEmcalGeom(kTRUE),
104  fParticleCollArray(),
105  fClusterCollArray(),
106  fTriggers(0),
107  fEMCalTriggerMode(kOverlapWithLowThreshold),
108  fUseNewCentralityEstimation(kFALSE),
109  fGeneratePythiaInfoObject(kFALSE),
110  fUsePtHardBinScaling(kFALSE),
111  fMCRejectFilter(kFALSE),
112  fCountDownscaleCorrectedEvents(kFALSE),
113  fPtHardAndJetPtFactor(0.),
114  fPtHardAndClusterPtFactor(0.),
115  fPtHardAndTrackPtFactor(0.),
116  fRunNumber(-1),
117  fAliAnalysisUtils(nullptr),
118  fIsEsd(kFALSE),
119  fGeom(nullptr),
120  fTracks(nullptr),
121  fCaloClusters(nullptr),
122  fCaloCells(nullptr),
123  fCaloTriggers(nullptr),
124  fTriggerPatchInfo(nullptr),
125  fCent(0),
126  fCentBin(-1),
127  fEPV0(-1.0),
128  fEPV0A(-1.0),
129  fEPV0C(-1.0),
130  fNVertCont(0),
131  fNVertSPDCont(0),
132  fBeamType(kNA),
133  fPythiaHeader(nullptr),
134  fPtHard(0),
135  fPtHardBin(0),
136  fNTrials(0),
137  fXsection(0),
138  fPythiaInfo(nullptr),
139  fOutput(nullptr),
140  fHistEventCount(nullptr),
141  fHistTrialsAfterSel(nullptr),
142  fHistEventsAfterSel(nullptr),
143  fHistXsectionAfterSel(nullptr),
144  fHistTrials(nullptr),
145  fHistEvents(nullptr),
146  fHistXsection(nullptr),
147  fHistPtHard(nullptr),
148  fHistCentrality(nullptr),
149  fHistZVertex(nullptr),
150  fHistEventPlane(nullptr),
151  fHistEventRejection(nullptr),
152  fHistTriggerClasses(nullptr),
153  fHistTriggerClassesCorr(nullptr)
154 {
155  fVertex[0] = 0;
156  fVertex[1] = 0;
157  fVertex[2] = 0;
158  fVertexSPD[0] = 0;
159  fVertexSPD[1] = 0;
160  fVertexSPD[2] = 0;
161 
162  fParticleCollArray.SetOwner(kTRUE);
163  fClusterCollArray.SetOwner(kTRUE);
164 }
165 
177  AliAnalysisTaskSE(name),
178  fPythiaInfoName(""),
179  fForceBeamType(kNA),
180  fGeneralHistograms(kFALSE),
181  fLocalInitialized(kFALSE),
182  fCreateHisto(histo),
183  fCaloCellsName(),
184  fCaloTriggersName(),
185  fCaloTriggerPatchInfoName(),
186  fMinCent(-999),
187  fMaxCent(-999),
188  fMinVz(-999),
189  fMaxVz(999),
190  fTrackPtCut(0),
191  fMinNTrack(0),
192  fZvertexDiff(0.5),
193  fUseAliAnaUtils(kFALSE),
194  fRejectPileup(kFALSE),
195  fTklVsClusSPDCut(kFALSE),
196  fOffTrigger(AliVEvent::kAny),
197  fTrigClass(),
198  fMinBiasRefTrigger("CINT7-B-NOPF-ALLNOTRD"),
199  fTriggerTypeSel(kND),
200  fNbins(250),
201  fMinBinPt(0),
202  fMaxBinPt(250),
203  fMinPtTrackInEmcal(0),
204  fEventPlaneVsEmcal(-1),
205  fMinEventPlane(-1e6),
206  fMaxEventPlane(1e6),
207  fCentEst("V0M"),
208  fIsEmbedded(kFALSE),
209  fIsPythia(kFALSE),
210  fSelectPtHardBin(-999),
211  fMinMCLabel(0),
212  fMCLabelShift(0),
213  fNcentBins(4),
214  fNeedEmcalGeom(kTRUE),
215  fParticleCollArray(),
216  fClusterCollArray(),
217  fTriggers(0),
218  fEMCalTriggerMode(kOverlapWithLowThreshold),
219  fUseNewCentralityEstimation(kFALSE),
220  fGeneratePythiaInfoObject(kFALSE),
221  fUsePtHardBinScaling(kFALSE),
222  fMCRejectFilter(kFALSE),
223  fCountDownscaleCorrectedEvents(kFALSE),
224  fPtHardAndJetPtFactor(0.),
225  fPtHardAndClusterPtFactor(0.),
226  fPtHardAndTrackPtFactor(0.),
227  fRunNumber(-1),
228  fAliAnalysisUtils(nullptr),
229  fIsEsd(kFALSE),
230  fGeom(nullptr),
231  fTracks(nullptr),
232  fCaloClusters(nullptr),
233  fCaloCells(nullptr),
234  fCaloTriggers(nullptr),
235  fTriggerPatchInfo(nullptr),
236  fCent(0),
237  fCentBin(-1),
238  fEPV0(-1.0),
239  fEPV0A(-1.0),
240  fEPV0C(-1.0),
241  fNVertCont(0),
242  fNVertSPDCont(0),
243  fBeamType(kNA),
244  fPythiaHeader(nullptr),
245  fPtHard(0),
246  fPtHardBin(0),
247  fNTrials(0),
248  fXsection(0),
249  fPythiaInfo(0),
250  fOutput(nullptr),
251  fHistEventCount(nullptr),
252  fHistTrialsAfterSel(nullptr),
253  fHistEventsAfterSel(nullptr),
254  fHistXsectionAfterSel(nullptr),
255  fHistTrials(nullptr),
256  fHistEvents(nullptr),
257  fHistXsection(nullptr),
258  fHistPtHard(nullptr),
259  fHistCentrality(nullptr),
260  fHistZVertex(nullptr),
261  fHistEventPlane(nullptr),
262  fHistEventRejection(nullptr),
263  fHistTriggerClasses(nullptr),
264  fHistTriggerClassesCorr(nullptr)
265 {
266  fVertex[0] = 0;
267  fVertex[1] = 0;
268  fVertex[2] = 0;
269  fVertexSPD[0] = 0;
270  fVertexSPD[1] = 0;
271  fVertexSPD[2] = 0;
272  fParticleCollArray.SetOwner(kTRUE);
273  fClusterCollArray.SetOwner(kTRUE);
274 
275  if (fCreateHisto) {
276  DefineOutput(1, AliEmcalList::Class());
277  }
278 }
279 
284 {
285 }
286 
294 {
296  if (cont) cont->SetClusPtCut(cut);
297  else AliError(Form("%s in SetClusPtCut(...): container %d not found",GetName(),c));
298 }
299 
308 {
310  if (cont) cont->SetClusTimeCut(min,max);
311  else AliError(Form("%s in SetClusTimeCut(...): container %d not found",GetName(),c));
312 }
313 
321 {
323  if (cont) cont->SetParticlePtCut(cut);
324  else AliError(Form("%s in SetTrackPtCut(...): container %d not found",GetName(),c));
325 
326  fTrackPtCut = cut;
327 }
328 
337 {
339  if (cont) cont->SetParticleEtaLimits(min,max);
340  else AliError(Form("%s in SetTrackPtCut(...): container %d not found",GetName(),c));
341 }
342 
351 {
353  if (cont) cont->SetParticlePhiLimits(min,max);
354  else AliError(Form("%s in SetTrackPhiLimits(...): container %d not found",GetName(),c));
355 }
356 
377 {
378  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
379  if (mgr) {
380  AliVEventHandler *evhand = mgr->GetInputEventHandler();
381  if (evhand) {
382  if (evhand->InheritsFrom("AliESDInputHandler")) {
383  fIsEsd = kTRUE;
384  }
385  else {
386  fIsEsd = kFALSE;
387  }
388  }
389  else {
390  AliError("Event handler not found!");
391  }
392  }
393  else {
394  AliError("Analysis manager not found!");
395  }
396 
397  if (!fCreateHisto)
398  return;
399 
400  OpenFile(1);
401  fOutput = new AliEmcalList();
403  fOutput->SetOwner();
404 
405  if (fForceBeamType == kpp)
406  fNcentBins = 1;
407 
408  if (!fGeneralHistograms)
409  return;
410 
411  if (fIsPythia) {
412  fHistTrialsAfterSel = new TH1F("fHistTrialsAfterSel", "fHistTrialsAfterSel", 11, 0, 11);
413  fHistTrialsAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
414  fHistTrialsAfterSel->GetYaxis()->SetTitle("trials");
416 
417  fHistEventsAfterSel = new TH1F("fHistEventsAfterSel", "fHistEventsAfterSel", 11, 0, 11);
418  fHistEventsAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
419  fHistEventsAfterSel->GetYaxis()->SetTitle("total events");
421 
422  fHistXsectionAfterSel = new TProfile("fHistXsectionAfterSel", "fHistXsectionAfterSel", 11, 0, 11);
423  fHistXsectionAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
424  fHistXsectionAfterSel->GetYaxis()->SetTitle("xsection");
426 
427  fHistTrials = new TH1F("fHistTrials", "fHistTrials", 11, 0, 11);
428  fHistTrials->GetXaxis()->SetTitle("p_{T} hard bin");
429  fHistTrials->GetYaxis()->SetTitle("trials");
430  fOutput->Add(fHistTrials);
431 
432  fHistEvents = new TH1F("fHistEvents", "fHistEvents", 11, 0, 11);
433  fHistEvents->GetXaxis()->SetTitle("p_{T} hard bin");
434  fHistEvents->GetYaxis()->SetTitle("total events");
435  fOutput->Add(fHistEvents);
436 
437  fHistXsection = new TProfile("fHistXsection", "fHistXsection", 11, 0, 11);
438  fHistXsection->GetXaxis()->SetTitle("p_{T} hard bin");
439  fHistXsection->GetYaxis()->SetTitle("xsection");
440  fOutput->Add(fHistXsection);
441 
442  const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
443  const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
444 
445  for (Int_t i = 1; i < 12; i++) {
446  fHistTrialsAfterSel->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
447  fHistEventsAfterSel->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
448 
449  fHistTrials->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
450  fHistXsection->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
451  fHistEvents->GetXaxis()->SetBinLabel(i, Form("%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
452  }
453 
454  fHistPtHard = new TH1F("fHistPtHard", "fHistPtHard", fNbins*2, fMinBinPt, fMaxBinPt*4);
455  fHistPtHard->GetXaxis()->SetTitle("p_{T,hard} (GeV/c)");
456  fHistPtHard->GetYaxis()->SetTitle("counts");
457  fOutput->Add(fHistPtHard);
458  }
459 
460  fHistZVertex = new TH1F("fHistZVertex","Z vertex position", 60, -30, 30);
461  fHistZVertex->GetXaxis()->SetTitle("z");
462  fHistZVertex->GetYaxis()->SetTitle("counts");
463  fOutput->Add(fHistZVertex);
464 
465  if (fForceBeamType != kpp) {
466  fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", 200, 0, 100);
467  fHistCentrality->GetXaxis()->SetTitle("Centrality (%)");
468  fHistCentrality->GetYaxis()->SetTitle("counts");
469  fOutput->Add(fHistCentrality);
470 
471  fHistEventPlane = new TH1F("fHistEventPlane","Event plane", 120, -TMath::Pi(), TMath::Pi());
472  fHistEventPlane->GetXaxis()->SetTitle("event plane");
473  fHistEventPlane->GetYaxis()->SetTitle("counts");
474  fOutput->Add(fHistEventPlane);
475  }
476 
477  fHistEventRejection = new TH1F("fHistEventRejection","Reasons to reject event",20,0,20);
478 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
479  fHistEventRejection->SetBit(TH1::kCanRebin);
480 #else
481  fHistEventRejection->SetCanExtend(TH1::kAllAxes);
482 #endif
483  fHistEventRejection->GetXaxis()->SetBinLabel(1,"PhysSel");
484  fHistEventRejection->GetXaxis()->SetBinLabel(2,"trigger");
485  fHistEventRejection->GetXaxis()->SetBinLabel(3,"trigTypeSel");
486  fHistEventRejection->GetXaxis()->SetBinLabel(4,"Cent");
487  fHistEventRejection->GetXaxis()->SetBinLabel(5,"vertex contr.");
488  fHistEventRejection->GetXaxis()->SetBinLabel(6,"Vz");
489  fHistEventRejection->GetXaxis()->SetBinLabel(7,"VzSPD");
490  fHistEventRejection->GetXaxis()->SetBinLabel(8,"trackInEmcal");
491  fHistEventRejection->GetXaxis()->SetBinLabel(9,"minNTrack");
492  fHistEventRejection->GetXaxis()->SetBinLabel(10,"VtxSel2013pA");
493  fHistEventRejection->GetXaxis()->SetBinLabel(11,"PileUp");
494  fHistEventRejection->GetXaxis()->SetBinLabel(12,"EvtPlane");
495  fHistEventRejection->GetXaxis()->SetBinLabel(13,"SelPtHardBin");
496  fHistEventRejection->GetXaxis()->SetBinLabel(14,"Bkg evt");
497  fHistEventRejection->GetYaxis()->SetTitle("counts");
499 
500  fHistTriggerClasses = new TH1F("fHistTriggerClasses","fHistTriggerClasses",3,0,3);
501 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
502  fHistTriggerClasses->SetBit(TH1::kCanRebin);
503 #else
504  fHistTriggerClasses->SetCanExtend(TH1::kAllAxes);
505 #endif
507 
509  fHistTriggerClassesCorr = new TH1F("fHistTriggerClassesCorr","fHistTriggerClassesCorr",3,0,3);
510 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
511  fHistTriggerClassesCorr->SetBit(TH1::kCanRebin);
512 #else
513  fHistTriggerClassesCorr->SetCanExtend(TH1::kAllAxes);
514 #endif
516  }
517 
518  fHistEventCount = new TH1F("fHistEventCount","fHistEventCount",2,0,2);
519  fHistEventCount->GetXaxis()->SetBinLabel(1,"Accepted");
520  fHistEventCount->GetXaxis()->SetBinLabel(2,"Rejected");
521  fHistEventCount->GetYaxis()->SetTitle("counts");
522  fOutput->Add(fHistEventCount);
523 
524  PostData(1, fOutput);
525 }
526 
541 {
542  if (fIsPythia) {
546  fHistPtHard->Fill(fPtHard);
547  }
548 
549  fHistZVertex->Fill(fVertex[2]);
550 
551  if (fForceBeamType != kpp) {
552  fHistCentrality->Fill(fCent);
553  fHistEventPlane->Fill(fEPV0);
554  }
555 
556  std::unique_ptr<TObjArray> triggerClasses(InputEvent()->GetFiredTriggerClasses().Tokenize(" "));
557  TObjString* triggerClass(nullptr);
558  for(auto trg : *triggerClasses){
559  triggerClass = static_cast<TObjString*>(trg);
560  fHistTriggerClasses->Fill(triggerClass->GetString(), 1);
561  }
562 
564  // downscale-corrected number of events are calculated based on the min. bias reference
565  // Formula: N_corr = N_MB * d_Trg/d_{Min_Bias}
566  if(InputEvent()->GetFiredTriggerClasses().Contains(fMinBiasRefTrigger)){
568  Double_t downscaleref = downscalefactors->GetDownscaleFactorForTriggerClass(fMinBiasRefTrigger);
569  for(auto t : downscalefactors->GetTriggerClasses()){
570  Double_t downscaletrg = downscalefactors->GetDownscaleFactorForTriggerClass(t);
571  fHistTriggerClassesCorr->Fill(t, downscaletrg/downscaleref);
572  }
573  }
574  }
575 
576  return kTRUE;
577 }
578 
599 {
600  if (!fLocalInitialized){
601  ExecOnce();
602  UserExecOnce();
603  }
604 
605  if (!fLocalInitialized)
606  return;
607 
608  if (!RetrieveEventObjects())
609  return;
610 
611  if(InputEvent()->GetRunNumber() != fRunNumber){
612  fRunNumber = InputEvent()->GetRunNumber();
615  }
616 
617  if (IsEventSelected()) {
618  if (fGeneralHistograms) fHistEventCount->Fill("Accepted",1);
619  }
620  else {
621  if (fGeneralHistograms) fHistEventCount->Fill("Rejected",1);
622  return;
623  }
624 
626  if (!FillGeneralHistograms())
627  return;
628  }
629 
630  if (!Run())
631  return;
632 
633  if (fCreateHisto) {
634  if (!FillHistograms())
635  return;
636  }
637 
638  if (fCreateHisto && fOutput) {
639  // information for this iteration of the UserExec in the container
640  PostData(1, fOutput);
641  }
642 }
643 
653 {
654  AliWarning("AliAnalysisTaskEmcal::AcceptCluster method is deprecated. Please use GetCusterContainer(c)->AcceptCluster(clus).");
655 
656  if (!clus) return kFALSE;
657 
659  if (!cont) {
660  AliError(Form("%s:Container %d not found",GetName(),c));
661  return 0;
662  }
663  UInt_t rejectionReason = 0;
664  return cont->AcceptCluster(clus, rejectionReason);
665 }
666 
675 Bool_t AliAnalysisTaskEmcal::AcceptTrack(AliVParticle *track, Int_t c) const
676 {
677  AliWarning("AliAnalysisTaskEmcal::AcceptTrack method is deprecated. Please use GetParticleContainer(c)->AcceptParticle(clus).");
678 
679  if (!track) return kFALSE;
680 
682  if (!cont) {
683  AliError(Form("%s:Container %d not found",GetName(),c));
684  return 0;
685  }
686 
687  UInt_t rejectionReason = 0;
688  return cont->AcceptParticle(track, rejectionReason);
689 }
690 
702 Bool_t AliAnalysisTaskEmcal::PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
703 {
704 
705  TString file(currFile);
706  fXsec = 0;
707  fTrials = 1;
708 
709  if (file.Contains(".zip#")) {
710  Ssiz_t pos1 = file.Index("root_archive",12,0,TString::kExact);
711  Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
712  Ssiz_t pos2 = file.Index(".root",5,TString::kExact);
713  file.Replace(pos+1,pos2-pos1,"");
714  } else {
715  // not an archive take the basename....
716  file.ReplaceAll(gSystem->BaseName(file.Data()),"");
717  }
718  AliDebug(1,Form("File name: %s",file.Data()));
719 
720  // Get the pt hard bin
721  TString strPthard(file);
722 
723  strPthard.Remove(strPthard.Last('/'));
724  strPthard.Remove(strPthard.Last('/'));
725  if (strPthard.Contains("AOD")) strPthard.Remove(strPthard.Last('/'));
726  strPthard.Remove(0,strPthard.Last('/')+1);
727  if (strPthard.IsDec()) pthard = strPthard.Atoi();
728  else
729  AliWarning(Form("Could not extract file number from path %s", strPthard.Data()));
730 
731  // 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
732  std::unique_ptr<TFile> fxsec(TFile::Open(Form("%s%s",file.Data(),"pyxsec.root")));
733 
734  if (!fxsec) {
735  // next trial fetch the histgram file
736  fxsec = std::unique_ptr<TFile>(TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root")));
737  if (!fxsec) return kFALSE; // not a severe condition but inciate that we have no information
738  else {
739  // find the tlist we want to be independtent of the name so use the Tkey
740  TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
741  if (!key) return kFALSE;
742  TList *list = dynamic_cast<TList*>(key->ReadObj());
743  if (!list) return kFALSE;
744  fXsec = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
745  fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
746  }
747  } else { // no tree pyxsec.root
748  TTree *xtree = (TTree*)fxsec->Get("Xsection");
749  if (!xtree) return kFALSE;
750  UInt_t ntrials = 0;
751  Double_t xsection = 0;
752  xtree->SetBranchAddress("xsection",&xsection);
753  xtree->SetBranchAddress("ntrials",&ntrials);
754  xtree->GetEntry(0);
755  fTrials = ntrials;
756  fXsec = xsection;
757  }
758  return kTRUE;
759 }
760 
775 {
777  return kTRUE;
778 
779  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
780  if (!tree) {
781  AliError(Form("%s - UserNotify: No current tree!",GetName()));
782  return kFALSE;
783  }
784 
785  Float_t xsection = 0;
786  Float_t trials = 0;
787  Int_t pthardbin = 0;
788 
789  TFile *curfile = tree->GetCurrentFile();
790  if (!curfile) {
791  AliError(Form("%s - UserNotify: No current file!",GetName()));
792  return kFALSE;
793  }
794 
795  TChain *chain = dynamic_cast<TChain*>(tree);
796  if (chain) tree = chain->GetTree();
797 
798  Int_t nevents = tree->GetEntriesFast();
799 
800  PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
801 
802  // TODO: Workaround
803  if ((pthardbin < 0) || (pthardbin > 10)) pthardbin = 0;
804 
805  fHistTrials->Fill(pthardbin, trials);
806  fHistXsection->Fill(pthardbin, xsection);
807  fHistEvents->Fill(pthardbin, nevents);
808 
809  return kTRUE;
810 }
811 
817 {
818  if (!fPythiaInfoName.IsNull() && !fPythiaInfo) {
819  fPythiaInfo = dynamic_cast<AliEmcalPythiaInfo*>(event->FindListObject(fPythiaInfoName));
820  if (!fPythiaInfo) {
821  AliError(Form("%s: Could not retrieve parton infos! %s!", GetName(), fPythiaInfoName.Data()));
822  return;
823  }
824  }
825 }
826 
838 {
839  if (!InputEvent()) {
840  AliError(Form("%s: Could not retrieve event! Returning!", GetName()));
841  return;
842  }
843 
844  LoadPythiaInfo(InputEvent());
845 
846  if (fNeedEmcalGeom) {
847  fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
848  if (!fGeom) {
849  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()));
850  return;
851  }
852  }
853 
854  if (fEventPlaneVsEmcal >= 0) {
855  if (fGeom) {
856  Double_t ep = (fGeom->GetArm1PhiMax() + fGeom->GetArm1PhiMin()) / 2 * TMath::DegToRad() + fEventPlaneVsEmcal - TMath::Pi();
857  fMinEventPlane = ep - TMath::Pi() / 4;
858  fMaxEventPlane = ep + TMath::Pi() / 4;
859  }
860  else {
861  AliWarning("Could not set event plane limits because EMCal geometry was not loaded!");
862  }
863  }
864 
865  //Load all requested track branches - each container knows name already
866  for (Int_t i =0; i<fParticleCollArray.GetEntriesFast(); i++) {
867  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
868  cont->SetArray(InputEvent());
869  }
870 
871  if (fParticleCollArray.GetEntriesFast()>0) {
873  if (!fTracks) {
874  AliError(Form("%s: Could not retrieve first track branch!", GetName()));
875  return;
876  }
877  }
878 
879  //Load all requested cluster branches - each container knows name already
880  for (Int_t i =0; i<fClusterCollArray.GetEntriesFast(); i++) {
881  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
882  cont->SetArray(InputEvent());
883  }
884 
885  if (fClusterCollArray.GetEntriesFast()>0) {
887  if (!fCaloClusters) {
888  AliError(Form("%s: Could not retrieve first cluster branch!", GetName()));
889  return;
890  }
891  }
892 
893  if (!fCaloCellsName.IsNull() && !fCaloCells) {
894  fCaloCells = dynamic_cast<AliVCaloCells*>(InputEvent()->FindListObject(fCaloCellsName));
895  if (!fCaloCells) {
896  AliError(Form("%s: Could not retrieve cells %s!", GetName(), fCaloCellsName.Data()));
897  return;
898  }
899  }
900 
901  if (!fCaloTriggersName.IsNull() && !fCaloTriggers) {
902  fCaloTriggers = dynamic_cast<AliVCaloTrigger*>(InputEvent()->FindListObject(fCaloTriggersName));
903  if (!fCaloTriggers) {
904  AliError(Form("%s: Could not retrieve calo triggers %s!", GetName(), fCaloTriggersName.Data()));
905  return;
906  }
907  }
908 
909  if (!fCaloTriggerPatchInfoName.IsNull() && !fTriggerPatchInfo) {
910  fTriggerPatchInfo = GetArrayFromEvent(fCaloTriggerPatchInfoName.Data(),"AliEMCALTriggerPatchInfo");
911  if (!fTriggerPatchInfo) {
912  AliError(Form("%s: Could not retrieve calo trigger patch info %s!", GetName(), fCaloTriggerPatchInfoName.Data()));
913  return;
914  }
915 
916  }
917 
918  fLocalInitialized = kTRUE;
919 }
920 
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("AddAODHandler", "No analysis manager to connect to.");
2037  return NULL;
2038  }
2039 
2040  AliAODInputHandler* aodHandler = new AliAODInputHandler();
2041 
2042  AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2043  if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2044  AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2045  multiInputHandler->AddInputEventHandler(aodHandler);
2046  }
2047  else {
2048  if (!inputHandler) {
2049  mgr->SetInputEventHandler(aodHandler);
2050  }
2051  else {
2052  ::Error("AddAODHandler", "inputHandler is NOT null. AOD handler was NOT added !!!");
2053  return NULL;
2054  }
2055  }
2056 
2057  return aodHandler;
2058 }
2059 
2065 {
2066  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
2067  if (!mgr) {
2068  ::Error("AddESDHandler", "No analysis manager to connect to.");
2069  return NULL;
2070  }
2071 
2072  AliESDInputHandler *esdHandler = new AliESDInputHandler();
2073 
2074  AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2075  if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2076  AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2077  multiInputHandler->AddInputEventHandler(esdHandler);
2078  }
2079  else {
2080  if (!inputHandler) {
2081  mgr->SetInputEventHandler(esdHandler);
2082  }
2083  else {
2084  ::Error("AddESDHandler", "inputHandler is NOT null. ESD handler was NOT added !!!");
2085  return NULL;
2086  }
2087  }
2088 
2089  return esdHandler;
2090 }
2091 
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
BeamType GetBeamType() 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
static AliAODInputHandler * AddAODHandler()
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