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