AliPhysics  7baac56 (7baac56)
 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 
17 #include <RVersion.h>
18 #include <TClonesArray.h>
19 #include <TList.h>
20 #include <TObject.h>
21 #include <TH1F.h>
22 #include <TProfile.h>
23 #include <TSystem.h>
24 #include <TFile.h>
25 #include <TChain.h>
26 #include <TKey.h>
27 
28 #include "AliStack.h"
29 #include "AliAODEvent.h"
30 #include "AliAnalysisManager.h"
31 #include "AliCentrality.h"
32 #include "AliEMCALGeometry.h"
33 #include "AliESDEvent.h"
34 #include "AliEmcalParticle.h"
35 #include "AliEventplane.h"
36 #include "AliInputEventHandler.h"
37 #include "AliLog.h"
38 #include "AliMCParticle.h"
39 #include "AliVCluster.h"
40 #include "AliVEventHandler.h"
41 #include "AliVParticle.h"
42 #include "AliAODTrack.h"
43 #include "AliVCaloTrigger.h"
44 #include "AliGenPythiaEventHeader.h"
45 #include "AliAODMCHeader.h"
46 #include "AliMCEvent.h"
47 #include "AliEMCALTriggerPatchInfo.h"
48 
49 #include "AliMultSelection.h"
50 
52 
54 
58 
64  fForceBeamType(kNA),
65  fGeneralHistograms(kFALSE),
66  fCreateHisto(kTRUE),
67  fNeedEmcalGeom(kTRUE),
68  fCentBins(),
69  fUseNewCentralityEstimation(kFALSE),
70  fIsPythia(kFALSE),
71  fCaloCellsName(),
72  fCaloTriggersName(),
73  fCaloTriggerPatchInfoName(),
74  fCentEst("V0M"),
75  fParticleCollArray(),
76  fClusterCollArray(),
77  fTriggerSelectionBitMap(0),
78  fMinCent(-1),
79  fMaxCent(-1),
80  fMinVz(-999),
81  fMaxVz(999),
82  fMaxVzDiff(-1),
83  fMinNVertCont(0),
84  fMinPtHard(-1),
85  fMaxPtHard(-1),
86  fMaxMinimumBiasPtHard(-1),
87  fAcceptedTriggerClasses(),
88  fRejectedTriggerClasses(),
89  fMCRejectFilter(kFALSE),
90  fPtHardAndJetPtFactor(0.),
91  fPtHardAndClusterPtFactor(0.),
92  fPtHardAndTrackPtFactor(0.),
93  fSwitchOffLHC15oFaultyBranches(kFALSE),
94  fLocalInitialized(kFALSE),
95  fDataType(kAOD),
96  fGeom(0),
97  fCaloCells(0),
98  fCaloTriggers(0),
99  fTriggerPatchInfo(0),
100  fCent(-1),
101  fCentBin(-1),
102  fEPV0(-1.0),
103  fEPV0A(-1.0),
104  fEPV0C(-1.0),
105  fNVertCont(0),
106  fNVertSPDCont(0),
107  fFiredTriggerBitMap(0),
108  fFiredTriggerClasses(),
109  fBeamType(kNA),
110  fPythiaHeader(0),
111  fPtHardBin(-1),
112  fPtHard(0),
113  fNTrials(0),
114  fXsection(0),
115  fOutput(0),
116  fHistTrialsVsPtHardNoSel(0),
117  fHistEventsVsPtHardNoSel(0),
118  fHistXsectionVsPtHardNoSel(0),
119  fHistTriggerClassesNoSel(0),
120  fHistZVertexNoSel(0),
121  fHistCentralityNoSel(0),
122  fHistEventPlaneNoSel(0),
123  fHistTrialsVsPtHard(0),
124  fHistEventsVsPtHard(0),
125  fHistXsectionVsPtHard(0),
126  fHistTriggerClasses(0),
127  fHistZVertex(0),
128  fHistCentrality(0),
129  fHistEventPlane(0),
130  fHistEventCount(0),
131  fHistEventRejection(0),
132  fHistTrials(0),
133  fHistEvents(0),
134  fHistXsection(0)
135 {
136  fVertex[0] = 0;
137  fVertex[1] = 0;
138  fVertex[2] = 0;
139  fVertexSPD[0] = 0;
140  fVertexSPD[1] = 0;
141  fVertexSPD[2] = 0;
142 }
143 
155  AliAnalysisTaskSE(name),
156  fForceBeamType(kNA),
157  fGeneralHistograms(kFALSE),
158  fCreateHisto(kTRUE),
159  fNeedEmcalGeom(kTRUE),
160  fCentBins(6),
161  fUseNewCentralityEstimation(kFALSE),
162  fIsPythia(kFALSE),
163  fCaloCellsName(),
164  fCaloTriggersName(),
165  fCaloTriggerPatchInfoName(),
166  fCentEst("V0M"),
167  fParticleCollArray(),
168  fClusterCollArray(),
169  fTriggerSelectionBitMap(0),
170  fMinCent(-1),
171  fMaxCent(-1),
172  fMinVz(-999),
173  fMaxVz(999),
174  fMaxVzDiff(-1),
175  fMinNVertCont(0),
176  fMinPtHard(-1),
177  fMaxPtHard(-1),
178  fMaxMinimumBiasPtHard(-1),
179  fAcceptedTriggerClasses(),
180  fRejectedTriggerClasses(),
181  fMCRejectFilter(kFALSE),
182  fPtHardAndJetPtFactor(0.),
183  fPtHardAndClusterPtFactor(0.),
184  fPtHardAndTrackPtFactor(0.),
185  fSwitchOffLHC15oFaultyBranches(kFALSE),
186  fLocalInitialized(kFALSE),
187  fDataType(kAOD),
188  fGeom(0),
189  fCaloCells(0),
190  fCaloTriggers(0),
191  fTriggerPatchInfo(0),
192  fCent(0),
193  fCentBin(-1),
194  fEPV0(-1.0),
195  fEPV0A(-1.0),
196  fEPV0C(-1.0),
197  fNVertCont(0),
198  fNVertSPDCont(0),
199  fFiredTriggerBitMap(0),
200  fFiredTriggerClasses(),
201  fBeamType(kNA),
202  fPythiaHeader(0),
203  fPtHardBin(-1),
204  fPtHard(0),
205  fNTrials(0),
206  fXsection(0),
207  fOutput(0),
208  fHistTrialsVsPtHardNoSel(0),
209  fHistEventsVsPtHardNoSel(0),
210  fHistXsectionVsPtHardNoSel(0),
211  fHistTriggerClassesNoSel(0),
212  fHistZVertexNoSel(0),
213  fHistCentralityNoSel(0),
214  fHistEventPlaneNoSel(0),
215  fHistTrialsVsPtHard(0),
216  fHistEventsVsPtHard(0),
217  fHistXsectionVsPtHard(0),
218  fHistTriggerClasses(0),
219  fHistZVertex(0),
220  fHistCentrality(0),
221  fHistEventPlane(0),
222  fHistEventCount(0),
223  fHistEventRejection(0),
224  fHistTrials(0),
225  fHistEvents(0),
226  fHistXsection(0)
227 {
228  fVertex[0] = 0;
229  fVertex[1] = 0;
230  fVertex[2] = 0;
231  fVertexSPD[0] = 0;
232  fVertexSPD[1] = 0;
233  fVertexSPD[2] = 0;
234 
235  fCentBins[0] = 0;
236  fCentBins[1] = 10;
237  fCentBins[2] = 30;
238  fCentBins[3] = 50;
239  fCentBins[4] = 90;
240  fCentBins[5] = 100;
241 
242  if (fCreateHisto) DefineOutput(1, TList::Class());
243 }
244 
249 {
250  for (auto cont_it : fParticleCollArray) delete cont_it.second;
251  for (auto cont_it : fClusterCollArray) delete cont_it.second;
252 }
253 
274 {
275  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
276  if (mgr) {
277  AliVEventHandler *evhand = mgr->GetInputEventHandler();
278  if (evhand) {
279  if (evhand->InheritsFrom("AliESDInputHandler")) {
280  fDataType = kESD;
281  }
282  else {
283  fDataType = kAOD;
284  }
285  }
286  else {
287  AliError("Event handler not found!");
288  }
289  }
290  else {
291  AliError("Analysis manager not found!");
292  }
293 
294  if (!fCreateHisto)
295  return;
296 
297  OpenFile(1);
298  fOutput = new TList();
299  fOutput->SetOwner();
300 
301  if (fForceBeamType == kpp) fCentBins.clear();
302 
303  if (!fGeneralHistograms)
304  return;
305 
306  if (fIsPythia) {
307  fHistEventsVsPtHard = new TH1F("fHistEventsVsPtHard", "fHistEventsVsPtHard", 1000, 0, 1000);
308  fHistEventsVsPtHard->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
309  fHistEventsVsPtHard->GetYaxis()->SetTitle("events");
311 
312  fHistTrialsVsPtHard = new TH1F("fHistTrialsVsPtHard", "fHistTrialsVsPtHard", 1000, 0, 1000);
313  fHistTrialsVsPtHard->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
314  fHistTrialsVsPtHard->GetYaxis()->SetTitle("trials");
316 
317  fHistXsectionVsPtHard = new TProfile("fHistXsectionVsPtHard", "fHistXsectionVsPtHard", 1000, 0, 1000);
318  fHistXsectionVsPtHard->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
319  fHistXsectionVsPtHard->GetYaxis()->SetTitle("xsection");
321 
322  fHistEventsVsPtHardNoSel = new TH1F("fHistEventsVsPtHardNoSel", "fHistEventsVsPtHardNoSel", 1000, 0, 1000);
323  fHistEventsVsPtHardNoSel->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
324  fHistEventsVsPtHardNoSel->GetYaxis()->SetTitle("events");
326 
327  fHistTrialsVsPtHardNoSel = new TH1F("fHistTrialsVsPtHardNoSel", "fHistTrialsVsPtHardNoSel", 1000, 0, 1000);
328  fHistTrialsVsPtHardNoSel->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
329  fHistTrialsVsPtHardNoSel->GetYaxis()->SetTitle("trials");
331 
332  fHistXsectionVsPtHardNoSel = new TProfile("fHistXsectionVsPtHardNoSel", "fHistXsectionVsPtHardNoSel", 1000, 0, 1000);
333  fHistXsectionVsPtHardNoSel->GetXaxis()->SetTitle("#it{p}_{T,hard} (GeV/#it{c})");
334  fHistXsectionVsPtHardNoSel->GetYaxis()->SetTitle("xsection");
336 
337  fHistTrials = new TH1F("fHistTrials", "fHistTrials", 50, 0, 50);
338  fHistTrials->GetXaxis()->SetTitle("#it{p}_{T,hard} bin");
339  fHistTrials->GetYaxis()->SetTitle("trials");
340  fOutput->Add(fHistTrials);
341 
342  fHistEvents = new TH1F("fHistEvents", "fHistEvents", 50, 0, 50);
343  fHistEvents->GetXaxis()->SetTitle("#it{p}_{T,hard} bin");
344  fHistEvents->GetYaxis()->SetTitle("total events");
345  fOutput->Add(fHistEvents);
346 
347  fHistXsection = new TProfile("fHistXsection", "fHistXsection", 50, 0, 50);
348  fHistXsection->GetXaxis()->SetTitle("#it{p}_{T,hard} bin");
349  fHistXsection->GetYaxis()->SetTitle("xsection");
350  fOutput->Add(fHistXsection);
351  }
352 
353  fHistZVertex = new TH1F("fHistZVertex","Z vertex position", 60, -30, 30);
354  fHistZVertex->GetXaxis()->SetTitle("V_{#it{z}}");
355  fHistZVertex->GetYaxis()->SetTitle("counts");
356  fOutput->Add(fHistZVertex);
357 
358  fHistZVertexNoSel = new TH1F("fHistZVertexNoSel","Z vertex position (no event selection)", 60, -30, 30);
359  fHistZVertexNoSel->GetXaxis()->SetTitle("V_{#it{z}}");
360  fHistZVertexNoSel->GetYaxis()->SetTitle("counts");
362 
363  if (fForceBeamType != kpp) {
364  fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", 101, 0, 101);
365  fHistCentrality->GetXaxis()->SetTitle("Centrality (%)");
366  fHistCentrality->GetYaxis()->SetTitle("counts");
367  fOutput->Add(fHistCentrality);
368 
369  fHistCentralityNoSel = new TH1F("fHistCentralityNoSel","Event centrality distribution (no event selection)", 101, 0, 101);
370  fHistCentralityNoSel->GetXaxis()->SetTitle("Centrality (%)");
371  fHistCentralityNoSel->GetYaxis()->SetTitle("counts");
373 
374  fHistEventPlane = new TH1F("fHistEventPlane","Event plane", 120, -TMath::Pi(), TMath::Pi());
375  fHistEventPlane->GetXaxis()->SetTitle("event plane");
376  fHistEventPlane->GetYaxis()->SetTitle("counts");
377  fOutput->Add(fHistEventPlane);
378 
379  fHistEventPlaneNoSel = new TH1F("fHistEventPlaneNoSel","Event plane (no event selection)", 120, -TMath::Pi(), TMath::Pi());
380  fHistEventPlaneNoSel->GetXaxis()->SetTitle("event plane");
381  fHistEventPlaneNoSel->GetYaxis()->SetTitle("counts");
383  }
384 
385  fHistEventRejection = new TH1F("fHistEventRejection","Reasons to reject event",20,0,20);
386 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
387  fHistEventRejection->SetBit(TH1::kCanRebin);
388 #else
389  fHistEventRejection->SetCanExtend(TH1::kAllAxes);
390 #endif
391  fHistEventRejection->GetXaxis()->SetBinLabel(1,"PhysSel");
392  fHistEventRejection->GetXaxis()->SetBinLabel(2,"trigger");
393  fHistEventRejection->GetXaxis()->SetBinLabel(3,"trigTypeSel");
394  fHistEventRejection->GetXaxis()->SetBinLabel(4,"Cent");
395  fHistEventRejection->GetXaxis()->SetBinLabel(5,"vertex contr.");
396  fHistEventRejection->GetXaxis()->SetBinLabel(6,"Vz");
397  fHistEventRejection->GetXaxis()->SetBinLabel(7,"VzSPD");
398  fHistEventRejection->GetXaxis()->SetBinLabel(8,"trackInEmcal");
399  fHistEventRejection->GetXaxis()->SetBinLabel(9,"minNTrack");
400  fHistEventRejection->GetXaxis()->SetBinLabel(10,"VtxSel2013pA");
401  fHistEventRejection->GetXaxis()->SetBinLabel(11,"PileUp");
402  fHistEventRejection->GetXaxis()->SetBinLabel(12,"EvtPlane");
403  fHistEventRejection->GetXaxis()->SetBinLabel(13,"SelPtHardBin");
404  fHistEventRejection->GetXaxis()->SetBinLabel(14,"Bkg evt");
405  fHistEventRejection->GetXaxis()->SetBinLabel(14,"MCOutlier");
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 
459  if (fForceBeamType != kpp) {
460  fHistCentrality->Fill(fCent);
461  fHistEventPlane->Fill(fEPV0);
462  }
463 
464  for (auto fired_trg : fFiredTriggerClasses) fHistTriggerClasses->Fill(fired_trg.c_str(), 1);
465  }
466  else {
467  if (fIsPythia) {
471  }
472 
473  fHistZVertexNoSel->Fill(fVertex[2]);
474 
475  if (fForceBeamType != kpp) {
478  }
479 
480  for (auto fired_trg : fFiredTriggerClasses) fHistTriggerClassesNoSel->Fill(fired_trg.c_str(), 1);
481  }
482 
483  return kTRUE;
484 }
485 
506 {
507  if (!fLocalInitialized)
508  ExecOnce();
509 
510  if (!fLocalInitialized)
511  return;
512 
513  if (!RetrieveEventObjects())
514  return;
515 
516  FillGeneralHistograms(kFALSE);
517 
518  if (IsEventSelected()) {
519  if (fGeneralHistograms) fHistEventCount->Fill("Accepted",1);
520  }
521  else {
522  if (fGeneralHistograms) fHistEventCount->Fill("Rejected",1);
523  return;
524  }
525 
527  if (!FillGeneralHistograms(kTRUE))
528  return;
529  }
530 
531  if (!Run())
532  return;
533 
534  if (fCreateHisto) {
535  if (!FillHistograms())
536  return;
537  }
538 
539  if (fCreateHisto && fOutput) {
540  // information for this iteration of the UserExec in the container
541  PostData(1, fOutput);
542  }
543 }
544 
556 Bool_t AliAnalysisTaskEmcalLight::PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
557 {
558 
559  TString file(currFile);
560  fXsec = 0;
561  fTrials = 1;
562 
563  if (file.Contains(".zip#")) {
564  Ssiz_t pos1 = file.Index("root_archive",12,0,TString::kExact);
565  Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
566  Ssiz_t pos2 = file.Index(".root",5,TString::kExact);
567  file.Replace(pos+1,pos2-pos1,"");
568  } else {
569  // not an archive take the basename....
570  file.ReplaceAll(gSystem->BaseName(file.Data()),"");
571  }
572  AliDebug(1,Form("File name: %s",file.Data()));
573 
574  // Get the pt hard bin
575  TString strPthard(file);
576 
577  strPthard.Remove(strPthard.Last('/'));
578  strPthard.Remove(strPthard.Last('/'));
579  if (strPthard.Contains("AOD")) strPthard.Remove(strPthard.Last('/'));
580  strPthard.Remove(0,strPthard.Last('/')+1);
581  if (strPthard.IsDec()) {
582  pthard = strPthard.Atoi();
583  }
584  else {
585  AliWarning(Form("Could not extract file number from path %s", strPthard.Data()));
586  pthard = -1;
587  }
588 
589  // 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
590  TFile *fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec.root"));
591 
592  if (!fxsec) {
593  // next trial fetch the histgram file
594  fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
595  if (!fxsec) {
596  // not a severe condition but inciate that we have no information
597  return kFALSE;
598  } else {
599  // find the tlist we want to be independtent of the name so use the Tkey
600  TKey* key = static_cast<TKey*>(fxsec->GetListOfKeys()->At(0));
601  if (!key) {
602  fxsec->Close();
603  return kFALSE;
604  }
605  TList *list = dynamic_cast<TList*>(key->ReadObj());
606  if (!list) {
607  fxsec->Close();
608  return kFALSE;
609  }
610  fXsec = static_cast<TProfile*>(list->FindObject("h1Xsec"))->GetBinContent(1);
611  fTrials = static_cast<TH1F*>(list->FindObject("h1Trials"))->GetBinContent(1);
612  fxsec->Close();
613  }
614  } else { // no tree pyxsec.root
615  TTree *xtree = static_cast<TTree*>(fxsec->Get("Xsection"));
616  if (!xtree) {
617  fxsec->Close();
618  return kFALSE;
619  }
620  UInt_t ntrials = 0;
621  Double_t xsection = 0;
622  xtree->SetBranchAddress("xsection",&xsection);
623  xtree->SetBranchAddress("ntrials",&ntrials);
624  xtree->GetEntry(0);
625  fTrials = ntrials;
626  fXsec = xsection;
627  fxsec->Close();
628  }
629  return kTRUE;
630 }
631 
646 {
648  return kTRUE;
649 
650  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
651  if (!tree) {
652  AliError(Form("%s - UserNotify: No current tree!",GetName()));
653  return kFALSE;
654  }
655 
656  Float_t xsection = 0;
657  Float_t trials = 0;
658  Int_t pthardbin = 0;
659 
660  TFile *curfile = tree->GetCurrentFile();
661  if (!curfile) {
662  AliError(Form("%s - UserNotify: No current file!",GetName()));
663  return kFALSE;
664  }
665 
666  TChain *chain = dynamic_cast<TChain*>(tree);
667  if (chain) tree = chain->GetTree();
668 
669  Int_t nevents = tree->GetEntriesFast();
670 
671  Bool_t res = PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
672 
673  fPtHardBin = pthardbin;
674 
675  if (!res) return kTRUE;
676 
677  fHistTrials->Fill(fPtHardBin, trials);
678  fHistXsection->Fill(fPtHardBin, xsection);
679  fHistEvents->Fill(fPtHardBin, nevents);
680 
681  return kTRUE;
682 }
683 
695 {
696  if (!InputEvent()) {
697  AliError(Form("%s: Could not retrieve event! Returning!", GetName()));
698  return;
699  }
700 
701  if (fNeedEmcalGeom) {
702  fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
703  if (!fGeom) {
704  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()));
705  return;
706  }
707  }
708 
709  if (fSwitchOffLHC15oFaultyBranches && dynamic_cast<AliAODEvent*>(InputEvent())) {
710  TTree *aodTree = AliAnalysisManager::GetAnalysisManager()->GetTree();
711  aodTree->SetBranchStatus("D0toKpi.fPx", 0);
712  aodTree->SetBranchStatus("D0toKpi.fPy", 0);
713  aodTree->SetBranchStatus("D0toKpi.fPz", 0);
714  aodTree->SetBranchStatus("D0toKpi.fd0", 0);
715  aodTree->SetBranchStatus("Charm3Prong.fPx", 0);
716  aodTree->SetBranchStatus("Charm3Prong.fPy", 0);
717  aodTree->SetBranchStatus("Charm3Prong.fPz", 0);
718  aodTree->SetBranchStatus("Charm3Prong.fd0", 0);
719  aodTree->SetBranchStatus("Dstar.fPx", 0);
720  aodTree->SetBranchStatus("Dstar.fPy", 0);
721  aodTree->SetBranchStatus("Dstar.fPz", 0);
722  aodTree->SetBranchStatus("Dstar.fd0", 0);
723  }
724 
725  //Load all requested track branches - each container knows name already
726  for (auto cont_it : fParticleCollArray) cont_it.second->SetArray(InputEvent());
727 
728  //Load all requested cluster branches - each container knows name already
729  for (auto cont_it : fClusterCollArray) cont_it.second->SetArray(InputEvent());
730 
731  if (!fCaloCellsName.IsNull() && !fCaloCells) {
732  fCaloCells = dynamic_cast<AliVCaloCells*>(InputEvent()->FindListObject(fCaloCellsName));
733  if (!fCaloCells) {
734  AliError(Form("%s: Could not retrieve cells %s!", GetName(), fCaloCellsName.Data()));
735  return;
736  }
737  }
738 
739  if (!fCaloTriggersName.IsNull() && !fCaloTriggers) {
740  fCaloTriggers = dynamic_cast<AliVCaloTrigger*>(InputEvent()->FindListObject(fCaloTriggersName));
741  if (!fCaloTriggers) {
742  AliError(Form("%s: Could not retrieve calo triggers %s!", GetName(), fCaloTriggersName.Data()));
743  return;
744  }
745  }
746 
747  if (!fCaloTriggerPatchInfoName.IsNull() && !fTriggerPatchInfo) {
748  fTriggerPatchInfo = GetArrayFromEvent(fCaloTriggerPatchInfoName.Data(),"AliEMCALTriggerPatchInfo");
749  if (!fTriggerPatchInfo) {
750  AliError(Form("%s: Could not retrieve calo trigger patch info %s!", GetName(), fCaloTriggerPatchInfoName.Data()));
751  return;
752  }
753 
754  }
755 
756  fLocalInitialized = kTRUE;
757 }
758 
765 {
766  if (fForceBeamType != kNA)
767  return fForceBeamType;
768 
769  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
770  if (esd) {
771  const AliESDRun *run = esd->GetESDRun();
772  TString beamType = run->GetBeamType();
773  if (beamType == "p-p")
774  return kpp;
775  else if (beamType == "A-A")
776  return kAA;
777  else if (beamType == "p-A")
778  return kpA;
779  else
780  return kNA;
781  } else {
782  Int_t runNumber = InputEvent()->GetRunNumber();
783  // All run number ranges taken from the RCT
784  if ((runNumber >= 136833 && runNumber <= 139517) || // LHC10h
785  (runNumber >= 167693 && runNumber <= 170593) || // LHC11h
786  (runNumber >= 244824 && runNumber <= 246994)) { // LHC15o
787  return kAA;
788  } else if ((runNumber >= 188356 && runNumber <= 188366) || // LHC12g
789  (runNumber >= 195164 && runNumber <= 197388) || // LHC13b-f
790  (runNumber >= 265015 && runNumber <= 267166)) { // LHC16q-t
791  return kpA;
792  } else {
793  return kpp;
794  }
795  }
796 }
797 
820 {
822  if (fGeneralHistograms) fHistEventRejection->Fill("PhysSel",1);
823  return kFALSE;
824  }
825 
826  Bool_t acceptedTrgClassFound = kFALSE;
827  if (fAcceptedTriggerClasses.size() > 0) {
828  for (auto acc_trg : fAcceptedTriggerClasses) {
829  for (auto fired_trg : fFiredTriggerClasses) {
830  if (fired_trg.find(acc_trg) != std::string::npos) {
831  acceptedTrgClassFound = kTRUE;
832  break;
833  }
834  }
835  if (acceptedTrgClassFound) break;
836  }
837 
838  if (!acceptedTrgClassFound) {
839  if (fGeneralHistograms) fHistEventRejection->Fill("Trg class (acc)",1);
840  return kFALSE;
841  }
842  }
843 
844  if (fRejectedTriggerClasses.size() > 0) {
845  for (auto rej_trg : fRejectedTriggerClasses) {
846  for (auto fired_trg : fFiredTriggerClasses) {
847  if (fired_trg.find(rej_trg) != std::string::npos) {
848  if (fGeneralHistograms) fHistEventRejection->Fill("Trg class (rej)",1);
849  return kFALSE;
850  }
851  }
852  }
853  }
854 
855  if (fMinCent < fMaxCent && fMaxCent > 0) {
856  if (fCent < fMinCent || fCent > fMaxCent) {
857  if (fGeneralHistograms) fHistEventRejection->Fill("Cent",1);
858  return kFALSE;
859  }
860  }
861 
862  if (fNVertCont < fMinNVertCont) {
863  if (fGeneralHistograms) fHistEventRejection->Fill("vertex contr.",1);
864  return kFALSE;
865  }
866 
867  if (fMinVz < fMaxVz) {
868  if (fVertex[2] < fMinVz || fVertex[2] > fMaxVz) {
869  if (fGeneralHistograms) fHistEventRejection->Fill("Vz",1);
870  return kFALSE;
871  }
872  }
873 
874  if (fMaxVzDiff >= 0) {
875  if (fNVertSPDCont > 0) {
876  Double_t vzSPD = fVertexSPD[2];
877  Double_t dvertex = TMath::Abs(fVertex[2] - vzSPD);
878  //if difference larger than fZvertexDiff
879  if (dvertex > fMaxVzDiff) {
880  if (fGeneralHistograms) fHistEventRejection->Fill("VzSPD",1);
881  return kFALSE;
882  }
883  }
884  }
885 
886  if (fMinPtHard >= 0 && fPtHard < fMinPtHard) {
887  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
888  return kFALSE;
889  }
890 
891  if (fMaxPtHard >= 0 && fPtHard >= fMaxPtHard) {
892  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
893  return kFALSE;
894  }
895 
897  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
898  return kFALSE;
899  }
900 
901  // Reject filter for MC data
902  if (!CheckMCOutliers()) {
903  if (fGeneralHistograms) fHistEventRejection->Fill("MCOutlier",1);
904  return kFALSE;
905  }
906 
907  return kTRUE;
908 }
909 
918 TClonesArray *AliAnalysisTaskEmcalLight::GetArrayFromEvent(const char *name, const char *clname)
919 {
920  TClonesArray *arr = 0;
921  TString sname(name);
922  if (!sname.IsNull()) {
923  arr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(sname));
924  if (!arr) {
925  AliWarning(Form("%s: Could not retrieve array with name %s!", GetName(), name));
926  return 0;
927  }
928  } else {
929  return 0;
930  }
931 
932  if (!clname)
933  return arr;
934 
935  TString objname(arr->GetClass()->GetName());
936  TClass cls(objname);
937  if (!cls.InheritsFrom(clname)) {
938  AliWarning(Form("%s: Objects of type %s in %s are not inherited from %s!",
939  GetName(), cls.GetName(), name, clname));
940  return 0;
941  }
942  return arr;
943 }
944 
950 {
951  fVertex[0] = 0;
952  fVertex[1] = 0;
953  fVertex[2] = 0;
954  fNVertCont = 0;
955 
956  fVertexSPD[0] = 0;
957  fVertexSPD[1] = 0;
958  fVertexSPD[2] = 0;
959  fNVertSPDCont = 0;
960 
961  fFiredTriggerClasses.clear();
962  std::stringstream firedClasses(InputEvent()->GetFiredTriggerClasses().Data());
963  while (firedClasses.good()) {
964  std::string trgClass;
965  firedClasses >> trgClass;
966  if (!trgClass.empty()) fFiredTriggerClasses.push_back(trgClass);
967  }
968 
969  if (fDataType == kESD) {
970  fFiredTriggerBitMap = static_cast<AliInputEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler())->IsEventSelected();
971  }
972  else {
973  fFiredTriggerBitMap = static_cast<AliVAODHeader*>(InputEvent()->GetHeader())->GetOfflineTrigger();
974  }
975 
976  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
977  if (vert) {
978  vert->GetXYZ(fVertex);
979  fNVertCont = vert->GetNContributors();
980  }
981 
982  const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
983  if (vertSPD) {
984  vertSPD->GetXYZ(fVertexSPD);
985  fNVertSPDCont = vertSPD->GetNContributors();
986  }
987 
989 
990  fCent = 99;
991  fCentBin = 0;
992  fEPV0 = -999;
993  fEPV0A = -999;
994  fEPV0C = -999;
995 
996  if (fBeamType == kAA || fBeamType == kpA ) {
998  AliMultSelection *MultSelection = static_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
999  if (MultSelection) {
1000  fCent = MultSelection->GetMultiplicityPercentile(fCentEst.Data());
1001  }
1002  else {
1003  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1004  }
1005  }
1006  else { // old centrality estimation < 2015
1007  AliCentrality *aliCent = InputEvent()->GetCentrality();
1008  if (aliCent) {
1009  fCent = aliCent->GetCentralityPercentile(fCentEst.Data());
1010  }
1011  else {
1012  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1013  }
1014  }
1015 
1016  fCentBin = -1;
1017  for (auto cent_it = fCentBins.begin(); cent_it != fCentBins.end() - 1; cent_it++) {
1018  if (fCent >= *cent_it && fCent < *(cent_it+1)) fCentBin = cent_it - fCentBins.begin();
1019  }
1020 
1021  AliEventplane *aliEP = InputEvent()->GetEventplane();
1022  if (aliEP) {
1023  fEPV0 = aliEP->GetEventplane("V0" ,InputEvent());
1024  fEPV0A = aliEP->GetEventplane("V0A",InputEvent());
1025  fEPV0C = aliEP->GetEventplane("V0C",InputEvent());
1026  } else {
1027  AliWarning(Form("%s: Could not retrieve event plane information!", GetName()));
1028  }
1029  }
1030 
1031  if (fIsPythia) {
1032  if (MCEvent()) {
1033  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
1034  if (!fPythiaHeader) {
1035  // Check if AOD
1036  AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1037 
1038  if (aodMCH) {
1039  for (UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1040  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
1041  if (fPythiaHeader) break;
1042  }
1043  }
1044  }
1045  }
1046 
1047  if (fPythiaHeader) {
1048  fPtHard = fPythiaHeader->GetPtHard();
1049  fXsection = fPythiaHeader->GetXsection();
1050  fNTrials = fPythiaHeader->Trials();
1051  }
1052  }
1053 
1054  for (auto cont_it : fParticleCollArray) cont_it.second->NextEvent();
1055  for (auto cont_it : fClusterCollArray) cont_it.second->NextEvent();
1056 
1057  return kTRUE;
1058 }
1059 
1068 AliParticleContainer* AliAnalysisTaskEmcalLight::AddParticleContainer(std::string branchName, std::string contName)
1069 {
1070  if (branchName.size() == 0) return 0;
1071 
1072  AliParticleContainer* cont = 0;
1073 
1074  if (branchName == "tracks" || branchName == "Tracks") cont = new AliTrackContainer(branchName.c_str());
1075  else if (branchName == "mcparticles") cont = new AliMCParticleContainer(branchName.c_str());
1076  else cont = new AliParticleContainer(branchName.c_str());
1077 
1078  if (contName.size() > 0) cont->SetName(contName.c_str());
1079 
1080  AdoptParticleContainer(cont);
1081 
1082  return cont;
1083 }
1084 
1093 AliClusterContainer* AliAnalysisTaskEmcalLight::AddClusterContainer(std::string branchName, std::string contName)
1094 {
1095  if (branchName.size() == 0) return 0;
1096 
1097  AliClusterContainer* cont = new AliClusterContainer(branchName.c_str());
1098 
1099  if (contName.size() > 0) cont->SetName(contName.c_str());
1100 
1101  AdoptClusterContainer(cont);
1102 
1103  return cont;
1104 }
1105 
1112 {
1113  std::map<std::string, AliParticleContainer*>::const_iterator cont_it = fParticleCollArray.find(name);
1114  if (cont_it != fParticleCollArray.end()) return cont_it->second;
1115  else return nullptr;
1116 }
1117 
1124 {
1125  std::map<std::string, AliClusterContainer*>::const_iterator cont_it = fClusterCollArray.find(name);
1126  if (cont_it != fClusterCollArray.end()) return cont_it->second;
1127  else return nullptr;
1128 }
1129 
1136 {
1137  if (!(InputEvent()->FindListObject(obj->GetName()))) {
1138  InputEvent()->AddObject(obj);
1139  }
1140  else {
1141  if (!attempt) {
1142  AliFatal(Form("%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1143  }
1144  }
1145 }
1146 
1155 {
1156 
1157  if (!fGeom) {
1158  AliWarning(Form("%s - AliAnalysisTaskEmcalBase::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1159  return kFALSE;
1160  }
1161 
1162  Double_t minPhi = fGeom->GetArm1PhiMin() - edges;
1163  Double_t maxPhi = fGeom->GetArm1PhiMax() + edges;
1164 
1165  if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1166  return kTRUE;
1167  }
1168  else {
1169  return kFALSE;
1170  }
1171 }
1172 
1174 {
1175  axis->SetBinLabel(1, "NullObject");
1176  axis->SetBinLabel(2, "Pt");
1177  axis->SetBinLabel(3, "Acceptance");
1178  axis->SetBinLabel(4, "MCLabel");
1179  axis->SetBinLabel(5, "BitMap");
1180  axis->SetBinLabel(6, "HF cut");
1181  axis->SetBinLabel(7, "Bit6");
1182  axis->SetBinLabel(8, "NotHybridTrack");
1183  axis->SetBinLabel(9, "MCFlag");
1184  axis->SetBinLabel(10, "MCGenerator");
1185  axis->SetBinLabel(11, "ChargeCut");
1186  axis->SetBinLabel(12, "MinDistanceTPCSectorEdge");
1187  axis->SetBinLabel(13, "Bit12");
1188  axis->SetBinLabel(14, "IsEMCal");
1189  axis->SetBinLabel(15, "Time");
1190  axis->SetBinLabel(16, "Energy");
1191  axis->SetBinLabel(17, "ExoticCut");
1192  axis->SetBinLabel(18, "Bit17");
1193  axis->SetBinLabel(19, "Area");
1194  axis->SetBinLabel(20, "AreaEmc");
1195  axis->SetBinLabel(21, "ZLeadingCh");
1196  axis->SetBinLabel(22, "ZLeadingEmc");
1197  axis->SetBinLabel(23, "NEF");
1198  axis->SetBinLabel(24, "MinLeadPt");
1199  axis->SetBinLabel(25, "MaxTrackPt");
1200  axis->SetBinLabel(26, "MaxClusterPt");
1201  axis->SetBinLabel(27, "Flavour");
1202  axis->SetBinLabel(28, "TagStatus");
1203  axis->SetBinLabel(29, "MinNConstituents");
1204  axis->SetBinLabel(30, "Bit29");
1205  axis->SetBinLabel(31, "Bit30");
1206  axis->SetBinLabel(32, "Bit31");
1207 }
1208 
1215 Double_t AliAnalysisTaskEmcalLight::GetParallelFraction(AliVParticle* part1, AliVParticle* part2)
1216 {
1217  TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1218  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1219  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1220  return z;
1221 }
1222 
1229 Double_t AliAnalysisTaskEmcalLight::GetParallelFraction(const TVector3& vect1, AliVParticle* part2)
1230 {
1231  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1232  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1233  return z;
1234 }
1235 
1244 void AliAnalysisTaskEmcalLight::GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
1245 {
1246  phidiff = 999;
1247  etadiff = 999;
1248 
1249  if (!t||!v) return;
1250 
1251  Double_t veta = t->GetTrackEtaOnEMCal();
1252  Double_t vphi = t->GetTrackPhiOnEMCal();
1253 
1254  Float_t pos[3] = {0};
1255  v->GetPosition(pos);
1256  TVector3 cpos(pos);
1257  Double_t ceta = cpos.Eta();
1258  Double_t cphi = cpos.Phi();
1259  etadiff=veta-ceta;
1260  phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1261 }
1262 
1269 {
1270  Byte_t ret = 0;
1271  if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1272  ret = 1;
1273  else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1274  ret = 2;
1275  else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1276  ret = 3;
1277  return ret;
1278 }
1279 
1289 Byte_t AliAnalysisTaskEmcalLight::GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2)
1290 {
1291 
1292  Int_t res = 0;
1293 
1294  if (aodTrack->TestFilterBit(filterBit1)) {
1295  res = 0;
1296  }
1297  else if (aodTrack->TestFilterBit(filterBit2)) {
1298  if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1299  res = 1;
1300  }
1301  else {
1302  res = 2;
1303  }
1304  }
1305  else {
1306  res = 3;
1307  }
1308 
1309  return res;
1310 }
1311 
1318 {
1319  EBeamType_t b = kpp;
1320  if ((runnumber >= 136833 && runnumber <= 139517) || // LHC10h Run-1 (Pb-Pb)
1321  (runnumber >= 167693 && runnumber <= 170593) || // LHC11h Run-1 (Pb-Pb)
1322  (runnumber >= 244824 && runnumber <= 246994)) { // LHC15o Run-2 (Pb-Pb)
1323  b = kAA;
1324  }
1325  else if ((runnumber > 188356 && runnumber <= 188503) || // LHC12g Run-1 (p-Pb pilot)
1326  (runnumber >= 195164 && runnumber <= 197388) || // LHC13b,c,d,e,f Run-1 (p-Pb)
1327  (runnumber >= 265077 && runnumber <= 999999)) { // LHC16 Run-2 (p-Pb)
1328  b = kpA;
1329  }
1330  return b;
1331 }
1332 
1339 {
1340  if (!fPythiaHeader || !fMCRejectFilter) return kTRUE;
1341 
1342  // Condition 1: Pythia jet / pT-hard > factor
1343  if (fPtHardAndJetPtFactor > 0.) {
1344  AliTLorentzVector jet;
1345 
1346  Int_t nTriggerJets = fPythiaHeader->NTriggerJets();
1347 
1348  AliDebug(1,Form("Njets: %d, pT Hard %f",nTriggerJets, fPtHard));
1349 
1350  Float_t tmpjet[]={0,0,0,0};
1351  for (Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1352  fPythiaHeader->TriggerJet(ijet, tmpjet);
1353 
1354  jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1355 
1356  AliDebug(1,Form("jet %d; pycell jet pT %f",ijet, jet.Pt()));
1357 
1358  //Compare jet pT and pt Hard
1359  if (jet.Pt() > fPtHardAndJetPtFactor * fPtHard) {
1360  AliInfo(Form("Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", fPtHard, jet.Pt(), fPtHardAndJetPtFactor));
1361  return kFALSE;
1362  }
1363  }
1364  }
1365  // end condition 1
1366 
1367  // Condition 2 : Reconstructed EMCal cluster pT / pT-hard > factor
1368  if (fPtHardAndClusterPtFactor > 0.) {
1369  AliClusterContainer* mccluscont = GetClusterContainer(0);
1370  if ((Bool_t)mccluscont) {
1371  for (auto cluster : mccluscont->all()) {// Not cuts applied ; use accept for cuts
1372  Float_t ecluster = cluster->E();
1373 
1374  if (ecluster > (fPtHardAndClusterPtFactor * fPtHard)) {
1375  AliInfo(Form("Reject : ecluster %2.2f, calo %d, factor %2.2f, ptHard %f",ecluster,cluster->GetType(),fPtHardAndClusterPtFactor,fPtHard));
1376  return kFALSE;
1377  }
1378  }
1379  }
1380  }
1381  // end condition 2
1382 
1383  // condition 3 : Reconstructed track pT / pT-hard >factor
1384  if (fPtHardAndTrackPtFactor > 0.) {
1385  AliMCParticleContainer* mcpartcont = dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(0));
1386  if ((Bool_t)mcpartcont) {
1387  for (auto mctrack : mcpartcont->all()) {// Not cuts applied ; use accept for cuts
1388  Float_t trackpt = mctrack->Pt();
1389  if (trackpt > (fPtHardAndTrackPtFactor * fPtHard) ) {
1390  AliInfo(Form("Reject : track %2.2f, factor %2.2f, ptHard %f", trackpt, fPtHardAndTrackPtFactor, fPtHard));
1391  return kFALSE;
1392  }
1393  }
1394  }
1395  }
1396  // end condition 3
1397 
1398  return kTRUE;
1399 }
1400 
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
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
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
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
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="")
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
TFile * file
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.
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
Bool_t fUseNewCentralityEstimation
Use new centrality estimation (for 2015 data)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Double_t fMaxPtHard
select maximum pt hard (MC)
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)