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