AliPhysics  a9863a5 (a9863a5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskChargedParticlesRef.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2015, 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 <vector>
16 #include <map>
17 
18 #include <TArrayD.h>
19 #include <TMath.h>
20 #include <THashList.h>
21 #include <THistManager.h>
22 #include <TString.h>
23 
24 #include "AliAnalysisUtils.h"
25 #include "AliAODInputHandler.h"
26 #include "AliAODTrack.h"
28 #include "AliEMCALGeometry.h"
29 #include "AliEMCALRecoUtils.h"
30 #include "AliEMCALTriggerPatchInfo.h"
31 #include "AliEmcalTrackSelection.h"
33 #include "AliESDtrackCuts.h"
34 #include "AliESDEvent.h"
35 #include "AliInputEventHandler.h"
36 #include "AliVVertex.h"
37 
40 
44 
45 namespace EMCalTriggerPtAnalysis {
46 
50 AliAnalysisTaskChargedParticlesRef::AliAnalysisTaskChargedParticlesRef() :
51  AliAnalysisTaskSE(),
52  fTrackCuts(NULL),
53  fAnalysisUtil(NULL),
54  fTriggerSelection(NULL),
55  fHistos(NULL),
56  fGeometry(NULL),
57  fTriggerStringFromPatches(kFALSE),
58  fYshift(0.465),
59  fEtaSign(1)
60 {
61  // Restrict analysis to the EMCAL acceptance
62  fEtaLabCut[0] = -0.6;
63  fEtaLabCut[1] = 0.6;
64  fEtaCmsCut[0] = -0.13;
65  fEtaCmsCut[1] = 0.13;
66 }
67 
73  AliAnalysisTaskSE(name),
74  fTrackCuts(NULL),
75  fAnalysisUtil(NULL),
76  fTriggerSelection(NULL),
77  fHistos(NULL),
78  fGeometry(NULL),
79  fTriggerStringFromPatches(kFALSE),
80  fYshift(0.465),
81  fEtaSign(1)
82 {
83  // Restrict analysis to the EMCAL acceptance
84  fEtaLabCut[0] = -0.6;
85  fEtaLabCut[1] = 0.6;
86  fEtaCmsCut[0] = -0.13;
87  fEtaCmsCut[1] = 0.13;
88  DefineOutput(1, TList::Class());
89 }
90 
95  //if(fTrackCuts) delete fTrackCuts;
96  if(fAnalysisUtil) delete fAnalysisUtil;
98  if(fHistos) delete fHistos;
99 }
100 
105  fAnalysisUtil = new AliAnalysisUtils;
106 
107  if(!fTrackCuts) InitializeTrackCuts("standard", fInputHandler->IsA() == AliAODInputHandler::Class());
108 
109  TArrayD oldbinning, newbinning;
110  CreateOldPtBinning(oldbinning);
111  CreateNewPtBinning(newbinning);
112 
113  fHistos = new THistManager("Ref");
114  // Exclusive means classes without higher trigger classes:
115  // EG2excl means EG2 && !EG1
116  // EJ2excl means EJ2 && !EJ1
117  // MBExcl means MinBias && !EMCAL trigger
118  // Combined means: gamma and ANY jet class, jet and ANY gamma class
119  // Jonly means: No gamma class fired at the same time
120  // Gonly means: No jet class fired at the same time
121  TString triggers[17] = {
122  "MB", "EMC7",
123  "EJ1", "EJ2", "EG1", "EG2",
124  "EMC7excl", "EG1excl", "EG2excl", "EJ1excl", "EJ2excl",
125  "E1combined", "E1Jonly", "E1Gonly", "E2combined", "E2Jonly", "E2Gonly"
126  };
127  Double_t ptcuts[5] = {1., 2., 5., 10., 20.};
128  for(TString *trg = triggers; trg < triggers + sizeof(triggers)/sizeof(TString); trg++){
129  fHistos->CreateTH1(Form("hEventCount%s", trg->Data()), Form("Event Counter for trigger class %s", trg->Data()), 1, 0.5, 1.5);
130  fHistos->CreateTH1(Form("hVertexBefore%s", trg->Data()), Form("Vertex distribution before z-cut for trigger class %s", trg->Data()), 500, -50, 50);
131  fHistos->CreateTH1(Form("hVertexAfter%s", trg->Data()), Form("Vertex distribution after z-cut for trigger class %s", trg->Data()), 100, -10, 10);
132  fHistos->CreateTH1(Form("hPtEtaAllOldBinning%s", trg->Data()), Form("Charged particle pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
133  fHistos->CreateTH1(Form("hPtEtaCentOldBinning%s", trg->Data()), Form("Charged particle pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
134  fHistos->CreateTH1(Form("hPtEtaAllNewBinning%s", trg->Data()), Form("Charged particle pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
135  fHistos->CreateTH1(Form("hPtEtaCentNewBinning%s", trg->Data()), Form("Charged particle pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
136  fHistos->CreateTH1(Form("hPtEMCALEtaAllOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
137  fHistos->CreateTH1(Form("hPtEMCALEtaCentOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
138  fHistos->CreateTH1(Form("hPtEMCALEtaAllNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
139  fHistos->CreateTH1(Form("hPtEMCALEtaCentNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
140  fHistos->CreateTH1(Form("hPtEMCALNoTRDEtaAllOldBinning%s", trg->Data()), Form("Charged particle in EMCAL (no TRD in front) pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
141  fHistos->CreateTH1(Form("hPtEMCALNoTRDEtaCentOldBinning%s", trg->Data()), Form("Charged particle in EMCAL (no TRD in front) pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
142  fHistos->CreateTH1(Form("hPtEMCALNoTRDEtaAllNewBinning%s", trg->Data()), Form("Charged particle in EMCAL (no TRD in front) pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
143  fHistos->CreateTH1(Form("hPtEMCALNoTRDEtaCentNewBinning%s", trg->Data()), Form("Charged particle in EMCAL (no TRD in front) pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
144  fHistos->CreateTH1(Form("hPtEMCALWithTRDEtaAllOldBinning%s", trg->Data()), Form("Charged particle in EMCAL (with TRD in front) pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
145  fHistos->CreateTH1(Form("hPtEMCALWithTRDEtaCentOldBinning%s", trg->Data()), Form("Charged particle in EMCAL (with TRD in front) pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
146  fHistos->CreateTH1(Form("hPtEMCALWithTRDEtaAllNewBinning%s", trg->Data()), Form("Charged particle in EMCAL (with TRD in front) pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
147  fHistos->CreateTH1(Form("hPtEMCALWithTRDEtaCentNewBinning%s", trg->Data()), Form("Charged particle in EMCAL (with TRD in front) pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
148  for(int ipt = 0; ipt < 5; ipt++){
149  fHistos->CreateTH1(
150  Form("hEtaLabDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
151  Form("Eta (lab) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
152  100,
153  -1.,
154  1.
155  );
156  fHistos->CreateTH1(
157  Form("hEtaLabDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
158  Form("Eta (lab) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
159  100,
160  -1.,
161  1.
162  );
163  fHistos->CreateTH1(
164  Form("hEtaCentDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
165  Form("Eta (cent) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s",
166  trg->Data()),
167  160,
168  -1.3,
169  1.3
170  );
171  fHistos->CreateTH1(
172  Form("hEtaCentDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
173  Form("Eta (cent) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
174  160,
175  -1.3,
176  1.3
177  );
178  fHistos->CreateTH1(
179  Form("hEtaLabDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
180  Form("Eta (lab) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
181  100,
182  -1.,
183  1.
184  );
185  fHistos->CreateTH1(
186  Form("hEtaLabDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
187  Form("Eta (lab) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
188  100,
189  -1.,
190  1.
191  );
192  fHistos->CreateTH1(
193  Form("hEtaCentDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
194  Form("Eta (cent) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
195  160,
196  -1.3,
197  1.3
198  );
199  fHistos->CreateTH1(
200  Form("hEtaCentDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
201  Form("Eta (cent) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
202  160,
203  -1.3,
204  1.3
205  );
206  fHistos->CreateTH1(
207  Form("hPhiDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
208  Form("#phi distribution of particles with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
209  300,
210  0.,
211  2*TMath::Pi()
212  );
213  }
214  }
215  fHistos->GetListOfHistograms()->Add(fTrackCuts);
216  PostData(1, fHistos->GetListOfHistograms());
217 }
218 
228  if(!fGeometry){
229  fGeometry = AliEMCALGeometry::GetInstance();
230  if(!fGeometry)
231  fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
232  }
233  // Select event
234  TClonesArray *triggerpatches = static_cast<TClonesArray *>(fInputEvent->FindListObject("EmcalTriggers"));
235  TString triggerstring = "";
237  triggerstring = GetFiredTriggerClassesFromPatches(triggerpatches);
238  } else {
239  triggerstring = fInputEvent->GetFiredTriggerClasses();
240  }
241  UInt_t selectionstatus = fInputHandler->IsEventSelected();
242  Bool_t isMinBias = selectionstatus & AliVEvent::kINT7,
243  isEJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ1"),
244  isEJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ2"),
245  isEG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG1"),
246  isEG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG2"),
247  isEMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("CEMC7");
248  if(triggerpatches && fTriggerSelection){
254  }
255  if(!(isMinBias || isEMC7 || isEG1 || isEG2 || isEJ1 || isEJ2)) return;
256  const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
257  //if(!fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.)) return; // reject pileup event
258  if(vtx->GetNContributors() < 1) return;
259  if(fInputEvent->IsA() == AliESDEvent::Class() && fAnalysisUtil->IsFirstEventInChunk(fInputEvent)) return;
260  bool isSelected = kTRUE;
261  if(!fAnalysisUtil->IsVertexSelected2013pA(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
262  if(fAnalysisUtil->IsPileUpEvent(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
263  // Apply vertex z cut
264  if(vtx->GetZ() < -10. || vtx->GetZ() > 10.) isSelected = kFALSE;
265 
266  // Fill Event counter and reference vertex distributions for the different trigger classes
267  if(isMinBias){
268  FillEventCounterHists("MB", vtx->GetZ(), isSelected);
269  }
270  if(isEMC7){
271  FillEventCounterHists("EMC7", vtx->GetZ(), isSelected);
272  if(!isMinBias){
273  FillEventCounterHists("EMC7excl", vtx->GetZ(), isSelected);
274  }
275  }
276  if(isEJ2){
277  FillEventCounterHists("EJ2", vtx->GetZ(), isSelected);
278  // Check for exclusive classes
279  if(!isMinBias){
280  FillEventCounterHists("EJ2excl", vtx->GetZ(), isSelected);
281  }
282  if(isEG1 || isEG2){
283  FillEventCounterHists("E2combined", vtx->GetZ(), isSelected);
284  } else {
285  FillEventCounterHists("E2Jonly", vtx->GetZ(), isSelected);
286  }
287  }
288  if(isEJ1){
289  FillEventCounterHists("EJ1", vtx->GetZ(), isSelected);
290  // Check for exclusive classes
291  if(!(isMinBias || isEJ2)){
292  FillEventCounterHists("EJ1excl", vtx->GetZ(), isSelected);
293  }
294  if(isEG1 || isEG2){
295  FillEventCounterHists("E1combined", vtx->GetZ(), isSelected);
296  } else {
297  FillEventCounterHists("E1Jonly", vtx->GetZ(), isSelected);
298  }
299  }
300  if(isEG2){
301  FillEventCounterHists("EG2", vtx->GetZ(), isSelected);
302  // Check for exclusive classes
303  if(!isMinBias){
304  FillEventCounterHists("EG2excl", vtx->GetZ(), isSelected);
305  }
306  if(!(isEJ1 || isEJ2)){
307  FillEventCounterHists("E2Gonly", vtx->GetZ(), isSelected);
308  }
309  }
310  if(isEG1){
311  FillEventCounterHists("EG1", vtx->GetZ(), isSelected);
312  // Check for exclusive classes
313  if(!(isMinBias || isEG2 )){
314  FillEventCounterHists("EG1excl", vtx->GetZ(), isSelected);
315  }
316  if(!(isEJ1 || isEJ2)){
317  FillEventCounterHists("E1Gonly", vtx->GetZ(), isSelected);
318  }
319  }
320 
321  if(!isSelected) return;
322 
323  // Loop over tracks, fill select particles
324  // Histograms
325  // - Full eta_{lab} (-0.8, 0.8), new binning
326  // - Full eta_{lab} (-0.8, 0.8), old binning
327  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c without eta cut
328  // - Central eta_{cms} (-0.3, -0.2), new binning,
329  // - Central eta_{cms} (-0.8, -0.2), old binning,
330  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c
331  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c with eta cut
332  AliVTrack *checktrack(NULL);
333  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
334  Bool_t isEMCAL(kFALSE), hasTRD(kFALSE);
335  Double_t etaEMCAL(0.), phiEMCAL(0.);
336  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); ++itrk){
337  checktrack = dynamic_cast<AliVTrack *>(fInputEvent->GetTrack(itrk));
338  if(!checktrack) continue;
339  if((checktrack->Eta() < fEtaLabCut[0]) || (checktrack->Eta() > fEtaLabCut[1])) continue;
340  if(TMath::Abs(checktrack->Pt()) < 0.1) continue;
341  if(checktrack->IsA() == AliESDtrack::Class()){
342  AliESDtrack copytrack(*(static_cast<AliESDtrack *>(checktrack)));
343  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
344  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
345  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
346  } else {
347  AliAODTrack copytrack(*(static_cast<AliAODTrack *>(checktrack)));
348  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
349  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
350  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
351  }
352  Int_t supermoduleID = -1;
353  isEMCAL = fGeometry->SuperModuleNumberFromEtaPhi(etaEMCAL, phiEMCAL, supermoduleID);
354  // Exclude supermodules 10 and 11 as they did not participate in the trigger
355  isEMCAL = isEMCAL && supermoduleID < 10;
356  hasTRD = isEMCAL && supermoduleID >= 4; // supermodules 4 - 10 have TRD in front in the 2012-2013 ALICE setup
357 
358  // Calculate eta in cms frame according
359  // EPJC74 (2014) 3054:
360  // eta_cms = - eta_lab - |yshift|
361  Double_t etacent = -1. * checktrack->Eta() - TMath::Abs(fYshift);
362  etacent *= fEtaSign;
363 
364  Bool_t etacentcut = etacent > fEtaCmsCut[0] && etacent < fEtaCmsCut[1];
365 
366  if(!fTrackCuts->IsTrackAccepted(checktrack)) continue;
367 
368  // fill histograms allEta
369  if(isMinBias){
370  FillTrackHistos("MB", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
371  }
372  if(isEMC7){
373  FillTrackHistos("EMC7", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
374  if(!isMinBias){
375  FillTrackHistos("EMC7excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
376  }
377  }
378  if(isEJ2){
379  FillTrackHistos("EJ2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
380  // check for exclusive classes
381  if(!isMinBias){
382  FillTrackHistos("EJ2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
383  }
384  if(isEG1 || isEG2){
385  FillTrackHistos("E2combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
386  } else {
387  FillTrackHistos("E2Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
388  }
389  }
390  if(isEJ1){
391  FillTrackHistos("EJ1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
392  // check for exclusive classes
393  if(!(isMinBias || isEJ2)){
394  FillTrackHistos("EJ1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
395  }
396  if(isEG1 || isEG2) {
397  FillTrackHistos("E1combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
398  } else {
399  FillTrackHistos("E1Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
400  }
401  }
402  if(isEG2){
403  FillTrackHistos("EG2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
404  // check for exclusive classes
405  if(!isMinBias){
406  FillTrackHistos("EG2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
407  }
408  if(!(isEJ2 || isEJ1)){
409  FillTrackHistos("E2Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
410  }
411  }
412  if(isEG1){
413  FillTrackHistos("EG1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
414  if(!(isMinBias || isEG2)){
415  FillTrackHistos("EG1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
416  }
417  if(!(isEJ1 || isEJ2)){
418  FillTrackHistos("E1Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
419  }
420  }
421  }
422  PostData(1, fHistos->GetListOfHistograms());
423 }
424 
432  const char *triggerclass,
433  double vtxz,
434  bool isSelected
435 )
436 {
437  // Fill reference distribution for the primary vertex before any z-cut
438  fHistos->FillTH1(Form("hVertexBefore%s", triggerclass), vtxz);
439  if(isSelected){
440  // Fill Event counter and reference vertex distributions after event selection
441  fHistos->FillTH1(Form("hEventCount%s", triggerclass), 1);
442  fHistos->FillTH1(Form("hVertexAfter%s", triggerclass), vtxz);
443  }
444 }
445 
457  const char *eventclass,
458  Double_t pt,
459  Double_t etalab,
460  Double_t etacent,
461  Double_t phi,
462  Bool_t etacut,
463  Bool_t inEmcal,
464  Bool_t hasTRD
465  )
466 {
467  fHistos->FillTH1(Form("hPtEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
468  fHistos->FillTH1(Form("hPtEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
469  if(inEmcal){
470  fHistos->FillTH1(Form("hPtEMCALEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
471  fHistos->FillTH1(Form("hPtEMCALEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
472  if(hasTRD){
473  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
474  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
475  } else {
476  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
477  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
478  }
479  }
480 
481  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
482  for(int icut = 0; icut < 5; icut++){
483  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
484  fHistos->FillTH1(Form("hPhiDistAllPt%d%s", ptmin[icut], eventclass), phi);
485  fHistos->FillTH1(Form("hEtaLabDistAllPt%d%s", ptmin[icut], eventclass), etalab);
486  fHistos->FillTH1(Form("hEtaCentDistAllPt%d%s", ptmin[icut], eventclass), etacent);
487  if(inEmcal){
488  fHistos->FillTH1(Form("hEtaLabDistAllEMCALPt%d%s", ptmin[icut], eventclass), etalab);
489  fHistos->FillTH1(Form("hEtaCentDistAllEMCALPt%d%s", ptmin[icut], eventclass), etacent);
490  }
491  }
492  }
493 
494  if(etacut){
495  fHistos->FillTH1(Form("hPtEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
496  fHistos->FillTH1(Form("hPtEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
497  if(inEmcal){
498  fHistos->FillTH1(Form("hPtEMCALEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
499  fHistos->FillTH1(Form("hPtEMCALEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
500  if(hasTRD){
501  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
502  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
503  } else {
504  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
505  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
506  }
507  }
508  for(int icut = 0; icut < 5; icut++){
509  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
510  fHistos->FillTH1(Form("hEtaLabDistCutPt%d%s", ptmin[icut], eventclass), etalab);
511  fHistos->FillTH1(Form("hEtaCentDistCutPt%d%s", ptmin[icut], eventclass), etacent);
512  if(inEmcal){
513  fHistos->FillTH1(Form("hEtaLabDistCutEMCALPt%d%s", ptmin[icut], eventclass), etalab);
514  fHistos->FillTH1(Form("hEtaCentDistCutEMCALPt%d%s", ptmin[icut], eventclass), etacent);
515  }
516  }
517  }
518  }
519 }
520 
528 }
529 
535  std::vector<double> mybinning;
536  std::map<double,double> definitions;
537  definitions.insert(std::pair<double,double>(2.5, 0.1));
538  definitions.insert(std::pair<double,double>(7., 0.25));
539  definitions.insert(std::pair<double,double>(15., 0.5));
540  definitions.insert(std::pair<double,double>(25., 1.));
541  definitions.insert(std::pair<double,double>(40., 2.5));
542  definitions.insert(std::pair<double,double>(50., 5.));
543  definitions.insert(std::pair<double,double>(100., 10.));
544  double currentval = 0;
545  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
546  double limit = id->first, binwidth = id->second;
547  while(currentval < limit){
548  currentval += binwidth;
549  mybinning.push_back(currentval);
550  }
551  }
552  binning.Set(mybinning.size());
553  int ib = 0;
554  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
555  binning[ib++] = *it;
556 }
557 
563  std::vector<double> mybinning;
564  std::map<double,double> definitions;
565  definitions.insert(std::pair<double, double>(1, 0.05));
566  definitions.insert(std::pair<double, double>(2, 0.1));
567  definitions.insert(std::pair<double, double>(4, 0.2));
568  definitions.insert(std::pair<double, double>(7, 0.5));
569  definitions.insert(std::pair<double, double>(16, 1));
570  definitions.insert(std::pair<double, double>(36, 2));
571  definitions.insert(std::pair<double, double>(40, 4));
572  definitions.insert(std::pair<double, double>(50, 5));
573  definitions.insert(std::pair<double, double>(100, 10));
574  definitions.insert(std::pair<double, double>(200, 20));
575  double currentval = 0.;
576  mybinning.push_back(currentval);
577  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
578  double limit = id->first, binwidth = id->second;
579  while(currentval < limit){
580  currentval += binwidth;
581  mybinning.push_back(currentval);
582  }
583  }
584  binning.Set(mybinning.size());
585  int ib = 0;
586  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
587  binning[ib++] = *it;
588 }
589 
595 TString AliAnalysisTaskChargedParticlesRef::GetFiredTriggerClassesFromPatches(const TClonesArray* triggerpatches) const {
596  TString triggerstring = "";
597  Int_t nEJ1 = 0, nEJ2 = 0, nEG1 = 0, nEG2 = 0;
598  double minADC_EJ1 = 260.,
599  minADC_EJ2 = 127.,
600  minADC_EG1 = 140.,
601  minADC_EG2 = 89.;
602  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
603  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
604  if(!patch->IsOfflineSimple()) continue;
605  if(patch->IsJetHighSimple() && patch->GetADCOfflineAmp() > minADC_EJ1) nEJ1++;
606  if(patch->IsJetLowSimple() && patch->GetADCOfflineAmp() > minADC_EJ2) nEJ2++;
607  if(patch->IsGammaHighSimple() && patch->GetADCOfflineAmp() > minADC_EG1) nEG1++;
608  if(patch->IsGammaLowSimple() && patch->GetADCOfflineAmp() > minADC_EG2) nEG2++;
609  }
610  if(nEJ1) triggerstring += "EJ1";
611  if(nEJ2){
612  if(triggerstring.Length()) triggerstring += ",";
613  triggerstring += "EJ2";
614  }
615  if(nEG1){
616  if(triggerstring.Length()) triggerstring += ",";
617  triggerstring += "EG1";
618  }
619  if(nEG2){
620  if(triggerstring.Length()) triggerstring += ",";
621  triggerstring += "EG2";
622  }
623  return triggerstring;
624 }
625 
626 } /* namespace EMCalTriggerPtAnalysis */
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Double_t fEtaSign
Sign of the eta distribution (swaps when beam directions swap): p-Pb: +1, Pb-p: -1.
AliEmcalTriggerOfflineSelection * fTriggerSelection
Offline trigger selection.
AliEmcalTrackSelection * fTrackCuts
Standard track selection.
static AliEmcalTrackSelection * TrackCutsFactory(TString name, Bool_t isAOD)
void FillTrackHistos(const char *eventclass, Double_t pt, Double_t eta, Double_t etacent, Double_t phi, Bool_t etacut, Bool_t inEmcal, Bool_t hasTRD)
TString GetFiredTriggerClassesFromPatches(const TClonesArray *triggerpatches) const
Bool_t fTriggerStringFromPatches
Do rebuild the trigger string from trigger patches.
void FillEventCounterHists(const char *triggerclass, double vtxz, bool isSelected)
const Double_t ptmin
Declaration of class AliEMCalTriggerExtraCuts.
Bool_t IsOfflineSelected(EmcalTriggerClass trgcls, const TClonesArray *const triggerpatches) const
Double_t fEtaCmsCut[2]
Cut applied in Eta centre-of-mass frame.
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
virtual bool IsTrackAccepted(AliVTrack *const trk)=0