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