AliPhysics  0fdb362 (0fdb362)
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  fLocalInitialized(kFALSE),
99  fDataType(kAOD),
100  fGeom(0),
101  fCaloCells(0),
102  fCaloTriggers(0),
103  fTriggerPatchInfo(0),
104  fCent(-1),
105  fCentBin(-1),
106  fEPV0(-1.0),
107  fEPV0A(-1.0),
108  fEPV0C(-1.0),
109  fNVertCont(0),
110  fNVertSPDCont(0),
111  fFiredTriggerBitMap(0),
112  fFiredTriggerClasses(),
113  fBeamType(kNA),
114  fPythiaHeader(0),
115  fPtHardBin(-1),
116  fPtHard(0),
117  fNTrials(0),
118  fXsection(0),
119  fGeneratorName(),
120  fOutput(0),
121  fHistTrialsVsPtHardNoSel(0),
122  fHistEventsVsPtHardNoSel(0),
123  fHistXsectionVsPtHardNoSel(0),
124  fHistTriggerClassesNoSel(0),
125  fHistZVertexNoSel(0),
126  fHistCentralityNoSel(0),
127  fHistEventPlaneNoSel(0),
128  fHistTrialsVsPtHard(0),
129  fHistEventsVsPtHard(0),
130  fHistXsectionVsPtHard(0),
131  fHistTriggerClasses(0),
132  fHistZVertex(0),
133  fHistCentrality(0),
134  fHistEventPlane(0),
135  fHistEventCount(0),
136  fHistEventRejection(0),
137  fHistTrials(0),
138  fHistEvents(0),
139  fHistXsection(0)
140 {
141  fVertex[0] = 0;
142  fVertex[1] = 0;
143  fVertex[2] = 0;
144  fVertexSPD[0] = 0;
145  fVertexSPD[1] = 0;
146  fVertexSPD[2] = 0;
147 }
148 
160  AliAnalysisTaskSE(name),
161  fForceBeamType(kNA),
162  fGeneralHistograms(kFALSE),
163  fCreateHisto(kTRUE),
164  fNeedEmcalGeom(kTRUE),
165  fCentBins(6),
166  fCentralityEstimation(kNewCentrality),
167  fIsPythia(kFALSE),
168  fCaloCellsName(),
169  fCaloTriggersName(),
170  fCaloTriggerPatchInfoName(),
171  fCentEst("V0M"),
172  fParticleCollArray(),
173  fClusterCollArray(),
174  fTriggerSelectionBitMap(0),
175  fMinCent(-1),
176  fMaxCent(-1),
177  fMinVz(-999),
178  fMaxVz(999),
179  fMaxVzDiff(-1),
180  fMinNVertCont(0),
181  fMinPtHard(-1),
182  fMaxPtHard(-1),
183  fMaxMinimumBiasPtHard(-1),
184  fAcceptedTriggerClasses(),
185  fRejectedTriggerClasses(),
186  fMCRejectFilter(kFALSE),
187  fPtHardAndJetPtFactor(0.),
188  fPtHardAndClusterPtFactor(0.),
189  fPtHardAndTrackPtFactor(0.),
190  fSwitchOffLHC15oFaultyBranches(kFALSE),
191  fEventSelectionAfterRun(kFALSE),
192  fSelectGeneratorName(),
193  fLocalInitialized(kFALSE),
194  fDataType(kAOD),
195  fGeom(0),
196  fCaloCells(0),
197  fCaloTriggers(0),
198  fTriggerPatchInfo(0),
199  fCent(0),
200  fCentBin(-1),
201  fEPV0(-1.0),
202  fEPV0A(-1.0),
203  fEPV0C(-1.0),
204  fNVertCont(0),
205  fNVertSPDCont(0),
206  fFiredTriggerBitMap(0),
207  fFiredTriggerClasses(),
208  fBeamType(kNA),
209  fPythiaHeader(0),
210  fPtHardBin(-1),
211  fPtHard(0),
212  fNTrials(0),
213  fXsection(0),
214  fGeneratorName(),
215  fOutput(0),
216  fHistTrialsVsPtHardNoSel(0),
217  fHistEventsVsPtHardNoSel(0),
218  fHistXsectionVsPtHardNoSel(0),
219  fHistTriggerClassesNoSel(0),
220  fHistZVertexNoSel(0),
221  fHistCentralityNoSel(0),
222  fHistEventPlaneNoSel(0),
223  fHistTrialsVsPtHard(0),
224  fHistEventsVsPtHard(0),
225  fHistXsectionVsPtHard(0),
226  fHistTriggerClasses(0),
227  fHistZVertex(0),
228  fHistCentrality(0),
229  fHistEventPlane(0),
230  fHistEventCount(0),
231  fHistEventRejection(0),
232  fHistTrials(0),
233  fHistEvents(0),
234  fHistXsection(0)
235 {
236  fVertex[0] = 0;
237  fVertex[1] = 0;
238  fVertex[2] = 0;
239  fVertexSPD[0] = 0;
240  fVertexSPD[1] = 0;
241  fVertexSPD[2] = 0;
242 
243  fCentBins[0] = 0;
244  fCentBins[1] = 10;
245  fCentBins[2] = 30;
246  fCentBins[3] = 50;
247  fCentBins[4] = 90;
248  fCentBins[5] = 100;
249 
250  if (fCreateHisto) DefineOutput(1, TList::Class());
251 }
252 
257 {
258  for (auto cont_it : fParticleCollArray) delete cont_it.second;
259  for (auto cont_it : fClusterCollArray) delete cont_it.second;
260 }
261 
282 {
283  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
284  if (mgr) {
285  AliVEventHandler *evhand = mgr->GetInputEventHandler();
286  if (evhand) {
287  if (evhand->InheritsFrom("AliESDInputHandler")) {
288  fDataType = kESD;
289  }
290  else {
291  fDataType = kAOD;
292  }
293  }
294  else {
295  AliError("Event handler not found!");
296  }
297  }
298  else {
299  AliError("Analysis manager not found!");
300  }
301 
302  if (!fCreateHisto)
303  return;
304 
305  OpenFile(1);
306  fOutput = new TList();
307  fOutput->SetOwner(); // @suppress("Ambiguous problem")
308 
310 
311  if (!fGeneralHistograms) return;
312 
313  if (fIsPythia) {
314  fHistEventsVsPtHard = new TH1F("fHistEventsVsPtHard", "fHistEventsVsPtHard", 1000, 0, 1000);
315  fHistEventsVsPtHard->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
316  fHistEventsVsPtHard->GetYaxis()->SetTitle("events");
318 
319  fHistTrialsVsPtHard = new TH1F("fHistTrialsVsPtHard", "fHistTrialsVsPtHard", 1000, 0, 1000);
320  fHistTrialsVsPtHard->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
321  fHistTrialsVsPtHard->GetYaxis()->SetTitle("trials");
323 
324  fHistXsectionVsPtHard = new TProfile("fHistXsectionVsPtHard", "fHistXsectionVsPtHard", 1000, 0, 1000);
325  fHistXsectionVsPtHard->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
326  fHistXsectionVsPtHard->GetYaxis()->SetTitle("xsection");
328 
329  fHistEventsVsPtHardNoSel = new TH1F("fHistEventsVsPtHardNoSel", "fHistEventsVsPtHardNoSel", 1000, 0, 1000);
330  fHistEventsVsPtHardNoSel->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
331  fHistEventsVsPtHardNoSel->GetYaxis()->SetTitle("events");
333 
334  fHistTrialsVsPtHardNoSel = new TH1F("fHistTrialsVsPtHardNoSel", "fHistTrialsVsPtHardNoSel", 1000, 0, 1000);
335  fHistTrialsVsPtHardNoSel->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
336  fHistTrialsVsPtHardNoSel->GetYaxis()->SetTitle("trials");
338 
339  fHistXsectionVsPtHardNoSel = new TProfile("fHistXsectionVsPtHardNoSel", "fHistXsectionVsPtHardNoSel", 1000, 0, 1000);
340  fHistXsectionVsPtHardNoSel->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
341  fHistXsectionVsPtHardNoSel->GetYaxis()->SetTitle("xsection");
343 
344  fHistTrials = new TH1F("fHistTrials", "fHistTrials", 50, 0, 50);
345  fHistTrials->GetXaxis()->SetTitle("#it{p}_{T,hard} bin");
346  fHistTrials->GetYaxis()->SetTitle("trials");
347  fOutput->Add(fHistTrials);
348 
349  fHistEvents = new TH1F("fHistEvents", "fHistEvents", 50, 0, 50);
350  fHistEvents->GetXaxis()->SetTitle("#it{p}_{T,hard} bin");
351  fHistEvents->GetYaxis()->SetTitle("total events");
352  fOutput->Add(fHistEvents);
353 
354  fHistXsection = new TProfile("fHistXsection", "fHistXsection", 50, 0, 50);
355  fHistXsection->GetXaxis()->SetTitle("#it{p}_{T,hard} bin");
356  fHistXsection->GetYaxis()->SetTitle("xsection");
357  fOutput->Add(fHistXsection);
358  }
359 
360  fHistZVertex = new TH1F("fHistZVertex","Z vertex position", 60, -30, 30);
361  fHistZVertex->GetXaxis()->SetTitle("V_{#it{z}}");
362  fHistZVertex->GetYaxis()->SetTitle("counts");
363  fOutput->Add(fHistZVertex);
364 
365  fHistZVertexNoSel = new TH1F("fHistZVertexNoSel","Z vertex position (no event selection)", 60, -30, 30);
366  fHistZVertexNoSel->GetXaxis()->SetTitle("V_{#it{z}}");
367  fHistZVertexNoSel->GetYaxis()->SetTitle("counts");
369 
371  fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", 100, 0, 100);
372  fHistCentrality->GetXaxis()->SetTitle("Centrality (%)");
373  fHistCentrality->GetYaxis()->SetTitle("counts");
374  fOutput->Add(fHistCentrality);
375 
376  fHistCentralityNoSel = new TH1F("fHistCentralityNoSel","Event centrality distribution (no event selection)", 100, 0, 100);
377  fHistCentralityNoSel->GetXaxis()->SetTitle("Centrality (%)");
378  fHistCentralityNoSel->GetYaxis()->SetTitle("counts");
380  }
381 
382  if (fForceBeamType != kpp) {
383  fHistEventPlane = new TH1F("fHistEventPlane","Event plane", 120, -TMath::Pi(), TMath::Pi());
384  fHistEventPlane->GetXaxis()->SetTitle("event plane");
385  fHistEventPlane->GetYaxis()->SetTitle("counts");
386  fOutput->Add(fHistEventPlane);
387 
388  fHistEventPlaneNoSel = new TH1F("fHistEventPlaneNoSel","Event plane (no event selection)", 120, -TMath::Pi(), TMath::Pi());
389  fHistEventPlaneNoSel->GetXaxis()->SetTitle("event plane");
390  fHistEventPlaneNoSel->GetYaxis()->SetTitle("counts");
392  }
393 
394  fHistEventRejection = new TH1F("fHistEventRejection","Reasons to reject event",30,0,30);
395 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
396  fHistEventRejection->SetBit(TH1::kCanRebin);
397 #else
398  fHistEventRejection->SetCanExtend(TH1::kAllAxes);
399 #endif
400  std::array<std::string, 10> labels = {"PhysSel", "Evt Gen Name", "Trg class (acc)", "Trg class (rej)", "Cent", "vertex contr.", "Vz", "VzSPD", "SelPtHardBin", "MCOutlier"};
401  int i = 1;
402  for (auto label : labels) {
403  fHistEventRejection->GetXaxis()->SetBinLabel(i, label.c_str());
404  i++;
405  }
406  fHistEventRejection->GetYaxis()->SetTitle("counts");
408 
409  fHistTriggerClasses = new TH1F("fHistTriggerClasses","fHistTriggerClasses",3,0,3);
410 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
411  fHistTriggerClasses->SetBit(TH1::kCanRebin);
412 #else
413  fHistTriggerClasses->SetCanExtend(TH1::kAllAxes);
414 #endif
416 
417  fHistTriggerClassesNoSel = new TH1F("fHistTriggerClassesNoSel","fHistTriggerClassesNoSel",3,0,3);
418 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
419  fHistTriggerClassesNoSel->SetBit(TH1::kCanRebin);
420 #else
421  fHistTriggerClassesNoSel->SetCanExtend(TH1::kAllAxes);
422 #endif
424 
425  fHistEventCount = new TH1F("fHistEventCount","fHistEventCount",2,0,2);
426  fHistEventCount->GetXaxis()->SetBinLabel(1,"Accepted");
427  fHistEventCount->GetXaxis()->SetBinLabel(2,"Rejected");
428  fHistEventCount->GetYaxis()->SetTitle("counts");
429  fOutput->Add(fHistEventCount);
430 
431  PostData(1, fOutput);
432 }
433 
449 {
450  if (eventSelected) {
451  if (fIsPythia) {
452  fHistEventsVsPtHard->Fill(fPtHard, 1);
455  }
456 
457  fHistZVertex->Fill(fVertex[2]);
458 
461 
462 
463  for (auto fired_trg : fFiredTriggerClasses) fHistTriggerClasses->Fill(fired_trg.c_str(), 1);
464  }
465  else {
466  if (fIsPythia) {
470  }
471 
472  fHistZVertexNoSel->Fill(fVertex[2]);
473 
476 
477  for (auto fired_trg : fFiredTriggerClasses) fHistTriggerClassesNoSel->Fill(fired_trg.c_str(), 1);
478  }
479 
480  return kTRUE;
481 }
482 
503 {
504  if (!fLocalInitialized) ExecOnce();
505 
506  if (!fLocalInitialized) return;
507 
508  if (!RetrieveEventObjects()) return;
509 
510  Bool_t eventSelected = IsEventSelected();
511 
513  if (eventSelected) {
514  fHistEventCount->Fill("Accepted",1);
515  }
516  else {
517  fHistEventCount->Fill("Rejected",1);
518  }
519 
520  FillGeneralHistograms(kFALSE);
521  if (eventSelected) FillGeneralHistograms(kTRUE);
522  }
523 
524  Bool_t runOk = kFALSE;
525  if (eventSelected || fEventSelectionAfterRun) runOk = Run();
526 
527  if (fCreateHisto && eventSelected && runOk) FillHistograms();
528 
529  if (fCreateHisto && fOutput) {
530  // information for this iteration of the UserExec in the container
531  PostData(1, fOutput);
532  }
533 }
534 
546 Bool_t AliAnalysisTaskEmcalLight::PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
547 {
548 
549  TString file(currFile);
550  fXsec = 0;
551  fTrials = 1;
552 
553  if (file.Contains(".zip#")) {
554  Ssiz_t pos1 = file.Index("root_archive",12,0,TString::kExact);
555  Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
556  Ssiz_t pos2 = file.Index(".root",5,TString::kExact);
557  file.Replace(pos+1,pos2-pos1,"");
558  } else {
559  // not an archive take the basename....
560  file.ReplaceAll(gSystem->BaseName(file.Data()),"");
561  }
562  AliDebug(1,Form("File name: %s",file.Data()));
563 
564  // Get the pt hard bin
565  TString strPthard(file);
566 
567  strPthard.Remove(strPthard.Last('/'));
568  strPthard.Remove(strPthard.Last('/'));
569  if (strPthard.Contains("AOD")) strPthard.Remove(strPthard.Last('/'));
570  strPthard.Remove(0,strPthard.Last('/')+1);
571  if (strPthard.IsDec()) {
572  pthard = strPthard.Atoi();
573  }
574  else {
575  AliWarning(Form("Could not extract file number from path %s", strPthard.Data()));
576  pthard = -1;
577  }
578 
579  // 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
580  TFile *fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec.root"));
581 
582  if (!fxsec) {
583  // next trial fetch the histgram file
584  fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
585  if (!fxsec) {
586  // not a severe condition but inciate that we have no information
587  return kFALSE;
588  } else {
589  // find the tlist we want to be independtent of the name so use the Tkey
590  TKey* key = static_cast<TKey*>(fxsec->GetListOfKeys()->At(0));
591  if (!key) {
592  fxsec->Close();
593  return kFALSE;
594  }
595  TList *list = dynamic_cast<TList*>(key->ReadObj());
596  if (!list) {
597  fxsec->Close();
598  return kFALSE;
599  }
600  fXsec = static_cast<TProfile*>(list->FindObject("h1Xsec"))->GetBinContent(1);
601  fTrials = static_cast<TH1F*>(list->FindObject("h1Trials"))->GetBinContent(1);
602  fxsec->Close();
603  }
604  } else { // no tree pyxsec.root
605  TTree *xtree = static_cast<TTree*>(fxsec->Get("Xsection"));
606  if (!xtree) {
607  fxsec->Close();
608  return kFALSE;
609  }
610  UInt_t ntrials = 0;
611  Double_t xsection = 0;
612  xtree->SetBranchAddress("xsection",&xsection);
613  xtree->SetBranchAddress("ntrials",&ntrials);
614  xtree->GetEntry(0);
615  fTrials = ntrials;
616  fXsec = xsection;
617  fxsec->Close();
618  }
619  return kTRUE;
620 }
621 
636 {
638  return kTRUE;
639 
640  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
641  if (!tree) {
642  AliError(Form("%s - UserNotify: No current tree!",GetName()));
643  return kFALSE;
644  }
645 
646  Float_t xsection = 0;
647  Float_t trials = 0;
648  Int_t pthardbin = 0;
649 
650  TFile *curfile = tree->GetCurrentFile();
651  if (!curfile) {
652  AliError(Form("%s - UserNotify: No current file!",GetName()));
653  return kFALSE;
654  }
655 
656  TChain *chain = dynamic_cast<TChain*>(tree);
657  if (chain) tree = chain->GetTree();
658 
659  Int_t nevents = tree->GetEntriesFast();
660 
661  Bool_t res = PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
662 
663  fPtHardBin = pthardbin;
664 
665  if (!res) return kTRUE;
666 
667  fHistTrials->Fill(fPtHardBin, trials);
668  fHistXsection->Fill(fPtHardBin, xsection);
669  fHistEvents->Fill(fPtHardBin, nevents);
670 
671  return kTRUE;
672 }
673 
685 {
686  if (!InputEvent()) {
687  AliError(Form("%s: Could not retrieve event! Returning!", GetName()));
688  return;
689  }
690 
691  if (fNeedEmcalGeom && !fGeom) {
692  fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
693  if (!fGeom) {
694  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()));
695  return;
696  }
697  }
698 
699  if (fSwitchOffLHC15oFaultyBranches && dynamic_cast<AliAODEvent*>(InputEvent())) {
700  TTree *aodTree = AliAnalysisManager::GetAnalysisManager()->GetTree();
701  aodTree->SetBranchStatus("D0toKpi.fPx", 0);
702  aodTree->SetBranchStatus("D0toKpi.fPy", 0);
703  aodTree->SetBranchStatus("D0toKpi.fPz", 0);
704  aodTree->SetBranchStatus("D0toKpi.fd0", 0);
705  aodTree->SetBranchStatus("Charm3Prong.fPx", 0);
706  aodTree->SetBranchStatus("Charm3Prong.fPy", 0);
707  aodTree->SetBranchStatus("Charm3Prong.fPz", 0);
708  aodTree->SetBranchStatus("Charm3Prong.fd0", 0);
709  aodTree->SetBranchStatus("Dstar.fPx", 0);
710  aodTree->SetBranchStatus("Dstar.fPy", 0);
711  aodTree->SetBranchStatus("Dstar.fPz", 0);
712  aodTree->SetBranchStatus("Dstar.fd0", 0);
713  }
714 
715  //Load all requested track branches - each container knows name already
716  for (auto cont_it : fParticleCollArray) cont_it.second->SetArray(InputEvent());
717 
718  //Load all requested cluster branches - each container knows name already
719  for (auto cont_it : fClusterCollArray) cont_it.second->SetArray(InputEvent());
720 
721  if (!fCaloCellsName.IsNull() && !fCaloCells) {
722  fCaloCells = dynamic_cast<AliVCaloCells*>(InputEvent()->FindListObject(fCaloCellsName));
723  if (!fCaloCells) {
724  AliError(Form("%s: Could not retrieve cells %s!", GetName(), fCaloCellsName.Data()));
725  return;
726  }
727  }
728 
729  if (!fCaloTriggersName.IsNull() && !fCaloTriggers) {
730  fCaloTriggers = dynamic_cast<AliVCaloTrigger*>(InputEvent()->FindListObject(fCaloTriggersName));
731  if (!fCaloTriggers) {
732  AliError(Form("%s: Could not retrieve calo triggers %s!", GetName(), fCaloTriggersName.Data()));
733  return;
734  }
735  }
736 
737  if (!fCaloTriggerPatchInfoName.IsNull() && !fTriggerPatchInfo) {
738  fTriggerPatchInfo = GetArrayFromEvent(fCaloTriggerPatchInfoName.Data(),"AliEMCALTriggerPatchInfo");
739  if (!fTriggerPatchInfo) {
740  AliError(Form("%s: Could not retrieve calo trigger patch info %s!", GetName(), fCaloTriggerPatchInfoName.Data()));
741  return;
742  }
743 
744  }
745 
746  fLocalInitialized = kTRUE;
747 }
748 
755 {
756  if (fForceBeamType != kNA)
757  return fForceBeamType;
758 
759  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
760  if (esd) {
761  const AliESDRun *run = esd->GetESDRun();
762  TString beamType = run->GetBeamType();
763  if (beamType == "p-p")
764  return kpp;
765  else if (beamType == "A-A")
766  return kAA;
767  else if (beamType == "p-A")
768  return kpA;
769  else
770  return kNA;
771  } else {
772  Int_t runNumber = InputEvent()->GetRunNumber();
773  // All run number ranges taken from the RCT
774  if ((runNumber >= 136833 && runNumber <= 139517) || // LHC10h
775  (runNumber >= 167693 && runNumber <= 170593) || // LHC11h
776  (runNumber >= 244824 && runNumber <= 246994)) { // LHC15o
777  return kAA;
778  } else if ((runNumber >= 188356 && runNumber <= 188366) || // LHC12g
779  (runNumber >= 195164 && runNumber <= 197388) || // LHC13b-f
780  (runNumber >= 265015 && runNumber <= 267166)) { // LHC16q-t
781  return kpA;
782  } else {
783  return kpp;
784  }
785  }
786 }
787 
810 {
812  if (fGeneralHistograms) fHistEventRejection->Fill("PhysSel",1);
813  return kFALSE;
814  }
815 
816  if (!fSelectGeneratorName.IsNull() && !fGeneratorName.IsNull()) {
817  if (!fGeneratorName.Contains(fSelectGeneratorName)) {
818  if (fGeneralHistograms) fHistEventRejection->Fill("Evt Gen Name",1);
819  return kFALSE;
820  }
821  }
822 
823  Bool_t acceptedTrgClassFound = kFALSE;
824  if (fAcceptedTriggerClasses.size() > 0) {
825  for (auto acc_trg : fAcceptedTriggerClasses) {
826  for (auto fired_trg : fFiredTriggerClasses) {
827  if (fired_trg.find(acc_trg) != std::string::npos) {
828  acceptedTrgClassFound = kTRUE;
829  break;
830  }
831  }
832  if (acceptedTrgClassFound) break;
833  }
834 
835  if (!acceptedTrgClassFound) {
836  if (fGeneralHistograms) fHistEventRejection->Fill("Trg class (acc)",1);
837  return kFALSE;
838  }
839  }
840 
841  if (fRejectedTriggerClasses.size() > 0) {
842  for (auto rej_trg : fRejectedTriggerClasses) {
843  for (auto fired_trg : fFiredTriggerClasses) {
844  if (fired_trg.find(rej_trg) != std::string::npos) {
845  if (fGeneralHistograms) fHistEventRejection->Fill("Trg class (rej)",1);
846  return kFALSE;
847  }
848  }
849  }
850  }
851 
852  if (fMinCent < fMaxCent && fMaxCent > 0) {
853  if (fCent < fMinCent || fCent > fMaxCent) {
854  if (fGeneralHistograms) fHistEventRejection->Fill("Cent",1);
855  return kFALSE;
856  }
857  }
858 
859  if (fNVertCont < fMinNVertCont) {
860  if (fGeneralHistograms) fHistEventRejection->Fill("vertex contr.",1);
861  return kFALSE;
862  }
863 
864  if (fMinVz < fMaxVz) {
865  if (fVertex[2] < fMinVz || fVertex[2] > fMaxVz) {
866  if (fGeneralHistograms) fHistEventRejection->Fill("Vz",1);
867  return kFALSE;
868  }
869  }
870 
871  if (fMaxVzDiff >= 0) {
872  if (fNVertSPDCont > 0) {
873  Double_t vzSPD = fVertexSPD[2];
874  Double_t dvertex = TMath::Abs(fVertex[2] - vzSPD);
875  //if difference larger than fZvertexDiff
876  if (dvertex > fMaxVzDiff) {
877  if (fGeneralHistograms) fHistEventRejection->Fill("VzSPD",1);
878  return kFALSE;
879  }
880  }
881  }
882 
883  if (fMinPtHard >= 0 && fPtHard < fMinPtHard) {
884  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
885  return kFALSE;
886  }
887 
888  if (fMaxPtHard >= 0 && fPtHard >= fMaxPtHard) {
889  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
890  return kFALSE;
891  }
892 
894  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
895  return kFALSE;
896  }
897 
898  // Reject filter for MC data
899  if (!CheckMCOutliers()) {
900  if (fGeneralHistograms) fHistEventRejection->Fill("MCOutlier",1);
901  return kFALSE;
902  }
903 
904  return kTRUE;
905 }
906 
915 TClonesArray *AliAnalysisTaskEmcalLight::GetArrayFromEvent(const char *name, const char *clname)
916 {
917  TClonesArray *arr = 0;
918  TString sname(name);
919  if (!sname.IsNull()) {
920  arr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(sname));
921  if (!arr) {
922  AliWarning(Form("%s: Could not retrieve array with name %s!", GetName(), name));
923  return 0;
924  }
925  } else {
926  return 0;
927  }
928 
929  if (!clname)
930  return arr;
931 
932  TString objname(arr->GetClass()->GetName());
933  TClass cls(objname);
934  if (!cls.InheritsFrom(clname)) {
935  AliWarning(Form("%s: Objects of type %s in %s are not inherited from %s!",
936  GetName(), cls.GetName(), name, clname));
937  return 0;
938  }
939  return arr;
940 }
941 
947 {
948  fVertex[0] = 0;
949  fVertex[1] = 0;
950  fVertex[2] = 0;
951  fNVertCont = 0;
952 
953  fVertexSPD[0] = 0;
954  fVertexSPD[1] = 0;
955  fVertexSPD[2] = 0;
956  fNVertSPDCont = 0;
957 
958  fFiredTriggerClasses.clear();
959  std::stringstream firedClasses(InputEvent()->GetFiredTriggerClasses().Data());
960  while (firedClasses.good()) {
961  std::string trgClass;
962  firedClasses >> trgClass;
963  if (!trgClass.empty()) fFiredTriggerClasses.push_back(trgClass);
964  }
965 
966  if (fDataType == kESD) {
967  fFiredTriggerBitMap = static_cast<AliInputEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler())->IsEventSelected();
968  }
969  else {
970  fFiredTriggerBitMap = static_cast<AliVAODHeader*>(InputEvent()->GetHeader())->GetOfflineTrigger();
971  }
972 
973  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
974  if (vert) {
975  vert->GetXYZ(fVertex);
976  fNVertCont = vert->GetNContributors();
977  }
978 
979  const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
980  if (vertSPD) {
981  vertSPD->GetXYZ(fVertexSPD);
982  fNVertSPDCont = vertSPD->GetNContributors();
983  }
984 
986 
987  fCent = 99;
988  fCentBin = -1;
989  fEPV0 = -999;
990  fEPV0A = -999;
991  fEPV0C = -999;
992 
994  // New centrality estimation (AliMultSelection)
995  // See https://twiki.cern.ch/twiki/bin/viewauth/ALICE/AliMultSelectionCalibStatus for calibration status period-by-period)
996  AliMultSelection *MultSelection = static_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
997  if (MultSelection) {
998  fCent = MultSelection->GetMultiplicityPercentile(fCentEst.Data());
999  }
1000  else {
1001  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1002  }
1003  }
1004  else if (fCentralityEstimation == kOldCentrality) {
1005  // Old centrality estimation (AliCentrality, works only on Run-1 PbPb and pPb)
1006  AliCentrality *aliCent = InputEvent()->GetCentrality();
1007  if (aliCent) {
1008  fCent = aliCent->GetCentralityPercentile(fCentEst.Data());
1009  }
1010  else {
1011  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1012  }
1013  }
1014  if (!fCentBins.empty() && fCentralityEstimation != kNoCentrality) {
1015  for (auto cent_it = fCentBins.begin(); cent_it != fCentBins.end() - 1; cent_it++) {
1016  if (fCent >= *cent_it && fCent < *(cent_it+1)) fCentBin = cent_it - fCentBins.begin();
1017  }
1018  }
1019  else {
1020  fCentBin = 0;
1021  }
1022 
1023  if (fBeamType == kAA || fBeamType == kpA ) {
1024  AliEventplane *aliEP = InputEvent()->GetEventplane();
1025  if (aliEP) {
1026  fEPV0 = aliEP->GetEventplane("V0" ,InputEvent());
1027  fEPV0A = aliEP->GetEventplane("V0A",InputEvent());
1028  fEPV0C = aliEP->GetEventplane("V0C",InputEvent());
1029  } else {
1030  AliWarning(Form("%s: Could not retrieve event plane information!", GetName()));
1031  }
1032  }
1033 
1034  if (fIsPythia) {
1035  if (MCEvent()) {
1036  AliGenEventHeader* header = MCEvent()->GenEventHeader();
1037  if (header->InheritsFrom("AliGenPythiaEventHeader")) {
1038  fPythiaHeader = static_cast<AliGenPythiaEventHeader*>(header);
1039  }
1040  else if (header->InheritsFrom("AliGenCocktailEventHeader")) {
1041  AliGenCocktailEventHeader* cocktailHeader = static_cast<AliGenCocktailEventHeader*>(header);
1042  TList* headers = cocktailHeader->GetHeaders();
1043  for (auto obj : *headers) { // @suppress("Symbol is not resolved")
1044  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(obj);
1045  if (fPythiaHeader) break;
1046  }
1047  }
1048  }
1049  if (fPythiaHeader) {
1050  fPtHard = fPythiaHeader->GetPtHard();
1051  fXsection = fPythiaHeader->GetXsection();
1052  fNTrials = fPythiaHeader->Trials();
1053  }
1054  }
1055 
1056  for (auto cont_it : fParticleCollArray) cont_it.second->NextEvent(InputEvent());
1057  for (auto cont_it : fClusterCollArray) cont_it.second->NextEvent(InputEvent());
1058 
1059  return kTRUE;
1060 }
1061 
1070 AliParticleContainer* AliAnalysisTaskEmcalLight::AddParticleContainer(std::string branchName, std::string contName)
1071 {
1072  if (branchName.size() == 0) return 0;
1073 
1074  AliParticleContainer* cont = 0;
1075 
1076  if (branchName == "tracks" || branchName == "Tracks") cont = new AliTrackContainer(branchName.c_str());
1077  else if (branchName == "mcparticles") cont = new AliMCParticleContainer(branchName.c_str());
1078  else cont = new AliParticleContainer(branchName.c_str());
1079 
1080  if (contName.size() > 0) cont->SetName(contName.c_str());
1081 
1082  AdoptParticleContainer(cont);
1083 
1084  return cont;
1085 }
1086 
1095 AliClusterContainer* AliAnalysisTaskEmcalLight::AddClusterContainer(std::string branchName, std::string contName)
1096 {
1097  if (branchName.size() == 0) return 0;
1098 
1099  AliClusterContainer* cont = new AliClusterContainer(branchName.c_str());
1100 
1101  if (contName.size() > 0) cont->SetName(contName.c_str());
1102 
1103  AdoptClusterContainer(cont);
1104 
1105  return cont;
1106 }
1107 
1114 {
1115  std::map<std::string, AliParticleContainer*>::const_iterator cont_it = fParticleCollArray.find(name);
1116  if (cont_it != fParticleCollArray.end()) return cont_it->second;
1117  else return nullptr;
1118 }
1119 
1126 {
1127  std::map<std::string, AliClusterContainer*>::const_iterator cont_it = fClusterCollArray.find(name);
1128  if (cont_it != fClusterCollArray.end()) return cont_it->second;
1129  else return nullptr;
1130 }
1131 
1138 {
1139  if (!(InputEvent()->FindListObject(obj->GetName()))) {
1140  InputEvent()->AddObject(obj);
1141  }
1142  else {
1143  if (!attempt) {
1144  AliFatal(Form("%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1145  }
1146  }
1147 }
1148 
1157 {
1158 
1159  if (!fGeom) {
1160  AliWarning(Form("%s - AliAnalysisTaskEmcalBase::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1161  return kFALSE;
1162  }
1163 
1164  Double_t minPhi = fGeom->GetArm1PhiMin() - edges;
1165  Double_t maxPhi = fGeom->GetArm1PhiMax() + edges;
1166 
1167  if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1168  return kTRUE;
1169  }
1170  else {
1171  return kFALSE;
1172  }
1173 }
1174 
1176 {
1177  axis->SetBinLabel(1, "NullObject");
1178  axis->SetBinLabel(2, "Pt");
1179  axis->SetBinLabel(3, "Acceptance");
1180  axis->SetBinLabel(4, "MCLabel");
1181  axis->SetBinLabel(5, "BitMap");
1182  axis->SetBinLabel(6, "HF cut");
1183  axis->SetBinLabel(7, "Bit6");
1184  axis->SetBinLabel(8, "NotHybridTrack");
1185  axis->SetBinLabel(9, "MCFlag");
1186  axis->SetBinLabel(10, "MCGenerator");
1187  axis->SetBinLabel(11, "ChargeCut");
1188  axis->SetBinLabel(12, "MinDistanceTPCSectorEdge");
1189  axis->SetBinLabel(13, "Bit12");
1190  axis->SetBinLabel(14, "IsEMCal");
1191  axis->SetBinLabel(15, "Time");
1192  axis->SetBinLabel(16, "Energy");
1193  axis->SetBinLabel(17, "ExoticCut");
1194  axis->SetBinLabel(18, "Bit17");
1195  axis->SetBinLabel(19, "Area");
1196  axis->SetBinLabel(20, "AreaEmc");
1197  axis->SetBinLabel(21, "ZLeadingCh");
1198  axis->SetBinLabel(22, "ZLeadingEmc");
1199  axis->SetBinLabel(23, "NEF");
1200  axis->SetBinLabel(24, "MinLeadPt");
1201  axis->SetBinLabel(25, "MaxTrackPt");
1202  axis->SetBinLabel(26, "MaxClusterPt");
1203  axis->SetBinLabel(27, "Flavour");
1204  axis->SetBinLabel(28, "TagStatus");
1205  axis->SetBinLabel(29, "MinNConstituents");
1206  axis->SetBinLabel(30, "Bit29");
1207  axis->SetBinLabel(31, "Bit30");
1208  axis->SetBinLabel(32, "Bit31");
1209 }
1210 
1217 Double_t AliAnalysisTaskEmcalLight::GetParallelFraction(AliVParticle* part1, AliVParticle* part2)
1218 {
1219  TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1220  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1221  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1222  return z;
1223 }
1224 
1231 Double_t AliAnalysisTaskEmcalLight::GetParallelFraction(const TVector3& vect1, AliVParticle* part2)
1232 {
1233  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1234  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1235  return z;
1236 }
1237 
1246 void AliAnalysisTaskEmcalLight::GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
1247 {
1248  phidiff = 999;
1249  etadiff = 999;
1250 
1251  if (!t||!v) return;
1252 
1253  Double_t veta = t->GetTrackEtaOnEMCal();
1254  Double_t vphi = t->GetTrackPhiOnEMCal();
1255 
1256  Float_t pos[3] = {0};
1257  v->GetPosition(pos);
1258  TVector3 cpos(pos);
1259  Double_t ceta = cpos.Eta();
1260  Double_t cphi = cpos.Phi();
1261  etadiff=veta-ceta;
1262  phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1263 }
1264 
1271 {
1272  Byte_t ret = 0;
1273  if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1274  ret = 1;
1275  else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1276  ret = 2;
1277  else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1278  ret = 3;
1279  return ret;
1280 }
1281 
1291 Byte_t AliAnalysisTaskEmcalLight::GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2)
1292 {
1293 
1294  Int_t res = 0;
1295 
1296  if (aodTrack->TestFilterBit(filterBit1)) {
1297  res = 0;
1298  }
1299  else if (aodTrack->TestFilterBit(filterBit2)) {
1300  if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1301  res = 1;
1302  }
1303  else {
1304  res = 2;
1305  }
1306  }
1307  else {
1308  res = 3;
1309  }
1310 
1311  return res;
1312 }
1313 
1320 {
1321  EBeamType_t b = kpp;
1322  if ((runnumber >= 136833 && runnumber <= 139517) || // LHC10h Run-1 (Pb-Pb)
1323  (runnumber >= 167693 && runnumber <= 170593) || // LHC11h Run-1 (Pb-Pb)
1324  (runnumber >= 244824 && runnumber <= 246994)) { // LHC15o Run-2 (Pb-Pb)
1325  b = kAA;
1326  }
1327  else if ((runnumber > 188356 && runnumber <= 188503) || // LHC12g Run-1 (p-Pb pilot)
1328  (runnumber >= 195164 && runnumber <= 197388) || // LHC13b,c,d,e,f Run-1 (p-Pb)
1329  (runnumber >= 265077 && runnumber <= 267166)) { // LHC16 Run-2 (p-Pb)
1330  b = kpA;
1331  }
1332  return b;
1333 }
1334 
1341 {
1342  if (!fPythiaHeader || !fMCRejectFilter) return kTRUE;
1343 
1344  // Condition 1: Pythia jet / pT-hard > factor
1345  if (fPtHardAndJetPtFactor > 0.) {
1346  AliTLorentzVector jet;
1347 
1348  Int_t nTriggerJets = fPythiaHeader->NTriggerJets();
1349 
1350  AliDebug(1,Form("Njets: %d, pT Hard %f",nTriggerJets, fPtHard));
1351 
1352  Float_t tmpjet[]={0,0,0,0};
1353  for (Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1354  fPythiaHeader->TriggerJet(ijet, tmpjet);
1355 
1356  jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1357 
1358  AliDebug(1,Form("jet %d; pycell jet pT %f",ijet, jet.Pt()));
1359 
1360  //Compare jet pT and pt Hard
1361  if (jet.Pt() > fPtHardAndJetPtFactor * fPtHard) {
1362  AliInfo(Form("Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", fPtHard, jet.Pt(), fPtHardAndJetPtFactor));
1363  return kFALSE;
1364  }
1365  }
1366  }
1367  // end condition 1
1368 
1369  // Condition 2 : Reconstructed EMCal cluster pT / pT-hard > factor
1370  if (fPtHardAndClusterPtFactor > 0.) {
1371  AliClusterContainer* mccluscont = GetClusterContainer(0);
1372  if ((Bool_t)mccluscont) {
1373  for (auto cluster : mccluscont->all()) {// Not cuts applied ; use accept for cuts
1374  Float_t ecluster = cluster->E();
1375 
1376  if (ecluster > (fPtHardAndClusterPtFactor * fPtHard)) {
1377  AliInfo(Form("Reject : ecluster %2.2f, calo %d, factor %2.2f, ptHard %f",ecluster,cluster->GetType(),fPtHardAndClusterPtFactor,fPtHard));
1378  return kFALSE;
1379  }
1380  }
1381  }
1382  }
1383  // end condition 2
1384 
1385  // condition 3 : Reconstructed track pT / pT-hard >factor
1386  if (fPtHardAndTrackPtFactor > 0.) {
1387  AliMCParticleContainer* mcpartcont = dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(0));
1388  if ((Bool_t)mcpartcont) {
1389  for (auto mctrack : mcpartcont->all()) {// Not cuts applied ; use accept for cuts
1390  Float_t trackpt = mctrack->Pt();
1391  if (trackpt > (fPtHardAndTrackPtFactor * fPtHard) ) {
1392  AliInfo(Form("Reject : track %2.2f, factor %2.2f, ptHard %f", trackpt, fPtHardAndTrackPtFactor, fPtHard));
1393  return kFALSE;
1394  }
1395  }
1396  }
1397  }
1398  // end condition 3
1399 
1400  return kTRUE;
1401 }
1402 
1412 {
1413  Double_t dphi = -999;
1414  const Double_t tpi = TMath::TwoPi();
1415 
1416  if (phia < 0) phia += tpi;
1417  else if (phia > tpi) phia -= tpi;
1418  if (phib < 0) phib += tpi;
1419  else if (phib > tpi) phib -= tpi;
1420  dphi = phib - phia;
1421  if (dphi < rangeMin) dphi += tpi;
1422  else if (dphi > rangeMax) dphi -= tpi;
1423 
1424  return dphi;
1425 }
1426 
1436 void AliAnalysisTaskEmcalLight::GenerateFixedBinArray(int n, double min, double max, std::vector<double>& array, bool last)
1437 {
1438  double binWidth = (max - min) / n;
1439  double v = min;
1440  if (last) n++;
1441  for (int i = 0; i < n; i++) {
1442  array.push_back(v);
1443  v += binWidth;
1444  }
1445 }
1446 
1456 std::vector<double> AliAnalysisTaskEmcalLight::GenerateFixedBinArray(int n, double min, double max, bool last)
1457 {
1458  std::vector<double> array;
1459  GenerateFixedBinArray(n, min, max, array, last);
1460  return array;
1461 }
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
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)