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