AliPhysics  608b256 (608b256)
AliAnalysisTaskEmcal.cxx
Go to the documentation of this file.
1 /************************************************************************************
2  * Copyright (C) 2017, Copyright Holders of the ALICE Collaboration *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions are met: *
7  * * Redistributions of source code must retain the above copyright *
8  * notice, this list of conditions and the following disclaimer. *
9  * * Redistributions in binary form must reproduce the above copyright *
10  * notice, this list of conditions and the following disclaimer in the *
11  * documentation and/or other materials provided with the distribution. *
12  * * Neither the name of the <organization> nor the *
13  * names of its contributors may be used to endorse or promote products *
14  * derived from this software without specific prior written permission. *
15  * *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19  * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26  ************************************************************************************/
27 #include <RVersion.h>
28 #include <iostream>
29 #include <memory>
30 
31 #include <TClonesArray.h>
32 #include <AliEmcalList.h>
33 #include <TObject.h>
34 #include <TObjString.h>
35 #include <TH1F.h>
36 #include <TProfile.h>
37 #include <TSystem.h>
38 #include <TFile.h>
39 #include <TChain.h>
40 #include <TKey.h>
41 
42 #include "AliAnalysisTaskEmcal.h"
43 #include "AliAnalysisUtils.h"
44 #include "AliAODEvent.h"
45 #include "AliAODMCHeader.h"
46 #include "AliAODTrack.h"
47 #include "AliAnalysisManager.h"
48 #include "AliCentrality.h"
50 #include "AliEMCALGeometry.h"
51 #include "AliEmcalPythiaInfo.h"
52 #include "AliEMCALTriggerPatchInfo.h"
53 #include "AliESDEvent.h"
54 #include "AliAODInputHandler.h"
55 #include "AliESDInputHandler.h"
56 #include "AliEventplane.h"
57 #include "AliGenPythiaEventHeader.h"
58 #include "AliGenHerwigEventHeader.h"
59 #include "AliInputEventHandler.h"
60 #include "AliLog.h"
61 #include "AliMCEvent.h"
62 #include "AliMCParticle.h"
63 #include "AliMultiInputEventHandler.h"
64 #include "AliMultSelection.h"
65 #include "AliStack.h"
66 #include "AliVCaloTrigger.h"
67 #include "AliVCluster.h"
68 #include "AliVEventHandler.h"
69 #include "AliVParticle.h"
70 #include "AliNanoAODHeader.h"
72 
74 
76 ClassImp(AliAnalysisTaskEmcal);
78 
80  AliAnalysisTaskSE("AliAnalysisTaskEmcal"),
81  fPythiaInfoName(""),
82  fForceBeamType(kNA),
83  fGeneralHistograms(kFALSE),
84  fLocalInitialized(kFALSE),
85  fFileChanged(kTRUE),
86  fCreateHisto(kTRUE),
87  fCaloCellsName(),
88  fCaloTriggersName(),
89  fCaloTriggerPatchInfoName(),
90  fMinCent(-999),
91  fMaxCent(-999),
92  fMinVz(-999),
93  fMaxVz(999),
94  fMinVertexContrib(1),
95  fTrackPtCut(0),
96  fMinNTrack(0),
97  fZvertexDiff(0.5),
98  fUseAliAnaUtils(kFALSE),
99  fRejectPileup(kFALSE),
100  fTklVsClusSPDCut(kFALSE),
101  fOffTrigger(AliVEvent::kAny),
102  fTrigClass(),
103  fMinBiasRefTrigger("CINT7-B-NOPF-ALLNOTRD"),
104  fTriggerTypeSel(kND),
105  fNbins(250),
106  fMinBinPt(0),
107  fMaxBinPt(250),
108  fMinPtTrackInEmcal(0),
109  fEventPlaneVsEmcal(-1),
110  fMinEventPlane(-1e6),
111  fMaxEventPlane(1e6),
112  fCentEst("V0M"),
113  fRecycleUnusedEmbeddedEventsMode(false),
114  fIsEmbedded(kFALSE),
115  fIsPythia(kFALSE),
116  fIsHerwig(kFALSE),
117  fGetPtHardBinFromName(kTRUE),
118  fSelectPtHardBin(-999),
119  fMinMCLabel(0),
120  fMCLabelShift(0),
121  fNcentBins(4),
122  fNeedEmcalGeom(kTRUE),
123  fParticleCollArray(),
124  fClusterCollArray(),
125  fTriggers(0),
126  fEMCalTriggerMode(kOverlapWithLowThreshold),
127  fUseNewCentralityEstimation(kFALSE),
128  fGeneratePythiaInfoObject(kFALSE),
129  fUsePtHardBinScaling(kFALSE),
130  fUseXsecFromHeader(kFALSE),
131  fMCRejectFilter(kFALSE),
132  fCountDownscaleCorrectedEvents(kFALSE),
133  fUseBuiltinEventSelection(kFALSE),
134  fPtHardAndJetPtFactor(0.),
135  fPtHardAndClusterPtFactor(0.),
136  fPtHardAndTrackPtFactor(0.),
137  fRunNumber(-1),
138  fAliEventCuts(kFALSE),
139  fAliAnalysisUtils(nullptr),
140  fIsEsd(kFALSE),
141  fGeom(nullptr),
142  fTracks(nullptr),
143  fCaloClusters(nullptr),
144  fCaloCells(nullptr),
145  fCaloTriggers(nullptr),
146  fTriggerPatchInfo(nullptr),
147  fCent(0),
148  fCentBin(-1),
149  fEPV0(-1.0),
150  fEPV0A(-1.0),
151  fEPV0C(-1.0),
152  fNVertCont(0),
153  fNVertSPDCont(0),
154  fBeamType(kNA),
155  fPythiaHeader(nullptr),
156  fHerwigHeader(nullptr),
157  fPtHard(0),
158  fPtHardBin(0),
159  fPtHardBinGlobal(-1),
160  fPtHardInitialized(false),
161  fNPtHardBins(11),
162  fPtHardBinning(),
163  fNTrials(0),
164  fXsection(0),
165  fPythiaInfo(nullptr),
166  fOutput(nullptr),
167  fHistEventCount(nullptr),
168  fHistTrialsAfterSel(nullptr),
169  fHistEventsAfterSel(nullptr),
170  fHistXsectionAfterSel(nullptr),
171  fHistTrials(nullptr),
172  fHistEvents(nullptr),
173  fHistXsection(nullptr),
174  fHistPtHard(nullptr),
175  fHistPtHardCorr(nullptr),
176  fHistPtHardCorrGlobal(nullptr),
177  fHistPtHardBinCorr(nullptr),
178  fHistCentrality(nullptr),
179  fHistZVertex(nullptr),
180  fHistEventPlane(nullptr),
181  fHistEventRejection(nullptr),
182  fHistTriggerClasses(nullptr),
183  fHistTriggerClassesCorr(nullptr)
184 {
185  fVertex[0] = 0;
186  fVertex[1] = 0;
187  fVertex[2] = 0;
188  fVertexSPD[0] = 0;
189  fVertexSPD[1] = 0;
190  fVertexSPD[2] = 0;
191 
192  fParticleCollArray.SetOwner(kTRUE);
193  fClusterCollArray.SetOwner(kTRUE);
194 }
195 
197  AliAnalysisTaskSE(name),
198  fPythiaInfoName(""),
200  fGeneralHistograms(kFALSE),
201  fLocalInitialized(kFALSE),
202  fFileChanged(kFALSE),
203  fCreateHisto(histo),
204  fCaloCellsName(),
207  fMinCent(-999),
208  fMaxCent(-999),
209  fMinVz(-999),
210  fMaxVz(999),
212  fTrackPtCut(0),
213  fMinNTrack(0),
214  fZvertexDiff(0.5),
215  fUseAliAnaUtils(kFALSE),
216  fRejectPileup(kFALSE),
217  fTklVsClusSPDCut(kFALSE),
218  fOffTrigger(AliVEvent::kAny),
219  fTrigClass(),
220  fMinBiasRefTrigger("CINT7-B-NOPF-ALLNOTRD"),
222  fNbins(250),
223  fMinBinPt(0),
224  fMaxBinPt(250),
226  fEventPlaneVsEmcal(-1),
227  fMinEventPlane(-1e6),
228  fMaxEventPlane(1e6),
229  fCentEst("V0M"),
231  fIsEmbedded(kFALSE),
232  fIsPythia(kFALSE),
233  fIsHerwig(kFALSE),
234  fGetPtHardBinFromName(kTRUE),
235  fSelectPtHardBin(-999),
236  fMinMCLabel(0),
237  fMCLabelShift(0),
238  fNcentBins(4),
239  fNeedEmcalGeom(kTRUE),
242  fTriggers(0),
246  fUsePtHardBinScaling(kFALSE),
247  fUseXsecFromHeader(kFALSE),
248  fMCRejectFilter(kFALSE),
254  fRunNumber(-1),
255  fAliEventCuts(kFALSE),
257  fIsEsd(kFALSE),
258  fGeom(nullptr),
259  fTracks(nullptr),
264  fCent(0),
265  fCentBin(-1),
266  fEPV0(-1.0),
267  fEPV0A(-1.0),
268  fEPV0C(-1.0),
269  fNVertCont(0),
270  fNVertSPDCont(0),
271  fBeamType(kNA),
274  fPtHard(0),
275  fPtHardBin(0),
276  fPtHardBinGlobal(-1),
277  fPtHardInitialized(false),
278  fNPtHardBins(11),
279  fPtHardBinning(),
280  fNTrials(0),
281  fXsection(0),
282  fPythiaInfo(0),
283  fOutput(nullptr),
301 {
302  fVertex[0] = 0;
303  fVertex[1] = 0;
304  fVertex[2] = 0;
305  fVertexSPD[0] = 0;
306  fVertexSPD[1] = 0;
307  fVertexSPD[2] = 0;
308  fParticleCollArray.SetOwner(kTRUE);
309  fClusterCollArray.SetOwner(kTRUE);
310  // Do not perform trigger selection in the AliEvent cuts but let the task do this before
311  fAliEventCuts.OverrideAutomaticTriggerSelection(AliVEvent::kAny, true);
312 
313  if (fCreateHisto) {
314  DefineOutput(1, AliEmcalList::Class());
315  }
316 }
317 
319 {
320  if(fOutput) delete fOutput;
322  if(fPythiaInfo) delete fPythiaInfo;
323 }
324 
326 {
328  if (cont) cont->SetClusPtCut(cut);
329  else AliError(Form("%s in SetClusPtCut(...): container %d not found",GetName(),c));
330 }
331 
333 {
335  if (cont) cont->SetClusTimeCut(min,max);
336  else AliError(Form("%s in SetClusTimeCut(...): container %d not found",GetName(),c));
337 }
338 
340 {
342  if (cont) cont->SetParticlePtCut(cut);
343  else AliError(Form("%s in SetTrackPtCut(...): container %d not found",GetName(),c));
344 
345  fTrackPtCut = cut;
346 }
347 
349 {
351  if (cont) cont->SetParticleEtaLimits(min,max);
352  else AliError(Form("%s in SetTrackPtCut(...): container %d not found",GetName(),c));
353 }
354 
356 {
358  if (cont) cont->SetParticlePhiLimits(min,max);
359  else AliError(Form("%s in SetTrackPhiLimits(...): container %d not found",GetName(),c));
360 }
361 
363 {
364  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
365  if (mgr) {
366  AliVEventHandler *evhand = mgr->GetInputEventHandler();
367  if (evhand) {
368  if (evhand->InheritsFrom("AliESDInputHandler")) {
369  fIsEsd = kTRUE;
370  }
371  else {
372  fIsEsd = kFALSE;
373  }
374  }
375  else {
376  AliError("Event handler not found!");
377  }
378  }
379  else {
380  AliError("Analysis manager not found!");
381  }
382 
383 
384  if (!fCreateHisto)
385  return;
386 
387  OpenFile(1);
388  fOutput = new AliEmcalList();
390  fOutput->SetOwner();
391 
392  if (fForceBeamType == kpp)
393  fNcentBins = 1;
394 
395  if (!fGeneralHistograms)
396  return;
397 
398  if (fIsPythia || fIsHerwig) {
399  fHistTrialsAfterSel = new TH1F("fHistTrialsAfterSel", "fHistTrialsAfterSel", fNPtHardBins, 0, fNPtHardBins);
400  fHistTrialsAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
401  fHistTrialsAfterSel->GetYaxis()->SetTitle("trials");
403 
404  fHistEventsAfterSel = new TH1F("fHistEventsAfterSel", "fHistEventsAfterSel", fNPtHardBins, 0, fNPtHardBins);
405  fHistEventsAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
406  fHistEventsAfterSel->GetYaxis()->SetTitle("total events");
408 
409  fHistXsectionAfterSel = new TProfile("fHistXsectionAfterSel", "fHistXsectionAfterSel", fNPtHardBins, 0, fNPtHardBins);
410  fHistXsectionAfterSel->GetXaxis()->SetTitle("p_{T} hard bin");
411  fHistXsectionAfterSel->GetYaxis()->SetTitle("xsection");
413 
414  fHistTrials = new TH1F("fHistTrials", "fHistTrials", fNPtHardBins, 0, fNPtHardBins);
415  fHistTrials->GetXaxis()->SetTitle("p_{T} hard bin");
416  fHistTrials->GetYaxis()->SetTitle("trials");
417  fOutput->Add(fHistTrials);
418 
419  fHistEvents = new TH1F("fHistEvents", "fHistEvents", fNPtHardBins, 0, fNPtHardBins);
420  fHistEvents->GetXaxis()->SetTitle("p_{T} hard bin");
421  fHistEvents->GetYaxis()->SetTitle("total events");
422  fOutput->Add(fHistEvents);
423 
424  fHistXsection = new TProfile("fHistXsection", "fHistXsection", fNPtHardBins, 0, fNPtHardBins);
425  fHistXsection->GetXaxis()->SetTitle("p_{T} hard bin");
426  fHistXsection->GetYaxis()->SetTitle("xsection");
427  fOutput->Add(fHistXsection);
428 
429  // Set the bin labels
430  Bool_t binningAvailable = false;
431  if(fPtHardBinning.GetSize() > 0) {
432  AliInfoStream() << "Using custom pt-hard binning" << std::endl;
433  if(fPtHardBinning.GetSize() == fNPtHardBins + 1) binningAvailable = true;
434  else AliErrorStream() << "Pt-hard binning (" << fPtHardBinning.GetSize() -1 << ") does not match the amount of bins (" << fNPtHardBins << ")" << std::endl;
435  } else {
436  // Check if we fall back to the default binning
437  if(fNPtHardBins == 11) {
438  AliInfoStream() << "11 pt-hard bins - fall back to default binning for bin labels" << std::endl;
439  const Int_t kDefaultPtHardBinning[12] = {0,5,11,21,36,57, 84,117,152,191,234,1000000};
440  fPtHardBinning.Set(12);
441  for(Int_t ib = 0; ib < 12; ib++) fPtHardBinning[ib] = kDefaultPtHardBinning[ib];
442  binningAvailable = true;
443  } else {
444  AliErrorStream() << "No default binning available for " << fNPtHardBins << " pt-hard bins - bin labels will not be set." << std::endl;
445  }
446  }
447 
448  if(binningAvailable){
449  for (Int_t i = 0; i < fNPtHardBins; i++) {
450  fHistTrialsAfterSel->GetXaxis()->SetBinLabel(i+1, Form("%d-%d",fPtHardBinning[i],fPtHardBinning[i+1]));
451  fHistEventsAfterSel->GetXaxis()->SetBinLabel(i+1, Form("%d-%d",fPtHardBinning[i],fPtHardBinning[i+1]));
452  fHistXsectionAfterSel->GetXaxis()->SetBinLabel(i+1, Form("%d-%d",fPtHardBinning[i],fPtHardBinning[i+1]));
453 
454  fHistTrials->GetXaxis()->SetBinLabel(i+1, Form("%d-%d",fPtHardBinning[i],fPtHardBinning[i+1]));
455  fHistXsection->GetXaxis()->SetBinLabel(i+1, Form("%d-%d",fPtHardBinning[i],fPtHardBinning[i+1]));
456  fHistEvents->GetXaxis()->SetBinLabel(i+1, Form("%d-%d",fPtHardBinning[i],fPtHardBinning[i+1]));
457  }
458  } else {
459  AliErrorStream() << "No suitable binning available - skipping bin labels" << std::endl;
460  }
461 
462 
463  fHistPtHard = new TH1F("fHistPtHard", "fHistPtHard", fNbins*2, fMinBinPt, fMaxBinPt*4);
464  fHistPtHard->GetXaxis()->SetTitle("p_{T,hard} (GeV/c)");
465  fHistPtHard->GetYaxis()->SetTitle("counts");
466  fOutput->Add(fHistPtHard);
467 
468  // Pt-hard correlation histograms (debugging)
469  fHistPtHardCorr = new TH2F("fHistPtHardCorr", "Correlation between pt-hard value and binning", fNPtHardBins, -0.5, fNPtHardBins - 0.5, 1000, 0., 500.);
470  fHistPtHardCorr->SetXTitle("p_{T,hard bin}");
471  fHistPtHardCorr->SetYTitle("p_{T,hard value}");
472  fOutput->Add(fHistPtHardCorr);
473 
474  fHistPtHardCorrGlobal = new TH2F("fHistPtHardCorrGlobal", "Correlation between global pt-hard value and binning", fNPtHardBins, -0.5, fNPtHardBins - 0.5, 1000, 0., 500.);
475  fHistPtHardCorrGlobal->SetXTitle("p_{T,hard} bin_{global}");
476  fHistPtHardCorrGlobal->SetYTitle("p_{T,hard} value");
478 
479  fHistPtHardBinCorr = new TH2F("fHistPtHardBinCorr", "Correlation between global and local pt-hard bin", fNPtHardBins, -0.5, fNPtHardBins - 0.5, fNPtHardBins, -0.5, fNPtHardBins);
480  fHistPtHardBinCorr->SetXTitle("p_{T,hard} bin_{local}");
481  fHistPtHardBinCorr->SetYTitle("p_{T,hard} bin_{global}");
483  }
484 
485  fHistZVertex = new TH1F("fHistZVertex","Z vertex position", 60, -30, 30);
486  fHistZVertex->GetXaxis()->SetTitle("z");
487  fHistZVertex->GetYaxis()->SetTitle("counts");
488  fOutput->Add(fHistZVertex);
489 
490  if (fForceBeamType != kpp) {
491  fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", 200, 0, 100);
492  fHistCentrality->GetXaxis()->SetTitle("Centrality (%)");
493  fHistCentrality->GetYaxis()->SetTitle("counts");
494  fOutput->Add(fHistCentrality);
495 
496  fHistEventPlane = new TH1F("fHistEventPlane","Event plane", 120, -TMath::Pi(), TMath::Pi());
497  fHistEventPlane->GetXaxis()->SetTitle("event plane");
498  fHistEventPlane->GetYaxis()->SetTitle("counts");
499  fOutput->Add(fHistEventPlane);
500  }
501 
502  fHistEventRejection = new TH1F("fHistEventRejection","Reasons to reject event",20,0,20);
503 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
504  fHistEventRejection->SetBit(TH1::kCanRebin);
505 #else
506  fHistEventRejection->SetCanExtend(TH1::kAllAxes);
507 #endif
508  // We must keep track of the recycled embedded event count. If we use the builtin event selection, then
509  // this count is appended after all of the rest of the bins.
510  int recycleEmbeddedEventIndex = 1;
512  fHistEventRejection->GetXaxis()->SetBinLabel(1,"PhysSel");
513  fHistEventRejection->GetXaxis()->SetBinLabel(2,"trigger");
514  fHistEventRejection->GetXaxis()->SetBinLabel(3,"trigTypeSel");
515  fHistEventRejection->GetXaxis()->SetBinLabel(4,"Cent");
516  fHistEventRejection->GetXaxis()->SetBinLabel(5,"vertex contr.");
517  fHistEventRejection->GetXaxis()->SetBinLabel(6,"Vz");
518  fHistEventRejection->GetXaxis()->SetBinLabel(7,"VzSPD");
519  fHistEventRejection->GetXaxis()->SetBinLabel(8,"trackInEmcal");
520  fHistEventRejection->GetXaxis()->SetBinLabel(9,"minNTrack");
521  fHistEventRejection->GetXaxis()->SetBinLabel(10,"VtxSel2013pA");
522  fHistEventRejection->GetXaxis()->SetBinLabel(11,"PileUp");
523  fHistEventRejection->GetXaxis()->SetBinLabel(12,"EvtPlane");
524  fHistEventRejection->GetXaxis()->SetBinLabel(13,"SelPtHardBin");
525  fHistEventRejection->GetXaxis()->SetBinLabel(14,"Bkg evt");
526  recycleEmbeddedEventIndex = 15;
527  fHistEventRejection->GetYaxis()->SetTitle("counts");
528  }
529  // Finish setting up the event rejection histogram.
530  fHistEventRejection->GetXaxis()->SetBinLabel(recycleEmbeddedEventIndex,"RecycleEmbeddedEvent");
532 
533  // Finish setting up AliEventCuts
535  fAliEventCuts.AddQAplotsToList(fOutput);
536  }
537 
538  fHistTriggerClasses = new TH1F("fHistTriggerClasses","fHistTriggerClasses",3,0,3);
539 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
540  fHistTriggerClasses->SetBit(TH1::kCanRebin);
541 #else
542  fHistTriggerClasses->SetCanExtend(TH1::kAllAxes);
543 #endif
545 
547  fHistTriggerClassesCorr = new TH1F("fHistTriggerClassesCorr","fHistTriggerClassesCorr",3,0,3);
548 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
549  fHistTriggerClassesCorr->SetBit(TH1::kCanRebin);
550 #else
551  fHistTriggerClassesCorr->SetCanExtend(TH1::kAllAxes);
552 #endif
554  }
555 
556  fHistEventCount = new TH1F("fHistEventCount","fHistEventCount",2,0,2);
557  fHistEventCount->GetXaxis()->SetBinLabel(1,"Accepted");
558  fHistEventCount->GetXaxis()->SetBinLabel(2,"Rejected");
559  fHistEventCount->GetYaxis()->SetTitle("counts");
560  fOutput->Add(fHistEventCount);
561 
562  PostData(1, fOutput);
563 }
564 
566 {
567  if (fIsPythia || fIsHerwig) {
568  // Protection: In case the pt-hard bin handling is not initialized we fall back to the
569  // global pt-hard bin (usually 0) in order to aviod mismatch between histograms before
570  // and after selection
574  fHistPtHard->Fill(fPtHard);
575  if(fPtHardInitialized){
576  fHistPtHardCorr->Fill(fPtHardBin, fPtHard);
578  fHistPtHardBinCorr->Fill(fPtHardBin, fPtHardBinGlobal);
579  }
580  }
581 
582 
583  fHistZVertex->Fill(fVertex[2]);
584 
585  if (fForceBeamType != kpp) {
586  fHistCentrality->Fill(fCent);
587  fHistEventPlane->Fill(fEPV0);
588  }
589 
590  std::unique_ptr<TObjArray> triggerClasses(InputEvent()->GetFiredTriggerClasses().Tokenize(" "));
591  TObjString* triggerClass(nullptr);
592  for(auto trg : *triggerClasses){
593  triggerClass = static_cast<TObjString*>(trg);
594  fHistTriggerClasses->Fill(triggerClass->GetString(), 1);
595  }
596 
598  // downscale-corrected number of events are calculated based on the min. bias reference
599  // Formula: N_corr = N_MB * d_Trg/d_{Min_Bias}
600  if(InputEvent()->GetFiredTriggerClasses().Contains(fMinBiasRefTrigger)){
602  Double_t downscaleref = downscalefactors->GetDownscaleFactorForTriggerClass(fMinBiasRefTrigger);
603  for(auto t : downscalefactors->GetTriggerClasses()){
604  Double_t downscaletrg = downscalefactors->GetDownscaleFactorForTriggerClass(t);
605  fHistTriggerClassesCorr->Fill(t, downscaletrg/downscaleref);
606  }
607  }
608  }
609 
610  return kTRUE;
611 }
612 
614 {
615  // Recycle embedded events which do not pass the internal event selection in the embedding helper
617  auto embeddingHelper = AliAnalysisTaskEmcalEmbeddingHelper::GetInstance();
618  if (embeddingHelper && embeddingHelper->EmbeddedEventUsed() == false) {
619  if (fGeneralHistograms) {
620  fHistEventRejection->Fill("RecycleEmbeddedEvent",1);
621  fHistEventCount->Fill("Rejected",1);
622  }
623  return;
624  }
625  }
626 
627  if (!fLocalInitialized){
628  ExecOnce();
629  UserExecOnce();
630  }
631 
632  if (!fLocalInitialized)
633  return;
634 
635  if(fFileChanged){
636  FileChanged();
637  fFileChanged = kFALSE;
638  }
639 
640  if (!RetrieveEventObjects())
641  return;
642 
643  if(InputEvent()->GetRunNumber() != fRunNumber){
644  fRunNumber = InputEvent()->GetRunNumber();
647  }
648 
649  // Apply fallback for pythia cross section if needed
651  AliDebugStream(1) << "Fallback to cross section from pythia header required" << std::endl;
652  /*
653  // Get the pthard bin
654  Float_t pthard = fPythiaHeader->GetPtHard();
655  int pthardbin = 0;
656  if(fPtHardBinning.GetSize()){
657  for(int ib = 0; ib < fNPtHardBins; ib++){
658  if(pthard >= static_cast<Float_t>(fPtHardBinning[ib]) && pthard < static_cast<Float_t>(fPtHardBinning[ib+1])) {
659  pthardbin = ib;
660  break;
661  }
662  }
663  }
664  */
665  fHistXsection->Fill(fPtHardBinGlobal, fPythiaHeader->GetXsection());
666  }
667 
668  if (IsEventSelected()) {
669  if (fGeneralHistograms) fHistEventCount->Fill("Accepted",1);
670  }
671  else {
672  if (fGeneralHistograms) fHistEventCount->Fill("Rejected",1);
673  return;
674  }
675 
677  if (!FillGeneralHistograms())
678  return;
679  }
680 
681  if (!Run())
682  return;
683 
684  if (fCreateHisto) {
685  if (!FillHistograms())
686  return;
687  }
688 
689  if (fCreateHisto && fOutput) {
690  // information for this iteration of the UserExec in the container
691  PostData(1, fOutput);
692  }
693 }
694 
696 {
697  AliWarning("AliAnalysisTaskEmcal::AcceptCluster method is deprecated. Please use GetCusterContainer(c)->AcceptCluster(clus).");
698 
699  if (!clus) return kFALSE;
700 
702  if (!cont) {
703  AliError(Form("%s:Container %d not found",GetName(),c));
704  return 0;
705  }
706  UInt_t rejectionReason = 0;
707  return cont->AcceptCluster(clus, rejectionReason);
708 }
709 
710 Bool_t AliAnalysisTaskEmcal::AcceptTrack(AliVParticle *track, Int_t c) const
711 {
712  AliWarning("AliAnalysisTaskEmcal::AcceptTrack method is deprecated. Please use GetParticleContainer(c)->AcceptParticle(clus).");
713 
714  if (!track) return kFALSE;
715 
717  if (!cont) {
718  AliError(Form("%s:Container %d not found",GetName(),c));
719  return 0;
720  }
721 
722  UInt_t rejectionReason = 0;
723  return cont->AcceptParticle(track, rejectionReason);
724 }
725 
726 Bool_t AliAnalysisTaskEmcal::PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
727 {
728  TString file(currFile);
729  fXsec = 0;
730  fTrials = 1;
731 
732  // Determine archive type
733  TString archivetype;
734  std::unique_ptr<TObjArray> walk(file.Tokenize("/"));
735  for(auto t : *walk){
736  TString &tok = static_cast<TObjString *>(t)->String();
737  if(tok.Contains(".zip")){
738  archivetype = tok;
739  Int_t pos = archivetype.Index(".zip");
740  archivetype.Replace(pos, archivetype.Length() - pos, "");
741  }
742  }
743  if(archivetype.Length()){
744  AliDebugStream(1) << "Auto-detected archive type " << archivetype << std::endl;
745  Ssiz_t pos1 = file.Index(archivetype,archivetype.Length(),0,TString::kExact);
746  Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
747  Ssiz_t pos2 = file.Index(".root",5,TString::kExact);
748  file.Replace(pos+1,pos2-pos1,"");
749  } else {
750  // not an archive take the basename....
751  file.ReplaceAll(gSystem->BaseName(file.Data()),"");
752  }
753  AliDebugStream(1) << "File name: " << file << std::endl;
754 
755  // Build virtual file name
756  // Support for train tests
757  TString virtualFileName;
758  if(file.Contains("__alice")){
759  TString tmp(file);
760  Int_t pos = tmp.Index("__alice");
761  tmp.Replace(0, pos, "");
762  tmp.ReplaceAll("__", "/");
763  // cut out tag for archive and root file
764  // this needs a determin
765  std::unique_ptr<TObjArray> toks(tmp.Tokenize("/"));
766  TString tag = "_" + archivetype;
767  for(auto t : *toks){
768  TString &path = static_cast<TObjString *>(t)->String();
769  if(path.Contains(tag)){
770  Int_t posTag = path.Index(tag);
771  path.Replace(posTag, path.Length() - posTag, "");
772  }
773  virtualFileName += "/" + path;
774  }
775  } else {
776  virtualFileName = file;
777  }
778 
779  AliDebugStream(1) << "Physical file name " << file << ", virtual file name " << virtualFileName << std::endl;
780 
781  // Get the pt hard bin
782  TString strPthard(virtualFileName);
783 
784  /*
785  // Dead code - to be removed after testing phase
786  // Procedure will fail for everything else than the expected path name
787  strPthard.Remove(strPthard.Last('/'));
788  strPthard.Remove(strPthard.Last('/'));
789  if (strPthard.Contains("AOD")) strPthard.Remove(strPthard.Last('/'));
790  strPthard.Remove(0,strPthard.Last('/')+1);
791  if (strPthard.IsDec()) pthard = strPthard.Atoi();
792  else
793  AliWarningStream() << "Could not extract file number from path " << strPthard << std::endl;
794  */
795 
796  // New implementation : pattern matching
797  // Reason: Implementation valid only for old productions (new productions swap run number and pt-hard bin)
798  // Idea: Don't use the position in the string but the match different informations
799  // + Year clearly 2000+
800  // + Run number can be match to the one in the event
801  // + If we know it is not year or run number, it must be the pt-hard bin if we start from the beginning
802  // The procedure is only valid for the current implementations and unable to detect non-pt-hard bins
803  // It will also fail in case of arbitrary file names
804 
805  bool binfound = false;
806  std::unique_ptr<TObjArray> tokens(strPthard.Tokenize("/"));
807  for(auto t : *tokens) {
808  TString &tok = static_cast<TObjString *>(t)->String();
809  if(tok.IsDec()){
810  Int_t number = tok.Atoi();
811  if(number > 2000 && number < 3000){
812  // Year
813  continue;
814  } else if(number == fInputHandler->GetEvent()->GetRunNumber()){
815  // Run number
816  continue;
817  } else {
818  if(!binfound){
819  // the first number that is not one of the two must be the pt-hard bin
820  binfound = true;
821  pthard = number;
822  break;
823  }
824  }
825  }
826  }
827  if(!binfound) {
828  AliErrorStream() << "Could not extract file number from path " << strPthard << std::endl;
829  } else {
830  AliInfoStream() << "Auto-detecting pt-hard bin " << pthard << std::endl;
831  }
832 
833  AliInfoStream() << "File: " << file << std::endl;
834 
835  // 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
836  std::unique_ptr<TFile> fxsec(TFile::Open(Form("%s%s",file.Data(),"pyxsec.root")));
837 
838  if (!fxsec) {
839  // next trial fetch the histgram file
840  fxsec = std::unique_ptr<TFile>(TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root")));
841  if (!fxsec){
842  AliErrorStream() << "Failed reading cross section from file " << file << std::endl;
843  fUseXsecFromHeader = true;
844  return kFALSE; // not a severe condition but inciate that we have no information
845  }
846  else {
847  // find the tlist we want to be independtent of the name so use the Tkey
848  TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
849  if (!key) return kFALSE;
850  TList *list = dynamic_cast<TList*>(key->ReadObj());
851  if (!list) return kFALSE;
852  TProfile *xSecHist = static_cast<TProfile*>(list->FindObject("h1Xsec"));
853  // check for failure
854  if(!xSecHist->GetEntries()) {
855  // No cross seciton information available - fall back to raw
856  AliErrorStream() << "No cross section information available in file " << fxsec->GetName() <<" - fall back to cross section in PYTHIA header" << std::endl;
857  fUseXsecFromHeader = true;
858  } else {
859  // Cross section histogram filled - take it from there
860  fXsec = xSecHist->GetBinContent(1);
861  if(!fXsec) AliErrorStream() << GetName() << ": Cross section 0 for file " << file << std::endl;
862  fUseXsecFromHeader = false;
863  }
864  fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
865  }
866  } else { // no tree pyxsec.root
867  TTree *xtree = (TTree*)fxsec->Get("Xsection");
868  if (!xtree) return kFALSE;
869  UInt_t ntrials = 0;
870  Double_t xsection = 0;
871  xtree->SetBranchAddress("xsection",&xsection);
872  xtree->SetBranchAddress("ntrials",&ntrials);
873  xtree->GetEntry(0);
874  fTrials = ntrials;
875  fXsec = xsection;
876  }
877  return kTRUE;
878 }
879 
881  fPtHardInitialized = kFALSE;
882  fFileChanged = kTRUE;
883  return kTRUE;
884 }
885 
888  return kTRUE;
889 
890  // Debugging:
891  AliInfoStream() << "FileChanged called for run " << InputEvent()->GetRunNumber() << std::endl;
892 
893  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
894  if (!tree) {
895  AliErrorStream() << GetName() << " - FileChanged: No current tree!" << std::endl;
896  return kFALSE;
897  }
898 
899  Float_t xsection = 0;
900  Float_t trials = 0;
901  Int_t pthardbin = -1;
902 
903  TFile *curfile = tree->GetCurrentFile();
904  if (!curfile) {
905  AliErrorStream() << GetName() << " - FileChanged: No current file!" << std::endl;
906  return kFALSE;
907  }
908 
909  TChain *chain = dynamic_cast<TChain*>(tree);
910  if (chain) tree = chain->GetTree();
911 
912  Int_t nevents = tree->GetEntriesFast();
913 
914  fUseXsecFromHeader = false;
915  PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
917  // Use the bin obtained from the path name
918  fPtHardBinGlobal = pthardbin;
919  fPtHardInitialized = kTRUE;
920  } else {
921  // Put everything in the first bin
922  fPtHardBinGlobal = 0;
923  pthardbin = 0;
924  }
925 
926  if ((pthardbin < 0) || (pthardbin > fNPtHardBins-1)){
927  AliErrorStream() << GetName() << ": Invalid global pt-hard bin " << pthardbin << " detected" << std::endl;
928  pthardbin = 0;
929  }
930  fHistTrials->Fill(pthardbin, trials);
931  if(!fUseXsecFromHeader){
932  AliDebugStream(1) << "Using cross section from file pyxsec.root" << std::endl;
933  fHistXsection->Fill(pthardbin, xsection);
934  }
935  fHistEvents->Fill(pthardbin, nevents);
936 
937  return kTRUE;
938 }
939 
941 {
942  if (!fPythiaInfoName.IsNull() && !fPythiaInfo) {
943  fPythiaInfo = dynamic_cast<AliEmcalPythiaInfo*>(event->FindListObject(fPythiaInfoName));
944  if (!fPythiaInfo) {
945  AliError(Form("%s: Could not retrieve parton infos! %s!", GetName(), fPythiaInfoName.Data()));
946  return;
947  }
948  }
949 }
950 
952 {
953  if (!InputEvent()) {
954  AliError(Form("%s: Could not retrieve event! Returning!", GetName()));
955  return;
956  }
957 
958  LoadPythiaInfo(InputEvent());
959 
960  if (fNeedEmcalGeom) {
961  fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
962  if (!fGeom) {
963  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()));
964  return;
965  }
966  }
967 
968  if (fEventPlaneVsEmcal >= 0) {
969  if (fGeom) {
970  Double_t ep = (fGeom->GetArm1PhiMax() + fGeom->GetArm1PhiMin()) / 2 * TMath::DegToRad() + fEventPlaneVsEmcal - TMath::Pi();
971  fMinEventPlane = ep - TMath::Pi() / 4;
972  fMaxEventPlane = ep + TMath::Pi() / 4;
973  }
974  else {
975  AliWarning("Could not set event plane limits because EMCal geometry was not loaded!");
976  }
977  }
978 
979  //Load all requested track branches - each container knows name already
980  for (Int_t i =0; i<fParticleCollArray.GetEntriesFast(); i++) {
981  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
982  cont->SetArray(InputEvent());
983  }
984 
985  if (fParticleCollArray.GetEntriesFast()>0) {
987  if (!fTracks) {
988  AliError(Form("%s: Could not retrieve first track branch!", GetName()));
989  return;
990  }
991  }
992 
993  //Load all requested cluster branches - each container knows name already
994  for (Int_t i =0; i<fClusterCollArray.GetEntriesFast(); i++) {
995  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
996  cont->SetArray(InputEvent());
997  }
998 
999  if (fClusterCollArray.GetEntriesFast()>0) {
1001  if (!fCaloClusters) {
1002  AliError(Form("%s: Could not retrieve first cluster branch!", GetName()));
1003  return;
1004  }
1005  }
1006 
1007  if (!fCaloCellsName.IsNull() && !fCaloCells) {
1008  fCaloCells = dynamic_cast<AliVCaloCells*>(InputEvent()->FindListObject(fCaloCellsName));
1009  if (!fCaloCells) {
1010  AliError(Form("%s: Could not retrieve cells %s!", GetName(), fCaloCellsName.Data()));
1011  return;
1012  }
1013  }
1014 
1015  if (!fCaloTriggersName.IsNull() && !fCaloTriggers) {
1016  fCaloTriggers = dynamic_cast<AliVCaloTrigger*>(InputEvent()->FindListObject(fCaloTriggersName));
1017  if (!fCaloTriggers) {
1018  AliError(Form("%s: Could not retrieve calo triggers %s!", GetName(), fCaloTriggersName.Data()));
1019  return;
1020  }
1021  }
1022 
1023  if (!fCaloTriggerPatchInfoName.IsNull() && !fTriggerPatchInfo) {
1024  fTriggerPatchInfo = GetArrayFromEvent(fCaloTriggerPatchInfoName.Data(),"AliEMCALTriggerPatchInfo");
1025  if (!fTriggerPatchInfo) {
1026  AliError(Form("%s: Could not retrieve calo trigger patch info %s!", GetName(), fCaloTriggerPatchInfoName.Data()));
1027  return;
1028  }
1029 
1030  }
1031 
1032  fLocalInitialized = kTRUE;
1033 }
1034 
1036 {
1037  if (fForceBeamType != kNA)
1038  return fForceBeamType;
1039 
1040  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
1041  if (esd) {
1042  const AliESDRun *run = esd->GetESDRun();
1043  TString beamType = run->GetBeamType();
1044  if (beamType == "p-p")
1045  return kpp;
1046  else if (beamType == "A-A")
1047  return kAA;
1048  else if (beamType == "p-A")
1049  return kpA;
1050  else
1051  return kNA;
1052  } else {
1053  Int_t runNumber = InputEvent()->GetRunNumber();
1054  // All run number ranges taken from the RCT
1055  if ((runNumber >= 136833 && runNumber <= 139517) || // LHC10h
1056  (runNumber >= 167693 && runNumber <= 170593) || // LHC11h
1057  (runNumber >= 244824 && runNumber <= 246994)) { // LHC15o
1058  return kAA;
1059  } else if ((runNumber >= 188356 && runNumber <= 188366) || // LHC12g
1060  (runNumber >= 195164 && runNumber <= 197388) || // LHC13b-f
1061  (runNumber >= 265015 && runNumber <= 267166)) { // LHC16q-t
1062  return kpA;
1063  } else {
1064  return kpp;
1065  }
1066  }
1067 }
1068 
1070 {
1071  if (!fTriggerPatchInfo)
1072  return 0;
1073 
1074  //number of patches in event
1075  Int_t nPatch = fTriggerPatchInfo->GetEntries();
1076 
1077  //loop over patches to define trigger type of event
1078  Int_t nG1 = 0;
1079  Int_t nG2 = 0;
1080  Int_t nJ1 = 0;
1081  Int_t nJ2 = 0;
1082  Int_t nL0 = 0;
1083  AliEMCALTriggerPatchInfo *patch;
1084  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1085  patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
1086  if (patch->IsGammaHigh()) nG1++;
1087  if (patch->IsGammaLow()) nG2++;
1088  if (patch->IsJetHigh()) nJ1++;
1089  if (patch->IsJetLow()) nJ2++;
1090  if (patch->IsLevel0()) nL0++;
1091  }
1092 
1093  AliDebug(2, "Patch summary: ");
1094  AliDebug(2, Form("Number of patches: %d", nPatch));
1095  AliDebug(2, Form("Jet: low[%d], high[%d]" ,nJ2, nJ1));
1096  AliDebug(2, Form("Gamma: low[%d], high[%d]" ,nG2, nG1));
1097 
1098  ULong_t triggers(0);
1099  if (nL0>0) SETBIT(triggers, kL0);
1100  if (nG1>0) SETBIT(triggers, kG1);
1101  if (nG2>0) SETBIT(triggers, kG2);
1102  if (nJ1>0) SETBIT(triggers, kJ1);
1103  if (nJ2>0) SETBIT(triggers, kJ2);
1104  return triggers;
1105 }
1106 
1108 {
1109  //
1110  if(trigger==kND) {
1111  AliWarning(Form("%s: Requesting undefined trigger type!", GetName()));
1112  return kFALSE;
1113  }
1114  //MV: removing this logic which as far as I can see doesn't make any sense
1115  // if(trigger & kND){
1116  // return fTriggers == 0;
1117  // }
1118  return TESTBIT(fTriggers, trigger);
1119 }
1120 
1123  if(!IsTriggerSelected()) return false;
1124  if(!CheckMCOutliers()) return false;
1125  return fAliEventCuts.AcceptEvent(fInputEvent);
1126 }
1127 
1129 {
1130  AliDebugStream(3) << "Using default event selection" << std::endl;
1131  if (fOffTrigger != AliVEvent::kAny) {
1132  UInt_t res = 0;
1133  const AliESDEvent *eev = dynamic_cast<const AliESDEvent*>(InputEvent());
1134  if (eev) {
1135  res = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1136  } else {
1137  const AliAODEvent *aev = dynamic_cast<const AliAODEvent*>(InputEvent());
1138  if (aev) {
1139  res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
1140  }
1141  }
1142  if ((res & fOffTrigger) == 0) {
1143  if (fGeneralHistograms) fHistEventRejection->Fill("PhysSel",1);
1144  return kFALSE;
1145  }
1146  }
1147 
1148  if(!IsTriggerSelected()) {
1149  if (fGeneralHistograms) fHistEventRejection->Fill("trigger",1);
1150  return kFALSE;
1151  }
1152 
1153  if (fTriggerTypeSel != kND) {
1155  if (fGeneralHistograms) fHistEventRejection->Fill("trigTypeSel",1);
1156  return kFALSE;
1157  }
1158  }
1159 
1160  if ((fMinCent != -999) && (fMaxCent != -999)) {
1161  if (fCent<fMinCent || fCent>fMaxCent) {
1162  if (fGeneralHistograms) fHistEventRejection->Fill("Cent",1);
1163  return kFALSE;
1164  }
1165  }
1166 
1167  if (fUseAliAnaUtils) {
1168  if (!fAliAnalysisUtils)
1169  fAliAnalysisUtils = new AliAnalysisUtils();
1170  fAliAnalysisUtils->SetMinVtxContr(fMinVertexContrib);
1171  fAliAnalysisUtils->SetMaxVtxZ(999);
1172  if(fMinVz<-998.) fMinVz = -10.;
1173  if(fMaxVz>998.) fMaxVz = 10.;
1174 
1175  if (!fAliAnalysisUtils->IsVertexSelected2013pA(InputEvent())) {
1176  if (fGeneralHistograms) fHistEventRejection->Fill("VtxSel2013pA",1);
1177  return kFALSE;
1178  }
1179 
1180  if (fRejectPileup && fAliAnalysisUtils->IsPileUpEvent(InputEvent())) {
1181  if (fGeneralHistograms) fHistEventRejection->Fill("PileUp",1);
1182  return kFALSE;
1183  }
1184 
1185  if(fTklVsClusSPDCut && fAliAnalysisUtils->IsSPDClusterVsTrackletBG(InputEvent())) {
1186  if (fGeneralHistograms) fHistEventRejection->Fill("Bkg evt",1);
1187  return kFALSE;
1188  }
1189  }
1190 
1191  if ((fMinVz > -998.) && (fMaxVz < 998.)) {
1192  if (fNVertCont == 0 ) {
1193  if (fGeneralHistograms) fHistEventRejection->Fill("vertex contr.",1);
1194  return kFALSE;
1195  }
1196  Double_t vz = fVertex[2];
1197  if (vz < fMinVz || vz > fMaxVz) {
1198  if (fGeneralHistograms) fHistEventRejection->Fill("Vz",1);
1199  return kFALSE;
1200  }
1201 
1202  if (fNVertSPDCont > 0 && fZvertexDiff < 999) {
1203  Double_t vzSPD = fVertexSPD[2];
1204  Double_t dvertex = TMath::Abs(vz-vzSPD);
1205  //if difference larger than fZvertexDiff
1206  if (dvertex > fZvertexDiff) {
1207  if (fGeneralHistograms) fHistEventRejection->Fill("VzSPD",1);
1208  return kFALSE;
1209  }
1210  }
1211  }
1212 
1213  if (fMinPtTrackInEmcal > 0 && fGeom) {
1214  Bool_t trackInEmcalOk = kFALSE;
1215  Int_t ntracks = GetNParticles(0);
1216  for (Int_t i = 0; i < ntracks; i++) {
1217  AliVParticle *track = GetAcceptParticleFromArray(i,0);
1218  if (!track)
1219  continue;
1220 
1221  Double_t phiMin = fGeom->GetArm1PhiMin() * TMath::DegToRad();
1222  Double_t phiMax = fGeom->GetArm1PhiMax() * TMath::DegToRad();
1223  Int_t runNumber = InputEvent()->GetRunNumber();
1224  if (runNumber>=177295 && runNumber<=197470) { //small SM masked in 2012 and 2013
1225  phiMin = 1.4;
1226  phiMax = TMath::Pi();
1227  }
1228 
1229  if (track->Eta() < fGeom->GetArm1EtaMin() || track->Eta() > fGeom->GetArm1EtaMax() || track->Phi() < phiMin || track->Phi() > phiMax)
1230  continue;
1231  if (track->Pt() > fMinPtTrackInEmcal) {
1232  trackInEmcalOk = kTRUE;
1233  break;
1234  }
1235  }
1236  if (!trackInEmcalOk) {
1237  if (fGeneralHistograms) fHistEventRejection->Fill("trackInEmcal",1);
1238  return kFALSE;
1239  }
1240  }
1241 
1242  if (fMinNTrack > 0) {
1243  Int_t nTracksAcc = 0;
1244  Int_t ntracks = GetNParticles(0);
1245  for (Int_t i = 0; i < ntracks; i++) {
1246  AliVParticle *track = GetAcceptParticleFromArray(i,0);
1247  if (!track)
1248  continue;
1249  if (track->Pt() > fTrackPtCut) {
1250  nTracksAcc++;
1251  if (nTracksAcc>=fMinNTrack)
1252  break;
1253  }
1254  }
1255  if (nTracksAcc<fMinNTrack) {
1256  if (fGeneralHistograms) fHistEventRejection->Fill("minNTrack",1);
1257  return kFALSE;
1258  }
1259  }
1260 
1261  if (!(fEPV0 > fMinEventPlane && fEPV0 <= fMaxEventPlane) &&
1262  !(fEPV0 + TMath::Pi() > fMinEventPlane && fEPV0 + TMath::Pi() <= fMaxEventPlane) &&
1263  !(fEPV0 - TMath::Pi() > fMinEventPlane && fEPV0 - TMath::Pi() <= fMaxEventPlane))
1264  {
1265  if (fGeneralHistograms) fHistEventRejection->Fill("EvtPlane",1);
1266  return kFALSE;
1267  }
1268 
1269  if (fSelectPtHardBin != -999 && fSelectPtHardBin != fPtHardBin) {
1270  if (fGeneralHistograms) fHistEventRejection->Fill("SelPtHardBin",1);
1271  return kFALSE;
1272  }
1273 
1274  // Reject filter for MC data
1275  if (!CheckMCOutliers()) return kFALSE;
1276 
1277  return kTRUE;
1278 }
1279 
1281  // Default implementation of trigger selection
1282  // same as previously (code moved from IsEventSelected
1283  // to trigger selection). Users should re-implement
1284  // this function in case they have certain needs, in
1285  // particular for EMCAL triggers
1286  AliDebugStream(3) << "Using default trigger selection" << std::endl;
1287  if (!fTrigClass.IsNull()) {
1288  TString fired = InputEvent()->GetFiredTriggerClasses();
1289  if (!fired.Contains("-B-")) return kFALSE;
1290 
1291  std::unique_ptr<TObjArray> arr(fTrigClass.Tokenize("|"));
1292  if (!arr) return kFALSE;
1293  Bool_t match = false;
1294  for (Int_t i=0;i<arr->GetEntriesFast();++i) {
1295  TObject *obj = arr->At(i);
1296  if (!obj) continue;
1297 
1298  //Check if requested trigger was fired
1299  TString objStr = obj->GetName();
1301  (objStr.Contains("J1") || objStr.Contains("J2") || objStr.Contains("G1") || objStr.Contains("G2"))) {
1302  // This is relevant for EMCal triggers with 2 thresholds
1303  // If the kOverlapWithLowThreshold was requested than the overlap between the two triggers goes with the lower threshold trigger
1304  TString trigType1 = "J1";
1305  TString trigType2 = "J2";
1306  if(objStr.Contains("G")) {
1307  trigType1 = "G1";
1308  trigType2 = "G2";
1309  }
1310  if(objStr.Contains(trigType2) && fired.Contains(trigType2.Data())) { //requesting low threshold + overlap
1311  match = 1;
1312  break;
1313  } else if(objStr.Contains(trigType1) && fired.Contains(trigType1.Data()) && !fired.Contains(trigType2.Data())) { //high threshold only
1314  match = 1;
1315  break;
1316  }
1317  }
1318  else {
1319  // If this is not an EMCal trigger, or no particular treatment of EMCal triggers was requested,
1320  // simply check that the trigger was fired
1321  if (fired.Contains(obj->GetName())) {
1322  match = 1;
1323  break;
1324  }
1325  }
1326  }
1327  if (!match) return kFALSE;
1328  }
1329  return kTRUE;
1330 }
1331 
1333 {
1334  if (!fPythiaHeader || !fMCRejectFilter) return kTRUE;
1335  AliDebugStream(2) << "Using custom outlier rejection" << std::endl;
1336 
1337  // Condition 1: Pythia jet / pT-hard > factor
1338  if (fPtHardAndJetPtFactor > 0.) {
1339  AliTLorentzVector jet;
1340 
1341  Int_t nTriggerJets = fPythiaHeader->NTriggerJets();
1342 
1343  AliDebug(2,Form("Njets: %d, pT Hard %f",nTriggerJets, fPtHard));
1344 
1345  Float_t tmpjet[]={0,0,0,0};
1346  for (Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
1347  fPythiaHeader->TriggerJet(ijet, tmpjet);
1348 
1349  jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
1350 
1351  AliDebug(2,Form("jet %d; pycell jet pT %f",ijet, jet.Pt()));
1352 
1353  //Compare jet pT and pt Hard
1354  if (jet.Pt() > fPtHardAndJetPtFactor * fPtHard) {
1355  AliInfo(Form("Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", fPtHard, jet.Pt(), fPtHardAndJetPtFactor));
1356  return kFALSE;
1357  }
1358  }
1359  }
1360  // end condition 1
1361 
1362  // Condition 2 : Reconstructed EMCal cluster pT / pT-hard > factor
1363  if (fPtHardAndClusterPtFactor > 0.) {
1364  AliClusterContainer* mccluscont = GetClusterContainer(0);
1365  if ((Bool_t)mccluscont) {
1366  for (auto cluster : mccluscont->all()) {// Not cuts applied ; use accept for cuts
1367  Float_t ecluster = cluster->E();
1368 
1369  if (ecluster > (fPtHardAndClusterPtFactor * fPtHard)) {
1370  AliInfo(Form("Reject : ecluster %2.2f, calo %d, factor %2.2f, ptHard %f",ecluster,cluster->GetType(),fPtHardAndClusterPtFactor,fPtHard));
1371  return kFALSE;
1372  }
1373  }
1374  }
1375  }
1376  // end condition 2
1377 
1378  // condition 3 : Reconstructed track pT / pT-hard >factor
1379  if (fPtHardAndTrackPtFactor > 0.) {
1380  AliMCParticleContainer* mcpartcont = dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(0));
1381  if ((Bool_t)mcpartcont) {
1382  for (auto mctrack : mcpartcont->all()) {// Not cuts applied ; use accept for cuts
1383  Float_t trackpt = mctrack->Pt();
1384  if (trackpt > (fPtHardAndTrackPtFactor * fPtHard) ) {
1385  AliInfo(Form("Reject : track %2.2f, factor %2.2f, ptHard %f", trackpt, fPtHardAndTrackPtFactor, fPtHard));
1386  return kFALSE;
1387  }
1388  }
1389  }
1390  }
1391  // end condition 3
1392 
1393  return kTRUE;
1394 }
1395 
1396 TClonesArray *AliAnalysisTaskEmcal::GetArrayFromEvent(const char *name, const char *clname)
1397 {
1398  TClonesArray *arr = 0;
1399  TString sname(name);
1400  if (!sname.IsNull()) {
1401  arr = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(sname));
1402  if (!arr) {
1403  AliWarning(Form("%s: Could not retrieve array with name %s!", GetName(), name));
1404  return 0;
1405  }
1406  } else {
1407  return 0;
1408  }
1409 
1410  if (!clname)
1411  return arr;
1412 
1413  TString objname(arr->GetClass()->GetName());
1414  TClass cls(objname);
1415  if (!cls.InheritsFrom(clname)) {
1416  AliWarning(Form("%s: Objects of type %s in %s are not inherited from %s!",
1417  GetName(), cls.GetName(), name, clname));
1418  return 0;
1419  }
1420  return arr;
1421 }
1422 
1424 {
1425  fVertex[0] = 0;
1426  fVertex[1] = 0;
1427  fVertex[2] = 0;
1428  fNVertCont = 0;
1429 
1430  fVertexSPD[0] = 0;
1431  fVertexSPD[1] = 0;
1432  fVertexSPD[2] = 0;
1433  fNVertSPDCont = 0;
1434 
1435  if (fGeneratePythiaInfoObject && MCEvent()) {
1436  GeneratePythiaInfoObject(MCEvent());
1437  }
1438 
1439  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1440  if (vert) {
1441  vert->GetXYZ(fVertex);
1442  fNVertCont = vert->GetNContributors();
1443  }
1444 
1445  const AliVVertex *vertSPD = InputEvent()->GetPrimaryVertexSPD();
1446  if (vertSPD) {
1447  vertSPD->GetXYZ(fVertexSPD);
1448  fNVertSPDCont = vertSPD->GetNContributors();
1449  }
1450 
1451  fBeamType = GetBeamType();
1452  TObject * header = InputEvent()->GetHeader();
1453  if (fBeamType == kAA || fBeamType == kpA ) {
1455  if (header->InheritsFrom("AliNanoAODStorage")){
1456  AliNanoAODHeader *nanoHead = (AliNanoAODHeader*)header;
1457  fCent=nanoHead->GetCentr(fCentEst.Data());
1458  }else{
1459  AliMultSelection *MultSelection = static_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
1460  if (MultSelection) {
1461  fCent = MultSelection->GetMultiplicityPercentile(fCentEst.Data());
1462  }
1463  else {
1464  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1465  }
1466  }
1467  }
1468  else { // old centrality estimation < 2015
1469  if (header->InheritsFrom("AliNanoAODStorage")){
1470  AliNanoAODHeader *nanoHead = (AliNanoAODHeader*)header;
1471  fCent=nanoHead->GetCentr(fCentEst.Data());
1472  }else{
1473  AliCentrality *aliCent = InputEvent()->GetCentrality();
1474  if (aliCent) {
1475  fCent = aliCent->GetCentralityPercentile(fCentEst.Data());
1476  }
1477  else {
1478  AliWarning(Form("%s: Could not retrieve centrality information! Assuming 99", GetName()));
1479  }
1480  }
1481  }
1482 
1483  if (fNcentBins==4) {
1484  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1485  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1486  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1487  else if (fCent >= 50 && fCent <= 100) fCentBin = 3;
1488  else {
1489  AliWarning(Form("%s: Negative centrality: %f. Assuming 99", GetName(), fCent));
1490  fCentBin = fNcentBins-1;
1491  }
1492  }
1493  else if (fNcentBins==5) { // for PbPb 2015
1494  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1495  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1496  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1497  else if (fCent >= 50 && fCent <= 90) fCentBin = 3;
1498  else if (fCent > 90) {
1499  fCent = 99;
1500  fCentBin = 4;
1501  }
1502  else {
1503  AliWarning(Form("%s: Negative centrality: %f. Assuming 99", GetName(), fCent));
1504  fCentBin = fNcentBins-1;
1505  }
1506  }
1507  else {
1508  Double_t centWidth = (fMaxCent-fMinCent)/(Double_t)fNcentBins;
1509  if(centWidth>0.) {
1510  fCentBin = TMath::FloorNint(fCent/centWidth);
1511  }
1512  else {
1513  fCentBin = 0;
1514  }
1515  if (fCentBin>=fNcentBins) {
1516  AliWarning(Form("%s: fCentBin too large: cent = %f fCentBin = %d. Assuming 99", GetName(),fCent,fCentBin));
1517  fCentBin = fNcentBins-1;
1518  }
1519  }
1520  if (header->InheritsFrom("AliNanoAODStorage")){
1521  AliNanoAODHeader *nanoHead = (AliNanoAODHeader*)header;
1522  fEPV0=nanoHead->GetVar(nanoHead->GetVarIndex("cstEvPlaneV0"));
1523  fEPV0A=nanoHead->GetVar(nanoHead->GetVarIndex("cstEvPlaneV0A"));
1524  fEPV0C=nanoHead->GetVar(nanoHead->GetVarIndex("cstEvPlaneV0C"));
1525  }else{
1526  AliEventplane *aliEP = InputEvent()->GetEventplane();
1527  if (aliEP) {
1528  fEPV0 = aliEP->GetEventplane("V0" ,InputEvent());
1529  fEPV0A = aliEP->GetEventplane("V0A",InputEvent());
1530  fEPV0C = aliEP->GetEventplane("V0C",InputEvent());
1531  } else {
1532  AliWarning(Form("%s: Could not retrieve event plane information!", GetName()));
1533  }
1534  }
1535  }
1536  else {
1537  fCent = 99;
1538  fCentBin = 0;
1539  }
1540 
1541  if (fIsPythia) {
1542  if (MCEvent()) {
1543  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
1544  if (!fPythiaHeader) {
1545  // Check if AOD
1546  AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1547 
1548  if (aodMCH) {
1549  for (UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1550  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
1551  if (fPythiaHeader) break;
1552  }
1553  }
1554  }
1555  }
1556  }
1557 
1558  if (fPythiaHeader) {
1559  fPtHard = fPythiaHeader->GetPtHard();
1560 
1561  if(fPtHardBinning.GetSize()){
1562  // pt-hard binning defined for the corresponding dataset - automatically determine the bin
1563  for (fPtHardBin = 0; fPtHardBin < fNPtHardBins; fPtHardBin++) {
1564  if (fPtHard >= static_cast<float>(fPtHardBinning[fPtHardBin]) && fPtHard < static_cast<float>(fPtHardBinning[fPtHardBin+1]))
1565  break;
1566  }
1567  } else {
1568  // No pt-hard binning defined for the dataset - leaving the bin to 0
1569  fPtHardBin = 0;
1570  }
1571 
1572  if(fPtHardInitialized){
1573  // do check only in case the global pt-hard bin is initialized
1575  AliErrorStream() << GetName() << ": Mismatch in pt-hard bin determination. Local: " << fPtHardBin << ", Global: " << fPtHardBinGlobal << std::endl;
1576  }
1577  }
1578 
1579  fXsection = fPythiaHeader->GetXsection();
1580  fNTrials = fPythiaHeader->Trials();
1581  }
1582 
1583  if (fIsHerwig) {
1584  if (MCEvent()) {
1585  fHerwigHeader = dynamic_cast<AliGenHerwigEventHeader*>(MCEvent()->GenEventHeader());
1586 
1587  if (!fHerwigHeader) {
1588  // Check if AOD
1589  AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
1590 
1591  if (aodMCH) {
1592  for (UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
1593  fHerwigHeader = dynamic_cast<AliGenHerwigEventHeader*>(aodMCH->GetCocktailHeader(i));
1594  if (fHerwigHeader) break;
1595  }
1596  }
1597  }
1598  }
1599  }
1600 
1601  if (fHerwigHeader) {
1602  fPtHard = fHerwigHeader->GetPtHard();
1603 
1604  if(fPtHardBinning.GetSize()){
1605  // pt-hard binning defined for the corresponding dataset - automatically determine the bin
1606  for (fPtHardBin = 0; fPtHardBin < fNPtHardBins; fPtHardBin++) {
1608  break;
1609  }
1610  } else {
1611  // No pt-hard binning defined for the dataset - leaving the bin to 0
1612  fPtHardBin = 0;
1613  }
1614  fXsection = fHerwigHeader->Weight();
1615  fNTrials = fHerwigHeader->Trials();
1616  }
1617 
1618 
1620 
1621  AliEmcalContainer* cont = 0;
1622 
1623  TIter nextPartColl(&fParticleCollArray);
1624  while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))){
1625  cont->NextEvent(InputEvent());
1626  }
1627 
1628  TIter nextClusColl(&fClusterCollArray);
1629  while ((cont = static_cast<AliParticleContainer*>(nextClusColl()))){
1630  cont->NextEvent(InputEvent());
1631  }
1632 
1633  return kTRUE;
1634 }
1635 
1637 {
1638  if (TString(n).IsNull()) return 0;
1639 
1641 
1642  fParticleCollArray.Add(cont);
1643 
1644  return cont;
1645 }
1646 
1648 {
1649  if (TString(n).IsNull()) return 0;
1650 
1651  AliTrackContainer* cont = new AliTrackContainer(n);
1652 
1653  fParticleCollArray.Add(cont);
1654 
1655  return cont;
1656 }
1657 
1659 {
1660  if (TString(n).IsNull()) return 0;
1661 
1663 
1664  fParticleCollArray.Add(cont);
1665 
1666  return cont;
1667 }
1668 
1670 {
1671  if (TString(n).IsNull()) return 0;
1672 
1674 
1675  fClusterCollArray.Add(cont);
1676 
1677  return cont;
1678 }
1679 
1681 {
1682  if (i<0 || i>fParticleCollArray.GetEntriesFast()) return 0;
1683  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
1684  return cont;
1685 }
1686 
1688 {
1689  if (i<0 || i>fClusterCollArray.GetEntriesFast()) return 0;
1690  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
1691  return cont;
1692 }
1693 
1695 {
1696  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.FindObject(name));
1697  return cont;
1698 }
1699 
1701 {
1702  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.FindObject(name));
1703  return cont;
1704 }
1705 
1707 {
1709  if (!cont) {
1710  AliError(Form("%s: Particle container %d not found",GetName(),i));
1711  return 0;
1712  }
1713  TString contName = cont->GetArrayName();
1714  return cont->GetArray();
1715 }
1716 
1718 {
1720  if (!cont) {
1721  AliError(Form("%s:Cluster container %d not found",GetName(),i));
1722  return 0;
1723  }
1724  return cont->GetArray();
1725 }
1726 
1728 {
1729 
1731  if (!cont) {
1732  AliError(Form("%s: Particle container %d not found",GetName(),c));
1733  return 0;
1734  }
1735  AliVParticle *vp = cont->GetAcceptParticle(p);
1736 
1737  return vp;
1738 }
1739 
1741 {
1743  if (!cont) {
1744  AliError(Form("%s: Cluster container %d not found",GetName(),c));
1745  return 0;
1746  }
1747  AliVCluster *vc = cont->GetAcceptCluster(cl);
1748 
1749  return vc;
1750 }
1751 
1753 {
1755  if (!cont) {
1756  AliError(Form("%s: Particle container %d not found",GetName(),i));
1757  return 0;
1758  }
1759  return cont->GetNEntries();
1760 }
1761 
1763 {
1765  if (!cont) {
1766  AliError(Form("%s: Cluster container %d not found",GetName(),i));
1767  return 0;
1768  }
1769  return cont->GetNEntries();
1770 }
1771 
1772 AliEMCALTriggerPatchInfo* AliAnalysisTaskEmcal::GetMainTriggerPatch(TriggerCategory trigger, Bool_t doSimpleOffline)
1773 {
1774 
1775  if (!fTriggerPatchInfo) {
1776  AliError(Form("%s: fTriggerPatchInfo not available",GetName()));
1777  return 0;
1778  }
1779 
1780  //number of patches in event
1781  Int_t nPatch = fTriggerPatchInfo->GetEntries();
1782 
1783  //extract main trigger patch(es)
1784  AliEMCALTriggerPatchInfo *patch(NULL), *selected(NULL);
1785  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
1786 
1787  patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
1788  if (patch->IsMainTrigger()) {
1789  if(doSimpleOffline){
1790  if(patch->IsOfflineSimple()){
1791  switch(trigger){
1792  case kTriggerLevel0:
1793  // option not yet implemented in the trigger maker
1794  if(patch->IsLevel0()) selected = patch;
1795  break;
1796  case kTriggerLevel1Jet:
1797  if(patch->IsJetHighSimple() || patch->IsJetLowSimple()){
1798  if(!selected) selected = patch;
1799  else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1800  }
1801  break;
1802  case kTriggerLevel1Gamma:
1803  if(patch->IsGammaHighSimple() || patch->IsGammaLowSimple()){
1804  if(!selected) selected = patch;
1805  else if(patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) selected = patch;
1806  }
1807  break;
1808  default: // Silence compiler warnings
1809  AliError("Untreated case: Main Patch is recalculated; should be in 'else' branch");
1810  };
1811  }
1812  } else { // Not OfflineSimple
1813  switch(trigger){
1814  case kTriggerLevel0:
1815  if(patch->IsLevel0()) selected = patch;
1816  break;
1817  case kTriggerLevel1Jet:
1818  if(patch->IsJetHigh() || patch->IsJetLow()){
1819  if(!selected) selected = patch;
1820  else if (patch->GetADCAmp() > selected->GetADCAmp())
1821  selected = patch;
1822  }
1823  break;
1824  case kTriggerLevel1Gamma:
1825  if(patch->IsGammaHigh() || patch->IsGammaLow()){
1826  if(!selected) selected = patch;
1827  else if (patch->GetADCAmp() > selected->GetADCAmp())
1828  selected = patch;
1829  }
1830  break;
1831  default:
1832  AliError("Untreated case: Main Patch is recalculated; should be in 'else' branch");
1833  };
1834  }
1835  }
1836  else if ((trigger == kTriggerRecalcJet && patch->IsRecalcJet()) ||
1837  (trigger == kTriggerRecalcGamma && patch->IsRecalcGamma())) { // recalculated patches
1838  if (doSimpleOffline && patch->IsOfflineSimple()) {
1839  if(!selected) selected = patch;
1840  else if (patch->GetADCOfflineAmp() > selected->GetADCOfflineAmp()) // this in fact should not be needed, but we have it in teh other branches as well, so keeping it for compleness
1841  selected = patch;
1842  }
1843  else if (!doSimpleOffline && !patch->IsOfflineSimple()) {
1844  if(!selected) selected = patch;
1845  else if (patch->GetADCAmp() > selected->GetADCAmp())
1846  selected = patch;
1847  }
1848  }
1849  }
1850  return selected;
1851 }
1852 
1854 {
1855  if (!(InputEvent()->FindListObject(obj->GetName()))) {
1856  InputEvent()->AddObject(obj);
1857  }
1858  else {
1859  if (!attempt) {
1860  AliFatal(Form("%s: Container with name %s already present. Aborting", GetName(), obj->GetName()));
1861  }
1862  }
1863 }
1864 
1866 {
1867 
1868  if (!fGeom) {
1869  AliWarning(Form("%s - AliAnalysisTaskEmcal::IsTrackInEmcalAcceptance - Geometry is not available!", GetName()));
1870  return kFALSE;
1871  }
1872 
1873  Double_t minPhi = fGeom->GetArm1PhiMin() - edges;
1874  Double_t maxPhi = fGeom->GetArm1PhiMax() + edges;
1875 
1876  if (part->Phi() > minPhi && part->Phi() < maxPhi) {
1877  return kTRUE;
1878  }
1879  else {
1880  return kFALSE;
1881  }
1882 }
1883 
1885 {
1886  axis->SetBinLabel(1, "NullObject");
1887  axis->SetBinLabel(2, "Pt");
1888  axis->SetBinLabel(3, "Acceptance");
1889  axis->SetBinLabel(4, "MCLabel");
1890  axis->SetBinLabel(5, "BitMap");
1891  axis->SetBinLabel(6, "HF cut");
1892  axis->SetBinLabel(7, "Bit6");
1893  axis->SetBinLabel(8, "NotHybridTrack");
1894  axis->SetBinLabel(9, "MCFlag");
1895  axis->SetBinLabel(10, "MCGenerator");
1896  axis->SetBinLabel(11, "ChargeCut");
1897  axis->SetBinLabel(12, "MinDistanceTPCSectorEdge");
1898  axis->SetBinLabel(13, "Bit12");
1899  axis->SetBinLabel(14, "IsEMCal");
1900  axis->SetBinLabel(15, "Time");
1901  axis->SetBinLabel(16, "Energy");
1902  axis->SetBinLabel(17, "ExoticCut");
1903  axis->SetBinLabel(18, "Bit17");
1904  axis->SetBinLabel(19, "Area");
1905  axis->SetBinLabel(20, "AreaEmc");
1906  axis->SetBinLabel(21, "ZLeadingCh");
1907  axis->SetBinLabel(22, "ZLeadingEmc");
1908  axis->SetBinLabel(23, "NEF");
1909  axis->SetBinLabel(24, "MinLeadPt");
1910  axis->SetBinLabel(25, "MaxTrackPt");
1911  axis->SetBinLabel(26, "MaxClusterPt");
1912  axis->SetBinLabel(27, "Flavour");
1913  axis->SetBinLabel(28, "TagStatus");
1914  axis->SetBinLabel(29, "MinNConstituents");
1915  axis->SetBinLabel(30, "Bit29");
1916  axis->SetBinLabel(31, "Bit30");
1917  axis->SetBinLabel(32, "Bit31");
1918 }
1919 
1920 Double_t AliAnalysisTaskEmcal::GetParallelFraction(AliVParticle* part1, AliVParticle* part2)
1921 {
1922  TVector3 vect1(part1->Px(), part1->Py(), part1->Pz());
1923  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1924  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1925  return z;
1926 }
1927 
1928 Double_t AliAnalysisTaskEmcal::GetParallelFraction(const TVector3& vect1, AliVParticle* part2)
1929 {
1930  TVector3 vect2(part2->Px(), part2->Py(), part2->Pz());
1931  Double_t z = (vect1 * vect2) / (vect2 * vect2);
1932  return z;
1933 }
1934 
1935 void AliAnalysisTaskEmcal::GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
1936 {
1937  phidiff = 999;
1938  etadiff = 999;
1939 
1940  if (!t||!v) return;
1941 
1942  Double_t veta = t->GetTrackEtaOnEMCal();
1943  Double_t vphi = t->GetTrackPhiOnEMCal();
1944 
1945  Float_t pos[3] = {0};
1946  v->GetPosition(pos);
1947  TVector3 cpos(pos);
1948  Double_t ceta = cpos.Eta();
1949  Double_t cphi = cpos.Phi();
1950  etadiff=veta-ceta;
1951  phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
1952 }
1953 
1954 Byte_t AliAnalysisTaskEmcal::GetTrackType(const AliVTrack *t)
1955 {
1956  Byte_t ret = 0;
1957  if (t->TestBit(BIT(22)) && !t->TestBit(BIT(23)))
1958  ret = 1;
1959  else if (!t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1960  ret = 2;
1961  else if (t->TestBit(BIT(22)) && t->TestBit(BIT(23)))
1962  ret = 3;
1963  return ret;
1964 }
1965 
1966 Byte_t AliAnalysisTaskEmcal::GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2)
1967 {
1968 
1969  Int_t res = 0;
1970 
1971  if (aodTrack->TestFilterBit(filterBit1)) {
1972  res = 0;
1973  }
1974  else if (aodTrack->TestFilterBit(filterBit2)) {
1975  if ((aodTrack->GetStatus()&AliVTrack::kITSrefit)!=0) {
1976  res = 1;
1977  }
1978  else {
1979  res = 2;
1980  }
1981  }
1982  else {
1983  res = 3;
1984  }
1985 
1986  return res;
1987 }
1988 
1990 {
1991  if (!fPythiaInfo) {
1993  }
1994 
1995  AliStack* stack = mcEvent->Stack();
1996 
1997  const Int_t nprim = stack->GetNprimary();
1998  // reject if partons are missing from stack for some reason
1999  if (nprim < 8) return;
2000 
2001  TParticle *part6 = stack->Particle(6);
2002  TParticle *part7 = stack->Particle(7);
2003 
2004  fPythiaInfo->SetPartonFlag6(TMath::Abs(part6->GetPdgCode()));
2005  fPythiaInfo->SetParton6(part6->Pt(), part6->Eta(), part6->Phi(), part6->GetMass());
2006 
2007  fPythiaInfo->SetPartonFlag7(TMath::Abs(part7->GetPdgCode()));
2008  fPythiaInfo->SetParton7(part7->Pt(), part7->Eta(), part7->Phi(), part7->GetMass());
2009 
2010  AliGenPythiaEventHeader *pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(mcEvent->GenEventHeader());
2011  if(pythiaGenHeader){
2012  Float_t ptWeight=pythiaGenHeader->EventWeight();
2013  fPythiaInfo->SetPythiaEventWeight(ptWeight);}
2014 }
2015 
2017 {
2018  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
2019  if (!mgr) {
2020  ::Error("AddAODHandler", "No analysis manager to connect to.");
2021  return NULL;
2022  }
2023 
2024  AliAODInputHandler* aodHandler = new AliAODInputHandler();
2025 
2026  AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2027  if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2028  AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2029  multiInputHandler->AddInputEventHandler(aodHandler);
2030  }
2031  else {
2032  if (!inputHandler) {
2033  mgr->SetInputEventHandler(aodHandler);
2034  }
2035  else {
2036  ::Error("AddAODHandler", "inputHandler is NOT null. AOD handler was NOT added !!!");
2037  return NULL;
2038  }
2039  }
2040 
2041  return aodHandler;
2042 }
2043 
2045 {
2046  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
2047  if (!mgr) {
2048  ::Error("AddESDHandler", "No analysis manager to connect to.");
2049  return NULL;
2050  }
2051 
2052  AliESDInputHandler *esdHandler = new AliESDInputHandler();
2053 
2054  AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
2055  if (inputHandler && (inputHandler->IsA() == AliMultiInputEventHandler::Class())) {
2056  AliMultiInputEventHandler *multiInputHandler=(AliMultiInputEventHandler*)inputHandler;
2057  multiInputHandler->AddInputEventHandler(esdHandler);
2058  }
2059  else {
2060  if (!inputHandler) {
2061  mgr->SetInputEventHandler(esdHandler);
2062  }
2063  else {
2064  ::Error("AddESDHandler", "inputHandler is NOT null. ESD handler was NOT added !!!");
2065  return NULL;
2066  }
2067  }
2068 
2069  return esdHandler;
2070 }
2071 
virtual Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
Bool_t fGeneratePythiaInfoObject
Generate Pythia info object.
TObjArray fClusterCollArray
cluster collection array
Int_t fNVertSPDCont
!event SPD vertex number of contributors
void SetParticlePtCut(Double_t cut)
Bool_t fIsPythia
trigger, if it is a PYTHIA production
double Double_t
Definition: External.C:58
void SetParton7(Float_t pt, Float_t eta, Float_t phi, Float_t mass=0)
TH2 * fHistPtHardBinCorr
!Correlation between global and local (per-event) -hard bin
TH1 * fHistTrials
!trials from pyxsec.root
Bool_t fPtHardInitialized
!flag whether the -hard bin was initialized, purely for internal processing
Definition: External.C:236
void SetArray(const AliVEvent *event)
EMCAL Level1 gamma trigger, low threshold.
AliEmcalPythiaInfo * fPythiaInfo
!event parton info
Bool_t AcceptTrack(AliVParticle *track, Int_t c=0) const
ULong_t GetTriggerList()
Get list of selected triggers of the given event.
Int_t fPtHardBinGlobal
!event -hard bin, detected from filename
EMCAL Level1 jet trigger, low threshold.
Bool_t HasTriggerType(TriggerType triggersel)
Check if event has a given trigger type.
Int_t fNTrials
!event trials
UInt_t fOffTrigger
offline trigger for event selection
Double_t fVertexSPD[3]
!event Svertex
Double_t fMinCent
min centrality for event selection
Double_t fTrackPtCut
cut on track pt in event selection
Bool_t fRecycleUnusedEmbeddedEventsMode
Allows the recycling of embedded events which fail internal event selection. See the embedding helper...
Recalculated jet trigger patch; does not need to be above trigger threshold.
Base task in the EMCAL framework.
Bool_t fLocalInitialized
whether or not the task has been already initialized
Bool_t fUsePtHardBinScaling
Use -hard bin scaling in merging.
TH2 * fHistPtHardCorrGlobal
!Correlation between -hard value and global bin
void SetPartonFlag7(Int_t flag7)
Container with name, TClonesArray and cuts for particles.
Bool_t fUseXsecFromHeader
! Use cross section from header instead of pyxsec.root (purely transient)
TSystem * gSystem
void SetTrackPtCut(Double_t cut, Int_t c=0)
Apply cut on the transverse momentum of all tracks in the track container with index c...
static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
Calculate and difference between a track (t) and a cluster (c).
Double_t fMinBinPt
min pt in histograms
Double_t fEPV0
!event plane V0
Double_t phiMin
static AliEmcalDownscaleFactorsOCDB * Instance()
Int_t fNPtHardBins
Number of -hard bins in the dataset.
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
Bool_t AcceptCluster(AliVCluster *clus, Int_t c=0) const
Cluster selection.
TCanvas * c
Definition: TestFitELoss.C:172
virtual void UserExecOnce()
Task initializations handled in user tasks.
Int_t fCentBin
!event centrality bin
virtual Bool_t IsTriggerSelected()
Selection of a hardware trigger.
TH1 * fHistEventsAfterSel
!total number of events per pt hard bin after selection
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
const AliMCParticleIterableContainer all() const
Int_t fMinVertexContrib
Min. number of vertex contributors.
Float_t fPtHardAndClusterPtFactor
Factor between ptHard and cluster pT to reject/accept event.
Double_t fMinPtTrackInEmcal
min pt track in emcal
AliStack * stack
TH1 * fHistEventPlane
!event plane distribution
Bool_t fUseBuiltinEventSelection
Use builtin event selection of the AliAnalysisTaskEmcal instead of AliEventCuts.
TH1 * fHistEvents
!total number of events per pt hard bin
void SetClusPtCut(Double_t cut, Int_t c=0)
Apply cut on for all clusters in container with index c.
AliClusterContainer * AddClusterContainer(const char *n)
Create new cluster container and attach it to the task.
virtual void NextEvent(const AliVEvent *event)
Preparation for the next event.
Double_t fEPV0C
!event plane V0C
void SetParton6(Float_t pt, Float_t eta, Float_t phi, Float_t mass=0)
TH1 * fHistCentrality
!event centrality distribution
Container for particles within the EMCAL framework.
Bool_t fIsEmbedded
trigger, embedded signal
TObjArray fParticleCollArray
particle/track collection array
BeamType
Switch for the beam type.
void SetTrackEtaLimits(Double_t min, Double_t max, Int_t c=0)
Apply cut on the pseudorapidity of the all tracks in the track container with index c...
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
TProfile * fHistXsectionAfterSel
!x section from pythia header
TriggerType
Switch for EMCAL trigger types.
virtual Bool_t CheckMCOutliers()
Filter the mc tails in pt-hard distributions.
EMCalTriggerMode_t fEMCalTriggerMode
EMCal trigger selection mode.
virtual Bool_t FillHistograms()
Function filling histograms.
Int_t GetNParticles(Int_t i=0) const
Get number of particles in container attached to this task with index i.
TClonesArray * fCaloClusters
!clusters
Bool_t fUseNewCentralityEstimation
Use new centrality estimation (for 2015 data)
Bool_t IsTrackInEmcalAcceptance(AliVParticle *part, Double_t edges=0.9) const
Determines if a track is inside the EMCal acceptance.
int Int_t
Definition: External.C:63
TH1 * fHistTriggerClasses
!number of events in each trigger class
Bool_t fCountDownscaleCorrectedEvents
Count event number corrected for downscaling.
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
Double_t fMaxVz
max vertex for event selection
void GeneratePythiaInfoObject(AliMCEvent *mcEvent)
Copy some information about the Pythia event in a PythaInfo object.
AliEMCALGeometry * fGeom
!emcal geometry
The overlap between low and high threshold trigger is assigned to the lower threshold only...
kRecalculated gamma trigger patch; does not need to be above trigger threshold
TString fCaloTriggerPatchInfoName
trigger patch info array name
TString fCaloTriggersName
name of calo triggers collection
TH1 * fHistTriggerClassesCorr
!corrected number of events in each trigger class
Bool_t fIsHerwig
trigger, if it is a HERWIG production
AliGenPythiaEventHeader * fPythiaHeader
!event Pythia header
void SetTrackPhiLimits(Double_t min, Double_t max, Int_t c=0)
Apply cut on azimuthal angle of the all tracks in the track container with index c...
Double_t phiMax
AliParticleContainer * AddParticleContainer(const char *n)
Create new particle container and attach it to the task.
AliAnalysisUtils * fAliAnalysisUtils
!vertex selection (optional)
BeamType fForceBeamType
forced beam type
void SetUseScaling(Bool_t val)
Definition: AliEmcalList.h:31
Int_t fNcentBins
how many centrality bins
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Base class for container structures within the EMCAL framework.
TriggerType fTriggerTypeSel
trigger type to select based on trigger patches
virtual Bool_t AcceptCluster(Int_t i, UInt_t &rejectionReason) const
virtual Bool_t FillGeneralHistograms()
Filling general histograms.
TString fTrigClass
trigger class name for event selection
Float_t fPtHardAndJetPtFactor
Factor between ptHard and jet pT to reject/accept event.
AliVCluster * GetAcceptCluster(Int_t i) const
TClonesArray * GetParticleArray(Int_t i=0) const
Get TClonesArray with particles.
BeamType GetBeamType() const
Get beam type.
Double_t fMinVz
min vertex for event selection
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
BeamType fBeamType
!event beam type
Float_t fPtHardAndTrackPtFactor
Factor between ptHard and track pT to reject/accept event.
Double_t fCent
!event centrality
TClonesArray * GetArray() const
Double_t fMinEventPlane
minimum event plane value
TString fCaloCellsName
name of calo cell collection
Int_t fMCLabelShift
if MC label > fMCLabelShift, MC label -= fMCLabelShift
Int_t GetNClusters(Int_t i=0) const
Get number of clusters in the cluster container attached to this task with index i.
Int_t fNVertCont
!event vertex number of contributors
Bool_t fMCRejectFilter
enable the filtering of events by tail rejection
Bool_t fGetPtHardBinFromName
Obtain pt-hard bin from file path.
unsigned long ULong_t
Definition: External.C:38
Double_t fZvertexDiff
upper limit for distance between primary and SPD vertex
virtual Bool_t AcceptParticle(const AliVParticle *vp, UInt_t &rejectionReason) const
AliEMCALTriggerPatchInfo * GetMainTriggerPatch(TriggerCategory triggersel=kTriggerLevel1Jet, Bool_t doSimpleOffline=kFALSE)
Get main trigger match.
EMCAL Level0 trigger.
EMCAL Level1 jet trigger, high threshold.
Int_t fSelectPtHardBin
select one pt hard bin for analysis
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Calculates the fraction of momentum z of part 1 w.r.t. part 2 in the direction of part 2...
virtual Bool_t RetrieveEventObjects()
Retrieve common objects from event.
Bool_t fRejectPileup
Reject pilup using function AliAnalysisUtils::IsPileUpEvent()
TProfile * fHistXsection
!x section from pyxsec.root
Bool_t PythiaInfoFromFile(const char *currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
Loading PYTHIA information from external cross section file into the task.
void UserExec(Option_t *option)
Event loop, called for each event.
Int_t fMinMCLabel
minimum MC label value for the tracks/clusters being considered MC particles
void SetPartonFlag6(Int_t flag6)
AliVCaloCells * fCaloCells
!cells
const TString & GetArrayName() const
TClonesArray * GetArrayFromEvent(const char *name, const char *clname=0)
Read a TClonesArray from event.
Enhanced TList-derived class that implements correct merging for pt_hard binned production.
Definition: AliEmcalList.h:25
Double_t fEventPlaneVsEmcal
select events which have a certain event plane wrt the emcal
Bool_t IsEventSelectedInternal()
Perform event selection (old method)
virtual Bool_t IsEventSelected()
Performing event selection.
Float_t fPtHard
!event -hard
TH1 * fHistPtHard
! -hard distribution
void SetParticleEtaLimits(Double_t min, Double_t max)
AliEventCuts fAliEventCuts
Event cuts (run2 defaults)
AliEmcalList * fOutput
!output list
Handler for downscale factors for various triggers obtained from the OCDB.
Double_t fMaxBinPt
max pt in histograms
Int_t fPtHardBin
!event -hard bin
virtual void RunChanged(Int_t)
Process tasks relevant when a file with a different run number is processed.
TClonesArray * fTracks
!tracks
TH1 * fHistTrialsAfterSel
!total number of trials per pt hard bin after selection
AliGenHerwigEventHeader * fHerwigHeader
!event Herwig header
void LoadPythiaInfo(AliVEvent *event)
Load parton info.
Bool_t fIsEsd
!whether it&#39;s an ESD analysis
static AliAODInputHandler * AddAODHandler()
Add an AOD handler to the analysis manager.
Double_t fVertex[3]
!event vertex
AliTrackContainer * AddTrackContainer(const char *n)
Create new track container and attach it to the task.
Bool_t fCreateHisto
whether or not create histograms
Bool_t UserNotify()
Notifying the user that the input data file has changed and performing steps needed to be done...
Store some informaion about a Pythia eventThis class is used to store some information about a Pythia...
TFile * file
TList with histograms for a given trigger.
TH1 * fHistEventRejection
!book keep reasons for rejecting event
Int_t nevents[nsamples]
TClonesArray * fTriggerPatchInfo
!trigger patch info array
TClonesArray * GetClusterArray(Int_t i=0) const
Get TClonesArray with EMCAL clusters.
Bool_t FileChanged()
Steps to be executed when a few file is loaded into the input handler.
Double_t fEPV0A
!event plane V0A
virtual void ExecOnce()
Perform steps needed to initialize the analysis.
TString fCentEst
name of V0 centrality estimator
void SetArray(const AliVEvent *event)
TString fPythiaInfoName
name of pythia info object
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
Declaration of class AliEmcalPythiaInfo.
const char Option_t
Definition: External.C:48
void SetClusPtCut(Double_t cut)
Int_t fRunNumber
!run number (triggering RunChanged())
EMCAL Level1 gamma trigger, high threshold.
void AddObjectToEvent(TObject *obj, Bool_t attempt=kFALSE)
Add object to event.
AliVCaloTrigger * fCaloTriggers
!calo triggers
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
Bool_t fFileChanged
! Signal triggered when the file has changed
TH1 * fHistZVertex
!z vertex position
Int_t fMinNTrack
minimum nr of tracks in event with pT>fTrackPtCut
Int_t GetNEntries() const
static Byte_t GetTrackType(const AliVTrack *t)
Get track type encoded from bits 20 and 21.
Bool_t fUseAliAnaUtils
used for LHC13* data: z-vtx, Ncontributors, z-vtx resolution cuts
void SetClusTimeCut(Double_t min, Double_t max, Int_t c=0)
Apply cut on cluster time for clusters in container with index c.
bool Bool_t
Definition: External.C:53
ULong_t fTriggers
list of fired triggers
static AliESDInputHandler * AddESDHandler()
Add a ESD handler to the analysis manager.
Double_t fMaxEventPlane
maximum event plane value
void SetPythiaEventWeight(Float_t ptWeight)
Float_t fXsection
!x-section from pythia header
TH1 * fHistEventCount
!incoming and selected events
Double_t fMaxCent
max centrality for event selection
void SetClusTimeCut(Double_t min, Double_t max)
TriggerCategory
Online trigger categories.
void SetParticlePhiLimits(Double_t min, Double_t max)
AliVParticle * GetAcceptParticleFromArray(Int_t p, Int_t c=0) const
Get particle p if accepted from container with index c If particle not accepted return 0...
Container structure for EMCAL clusters.
TString fMinBiasRefTrigger
Name of the minmum bias reference trigger, used in the calculation of downscale-corrected event numbe...
Container for MC-true particles within the EMCAL framework.
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
AliVCluster * GetAcceptClusterFromArray(Int_t cl, Int_t c=0) const
Get cluster cl if accepted from container c If particle not accepted return 0.
Int_t fNbins
no. of pt bins
Bool_t fTklVsClusSPDCut
Apply tracklet-vs-cluster SPD cut to reject background events in pp.
AliAnalysisTaskEmcal()
Default constructor.
TH2 * fHistPtHardCorr
!Correlation between -hard value and bin
TArrayI fPtHardBinning
-hard binning
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
virtual ~AliAnalysisTaskEmcal()
Destructor.
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal