AliPhysics  vAN-20150924 (e816f45)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
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 <TString.h>
22 
23 #include "AliAnalysisUtils.h"
24 #include "AliAODTrack.h"
25 #include "AliEMCALGeometry.h"
26 #include "AliEMCALRecoUtils.h"
27 #include "AliESDtrackCuts.h"
28 #include "AliESDEvent.h"
29 #include "AliESDtrack.h"
30 #include "AliInputEventHandler.h"
31 #include "AliVVertex.h"
32 
34 #include "AliEMCalHistoContainer.h"
36 
40 
41 namespace EMCalTriggerPtAnalysis {
42 
46 AliAnalysisTaskChargedParticlesRef::AliAnalysisTaskChargedParticlesRef() :
47  AliAnalysisTaskSE(),
48  fTrackCuts(NULL),
49  fAnalysisUtil(NULL),
50  fHistos(NULL),
51  fGeometry(NULL),
52  fTriggerStringFromPatches(kFALSE),
53  fYshift(0.465),
54  fEtaSign(1)
55 {
56  // Restrict analysis to the EMCAL acceptance
57  fEtaLabCut[0] = -0.6;
58  fEtaLabCut[1] = 0.6;
59  fEtaCmsCut[0] = -0.13;
60  fEtaCmsCut[1] = 0.13;
61 }
62 
68  AliAnalysisTaskSE(name),
69  fTrackCuts(NULL),
70  fAnalysisUtil(NULL),
71  fHistos(NULL),
72  fGeometry(NULL),
73  fTriggerStringFromPatches(kFALSE),
74  fYshift(0.465),
75  fEtaSign(1)
76 {
77  // Restrict analysis to the EMCAL acceptance
78  fEtaLabCut[0] = -0.6;
79  fEtaLabCut[1] = 0.6;
80  fEtaCmsCut[0] = -0.13;
81  fEtaCmsCut[1] = 0.13;
82  DefineOutput(1, TList::Class());
83 }
84 
89  if(fTrackCuts) delete fTrackCuts;
90  if(fAnalysisUtil) delete fAnalysisUtil;
91  if(fHistos) delete fHistos;
92 }
93 
98  fAnalysisUtil = new AliAnalysisUtils;
99 
100  fTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(true, 1);
101  fTrackCuts->SetName("Standard Track cuts");
102  fTrackCuts->SetMinNCrossedRowsTPC(120);
103  fTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
104 
105  TArrayD oldbinning, newbinning;
106  CreateOldPtBinning(oldbinning);
107  CreateNewPtBinning(newbinning);
108 
109  fHistos = new AliEMCalHistoContainer("Ref");
110  // Exclusive means classes without higher trigger classes:
111  // EG2excl means EG2 && !EG1
112  // EJ2excl means EJ2 && !EJ1
113  // MBExcl means MinBias && !EMCAL trigger
114  // Combined means: gamma and ANY jet class, jet and ANY gamma class
115  // Jonly means: No gamma class fired at the same time
116  // Gonly means: No jet class fired at the same time
117  TString triggers[17] = {
118  "MB", "EMC7",
119  "EJ1", "EJ2", "EG1", "EG2",
120  "EMC7excl", "EG1excl", "EG2excl", "EJ1excl", "EJ2excl",
121  "E1combined", "E1Jonly", "E1Gonly", "E2combined", "E2Jonly", "E2Gonly"
122  };
123  Double_t ptcuts[5] = {1., 2., 5., 10., 20.};
124  for(TString *trg = triggers; trg < triggers + sizeof(triggers)/sizeof(TString); trg++){
125  fHistos->CreateTH1(Form("hEventCount%s", trg->Data()), Form("Event Counter for trigger class %s", trg->Data()), 1, 0.5, 1.5);
126  fHistos->CreateTH1(Form("hVertexBefore%s", trg->Data()), Form("Vertex distribution before z-cut for trigger class %s", trg->Data()), 500, -50, 50);
127  fHistos->CreateTH1(Form("hVertexAfter%s", trg->Data()), Form("Vertex distribution after z-cut for trigger class %s", trg->Data()), 100, -10, 10);
128  fHistos->CreateTH1(Form("hPtEtaAllOldBinning%s", trg->Data()), Form("Charged particle pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
129  fHistos->CreateTH1(Form("hPtEtaCentOldBinning%s", trg->Data()), Form("Charged particle pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
130  fHistos->CreateTH1(Form("hPtEtaAllNewBinning%s", trg->Data()), Form("Charged particle pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
131  fHistos->CreateTH1(Form("hPtEtaCentNewBinning%s", trg->Data()), Form("Charged particle pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
132  fHistos->CreateTH1(Form("hPtEMCALEtaAllOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
133  fHistos->CreateTH1(Form("hPtEMCALEtaCentOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
134  fHistos->CreateTH1(Form("hPtEMCALEtaAllNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
135  fHistos->CreateTH1(Form("hPtEMCALEtaCentNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
136  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);
137  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);
138  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);
139  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);
140  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);
141  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);
142  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);
143  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);
144  for(int ipt = 0; ipt < 5; ipt++){
146  Form("hEtaLabDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
147  Form("Eta (lab) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
148  100,
149  -1.,
150  1.
151  );
153  Form("hEtaLabDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
154  Form("Eta (lab) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
155  100,
156  -1.,
157  1.
158  );
160  Form("hEtaCentDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
161  Form("Eta (cent) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s",
162  trg->Data()),
163  160,
164  -1.3,
165  1.3
166  );
168  Form("hEtaCentDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
169  Form("Eta (cent) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
170  160,
171  -1.3,
172  1.3
173  );
175  Form("hEtaLabDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
176  Form("Eta (lab) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
177  100,
178  -1.,
179  1.
180  );
182  Form("hEtaLabDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
183  Form("Eta (lab) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
184  100,
185  -1.,
186  1.
187  );
189  Form("hEtaCentDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
190  Form("Eta (cent) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
191  160,
192  -1.3,
193  1.3
194  );
196  Form("hEtaCentDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
197  Form("Eta (cent) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
198  160,
199  -1.3,
200  1.3
201  );
203  Form("hPhiDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
204  Form("#phi distribution of particles with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
205  300,
206  0.,
207  2*TMath::Pi()
208  );
209  }
210  }
211  PostData(1, fHistos->GetListOfHistograms());
212 }
213 
223  if(!fGeometry){
224  fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
225  }
226  // Select event
227  TString triggerstring = "";
229  triggerstring = GetFiredTriggerClassesFromPatches(dynamic_cast<TClonesArray *>(fInputEvent->FindListObject("EmcalTriggers")));
230  } else {
231  triggerstring = fInputEvent->GetFiredTriggerClasses();
232  }
233  UInt_t selectionstatus = fInputHandler->IsEventSelected();
234  Bool_t isMinBias = selectionstatus & AliVEvent::kINT7,
235  isEJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ1"),
236  isEJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ2"),
237  isEG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG1"),
238  isEG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG2"),
239  isEMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("CEMC7");
240  if(!(isMinBias || isEMC7 || isEG1 || isEG2 || isEJ1 || isEJ2)) return;
241  const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
242  //if(!fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.)) return; // reject pileup event
243  if(vtx->GetNContributors() < 1) return;
244  bool isSelected = kTRUE;
245  if(!fAnalysisUtil->IsVertexSelected2013pA(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
246  if(fAnalysisUtil->IsPileUpEvent(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
247  // Apply vertex z cut
248  if(vtx->GetZ() < -10. || vtx->GetZ() > 10.) isSelected = kFALSE;
249 
250  // Fill Event counter and reference vertex distributions for the different trigger classes
251  if(isMinBias){
252  FillEventCounterHists("MB", vtx->GetZ(), isSelected);
253  }
254  if(isEMC7){
255  FillEventCounterHists("EMC7", vtx->GetZ(), isSelected);
256  if(!isMinBias){
257  FillEventCounterHists("EMC7excl", vtx->GetZ(), isSelected);
258  }
259  }
260  if(isEJ2){
261  FillEventCounterHists("EJ2", vtx->GetZ(), isSelected);
262  // Check for exclusive classes
263  if(!isMinBias){
264  FillEventCounterHists("EJ2excl", vtx->GetZ(), isSelected);
265  }
266  if(isEG1 || isEG2){
267  FillEventCounterHists("E2combined", vtx->GetZ(), isSelected);
268  } else {
269  FillEventCounterHists("E2Jonly", vtx->GetZ(), isSelected);
270  }
271  }
272  if(isEJ1){
273  FillEventCounterHists("EJ1", vtx->GetZ(), isSelected);
274  // Check for exclusive classes
275  if(!(isMinBias || isEJ2)){
276  FillEventCounterHists("EJ1excl", vtx->GetZ(), isSelected);
277  }
278  if(isEG1 || isEG2){
279  FillEventCounterHists("E1combined", vtx->GetZ(), isSelected);
280  } else {
281  FillEventCounterHists("E1Jonly", vtx->GetZ(), isSelected);
282  }
283  }
284  if(isEG2){
285  FillEventCounterHists("EG2", vtx->GetZ(), isSelected);
286  // Check for exclusive classes
287  if(!isMinBias){
288  FillEventCounterHists("EG2excl", vtx->GetZ(), isSelected);
289  }
290  if(!(isEJ1 || isEJ2)){
291  FillEventCounterHists("E2Gonly", vtx->GetZ(), isSelected);
292  }
293  }
294  if(isEG1){
295  FillEventCounterHists("EG1", vtx->GetZ(), isSelected);
296  // Check for exclusive classes
297  if(!(isMinBias || isEG2 )){
298  FillEventCounterHists("EG1excl", vtx->GetZ(), isSelected);
299  }
300  if(!(isEJ1 || isEJ2)){
301  FillEventCounterHists("E1Gonly", vtx->GetZ(), isSelected);
302  }
303  }
304 
305  if(!isSelected) return;
306 
307  // Loop over tracks, fill select particles
308  // Histograms
309  // - Full eta_{lab} (-0.8, 0.8), new binning
310  // - Full eta_{lab} (-0.8, 0.8), old binning
311  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c without eta cut
312  // - Central eta_{cms} (-0.3, -0.2), new binning,
313  // - Central eta_{cms} (-0.8, -0.2), old binning,
314  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c
315  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c with eta cut
316  AliVTrack *checktrack(NULL);
317  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
318  Bool_t isEMCAL(kFALSE), hasTRD(kFALSE);
319  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); ++itrk){
320  checktrack = dynamic_cast<AliVTrack *>(fInputEvent->GetTrack(itrk));
321  if(!checktrack) continue;
322  if((checktrack->Eta() < fEtaLabCut[0]) || (checktrack->Eta() > fEtaLabCut[1])) continue;
323  if(TMath::Abs(checktrack->Pt()) < 0.1) continue;
324  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(checktrack);
325  Int_t supermoduleID = -1;
326  isEMCAL = fGeometry->SuperModuleNumberFromEtaPhi(checktrack->GetTrackEtaOnEMCal(), checktrack->GetTrackPhiOnEMCal(), supermoduleID);
327  // Exclude supermodules 10 and 11 as they did not participate in the trigger
328  isEMCAL = isEMCAL && supermoduleID < 10;
329  hasTRD = isEMCAL && supermoduleID >= 4; // supermodules 4 - 10 have TRD in front in the 2012-2013 ALICE setup
330 
331  // Calculate eta in cms frame according
332  // EPJC74 (2014) 3054:
333  // eta_cms = - eta_lab - |yshift|
334  Double_t etacent = -1. * checktrack->Eta() - TMath::Abs(fYshift);
335  etacent *= fEtaSign;
336 
337  Bool_t etacentcut = etacent > fEtaCmsCut[0] && etacent < fEtaCmsCut[1];
338 
339  // Distinguish track selection for ESD and AOD tracks
340  AliESDtrack *esdtrack(NULL);
341  AliAODTrack *aodtrack(NULL);
342  if((esdtrack = dynamic_cast<AliESDtrack *>(checktrack))){
343  if(!TrackSelectionESD(esdtrack)) continue;
344  } else if((aodtrack = dynamic_cast<AliAODTrack *>(checktrack))){
345  if(!TrackSelectionAOD(aodtrack)) continue;
346  } else {
347  continue;
348  }
349 
350  // fill histograms allEta
351  if(isMinBias){
352  FillTrackHistos("MB", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
353  }
354  if(isEMC7){
355  FillTrackHistos("EMC7", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
356  if(!isMinBias){
357  FillTrackHistos("EMC7excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
358  }
359  }
360  if(isEJ2){
361  FillTrackHistos("EJ2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
362  // check for exclusive classes
363  if(!isMinBias){
364  FillTrackHistos("EJ2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
365  }
366  if(isEG1 || isEG2){
367  FillTrackHistos("E2combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
368  } else {
369  FillTrackHistos("E2Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
370  }
371  }
372  if(isEJ1){
373  FillTrackHistos("EJ1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
374  // check for exclusive classes
375  if(!(isMinBias || isEJ2)){
376  FillTrackHistos("EJ1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
377  }
378  if(isEG1 || isEG2) {
379  FillTrackHistos("E1combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
380  } else {
381  FillTrackHistos("E1Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
382  }
383  }
384  if(isEG2){
385  FillTrackHistos("EG2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
386  // check for exclusive classes
387  if(!isMinBias){
388  FillTrackHistos("EG2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
389  }
390  if(!(isEJ2 || isEJ1)){
391  FillTrackHistos("E2Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
392  }
393  }
394  if(isEG1){
395  FillTrackHistos("EG1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
396  if(!(isMinBias || isEG2)){
397  FillTrackHistos("EG1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
398  }
399  if(!(isEJ1 || isEJ2)){
400  FillTrackHistos("E1Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
401  }
402  }
403  }
404  PostData(1, fHistos->GetListOfHistograms());
405 }
406 
414  const char *triggerclass,
415  double vtxz,
416  bool isSelected
417 )
418 {
419  // Fill reference distribution for the primary vertex before any z-cut
420  fHistos->FillTH1(Form("hVertexBefore%s", triggerclass), vtxz);
421  if(isSelected){
422  // Fill Event counter and reference vertex distributions after event selection
423  fHistos->FillTH1(Form("hEventCount%s", triggerclass), 1);
424  fHistos->FillTH1(Form("hVertexAfter%s", triggerclass), vtxz);
425  }
426 }
427 
439  const char *eventclass,
440  Double_t pt,
441  Double_t etalab,
442  Double_t etacent,
443  Double_t phi,
444  Bool_t etacut,
445  Bool_t inEmcal,
446  Bool_t hasTRD
447  )
448 {
449  fHistos->FillTH1(Form("hPtEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
450  fHistos->FillTH1(Form("hPtEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
451  if(inEmcal){
452  fHistos->FillTH1(Form("hPtEMCALEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
453  fHistos->FillTH1(Form("hPtEMCALEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
454  if(hasTRD){
455  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
456  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
457  } else {
458  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
459  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
460  }
461  }
462 
463  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
464  for(int icut = 0; icut < 5; icut++){
465  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
466  fHistos->FillTH1(Form("hPhiDistAllPt%d%s", ptmin[icut], eventclass), phi);
467  fHistos->FillTH1(Form("hEtaLabDistAllPt%d%s", ptmin[icut], eventclass), etalab);
468  fHistos->FillTH1(Form("hEtaCentDistAllPt%d%s", ptmin[icut], eventclass), etacent);
469  if(inEmcal){
470  fHistos->FillTH1(Form("hEtaLabDistAllEMCALPt%d%s", ptmin[icut], eventclass), etalab);
471  fHistos->FillTH1(Form("hEtaCentDistAllEMCALPt%d%s", ptmin[icut], eventclass), etacent);
472  }
473  }
474  }
475 
476  if(etacut){
477  fHistos->FillTH1(Form("hPtEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
478  fHistos->FillTH1(Form("hPtEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
479  if(inEmcal){
480  fHistos->FillTH1(Form("hPtEMCALEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
481  fHistos->FillTH1(Form("hPtEMCALEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
482  if(hasTRD){
483  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
484  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
485  } else {
486  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
487  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
488  }
489  }
490  for(int icut = 0; icut < 5; icut++){
491  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
492  fHistos->FillTH1(Form("hEtaLabDistCutPt%d%s", ptmin[icut], eventclass), etalab);
493  fHistos->FillTH1(Form("hEtaCentDistCutPt%d%s", ptmin[icut], eventclass), etacent);
494  if(inEmcal){
495  fHistos->FillTH1(Form("hEtaLabDistCutEMCALPt%d%s", ptmin[icut], eventclass), etalab);
496  fHistos->FillTH1(Form("hEtaCentDistCutEMCALPt%d%s", ptmin[icut], eventclass), etacent);
497  }
498  }
499  }
500  }
501 }
502 
503 
509  std::vector<double> mybinning;
510  std::map<double,double> definitions;
511  definitions.insert(std::pair<double,double>(2.5, 0.1));
512  definitions.insert(std::pair<double,double>(7., 0.25));
513  definitions.insert(std::pair<double,double>(15., 0.5));
514  definitions.insert(std::pair<double,double>(25., 1.));
515  definitions.insert(std::pair<double,double>(40., 2.5));
516  definitions.insert(std::pair<double,double>(50., 5.));
517  definitions.insert(std::pair<double,double>(100., 10.));
518  double currentval = 0;
519  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
520  double limit = id->first, binwidth = id->second;
521  while(currentval < limit){
522  currentval += binwidth;
523  mybinning.push_back(currentval);
524  }
525  }
526  binning.Set(mybinning.size());
527  int ib = 0;
528  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
529  binning[ib++] = *it;
530 }
531 
537  std::vector<double> mybinning;
538  std::map<double,double> definitions;
539  definitions.insert(std::pair<double, double>(1, 0.05));
540  definitions.insert(std::pair<double, double>(2, 0.1));
541  definitions.insert(std::pair<double, double>(4, 0.2));
542  definitions.insert(std::pair<double, double>(7, 0.5));
543  definitions.insert(std::pair<double, double>(16, 1));
544  definitions.insert(std::pair<double, double>(36, 2));
545  definitions.insert(std::pair<double, double>(40, 4));
546  definitions.insert(std::pair<double, double>(50, 5));
547  definitions.insert(std::pair<double, double>(100, 10));
548  definitions.insert(std::pair<double, double>(200, 20));
549  double currentval = 0.;
550  mybinning.push_back(currentval);
551  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
552  double limit = id->first, binwidth = id->second;
553  while(currentval < limit){
554  currentval += binwidth;
555  mybinning.push_back(currentval);
556  }
557  }
558  binning.Set(mybinning.size());
559  int ib = 0;
560  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
561  binning[ib++] = *it;
562 }
563 
570  return fTrackCuts->AcceptTrack(track);
571 }
572 
579  if(!track->TestFilterBit(AliAODTrack::kTrkGlobal)) return false;
580  if(track->GetTPCNCrossedRows() < 120) return false;
581  return true;
582 }
583 
589 TString AliAnalysisTaskChargedParticlesRef::GetFiredTriggerClassesFromPatches(const TClonesArray* triggerpatches) const {
590  TString triggerstring = "";
591  Int_t nEJ1 = 0, nEJ2 = 0, nEG1 = 0, nEG2 = 0;
592  double minADC_EJ1 = 260.,
593  minADC_EJ2 = 127.,
594  minADC_EG1 = 140.,
595  minADC_EG2 = 89.;
596  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
597  AliEmcalTriggerPatchInfo *patch = dynamic_cast<AliEmcalTriggerPatchInfo *>(*patchIter);
598  if(!patch->IsOfflineSimple()) continue;
599  if(patch->IsJetHighSimple() && patch->GetADCOfflineAmp() > minADC_EJ1) nEJ1++;
600  if(patch->IsJetLowSimple() && patch->GetADCOfflineAmp() > minADC_EJ2) nEJ2++;
601  if(patch->IsGammaHighSimple() && patch->GetADCOfflineAmp() > minADC_EG1) nEG1++;
602  if(patch->IsGammaLowSimple() && patch->GetADCOfflineAmp() > minADC_EG2) nEG2++;
603  }
604  if(nEJ1) triggerstring += "EJ1";
605  if(nEJ2){
606  if(triggerstring.Length()) triggerstring += ",";
607  triggerstring += "EJ2";
608  }
609  if(nEG1){
610  if(triggerstring.Length()) triggerstring += ",";
611  triggerstring += "EG1";
612  }
613  if(nEG2){
614  if(triggerstring.Length()) triggerstring += ",";
615  triggerstring += "EG2";
616  }
617  return triggerstring;
618 }
619 
620 } /* namespace EMCalTriggerPtAnalysis */
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Double_t fEtaSign
Sign of the eta distribution (swaps when beam directions swap): p-Pb: +1, Pb-p: -1.
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)
void CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Container class for histograms for the high- charged particle analysis.
TString GetFiredTriggerClassesFromPatches(const TClonesArray *triggerpatches) const
Main data structure storing all relevant information of EMCAL/DCAL trigger patches.
Bool_t fTriggerStringFromPatches
Do rebuild the trigger string from trigger patches.
Declarartion of class AliEMCalHistoContainer.
void FillEventCounterHists(const char *triggerclass, double vtxz, bool isSelected)
const Double_t ptmin
Double_t fEtaCmsCut[2]
Cut applied in Eta centre-of-mass frame.
Class to make array of trigger patch objects in AOD/ESD events.
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
void FillTH1(const char *hname, double x, double weight=1.)