AliPhysics  e841483 (e841483)
 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 cluster : mccluscont->all()) {// Not cuts applied ; use accept for cuts
1283  Float_t ecluster = cluster->E();
1284 
1285  if (ecluster > (fPtHardAndClusterPtFactor * fPtHard)) {
1286  AliInfo(Form("Reject : ecluster %2.2f, calo %d, factor %2.2f, ptHard %f",ecluster,cluster->GetType(),fPtHardAndClusterPtFactor,fPtHard));
1287  return kFALSE;
1288  }
1289  }
1290  }
1291  }
1292  // end condition 2
1293 
1294  // condition 3 : Reconstructed track pT / pT-hard >factor
1295  if (fPtHardAndTrackPtFactor > 0.) {
1296  AliMCParticleContainer* mcpartcont = dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(0));
1297  if ((Bool_t)mcpartcont) {
1298  for (auto mctrack : mcpartcont->all()) {// Not cuts applied ; use accept for cuts
1299  Float_t trackpt = mctrack->Pt();
1300  if (trackpt > (fPtHardAndTrackPtFactor * fPtHard) ) {
1301  AliInfo(Form("Reject : track %2.2f, factor %2.2f, ptHard %f", trackpt, fPtHardAndTrackPtFactor, fPtHard));
1302  return kFALSE;
1303  }
1304  }
1305  }
1306  }
1307  // end condition 3
1308 
1309  return kTRUE;
1310 }
1311 
1320 TClonesArray *AliAnalysisTaskEmcal::GetArrayFromEvent(const char *name, const char *clname)
1321 {
1322  TClonesArray *arr = 0;
1323  TString sname(name);
1324  if (!sname.IsNull()) {
1325  arr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(sname));
1326  if (!arr) {
1327  AliWarning(Form("%s: Could not retrieve array with name %s!", GetName(), name));
1328  return 0;
1329  }
1330  } else {
1331  return 0;
1332  }
1333 
1334  if (!clname)
1335  return arr;
1336 
1337  TString objname(arr->GetClass()->GetName());
1338  TClass cls(objname);
1339  if (!cls.InheritsFrom(clname)) {
1340  AliWarning(Form("%s: Objects of type %s in %s are not inherited from %s!",
1341  GetName(), cls.GetName(), name, clname));
1342  return 0;
1343  }
1344  return arr;
1345 }
1346 
1352 {
1353  fVertex[0] = 0;
1354  fVertex[1] = 0;
1355  fVertex[2] = 0;
1356  fNVertCont = 0;
1357 
1358  fVertexSPD[0] = 0;
1359  fVertexSPD[1] = 0;
1360  fVertexSPD[2] = 0;
1361  fNVertSPDCont = 0;
1362 
1363  if (fGeneratePythiaInfoObject && MCEvent()) {
1364  GeneratePythiaInfoObject(MCEvent());
1365  }
1366 
1367  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1368  if (vert) {
1369  vert->GetXYZ(fVertex);
1370  fNVertCont = vert->GetNContributors();
1371  }
1372 
1373  const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
1374  if (vertSPD) {
1375  vertSPD->GetXYZ(fVertexSPD);
1376  fNVertSPDCont = vertSPD->GetNContributors();
1377  }
1378 
1379  fBeamType = GetBeamType();
1380 
1381  if (fBeamType == kAA || fBeamType == kpA ) {
1383  AliMultSelection *MultSelection = static_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
1384  if (MultSelection) {
1385  fCent = MultSelection->GetMultiplicityPercentile(fCentEst.Data());
1386  }
1387  else {
1388  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1389  }
1390  }
1391  else { // old centrality estimation < 2015
1392  AliCentrality *aliCent = InputEvent()->GetCentrality();
1393  if (aliCent) {
1394  fCent = aliCent->GetCentralityPercentile(fCentEst.Data());
1395  }
1396  else {
1397  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1398  }
1399  }
1400 
1401  if (fNcentBins==4) {
1402  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1403  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1404  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1405  else if (fCent >= 50 && fCent <= 100) fCentBin = 3;
1406  else {
1407  AliWarning(Form("%s: Negative centrality: %f. Assuming 99", GetName(), fCent));
1408  fCentBin = fNcentBins-1;
1409  }
1410  }
1411  else if (fNcentBins==5) { // for PbPb 2015
1412  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1413  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1414  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1415  else if (fCent >= 50 && fCent <= 90) fCentBin = 3;
1416  else if (fCent > 90) {
1417  fCent = 99;
1418  fCentBin = 4;
1419  }
1420  else {
1421  AliWarning(Form("%s: Negative centrality: %f. Assuming 99", GetName(), fCent));
1422  fCentBin = fNcentBins-1;
1423  }
1424  }
1425  else {
1426  Double_t centWidth = (fMaxCent-fMinCent)/(Double_t)fNcentBins;
1427  if(centWidth>0.) {
1428  fCentBin = TMath::FloorNint(fCent/centWidth);
1429  }
1430  else {
1431  fCentBin = 0;
1432  }
1433  if (fCentBin>=fNcentBins) {
1434  AliWarning(Form("%s: fCentBin too large: cent = %f fCentBin = %d. Assuming 99", GetName(),fCent,fCentBin));
1435  fCentBin = fNcentBins-1;
1436  }
1437  }
1438 
1439  AliEventplane *aliEP = InputEvent()->GetEventplane();
1440  if (aliEP) {
1441  fEPV0 = aliEP->GetEventplane("V0" ,InputEvent());
1442  fEPV0A = aliEP->GetEventplane("V0A",InputEvent());
1443  fEPV0C = aliEP->GetEventplane("V0C",InputEvent());
1444  } else {
1445  AliWarning(Form("%s: Could not retrieve event plane information!", GetName()));
1446  }
1447  }
1448  else {
1449  fCent = 99;
1450  fCentBin = 0;
1451  }
1452 
1453  if (fPythiaHeader) {
1454  fPtHard = fPythiaHeader->GetPtHard();
1455 
1456  const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
1457  const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
1458  for (fPtHardBin = 0; fPtHardBin < 11; fPtHardBin++) {
1459  if (fPtHard >= ptHardLo[fPtHardBin] && fPtHard < ptHardHi[fPtHardBin])
1460  break;
1461  }
1462 
1463  fXsection = fPythiaHeader->GetXsection();
1464  fNTrials = fPythiaHeader->Trials();
1465  }
1466 
1468 
1469  AliEmcalContainer* cont = 0;
1470 
1471  TIter nextPartColl(&fParticleCollArray);
1472  while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))) cont->NextEvent();
1473 
1474  TIter nextClusColl(&fClusterCollArray);
1475  while ((cont = static_cast<AliParticleContainer*>(nextClusColl()))) cont->NextEvent();
1476 
1477  return kTRUE;
1478 }
1479 
1488 {
1489  if (TString(n).IsNull()) return 0;
1490 
1492 
1493  fParticleCollArray.Add(cont);
1494 
1495  return cont;
1496 }
1497 
1506 {
1507  if (TString(n).IsNull()) return 0;
1508 
1509  AliTrackContainer* cont = new AliTrackContainer(n);
1510 
1511  fParticleCollArray.Add(cont);
1512 
1513  return cont;
1514 }
1515 
1524 {
1525  if (TString(n).IsNull()) return 0;
1526 
1528 
1529  fParticleCollArray.Add(cont);
1530 
1531  return cont;
1532 }
1533 
1542 {
1543  if (TString(n).IsNull()) return 0;
1544 
1546 
1547  fClusterCollArray.Add(cont);
1548 
1549  return cont;
1550 }
1551 
1558 {
1559  if (i<0 || i>fParticleCollArray.GetEntriesFast()) return 0;
1560  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
1561  return cont;
1562 }
1563 
1570 {
1571  if (i<0 || i>fClusterCollArray.GetEntriesFast()) return 0;
1572  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
1573  return cont;
1574 }
1575 
1582 {
1583  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.FindObject(name));
1584  return cont;
1585 }
1586 
1593 {
1594  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.FindObject(name));
1595  return cont;
1596 }
1597 
1603 TClonesArray* AliAnalysisTaskEmcal::GetParticleArray(Int_t i) const
1604 {
1606  if (!cont) {
1607  AliError(Form("%s: Particle container %d not found",GetName(),i));
1608  return 0;
1609  }
1610  TString contName = cont->GetArrayName();
1611  return cont->GetArray();
1612 }
1613 
1619 TClonesArray* AliAnalysisTaskEmcal::GetClusterArray(Int_t i) const
1620 {
1622  if (!cont) {
1623  AliError(Form("%s:Cluster container %d not found",GetName(),i));
1624  return 0;
1625  }
1626  return cont->GetArray();
1627 }
1628 
1636 AliVParticle* AliAnalysisTaskEmcal::GetAcceptParticleFromArray(Int_t p, Int_t c) const
1637 {
1638 
1640  if (!cont) {
1641  AliError(Form("%s: Particle container %d not found",GetName(),c));
1642  return 0;
1643  }
1644  AliVParticle *vp = cont->GetAcceptParticle(p);
1645 
1646  return vp;
1647 }
1648 
1656 AliVCluster* AliAnalysisTaskEmcal::GetAcceptClusterFromArray(Int_t cl, Int_t c) const
1657 {
1659  if (!cont) {
1660  AliError(Form("%s: Cluster container %d not found",GetName(),c));
1661  return 0;
1662  }
1663  AliVCluster *vc = cont->GetAcceptCluster(cl);
1664 
1665  return vc;
1666 }
1667 
1674 {
1676  if (!cont) {
1677  AliError(Form("%s: Particle container %d not found",GetName(),i));
1678  return 0;
1679  }
1680  return cont->GetNEntries();
1681 }
1682 
1690 {
1692  if (!cont) {
1693  AliError(Form("%s: Cluster container %d not found",GetName(),i));
1694  return 0;
1695  }
1696  return cont->GetNEntries();
1697 }
1698 
1710 AliEMCALTriggerPatchInfo* AliAnalysisTaskEmcal::GetMainTriggerPatch(TriggerCategory trigger, Bool_t doSimpleOffline)
1711 {
1712 
1713  if (!fTriggerPatchInfo) {
1714  AliError(Form("%s: fTriggerPatchInfo not available",GetName()));
1715  return 0;
1716  }
1717 
1718  //number of patches in event
1719  Int_t nPatch = fTriggerPatchInfo->GetEntries();
1720 
1721  //extract main trigger patch(es)
1722  AliEMCALTriggerPatchInfo *patch(NULL), *selected(NULL);
1723  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1724 
1725  patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
1726  if (patch->IsMainTrigger()) {
1727  if(doSimpleOffline){
1728  if(patch->IsOfflineSimple()){
1729  switch(trigger){
1730  case kTriggerLevel0:
1731  // option not yet implemented in the trigger maker
1732  if(patch->IsLevel0()) selected = patch;
1733  break;
1734  case kTriggerLevel1Jet:
1735  if(patch->IsJetHighSimple() || patch->IsJetLowSimple()){
1736  if(!selected) selected = patch;
1737  else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1738  }
1739  break;
1740  case kTriggerLevel1Gamma:
1741  if(patch->IsGammaHighSimple() || patch->IsGammaLowSimple()){
1742  if(!selected) selected = patch;
1743  else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1744  }
1745  break;
1746  default: // Silence compiler warnings
1747  AliError("Untreated case: Main Patch is recalculated; should be in 'else' branch");
1748  };
1749  }
1750  } else { // Not OfflineSimple
1751  switch(trigger){
1752  case kTriggerLevel0:
1753  if(patch->IsLevel0()) selected = patch;
1754  break;
1755  case kTriggerLevel1Jet:
1756  if(patch->IsJetHigh() || patch->IsJetLow()){
1757  if(!selected) selected = patch;
1758  else if (patch->GetADCAmp() > selected->GetADCAmp())
1759  selected = patch;
1760  }
1761  break;
1762  case kTriggerLevel1Gamma:
1763  if(patch->IsGammaHigh() || patch->IsGammaLow()){
1764  if(!selected) selected = patch;
1765  else if (patch->GetADCAmp() > selected->GetADCAmp())
1766  selected = patch;
1767  }
1768  break;
1769  default:
1770  AliError("Untreated case: Main Patch is recalculated; should be in 'else' branch");
1771  };
1772  }
1773  }
1774  else if ((trigger == kTriggerRecalcJet && patch->IsRecalcJet()) ||
1775  (trigger == kTriggerRecalcGamma && patch->IsRecalcGamma())) { // recalculated patches
1776  if (doSimpleOffline && patch->IsOfflineSimple()) {
1777  if(!selected) selected = patch;
1778  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
1779  selected = patch;
1780  }
1781  else if (!doSimpleOffline && !patch->IsOfflineSimple()) {
1782  if(!selected) selected = patch;
1783  else if (patch->GetADCAmp() > selected->GetADCAmp())
1784  selected = patch;
1785  }
1786  }
1787  }
1788  return selected;
1789 }
1790 
1796 void AliAnalysisTaskEmcal::AddObjectToEvent(TObject *obj, Bool_t attempt)
1797 {
1798  if (!(InputEvent()->FindListObject(obj->GetName()))) {
1799  InputEvent()->AddObject(obj);
1800  }
1801  else {
1802  if (!attempt) {
1803  AliFatal(Form("%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1804  }
1805  }
1806 }
1807 
1815 Bool_t AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance(AliVParticle* part, Double_t edges) const
1816 {
1817 
1818  if (!fGeom) {
1819  AliWarning(Form("%s - AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1820  return kFALSE;
1821  }
1822 
1823  Double_t minPhi = fGeom->GetArm1PhiMin() - edges;
1824  Double_t maxPhi = fGeom->GetArm1PhiMax() + edges;
1825 
1826  if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1827  return kTRUE;
1828  }
1829  else {
1830  return kFALSE;
1831  }
1832 }
1833 
1835 {
1836  axis->SetBinLabel(1, "NullObject");
1837  axis->SetBinLabel(2, "Pt");
1838  axis->SetBinLabel(3, "Acceptance");
1839  axis->SetBinLabel(4, "MCLabel");
1840  axis->SetBinLabel(5, "BitMap");
1841  axis->SetBinLabel(6, "HF cut");
1842  axis->SetBinLabel(7, "Bit6");
1843  axis->SetBinLabel(8, "NotHybridTrack");
1844  axis->SetBinLabel(9, "MCFlag");
1845  axis->SetBinLabel(10, "MCGenerator");
1846  axis->SetBinLabel(11, "ChargeCut");
1847  axis->SetBinLabel(12, "MinDistanceTPCSectorEdge");
1848  axis->SetBinLabel(13, "Bit12");
1849  axis->SetBinLabel(14, "IsEMCal");
1850  axis->SetBinLabel(15, "Time");
1851  axis->SetBinLabel(16, "Energy");
1852  axis->SetBinLabel(17, "ExoticCut");
1853  axis->SetBinLabel(18, "Bit17");
1854  axis->SetBinLabel(19, "Area");
1855  axis->SetBinLabel(20, "AreaEmc");
1856  axis->SetBinLabel(21, "ZLeadingCh");
1857  axis->SetBinLabel(22, "ZLeadingEmc");
1858  axis->SetBinLabel(23, "NEF");
1859  axis->SetBinLabel(24, "MinLeadPt");
1860  axis->SetBinLabel(25, "MaxTrackPt");
1861  axis->SetBinLabel(26, "MaxClusterPt");
1862  axis->SetBinLabel(27, "Flavour");
1863  axis->SetBinLabel(28, "TagStatus");
1864  axis->SetBinLabel(29, "MinNConstituents");
1865  axis->SetBinLabel(30, "Bit29");
1866  axis->SetBinLabel(31, "Bit30");
1867  axis->SetBinLabel(32, "Bit31");
1868 }
1869 
1876 Double_t AliAnalysisTaskEmcal::GetParallelFraction(AliVParticle* part1, AliVParticle* part2)
1877 {
1878  TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1879  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1880  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1881  return z;
1882 }
1883 
1890 Double_t AliAnalysisTaskEmcal::GetParallelFraction(const TVector3& vect1, AliVParticle* part2)
1891 {
1892  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1893  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1894  return z;
1895 }
1896 
1905 void AliAnalysisTaskEmcal::GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
1906 {
1907  phidiff = 999;
1908  etadiff = 999;
1909 
1910  if (!t||!v) return;
1911 
1912  Double_t veta = t->GetTrackEtaOnEMCal();
1913  Double_t vphi = t->GetTrackPhiOnEMCal();
1914 
1915  Float_t pos[3] = {0};
1916  v->GetPosition(pos);
1917  TVector3 cpos(pos);
1918  Double_t ceta = cpos.Eta();
1919  Double_t cphi = cpos.Phi();
1920  etadiff=veta-ceta;
1921  phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1922 }
1923 
1929 Byte_t AliAnalysisTaskEmcal::GetTrackType(const AliVTrack *t)
1930 {
1931  Byte_t ret = 0;
1932  if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1933  ret = 1;
1934  else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1935  ret = 2;
1936  else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1937  ret = 3;
1938  return ret;
1939 }
1940 
1950 Byte_t AliAnalysisTaskEmcal::GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2)
1951 {
1952 
1953  Int_t res = 0;
1954 
1955  if (aodTrack->TestFilterBit(filterBit1)) {
1956  res = 0;
1957  }
1958  else if (aodTrack->TestFilterBit(filterBit2)) {
1959  if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1960  res = 1;
1961  }
1962  else {
1963  res = 2;
1964  }
1965  }
1966  else {
1967  res = 3;
1968  }
1969 
1970  return res;
1971 }
1972 
1978 {
1979  if (!fPythiaInfo) {
1981  }
1982 
1983  AliStack* stack = mcEvent->Stack();
1984 
1985  const Int_t nprim = stack->GetNprimary();
1986  // reject if partons are missing from stack for some reason
1987  if (nprim < 8) return;
1988 
1989  TParticle *part6 = stack->Particle(6);
1990  TParticle *part7 = stack->Particle(7);
1991 
1992  fPythiaInfo->SetPartonFlag6(TMath::Abs(part6->GetPdgCode()));
1993  fPythiaInfo->SetParton6(part6->Pt(), part6->Eta(), part6->Phi(), part6->GetMass());
1994 
1995  fPythiaInfo->SetPartonFlag7(TMath::Abs(part7->GetPdgCode()));
1996  fPythiaInfo->SetParton7(part7->Pt(), part7->Eta(), part7->Phi(), part7->GetMass());
1997 
1998  AliGenPythiaEventHeader *pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(mcEvent->GenEventHeader());
1999  if(pythiaGenHeader){
2000  Float_t ptWeight=pythiaGenHeader->EventWeight();
2001  fPythiaInfo->SetPythiaEventWeight(ptWeight);}
2002 
2003 
2004 }
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
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
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
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.
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