AliPhysics  93c564e (93c564e)
AliAnalysisTaskEmcalLight.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2016, 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 <sstream>
16 #include <array>
17 
18 #include <RVersion.h>
19 #include <TClonesArray.h>
20 #include <TList.h>
21 #include <TObject.h>
22 #include <TH1F.h>
23 #include <TProfile.h>
24 #include <TSystem.h>
25 #include <TFile.h>
26 #include <TChain.h>
27 #include <TKey.h>
28 
29 #include "AliGenCocktailEventHeader.h"
30 #include "AliStack.h"
31 #include "AliAODEvent.h"
32 #include "AliAnalysisManager.h"
33 #include "AliCentrality.h"
34 #include "AliEMCALGeometry.h"
35 #include "AliESDEvent.h"
36 #include "AliEmcalParticle.h"
37 #include "AliEventplane.h"
38 #include "AliInputEventHandler.h"
39 #include "AliLog.h"
40 #include "AliMCParticle.h"
41 #include "AliVCluster.h"
42 #include "AliVEventHandler.h"
43 #include "AliVParticle.h"
44 #include "AliAODTrack.h"
45 #include "AliVCaloTrigger.h"
46 #include "AliGenPythiaEventHeader.h"
47 #include "AliAODMCHeader.h"
48 #include "AliMCEvent.h"
49 #include "AliEMCALTriggerPatchInfo.h"
50 
51 #include "AliMultSelection.h"
52 
54 
56 
60 
66  fForceBeamType(kNA),
67  fGeneralHistograms(kFALSE),
68  fCreateHisto(kTRUE),
69  fNeedEmcalGeom(kTRUE),
70  fCentBins(),
71  fCentralityEstimation(kNewCentrality),
72  fIsPythia(kFALSE),
73  fCaloCellsName(),
74  fCaloTriggersName(),
75  fCaloTriggerPatchInfoName(),
76  fCentEst("V0M"),
77  fParticleCollArray(),
78  fClusterCollArray(),
79  fTriggerSelectionBitMap(0),
80  fMinCent(-1),
81  fMaxCent(-1),
82  fMinVz(-999),
83  fMaxVz(999),
84  fMaxVzDiff(-1),
85  fMinNVertCont(0),
86  fMinPtHard(-1),
87  fMaxPtHard(-1),
88  fMaxMinimumBiasPtHard(-1),
89  fAcceptedTriggerClasses(),
90  fRejectedTriggerClasses(),
91  fMCRejectFilter(kFALSE),
92  fPtHardAndJetPtFactor(0.),
93  fPtHardAndClusterPtFactor(0.),
94  fPtHardAndTrackPtFactor(0.),
95  fSwitchOffLHC15oFaultyBranches(kFALSE),
96  fEventSelectionAfterRun(kFALSE),
97  fSelectGeneratorName(),
98  fInhibit(kFALSE),
99  fLocalInitialized(kFALSE),
100  fDataType(kAOD),
101  fGeom(0),
102  fCaloCells(0),
103  fCaloTriggers(0),
104  fTriggerPatchInfo(0),
105  fCent(-1),
106  fCentBin(-1),
107  fEPV0(-1.0),
108  fEPV0A(-1.0),
109  fEPV0C(-1.0),
110  fNVertCont(0),
111  fNVertSPDCont(0),
112  fFiredTriggerBitMap(0),
113  fFiredTriggerClasses(),
114  fBeamType(kNA),
115  fPythiaHeader(0),
116  fPtHardBin(-1),
117  fPtHard(0),
118  fNTrials(0),
119  fXsection(0),
120  fGeneratorName(),
121  fOutput(0),
122  fHistTrialsVsPtHardNoSel(0),
123  fHistEventsVsPtHardNoSel(0),
124  fHistXsectionVsPtHardNoSel(0),
125  fHistTriggerClassesNoSel(0),
126  fHistZVertexNoSel(0),
127  fHistCentralityNoSel(0),
128  fHistEventPlaneNoSel(0),
129  fHistTrialsVsPtHard(0),
130  fHistEventsVsPtHard(0),
131  fHistXsectionVsPtHard(0),
132  fHistTriggerClasses(0),
133  fHistZVertex(0),
134  fHistCentrality(0),
135  fHistEventPlane(0),
136  fHistEventCount(0),
137  fHistEventRejection(0),
138  fHistTrials(0),
139  fHistEvents(0),
140  fHistXsection(0)
141 {
142  fVertex[0] = 0;
143  fVertex[1] = 0;
144  fVertex[2] = 0;
145  fVertexSPD[0] = 0;
146  fVertexSPD[1] = 0;
147  fVertexSPD[2] = 0;
148 }
149 
161  AliAnalysisTaskSE(name),
162  fForceBeamType(kNA),
163  fGeneralHistograms(kFALSE),
164  fCreateHisto(kTRUE),
165  fNeedEmcalGeom(kTRUE),
166  fCentBins(6),
167  fCentralityEstimation(kNewCentrality),
168  fIsPythia(kFALSE),
169  fCaloCellsName(),
170  fCaloTriggersName(),
171  fCaloTriggerPatchInfoName(),
172  fCentEst("V0M"),
173  fParticleCollArray(),
174  fClusterCollArray(),
175  fTriggerSelectionBitMap(0),
176  fMinCent(-1),
177  fMaxCent(-1),
178  fMinVz(-999),
179  fMaxVz(999),
180  fMaxVzDiff(-1),
181  fMinNVertCont(0),
182  fMinPtHard(-1),
183  fMaxPtHard(-1),
184  fMaxMinimumBiasPtHard(-1),
185  fAcceptedTriggerClasses(),
186  fRejectedTriggerClasses(),
187  fMCRejectFilter(kFALSE),
188  fPtHardAndJetPtFactor(0.),
189  fPtHardAndClusterPtFactor(0.),
190  fPtHardAndTrackPtFactor(0.),
191  fSwitchOffLHC15oFaultyBranches(kFALSE),
192  fEventSelectionAfterRun(kFALSE),
193  fSelectGeneratorName(),
194  fInhibit(kFALSE),
195  fLocalInitialized(kFALSE),
196  fDataType(kAOD),
197  fGeom(0),
198  fCaloCells(0),
199  fCaloTriggers(0),
200  fTriggerPatchInfo(0),
201  fCent(0),
202  fCentBin(-1),
203  fEPV0(-1.0),
204  fEPV0A(-1.0),
205  fEPV0C(-1.0),
206  fNVertCont(0),
207  fNVertSPDCont(0),
208  fFiredTriggerBitMap(0),
209  fFiredTriggerClasses(),
210  fBeamType(kNA),
211  fPythiaHeader(0),
212  fPtHardBin(-1),
213  fPtHard(0),
214  fNTrials(0),
215  fXsection(0),
216  fGeneratorName(),
217  fOutput(0),
218  fHistTrialsVsPtHardNoSel(0),
219  fHistEventsVsPtHardNoSel(0),
220  fHistXsectionVsPtHardNoSel(0),
221  fHistTriggerClassesNoSel(0),
222  fHistZVertexNoSel(0),
223  fHistCentralityNoSel(0),
224  fHistEventPlaneNoSel(0),
225  fHistTrialsVsPtHard(0),
226  fHistEventsVsPtHard(0),
227  fHistXsectionVsPtHard(0),
228  fHistTriggerClasses(0),
229  fHistZVertex(0),
230  fHistCentrality(0),
231  fHistEventPlane(0),
232  fHistEventCount(0),
233  fHistEventRejection(0),
234  fHistTrials(0),
235  fHistEvents(0),
236  fHistXsection(0)
237 {
238  fVertex[0] = 0;
239  fVertex[1] = 0;
240  fVertex[2] = 0;
241  fVertexSPD[0] = 0;
242  fVertexSPD[1] = 0;
243  fVertexSPD[2] = 0;
244 
245  fCentBins[0] = 0;
246  fCentBins[1] = 10;
247  fCentBins[2] = 30;
248  fCentBins[3] = 50;
249  fCentBins[4] = 90;
250  fCentBins[5] = 100;
251 
252  if (fCreateHisto) DefineOutput(1, TList::Class());
253 }
254 
259 {
260  for (auto cont_it : fParticleCollArray) delete cont_it.second;
261  for (auto cont_it : fClusterCollArray) delete cont_it.second;
262 }
263 
284 {
285  if (fInhibit) {
286  AliWarningStream() << "The execution of this task is inhibited. Returning." << std::endl;
287  return;
288  }
289  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
290  if (mgr) {
291  AliVEventHandler *evhand = mgr->GetInputEventHandler();
292  if (evhand) {
293  if (evhand->InheritsFrom("AliESDInputHandler")) {
294  fDataType = kESD;
295  }
296  else {
297  fDataType = kAOD;
298  }
299  }
300  else {
301  AliError("Event handler not found!");
302  }
303  }
304  else {
305  AliError("Analysis manager not found!");
306  }
307 
308  if (!fCreateHisto)
309  return;
310 
311  OpenFile(1);
312  fOutput = new TList();
313  fOutput->SetOwner(); // @suppress("Ambiguous problem")
314 
316 
317  if (!fGeneralHistograms) return;
318 
319  if (fIsPythia) {
320  fHistEventsVsPtHard = new TH1F("fHistEventsVsPtHard", "fHistEventsVsPtHard", 1000, 0, 1000);
321  fHistEventsVsPtHard->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
322  fHistEventsVsPtHard->GetYaxis()->SetTitle("events");
324 
325  fHistTrialsVsPtHard = new TH1F("fHistTrialsVsPtHard", "fHistTrialsVsPtHard", 1000, 0, 1000);
326  fHistTrialsVsPtHard->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
327  fHistTrialsVsPtHard->GetYaxis()->SetTitle("trials");
329 
330  fHistXsectionVsPtHard = new TProfile("fHistXsectionVsPtHard", "fHistXsectionVsPtHard", 1000, 0, 1000);
331  fHistXsectionVsPtHard->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
332  fHistXsectionVsPtHard->GetYaxis()->SetTitle("xsection");
334 
335  fHistEventsVsPtHardNoSel = new TH1F("fHistEventsVsPtHardNoSel", "fHistEventsVsPtHardNoSel", 1000, 0, 1000);
336  fHistEventsVsPtHardNoSel->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
337  fHistEventsVsPtHardNoSel->GetYaxis()->SetTitle("events");
339 
340  fHistTrialsVsPtHardNoSel = new TH1F("fHistTrialsVsPtHardNoSel", "fHistTrialsVsPtHardNoSel", 1000, 0, 1000);
341  fHistTrialsVsPtHardNoSel->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
342  fHistTrialsVsPtHardNoSel->GetYaxis()->SetTitle("trials");
344 
345  fHistXsectionVsPtHardNoSel = new TProfile("fHistXsectionVsPtHardNoSel", "fHistXsectionVsPtHardNoSel", 1000, 0, 1000);
346  fHistXsectionVsPtHardNoSel->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
347  fHistXsectionVsPtHardNoSel->GetYaxis()->SetTitle("xsection");
349 
350  fHistTrials = new TH1F("fHistTrials", "fHistTrials", 50, 0, 50);
351  fHistTrials->GetXaxis()->SetTitle("#it{p}_{T,hard} bin");
352  fHistTrials->GetYaxis()->SetTitle("trials");
353  fOutput->Add(fHistTrials);
354 
355  fHistEvents = new TH1F("fHistEvents", "fHistEvents", 50, 0, 50);
356  fHistEvents->GetXaxis()->SetTitle("#it{p}_{T,hard} bin");
357  fHistEvents->GetYaxis()->SetTitle("total events");
358  fOutput->Add(fHistEvents);
359 
360  fHistXsection = new TProfile("fHistXsection", "fHistXsection", 50, 0, 50);
361  fHistXsection->GetXaxis()->SetTitle("#it{p}_{T,hard} bin");
362  fHistXsection->GetYaxis()->SetTitle("xsection");
363  fOutput->Add(fHistXsection);
364  }
365 
366  fHistZVertex = new TH1F("fHistZVertex","Z vertex position", 60, -30, 30);
367  fHistZVertex->GetXaxis()->SetTitle("V_{#it{z}}");
368  fHistZVertex->GetYaxis()->SetTitle("counts");
369  fOutput->Add(fHistZVertex);
370 
371  fHistZVertexNoSel = new TH1F("fHistZVertexNoSel","Z vertex position (no event selection)", 60, -30, 30);
372  fHistZVertexNoSel->GetXaxis()->SetTitle("V_{#it{z}}");
373  fHistZVertexNoSel->GetYaxis()->SetTitle("counts");
375 
377  fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", 100, 0, 100);
378  fHistCentrality->GetXaxis()->SetTitle("Centrality (%)");
379  fHistCentrality->GetYaxis()->SetTitle("counts");
380  fOutput->Add(fHistCentrality);
381 
382  fHistCentralityNoSel = new TH1F("fHistCentralityNoSel","Event centrality distribution (no event selection)", 100, 0, 100);
383  fHistCentralityNoSel->GetXaxis()->SetTitle("Centrality (%)");
384  fHistCentralityNoSel->GetYaxis()->SetTitle("counts");
386  }
387 
388  if (fForceBeamType != kpp) {
389  fHistEventPlane = new TH1F("fHistEventPlane","Event plane", 120, -TMath::Pi(), TMath::Pi());
390  fHistEventPlane->GetXaxis()->SetTitle("event plane");
391  fHistEventPlane->GetYaxis()->SetTitle("counts");
392  fOutput->Add(fHistEventPlane);
393 
394  fHistEventPlaneNoSel = new TH1F("fHistEventPlaneNoSel","Event plane (no event selection)", 120, -TMath::Pi(), TMath::Pi());
395  fHistEventPlaneNoSel->GetXaxis()->SetTitle("event plane");
396  fHistEventPlaneNoSel->GetYaxis()->SetTitle("counts");
398  }
399 
400  fHistEventRejection = new TH1F("fHistEventRejection","Reasons to reject event",30,0,30);
401 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
402  fHistEventRejection->SetBit(TH1::kCanRebin);
403 #else
404  fHistEventRejection->SetCanExtend(TH1::kAllAxes);
405 #endif
406  std::array<std::string, 10> labels = {"PhysSel", "Evt Gen Name", "Trg class (acc)", "Trg class (rej)", "Cent", "vertex contr.", "Vz", "VzSPD", "SelPtHardBin", "MCOutlier"};
407  int i = 1;
408  for (auto label : labels) {
409  fHistEventRejection->GetXaxis()->SetBinLabel(i, label.c_str());
410  i++;
411  }
412  fHistEventRejection->GetYaxis()->SetTitle("counts");
414 
415  fHistTriggerClasses = new TH1F("fHistTriggerClasses","fHistTriggerClasses",3,0,3);
416 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
417  fHistTriggerClasses->SetBit(TH1::kCanRebin);
418 #else
419  fHistTriggerClasses->SetCanExtend(TH1::kAllAxes);
420 #endif
422 
423  fHistTriggerClassesNoSel = new TH1F("fHistTriggerClassesNoSel","fHistTriggerClassesNoSel",3,0,3);
424 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
425  fHistTriggerClassesNoSel->SetBit(TH1::kCanRebin);
426 #else
427  fHistTriggerClassesNoSel->SetCanExtend(TH1::kAllAxes);
428 #endif
430 
431  fHistEventCount = new TH1F("fHistEventCount","fHistEventCount",2,0,2);
432  fHistEventCount->GetXaxis()->SetBinLabel(1,"Accepted");
433  fHistEventCount->GetXaxis()->SetBinLabel(2,"Rejected");
434  fHistEventCount->GetYaxis()->SetTitle("counts");
435  fOutput->Add(fHistEventCount);
436 
437  PostData(1, fOutput);
438 }
439 
455 {
456  if (eventSelected) {
457  if (fIsPythia) {
458  fHistEventsVsPtHard->Fill(fPtHard, 1);
461  }
462 
463  fHistZVertex->Fill(fVertex[2]);
464 
467 
468 
469  for (auto fired_trg : fFiredTriggerClasses) fHistTriggerClasses->Fill(fired_trg.c_str(), 1);
470  }
471  else {
472  if (fIsPythia) {
476  }
477 
478  fHistZVertexNoSel->Fill(fVertex[2]);
479 
482 
483  for (auto fired_trg : fFiredTriggerClasses) fHistTriggerClassesNoSel->Fill(fired_trg.c_str(), 1);
484  }
485 
486  return kTRUE;
487 }
488 
509 {
510  if (fInhibit) {
511  AliWarningStream() << "The execution of this task is inhibited. Returning." << std::endl;
512  return;
513  }
514 
515  if (!fLocalInitialized) ExecOnce();
516 
517  if (!fLocalInitialized) return;
518 
519  if (!RetrieveEventObjects()) return;
520 
521  Bool_t eventSelected = IsEventSelected();
522 
524  if (eventSelected) {
525  fHistEventCount->Fill("Accepted",1);
526  }
527  else {
528  fHistEventCount->Fill("Rejected",1);
529  }
530 
531  FillGeneralHistograms(kFALSE);
532  if (eventSelected) FillGeneralHistograms(kTRUE);
533  }
534 
535  Bool_t runOk = kFALSE;
536  if (eventSelected || fEventSelectionAfterRun) runOk = Run();
537 
538  if (fCreateHisto && eventSelected && runOk) FillHistograms();
539 
540  if (fCreateHisto && fOutput) {
541  // information for this iteration of the UserExec in the container
542  PostData(1, fOutput);
543  }
544 }
545 
557 Bool_t AliAnalysisTaskEmcalLight::PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
558 {
559 
560  TString file(currFile);
561  fXsec = 0;
562  fTrials = 1;
563 
564  if (file.Contains(".zip#")) {
565  Ssiz_t pos1 = file.Index("root_archive",12,0,TString::kExact);
566  Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
567  Ssiz_t pos2 = file.Index(".root",5,TString::kExact);
568  file.Replace(pos+1,pos2-pos1,"");
569  } else {
570  // not an archive take the basename....
571  file.ReplaceAll(gSystem->BaseName(file.Data()),"");
572  }
573  AliDebug(1,Form("File name: %s",file.Data()));
574 
575  // Get the pt hard bin
576  TString strPthard(file);
577 
578  strPthard.Remove(strPthard.Last('/'));
579  strPthard.Remove(strPthard.Last('/'));
580  if (strPthard.Contains("AOD")) strPthard.Remove(strPthard.Last('/'));
581  strPthard.Remove(0,strPthard.Last('/')+1);
582  if (strPthard.IsDec()) {
583  pthard = strPthard.Atoi();
584  }
585  else {
586  AliWarning(Form("Could not extract file number from path %s", strPthard.Data()));
587  pthard = -1;
588  }
589 
590  // 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
591  TFile *fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec.root"));
592 
593  if (!fxsec) {
594  // next trial fetch the histgram file
595  fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
596  if (!fxsec) {
597  // not a severe condition but inciate that we have no information
598  return kFALSE;
599  } else {
600  // find the tlist we want to be independtent of the name so use the Tkey
601  TKey* key = static_cast<TKey*>(fxsec->GetListOfKeys()->At(0));
602  if (!key) {
603  fxsec->Close();
604  return kFALSE;
605  }
606  TList *list = dynamic_cast<TList*>(key->ReadObj());
607  if (!list) {
608  fxsec->Close();
609  return kFALSE;
610  }
611  fXsec = static_cast<TProfile*>(list->FindObject("h1Xsec"))->GetBinContent(1);
612  fTrials = static_cast<TH1F*>(list->FindObject("h1Trials"))->GetBinContent(1);
613  fxsec->Close();
614  }
615  } else { // no tree pyxsec.root
616  TTree *xtree = static_cast<TTree*>(fxsec->Get("Xsection"));
617  if (!xtree) {
618  fxsec->Close();
619  return kFALSE;
620  }
621  UInt_t ntrials = 0;
622  Double_t xsection = 0;
623  xtree->SetBranchAddress("xsection",&xsection);
624  xtree->SetBranchAddress("ntrials",&ntrials);
625  xtree->GetEntry(0);
626  fTrials = ntrials;
627  fXsec = xsection;
628  fxsec->Close();
629  }
630  return kTRUE;
631 }
632 
647 {
649  return kTRUE;
650 
651  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
652  if (!tree) {
653  AliError(Form("%s - UserNotify: No current tree!",GetName()));
654  return kFALSE;
655  }
656 
657  Float_t xsection = 0;
658  Float_t trials = 0;
659  Int_t pthardbin = 0;
660 
661  TFile *curfile = tree->GetCurrentFile();
662  if (!curfile) {
663  AliError(Form("%s - UserNotify: No current file!",GetName()));
664  return kFALSE;
665  }
666 
667  TChain *chain = dynamic_cast<TChain*>(tree);
668  if (chain) tree = chain->GetTree();
669 
670  Int_t nevents = tree->GetEntriesFast();
671 
672  Bool_t res = PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
673 
674  fPtHardBin = pthardbin;
675 
676  if (!res) return kTRUE;
677 
678  fHistTrials->Fill(fPtHardBin, trials);
679  fHistXsection->Fill(fPtHardBin, xsection);
680  fHistEvents->Fill(fPtHardBin, nevents);
681 
682  return kTRUE;
683 }
684 
696 {
697  if (!InputEvent()) {
698  AliError(Form("%s: Could not retrieve event! Returning!", GetName()));
699  return;
700  }
701 
702  if (fNeedEmcalGeom && !fGeom) {
703  fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
704  if (!fGeom) {
705  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()));
706  return;
707  }
708  }
709 
710  if (fSwitchOffLHC15oFaultyBranches && dynamic_cast<AliAODEvent*>(InputEvent())) {
711  TTree *aodTree = AliAnalysisManager::GetAnalysisManager()->GetTree();
712  aodTree->SetBranchStatus("D0toKpi.fPx", 0);
713  aodTree->SetBranchStatus("D0toKpi.fPy", 0);
714  aodTree->SetBranchStatus("D0toKpi.fPz", 0);
715  aodTree->SetBranchStatus("D0toKpi.fd0", 0);
716  aodTree->SetBranchStatus("Charm3Prong.fPx", 0);
717  aodTree->SetBranchStatus("Charm3Prong.fPy", 0);
718  aodTree->SetBranchStatus("Charm3Prong.fPz", 0);
719  aodTree->SetBranchStatus("Charm3Prong.fd0", 0);
720  aodTree->SetBranchStatus("Dstar.fPx", 0);
721  aodTree->SetBranchStatus("Dstar.fPy", 0);
722  aodTree->SetBranchStatus("Dstar.fPz", 0);
723  aodTree->SetBranchStatus("Dstar.fd0", 0);
724  }
725 
726  //Load all requested track branches - each container knows name already
727  for (auto cont_it : fParticleCollArray) cont_it.second->SetArray(InputEvent());
728 
729  //Load all requested cluster branches - each container knows name already
730  for (auto cont_it : fClusterCollArray) cont_it.second->SetArray(InputEvent());
731 
732  if (!fCaloCellsName.IsNull() && !fCaloCells) {
733  fCaloCells = dynamic_cast<AliVCaloCells*>(InputEvent()->FindListObject(fCaloCellsName));
734  if (!fCaloCells) {
735  AliError(Form("%s: Could not retrieve cells %s!", GetName(), fCaloCellsName.Data()));
736  return;
737  }
738  }
739 
740  if (!fCaloTriggersName.IsNull() && !fCaloTriggers) {
741  fCaloTriggers = dynamic_cast<AliVCaloTrigger*>(InputEvent()->FindListObject(fCaloTriggersName));
742  if (!fCaloTriggers) {
743  AliError(Form("%s: Could not retrieve calo triggers %s!", GetName(), fCaloTriggersName.Data()));
744  return;
745  }
746  }
747 
748  if (!fCaloTriggerPatchInfoName.IsNull() && !fTriggerPatchInfo) {
749  fTriggerPatchInfo = GetArrayFromEvent(fCaloTriggerPatchInfoName.Data(),"AliEMCALTriggerPatchInfo");
750  if (!fTriggerPatchInfo) {
751  AliError(Form("%s: Could not retrieve calo trigger patch info %s!", GetName(), fCaloTriggerPatchInfoName.Data()));
752  return;
753  }
754 
755  }
756 
757  fLocalInitialized = kTRUE;
758 }
759 
766 {
767  if (fForceBeamType != kNA)
768  return fForceBeamType;
769 
770  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
771  if (esd) {
772  const AliESDRun *run = esd->GetESDRun();
773  TString beamType = run->GetBeamType();
774  if (beamType == "p-p")
775  return kpp;
776  else if (beamType == "A-A")
777  return kAA;
778  else if (beamType == "p-A")
779  return kpA;
780  else
781  return kNA;
782  } else {
783  Int_t runNumber = InputEvent()->GetRunNumber();
784  // All run number ranges taken from the RCT
785  if ((runNumber >= 136833 && runNumber <= 139517) || // LHC10h
786  (runNumber >= 167693 && runNumber <= 170593) || // LHC11h
787  (runNumber >= 244824 && runNumber <= 246994)) { // LHC15o
788  return kAA;
789  } else if ((runNumber >= 188356 && runNumber <= 188366) || // LHC12g
790  (runNumber >= 195164 && runNumber <= 197388) || // LHC13b-f
791  (runNumber >= 265015 && runNumber <= 267166)) { // LHC16q-t
792  return kpA;
793  } else {
794  return kpp;
795  }
796  }
797 }
798 
821 {
823  if (fGeneralHistograms) fHistEventRejection->Fill("PhysSel",1);
824  return kFALSE;
825  }
826 
827  if (!fSelectGeneratorName.IsNull() && !fGeneratorName.IsNull()) {
828  if (!fGeneratorName.Contains(fSelectGeneratorName)) {
829  if (fGeneralHistograms) fHistEventRejection->Fill("Evt Gen Name",1);
830  return kFALSE;
831  }
832  }
833 
834  Bool_t acceptedTrgClassFound = kFALSE;
835  if (fAcceptedTriggerClasses.size() > 0) {
836  for (auto acc_trg : fAcceptedTriggerClasses) {
837  for (auto fired_trg : fFiredTriggerClasses) {
838  if (fired_trg.find(acc_trg) != std::string::npos) {
839  acceptedTrgClassFound = kTRUE;
840  break;
841  }
842  }
843  if (acceptedTrgClassFound) break;
844  }
845 
846  if (!acceptedTrgClassFound) {
847  if (fGeneralHistograms) fHistEventRejection->Fill("Trg class (acc)",1);
848  return kFALSE;
849  }
850  }
851 
852  if (fRejectedTriggerClasses.size() > 0) {
853  for (auto rej_trg : fRejectedTriggerClasses) {
854  for (auto fired_trg : fFiredTriggerClasses) {
855  if (fired_trg.find(rej_trg) != std::string::npos) {
856  if (fGeneralHistograms) fHistEventRejection->Fill("Trg class (rej)",1);
857  return kFALSE;
858  }
859  }
860  }
861  }
862 
863  if (fMinCent < fMaxCent && fMaxCent > 0) {
864  if (fCent < fMinCent || fCent > fMaxCent) {
865  if (fGeneralHistograms) fHistEventRejection->Fill("Cent",1);
866  return kFALSE;
867  }
868  }
869 
870  if (fNVertCont < fMinNVertCont) {
871  if (fGeneralHistograms) fHistEventRejection->Fill("vertex contr.",1);
872  return kFALSE;
873  }
874 
875  if (fMinVz < fMaxVz) {
876  if (fVertex[2] < fMinVz || fVertex[2] > fMaxVz) {
877  if (fGeneralHistograms) fHistEventRejection->Fill("Vz",1);
878  return kFALSE;
879  }
880  }
881 
882  if (fMaxVzDiff >= 0) {
883  if (fNVertSPDCont > 0) {
884  Double_t vzSPD = fVertexSPD[2];
885  Double_t dvertex = TMath::Abs(fVertex[2] - vzSPD);
886  //if difference larger than fZvertexDiff
887  if (dvertex > fMaxVzDiff) {
888  if (fGeneralHistograms) fHistEventRejection->Fill("VzSPD",1);
889  return kFALSE;
890  }
891  }
892  }
893 
894  if (fMinPtHard >= 0 && fPtHard < fMinPtHard) {
895  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
896  return kFALSE;
897  }
898 
899  if (fMaxPtHard >= 0 && fPtHard >= fMaxPtHard) {
900  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
901  return kFALSE;
902  }
903 
905  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
906  return kFALSE;
907  }
908 
909  // Reject filter for MC data
910  if (!CheckMCOutliers()) {
911  if (fGeneralHistograms) fHistEventRejection->Fill("MCOutlier",1);
912  return kFALSE;
913  }
914 
915  return kTRUE;
916 }
917 
926 TClonesArray *AliAnalysisTaskEmcalLight::GetArrayFromEvent(const char *name, const char *clname)
927 {
928  TClonesArray *arr = 0;
929  TString sname(name);
930  if (!sname.IsNull()) {
931  arr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(sname));
932  if (!arr) {
933  AliWarning(Form("%s: Could not retrieve array with name %s!", GetName(), name));
934  return 0;
935  }
936  } else {
937  return 0;
938  }
939 
940  if (!clname)
941  return arr;
942 
943  TString objname(arr->GetClass()->GetName());
944  TClass cls(objname);
945  if (!cls.InheritsFrom(clname)) {
946  AliWarning(Form("%s: Objects of type %s in %s are not inherited from %s!",
947  GetName(), cls.GetName(), name, clname));
948  return 0;
949  }
950  return arr;
951 }
952 
958 {
959  fVertex[0] = 0;
960  fVertex[1] = 0;
961  fVertex[2] = 0;
962  fNVertCont = 0;
963 
964  fVertexSPD[0] = 0;
965  fVertexSPD[1] = 0;
966  fVertexSPD[2] = 0;
967  fNVertSPDCont = 0;
968 
969  fFiredTriggerClasses.clear();
970  std::stringstream firedClasses(InputEvent()->GetFiredTriggerClasses().Data());
971  while (firedClasses.good()) {
972  std::string trgClass;
973  firedClasses >> trgClass;
974  if (!trgClass.empty()) fFiredTriggerClasses.push_back(trgClass);
975  }
976 
977  if (fDataType == kESD) {
978  fFiredTriggerBitMap = static_cast<AliInputEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler())->IsEventSelected();
979  }
980  else {
981  fFiredTriggerBitMap = static_cast<AliVAODHeader*>(InputEvent()->GetHeader())->GetOfflineTrigger();
982  }
983 
984  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
985  if (vert) {
986  vert->GetXYZ(fVertex);
987  fNVertCont = vert->GetNContributors();
988  }
989 
990  const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
991  if (vertSPD) {
992  vertSPD->GetXYZ(fVertexSPD);
993  fNVertSPDCont = vertSPD->GetNContributors();
994  }
995 
997 
998  fCent = 99;
999  fCentBin = -1;
1000  fEPV0 = -999;
1001  fEPV0A = -999;
1002  fEPV0C = -999;
1003 
1005  // New centrality estimation (AliMultSelection)
1006  // See https://twiki.cern.ch/twiki/bin/viewauth/ALICE/AliMultSelectionCalibStatus for calibration status period-by-period)
1007  AliMultSelection *MultSelection = static_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
1008  if (MultSelection) {
1009  fCent = MultSelection->GetMultiplicityPercentile(fCentEst.Data());
1010  }
1011  else {
1012  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1013  }
1014  }
1015  else if (fCentralityEstimation == kOldCentrality) {
1016  // Old centrality estimation (AliCentrality, works only on Run-1 PbPb and pPb)
1017  AliCentrality *aliCent = InputEvent()->GetCentrality();
1018  if (aliCent) {
1019  fCent = aliCent->GetCentralityPercentile(fCentEst.Data());
1020  }
1021  else {
1022  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1023  }
1024  }
1025  if (!fCentBins.empty() && fCentralityEstimation != kNoCentrality) {
1026  for (auto cent_it = fCentBins.begin(); cent_it != fCentBins.end() - 1; cent_it++) {
1027  if (fCent >= *cent_it && fCent < *(cent_it+1)) fCentBin = cent_it - fCentBins.begin();
1028  }
1029  }
1030  else {
1031  fCentBin = 0;
1032  }
1033 
1034  if (fBeamType == kAA || fBeamType == kpA ) {
1035  AliEventplane *aliEP = InputEvent()->GetEventplane();
1036  if (aliEP) {
1037  fEPV0 = aliEP->GetEventplane("V0" ,InputEvent());
1038  fEPV0A = aliEP->GetEventplane("V0A",InputEvent());
1039  fEPV0C = aliEP->GetEventplane("V0C",InputEvent());
1040  } else {
1041  AliWarning(Form("%s: Could not retrieve event plane information!", GetName()));
1042  }
1043  }
1044 
1045  if (fIsPythia) {
1046  if (MCEvent()) {
1047  AliGenEventHeader* header = MCEvent()->GenEventHeader();
1048  if (header->InheritsFrom("AliGenPythiaEventHeader")) {
1049  fPythiaHeader = static_cast<AliGenPythiaEventHeader*>(header);
1050  }
1051  else if (header->InheritsFrom("AliGenCocktailEventHeader")) {
1052  AliGenCocktailEventHeader* cocktailHeader = static_cast<AliGenCocktailEventHeader*>(header);
1053  TList* headers = cocktailHeader->GetHeaders();
1054  for (auto obj : *headers) { // @suppress("Symbol is not resolved")
1055  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(obj);
1056  if (fPythiaHeader) break;
1057  }
1058  }
1059  }
1060  if (fPythiaHeader) {
1061  fPtHard = fPythiaHeader->GetPtHard();
1062  fXsection = fPythiaHeader->GetXsection();
1063  fNTrials = fPythiaHeader->Trials();
1064  }
1065  }
1066 
1067  for (auto cont_it : fParticleCollArray) cont_it.second->NextEvent(InputEvent());
1068  for (auto cont_it : fClusterCollArray) cont_it.second->NextEvent(InputEvent());
1069 
1070  return kTRUE;
1071 }
1072 
1081 AliParticleContainer* AliAnalysisTaskEmcalLight::AddParticleContainer(std::string branchName, std::string contName)
1082 {
1083  if (branchName.size() == 0) return 0;
1084 
1085  AliParticleContainer* cont = 0;
1086 
1087  if (branchName == "tracks" || branchName == "Tracks") cont = new AliTrackContainer(branchName.c_str());
1088  else if (branchName == "mcparticles") cont = new AliMCParticleContainer(branchName.c_str());
1089  else cont = new AliParticleContainer(branchName.c_str());
1090 
1091  if (contName.size() > 0) cont->SetName(contName.c_str());
1092 
1093  AdoptParticleContainer(cont);
1094 
1095  return cont;
1096 }
1097 
1106 AliClusterContainer* AliAnalysisTaskEmcalLight::AddClusterContainer(std::string branchName, std::string contName)
1107 {
1108  if (branchName.size() == 0) return 0;
1109 
1110  AliClusterContainer* cont = new AliClusterContainer(branchName.c_str());
1111 
1112  if (contName.size() > 0) cont->SetName(contName.c_str());
1113 
1114  AdoptClusterContainer(cont);
1115 
1116  return cont;
1117 }
1118 
1125 {
1126  std::map<std::string, AliParticleContainer*>::const_iterator cont_it = fParticleCollArray.find(name);
1127  if (cont_it != fParticleCollArray.end()) return cont_it->second;
1128  else return nullptr;
1129 }
1130 
1137 {
1138  std::map<std::string, AliClusterContainer*>::const_iterator cont_it = fClusterCollArray.find(name);
1139  if (cont_it != fClusterCollArray.end()) return cont_it->second;
1140  else return nullptr;
1141 }
1142 
1149 {
1150  if (!(InputEvent()->FindListObject(obj->GetName()))) {
1151  InputEvent()->AddObject(obj);
1152  }
1153  else {
1154  if (!attempt) {
1155  AliFatal(Form("%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1156  }
1157  }
1158 }
1159 
1168 {
1169 
1170  if (!fGeom) {
1171  AliWarning(Form("%s - AliAnalysisTaskEmcalBase::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1172  return kFALSE;
1173  }
1174 
1175  Double_t minPhi = fGeom->GetArm1PhiMin() - edges;
1176  Double_t maxPhi = fGeom->GetArm1PhiMax() + edges;
1177 
1178  if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1179  return kTRUE;
1180  }
1181  else {
1182  return kFALSE;
1183  }
1184 }
1185 
1187 {
1188  axis->SetBinLabel(1, "NullObject");
1189  axis->SetBinLabel(2, "Pt");
1190  axis->SetBinLabel(3, "Acceptance");
1191  axis->SetBinLabel(4, "MCLabel");
1192  axis->SetBinLabel(5, "BitMap");
1193  axis->SetBinLabel(6, "HF cut");
1194  axis->SetBinLabel(7, "Bit6");
1195  axis->SetBinLabel(8, "NotHybridTrack");
1196  axis->SetBinLabel(9, "MCFlag");
1197  axis->SetBinLabel(10, "MCGenerator");
1198  axis->SetBinLabel(11, "ChargeCut");
1199  axis->SetBinLabel(12, "MinDistanceTPCSectorEdge");
1200  axis->SetBinLabel(13, "Bit12");
1201  axis->SetBinLabel(14, "IsEMCal");
1202  axis->SetBinLabel(15, "Time");
1203  axis->SetBinLabel(16, "Energy");
1204  axis->SetBinLabel(17, "ExoticCut");
1205  axis->SetBinLabel(18, "Bit17");
1206  axis->SetBinLabel(19, "Area");
1207  axis->SetBinLabel(20, "AreaEmc");
1208  axis->SetBinLabel(21, "ZLeadingCh");
1209  axis->SetBinLabel(22, "ZLeadingEmc");
1210  axis->SetBinLabel(23, "NEF");
1211  axis->SetBinLabel(24, "MinLeadPt");
1212  axis->SetBinLabel(25, "MaxTrackPt");
1213  axis->SetBinLabel(26, "MaxClusterPt");
1214  axis->SetBinLabel(27, "Flavour");
1215  axis->SetBinLabel(28, "TagStatus");
1216  axis->SetBinLabel(29, "MinNConstituents");
1217  axis->SetBinLabel(30, "Bit29");
1218  axis->SetBinLabel(31, "Bit30");
1219  axis->SetBinLabel(32, "Bit31");
1220 }
1221 
1228 Double_t AliAnalysisTaskEmcalLight::GetParallelFraction(AliVParticle* part1, AliVParticle* part2)
1229 {
1230  TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1231  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1232  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1233  return z;
1234 }
1235 
1242 Double_t AliAnalysisTaskEmcalLight::GetParallelFraction(const TVector3& vect1, AliVParticle* part2)
1243 {
1244  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1245  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1246  return z;
1247 }
1248 
1257 void AliAnalysisTaskEmcalLight::GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
1258 {
1259  phidiff = 999;
1260  etadiff = 999;
1261 
1262  if (!t||!v) return;
1263 
1264  Double_t veta = t->GetTrackEtaOnEMCal();
1265  Double_t vphi = t->GetTrackPhiOnEMCal();
1266 
1267  Float_t pos[3] = {0};
1268  v->GetPosition(pos);
1269  TVector3 cpos(pos);
1270  Double_t ceta = cpos.Eta();
1271  Double_t cphi = cpos.Phi();
1272  etadiff=veta-ceta;
1273  phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1274 }
1275 
1282 {
1283  Byte_t ret = 0;
1284  if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1285  ret = 1;
1286  else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1287  ret = 2;
1288  else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1289  ret = 3;
1290  return ret;
1291 }
1292 
1302 Byte_t AliAnalysisTaskEmcalLight::GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2)
1303 {
1304 
1305  Int_t res = 0;
1306 
1307  if (aodTrack->TestFilterBit(filterBit1)) {
1308  res = 0;
1309  }
1310  else if (aodTrack->TestFilterBit(filterBit2)) {
1311  if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1312  res = 1;
1313  }
1314  else {
1315  res = 2;
1316  }
1317  }
1318  else {
1319  res = 3;
1320  }
1321 
1322  return res;
1323 }
1324 
1331 {
1332  EBeamType_t b = kpp;
1333  if ((runnumber >= 136833 && runnumber <= 139517) || // LHC10h Run-1 (Pb-Pb)
1334  (runnumber >= 167693 && runnumber <= 170593) || // LHC11h Run-1 (Pb-Pb)
1335  (runnumber >= 244824 && runnumber <= 246994)) { // LHC15o Run-2 (Pb-Pb)
1336  b = kAA;
1337  }
1338  else if ((runnumber > 188356 && runnumber <= 188503) || // LHC12g Run-1 (p-Pb pilot)
1339  (runnumber >= 195164 && runnumber <= 197388) || // LHC13b,c,d,e,f Run-1 (p-Pb)
1340  (runnumber >= 265077 && runnumber <= 267166)) { // LHC16 Run-2 (p-Pb)
1341  b = kpA;
1342  }
1343  return b;
1344 }
1345 
1352 {
1353  if (!fPythiaHeader || !fMCRejectFilter) return kTRUE;
1354 
1355  // Condition 1: Pythia jet / pT-hard > factor
1356  if (fPtHardAndJetPtFactor > 0.) {
1357  AliTLorentzVector jet;
1358 
1359  Int_t nTriggerJets = fPythiaHeader->NTriggerJets();
1360 
1361  AliDebug(1,Form("Njets: %d, pT Hard %f",nTriggerJets, fPtHard));
1362 
1363  Float_t tmpjet[]={0,0,0,0};
1364  for (Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1365  fPythiaHeader->TriggerJet(ijet, tmpjet);
1366 
1367  jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1368 
1369  AliDebug(1,Form("jet %d; pycell jet pT %f",ijet, jet.Pt()));
1370 
1371  //Compare jet pT and pt Hard
1372  if (jet.Pt() > fPtHardAndJetPtFactor * fPtHard) {
1373  AliInfo(Form("Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", fPtHard, jet.Pt(), fPtHardAndJetPtFactor));
1374  return kFALSE;
1375  }
1376  }
1377  }
1378  // end condition 1
1379 
1380  // Condition 2 : Reconstructed EMCal cluster pT / pT-hard > factor
1381  if (fPtHardAndClusterPtFactor > 0.) {
1382  AliClusterContainer* mccluscont = GetClusterContainer(0);
1383  if ((Bool_t)mccluscont) {
1384  for (auto cluster : mccluscont->all()) {// Not cuts applied ; use accept for cuts
1385  Float_t ecluster = cluster->E();
1386 
1387  if (ecluster > (fPtHardAndClusterPtFactor * fPtHard)) {
1388  AliInfo(Form("Reject : ecluster %2.2f, calo %d, factor %2.2f, ptHard %f",ecluster,cluster->GetType(),fPtHardAndClusterPtFactor,fPtHard));
1389  return kFALSE;
1390  }
1391  }
1392  }
1393  }
1394  // end condition 2
1395 
1396  // condition 3 : Reconstructed track pT / pT-hard >factor
1397  if (fPtHardAndTrackPtFactor > 0.) {
1398  AliMCParticleContainer* mcpartcont = dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(0));
1399  if ((Bool_t)mcpartcont) {
1400  for (auto mctrack : mcpartcont->all()) {// Not cuts applied ; use accept for cuts
1401  Float_t trackpt = mctrack->Pt();
1402  if (trackpt > (fPtHardAndTrackPtFactor * fPtHard) ) {
1403  AliInfo(Form("Reject : track %2.2f, factor %2.2f, ptHard %f", trackpt, fPtHardAndTrackPtFactor, fPtHard));
1404  return kFALSE;
1405  }
1406  }
1407  }
1408  }
1409  // end condition 3
1410 
1411  return kTRUE;
1412 }
1413 
1423 {
1424  Double_t dphi = -999;
1425  const Double_t tpi = TMath::TwoPi();
1426 
1427  if (phia < 0) phia += tpi;
1428  else if (phia > tpi) phia -= tpi;
1429  if (phib < 0) phib += tpi;
1430  else if (phib > tpi) phib -= tpi;
1431  dphi = phib - phia;
1432  if (dphi < rangeMin) dphi += tpi;
1433  else if (dphi > rangeMax) dphi -= tpi;
1434 
1435  return dphi;
1436 }
1437 
1447 void AliAnalysisTaskEmcalLight::GenerateFixedBinArray(int n, double min, double max, std::vector<double>& array, bool last)
1448 {
1449  double binWidth = (max - min) / n;
1450  double v = min;
1451  if (last) n++;
1452  for (int i = 0; i < n; i++) {
1453  array.push_back(v);
1454  v += binWidth;
1455  }
1456 }
1457 
1467 std::vector<double> AliAnalysisTaskEmcalLight::GenerateFixedBinArray(int n, double min, double max, bool last)
1468 {
1469  std::vector<double> array;
1470  GenerateFixedBinArray(n, min, max, array, last);
1471  return array;
1472 }
Bool_t fSwitchOffLHC15oFaultyBranches
Switch off faulty tree branches in LHC15o AOD trees.
AliClusterContainer * AddClusterContainer(std::string branchName, std::string contName="")
Float_t fPtHardAndJetPtFactor
Factor between ptHard and jet pT to reject/accept event.
Double_t fVertexSPD[3]
!event Svertex
TString fCaloTriggersName
name of calo triggers collection
AliEMCALGeometry * fGeom
!emcal geometry
EBeamType_t fBeamType
!event beam type
Bool_t fInhibit
!inhibit execution of the task
double Double_t
Definition: External.C:58
TClonesArray * GetArrayFromEvent(const char *name, const char *clname=0)
Float_t fXsection
!x-section from pythia header
Double_t fEPV0A
!event plane V0A
TString fSelectGeneratorName
Selects only events produced by a generator that has a name containing a string.
TH1 * fHistZVertexNoSel
!z vertex position (no event selection)
Double_t fEPV0
!event plane V0
TH1 * fHistEventCount
!incoming and selected events
TProfile * fHistXsectionVsPtHardNoSel
!x section from pythia header (no event selection)
Container with name, TClonesArray and cuts for particles.
TSystem * gSystem
Bool_t fMCRejectFilter
enable the filtering of events by tail rejection
TString fCaloTriggerPatchInfoName
trigger patch info array name
Double_t fMinVz
min vertex for event selection
New centrality estimation (AliMultSelection, see https://twiki.cern.ch/twiki/bin/viewauth/ALICE/AliMu...
TString fCentEst
name of the centrality estimator
TH1 * fHistTrialsVsPtHardNoSel
!total number of trials per pt hard bin after selection (no event selection)
UInt_t fTriggerSelectionBitMap
trigger selection bit map
TH1 * fHistCentrality
!event centrality distribution
const AliMCParticleIterableContainer all() const
std::vector< double > fCentBins
how many centrality bins
Bool_t fEventSelectionAfterRun
If kTRUE, the event selection is performed after Run() but before FillHistograms() ...
static Byte_t GetTrackType(const AliVTrack *t)
static std::vector< double > GenerateFixedBinArray(int n, double min, double max, bool last=true)
TH1 * fHistTriggerClasses
!number of events in each trigger class
TString fCaloCellsName
name of calo cell collection
TH1 * fHistEvents
!total number of events per pt hard bin
Bool_t IsTrackInEmcalAcceptance(AliVParticle *part, Double_t edges=0.9) const
std::set< std::string > fRejectedTriggerClasses
list of accepted trigger classes
TString part
use mixed event to constrain combinatorial background
Definition: InvMassFit.C:52
Double_t fMaxMinimumBiasPtHard
maximum pt hard for the minimum bias pt hard bin (MC)
Container for particles within the EMCAL framework.
static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
void AddObjectToEvent(TObject *obj, Bool_t attempt=kFALSE)
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal
EBeamType_t fForceBeamType
forced beam type
std::vector< std::string > fFiredTriggerClasses
!trigger classes fired by the current event
Bool_t fCreateHisto
whether or not create histograms
TH1 * fHistTrialsVsPtHard
!total number of trials per pt hard bin after selection
TH1 * fHistEventRejection
!book keep reasons for rejecting event
int Int_t
Definition: External.C:63
TH1 * fHistTrials
!trials from pyxsec.root
Double_t fMinPtHard
select minimum pt hard (MC)
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
Base task in the EMCAL framework (lighter version of AliAnalysisTaskEmcal)
TH1 * fHistEventsVsPtHard
!total number of events per pt hard bin after selection
TH1 * fHistTriggerClassesNoSel
!number of events in each trigger class (no event selection)
Float_t fPtHardAndClusterPtFactor
Factor between ptHard and cluster pT to reject/accept event.
Double_t fMaxVzDiff
upper limit for distance between primary and SPD vertex
Double_t fVertex[3]
!event vertex
ECentralityEstimation_t fCentralityEstimation
Centrality estimation.
TH1 * fHistCentralityNoSel
!event centrality distribution (no event selection)
AliClusterContainer * GetClusterContainer(std::string name) const
void AdoptClusterContainer(AliClusterContainer *cont)
Bool_t fIsPythia
if it is a PYTHIA production
TProfile * fHistXsection
!x section from pyxsec.root
Int_t fCentBin
!event centrality bin
Double_t fMaxCent
max centrality for event selection
ULong_t fFiredTriggerBitMap
!bit map of fired triggers
Double_t fMinNVertCont
minumum number of vertex contributors
Int_t fNVertSPDCont
!event SPD vertex number of contributors
std::set< std::string > fAcceptedTriggerClasses
list of accepted trigger classes
static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin=-TMath::Pi()/2, Double_t rMax=3 *TMath::Pi()/2)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TH1 * fHistEventPlaneNoSel
!event plane distribution (no event selection)
Bool_t PythiaInfoFromFile(const char *currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
Bool_t fLocalInitialized
!whether or not the task has been already initialized
static EBeamType_t BeamTypeFromRunNumber(Int_t runnumber)
AliParticleContainer * AddParticleContainer(std::string branchName, std::string contName="")
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
TFile * file
TList with histograms for a given trigger.
Int_t nevents[nsamples]
TH1 * fHistEventsVsPtHardNoSel
!total number of events per pt hard bin after selection (no event selection)
Int_t fNVertCont
!event vertex number of contributors
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
AliGenPythiaEventHeader * fPythiaHeader
!event Pythia header
const char Option_t
Definition: External.C:48
Float_t fPtHardAndTrackPtFactor
Factor between ptHard and track pT to reject/accept event.
AliParticleContainer * GetParticleContainer(std::string name) const
bool Bool_t
Definition: External.C:53
TH1 * fHistEventPlane
!event plane distribution
std::map< std::string, AliClusterContainer * > fClusterCollArray
cluster collection array
EBeamType_t
Switch for the beam type.
AliVCaloTrigger * fCaloTriggers
!calo triggers
TProfile * fHistXsectionVsPtHard
!x section from pythia header
Container structure for EMCAL clusters.
Container for MC-true particles within the EMCAL framework.
TString fGeneratorName
!name of the MC generator used to produce the current event (only AOD)
TH1 * fHistZVertex
!z vertex position
void AdoptParticleContainer(AliParticleContainer *cont)
virtual Bool_t FillGeneralHistograms(Bool_t eventSelected)
Double_t fMaxVz
max vertex for event selection
Double_t fCent
!event centrality
Double_t fEPV0C
!event plane V0C
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Double_t fMaxPtHard
select maximum pt hard (MC)
Old centrality estimation (AliCentrality, works only on Run-1 PbPb and pPb)
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
EDataType_t fDataType
!data type (ESD or AOD)