AliPhysics  b7d3887 (b7d3887)
 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 <iostream>
16 #include <vector>
17 #include <map>
18 
19 #include <TArrayD.h>
20 #include <TMath.h>
21 #include <THashList.h>
22 #include <THistManager.h>
23 #include <TString.h>
24 
25 #include "AliAnalysisUtils.h"
26 #include "AliAODInputHandler.h"
27 #include "AliAODTrack.h"
29 #include "AliEMCALGeometry.h"
30 #include "AliEMCALRecoUtils.h"
31 #include "AliEMCALTriggerPatchInfo.h"
32 #include "AliEmcalTrackSelection.h"
34 #include "AliESDtrackCuts.h"
35 #include "AliESDEvent.h"
36 #include "AliInputEventHandler.h"
37 #include "AliPIDResponse.h"
38 #include "AliTOFPIDResponse.h"
39 #include "AliVVertex.h"
40 
43 
47 
48 namespace EMCalTriggerPtAnalysis {
49 
53 AliAnalysisTaskChargedParticlesRef::AliAnalysisTaskChargedParticlesRef() :
54  AliAnalysisTaskSE(),
55  fTrackCuts(NULL),
56  fAnalysisUtil(NULL),
57  fTriggerSelection(NULL),
58  fHistos(NULL),
59  fGeometry(NULL),
60  fTriggerStringFromPatches(kFALSE),
61  fYshift(0.465),
62  fEtaSign(1)
63 {
64  // Restrict analysis to the EMCAL acceptance
65  fEtaLabCut[0] = -0.6;
66  fEtaLabCut[1] = 0.6;
67  fEtaCmsCut[0] = -0.13;
68  fEtaCmsCut[1] = 0.13;
69 }
70 
76  AliAnalysisTaskSE(name),
77  fTrackCuts(NULL),
78  fAnalysisUtil(NULL),
79  fTriggerSelection(NULL),
80  fHistos(NULL),
81  fGeometry(NULL),
82  fTriggerStringFromPatches(kFALSE),
83  fYshift(0.465),
84  fEtaSign(1)
85 {
86  // Restrict analysis to the EMCAL acceptance
87  fEtaLabCut[0] = -0.6;
88  fEtaLabCut[1] = 0.6;
89  fEtaCmsCut[0] = -0.13;
90  fEtaCmsCut[1] = 0.13;
91  DefineOutput(1, TList::Class());
92 }
93 
98  //if(fTrackCuts) delete fTrackCuts;
99  if(fAnalysisUtil) delete fAnalysisUtil;
101  if(fHistos) delete fHistos;
102 }
103 
108  fAnalysisUtil = new AliAnalysisUtils;
109 
110  if(!fTrackCuts) InitializeTrackCuts("standard", fInputHandler->IsA() == AliAODInputHandler::Class());
111 
112  TArrayD oldbinning, newbinning;
113  CreateOldPtBinning(oldbinning);
114  CreateNewPtBinning(newbinning);
115 
116  fHistos = new THistManager("Ref");
117  // Exclusive means classes without higher trigger classes:
118  // EG2excl means EG2 && !EG1
119  // EJ2excl means EJ2 && !EJ1
120  // MBExcl means MinBias && !EMCAL trigger
121  // Combined means: gamma and ANY jet class, jet and ANY gamma class
122  // Jonly means: No gamma class fired at the same time
123  // Gonly means: No jet class fired at the same time
124  TString triggers[17] = {
125  "MB", "EMC7",
126  "EJ1", "EJ2", "EG1", "EG2",
127  "EMC7excl", "EG1excl", "EG2excl", "EJ1excl", "EJ2excl",
128  "E1combined", "E1Jonly", "E1Gonly", "E2combined", "E2Jonly", "E2Gonly"
129  };
130  Double_t ptcuts[5] = {1., 2., 5., 10., 20.};
131  for(TString *trg = triggers; trg < triggers + sizeof(triggers)/sizeof(TString); trg++){
132  fHistos->CreateTH1(Form("hEventCount%s", trg->Data()), Form("Event Counter for trigger class %s", trg->Data()), 1, 0.5, 1.5);
133  fHistos->CreateTH1(Form("hVertexBefore%s", trg->Data()), Form("Vertex distribution before z-cut for trigger class %s", trg->Data()), 500, -50, 50);
134  fHistos->CreateTH1(Form("hVertexAfter%s", trg->Data()), Form("Vertex distribution after z-cut for trigger class %s", trg->Data()), 100, -10, 10);
135  fHistos->CreateTH1(Form("hPtEtaAllOldBinning%s", trg->Data()), Form("Charged particle pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
136  fHistos->CreateTH1(Form("hPtEtaCentOldBinning%s", trg->Data()), Form("Charged particle pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
137  fHistos->CreateTH1(Form("hPtEtaAllNewBinning%s", trg->Data()), Form("Charged particle pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
138  fHistos->CreateTH1(Form("hPtEtaCentNewBinning%s", trg->Data()), Form("Charged particle pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
139  fHistos->CreateTH1(Form("hPtEMCALEtaAllOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
140  fHistos->CreateTH1(Form("hPtEMCALEtaCentOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
141  fHistos->CreateTH1(Form("hPtEMCALEtaAllNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
142  fHistos->CreateTH1(Form("hPtEMCALEtaCentNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
143  fHistos->CreateTH2(Form("hTPCdEdxEMCAL%s", trg->Data()), Form("TPC dE/dx of charged particles in the EMCAL region for trigger %s", trg->Data()), 400, -20., 20., 200, 0., 200.);
144  fHistos->CreateTH2(Form("hTOFBetaEMCAL%s", trg->Data()), Form("TOF beta of charged particles in the EMCAL region for trigger %s", trg->Data()), 400, -20., 20., 150, 0., 1.5);
145  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);
146  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);
147  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);
148  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);
149  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);
150  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);
151  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);
152  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);
153  for(int ipt = 0; ipt < 5; ipt++){
155  Form("hEtaLabDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
156  Form("Eta (lab) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
157  100,
158  -1.,
159  1.
160  );
162  Form("hEtaLabDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
163  Form("Eta (lab) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
164  100,
165  -1.,
166  1.
167  );
169  Form("hEtaCentDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
170  Form("Eta (cent) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s",
171  trg->Data()),
172  160,
173  -1.3,
174  1.3
175  );
177  Form("hEtaCentDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
178  Form("Eta (cent) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
179  160,
180  -1.3,
181  1.3
182  );
184  Form("hEtaLabDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
185  Form("Eta (lab) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
186  100,
187  -1.,
188  1.
189  );
191  Form("hEtaLabDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
192  Form("Eta (lab) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
193  100,
194  -1.,
195  1.
196  );
198  Form("hEtaCentDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
199  Form("Eta (cent) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
200  160,
201  -1.3,
202  1.3
203  );
205  Form("hEtaCentDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
206  Form("Eta (cent) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
207  160,
208  -1.3,
209  1.3
210  );
212  Form("hPhiDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
213  Form("#phi distribution of particles with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
214  300,
215  0.,
216  2*TMath::Pi()
217  );
218  }
219  }
221  PostData(1, fHistos->GetListOfHistograms());
222 }
223 
233  if(!fGeometry){
234  fGeometry = AliEMCALGeometry::GetInstance();
235  if(!fGeometry)
236  fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
237  }
238  // Select event
239  TClonesArray *triggerpatches = static_cast<TClonesArray *>(fInputEvent->FindListObject("EmcalTriggers"));
240  TString triggerstring = "";
242  triggerstring = GetFiredTriggerClassesFromPatches(triggerpatches);
243  } else {
244  triggerstring = fInputEvent->GetFiredTriggerClasses();
245  }
246  UInt_t selectionstatus = fInputHandler->IsEventSelected();
247  Bool_t isMinBias = selectionstatus & AliVEvent::kINT7,
248  isEJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ1"),
249  isEJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ2"),
250  isEG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG1"),
251  isEG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG2"),
252  isEMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("CEMC7");
253  if(triggerpatches && fTriggerSelection){
259  }
260  if(!(isMinBias || isEMC7 || isEG1 || isEG2 || isEJ1 || isEJ2)) return;
261  const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
262  //if(!fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.)) return; // reject pileup event
263  if(vtx->GetNContributors() < 1) return;
264  if(fInputEvent->IsA() == AliESDEvent::Class() && fAnalysisUtil->IsFirstEventInChunk(fInputEvent)) return;
265  bool isSelected = kTRUE;
266  if(!fAnalysisUtil->IsVertexSelected2013pA(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
267  if(fAnalysisUtil->IsPileUpEvent(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
268  // Apply vertex z cut
269  if(vtx->GetZ() < -10. || vtx->GetZ() > 10.) isSelected = kFALSE;
270 
271  // Fill Event counter and reference vertex distributions for the different trigger classes
272  if(isMinBias){
273  FillEventCounterHists("MB", vtx->GetZ(), isSelected);
274  }
275  if(isEMC7){
276  FillEventCounterHists("EMC7", vtx->GetZ(), isSelected);
277  if(!isMinBias){
278  FillEventCounterHists("EMC7excl", vtx->GetZ(), isSelected);
279  }
280  }
281  if(isEJ2){
282  FillEventCounterHists("EJ2", vtx->GetZ(), isSelected);
283  // Check for exclusive classes
284  if(!isMinBias){
285  FillEventCounterHists("EJ2excl", vtx->GetZ(), isSelected);
286  }
287  if(isEG1 || isEG2){
288  FillEventCounterHists("E2combined", vtx->GetZ(), isSelected);
289  } else {
290  FillEventCounterHists("E2Jonly", vtx->GetZ(), isSelected);
291  }
292  }
293  if(isEJ1){
294  FillEventCounterHists("EJ1", vtx->GetZ(), isSelected);
295  // Check for exclusive classes
296  if(!(isMinBias || isEJ2)){
297  FillEventCounterHists("EJ1excl", vtx->GetZ(), isSelected);
298  }
299  if(isEG1 || isEG2){
300  FillEventCounterHists("E1combined", vtx->GetZ(), isSelected);
301  } else {
302  FillEventCounterHists("E1Jonly", vtx->GetZ(), isSelected);
303  }
304  }
305  if(isEG2){
306  FillEventCounterHists("EG2", vtx->GetZ(), isSelected);
307  // Check for exclusive classes
308  if(!isMinBias){
309  FillEventCounterHists("EG2excl", vtx->GetZ(), isSelected);
310  }
311  if(!(isEJ1 || isEJ2)){
312  FillEventCounterHists("E2Gonly", vtx->GetZ(), isSelected);
313  }
314  }
315  if(isEG1){
316  FillEventCounterHists("EG1", vtx->GetZ(), isSelected);
317  // Check for exclusive classes
318  if(!(isMinBias || isEG2 )){
319  FillEventCounterHists("EG1excl", vtx->GetZ(), isSelected);
320  }
321  if(!(isEJ1 || isEJ2)){
322  FillEventCounterHists("E1Gonly", vtx->GetZ(), isSelected);
323  }
324  }
325 
326  if(!isSelected) return;
327 
328  // Loop over tracks, fill select particles
329  // Histograms
330  // - Full eta_{lab} (-0.8, 0.8), new binning
331  // - Full eta_{lab} (-0.8, 0.8), old binning
332  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c without eta cut
333  // - Central eta_{cms} (-0.3, -0.2), new binning,
334  // - Central eta_{cms} (-0.8, -0.2), old binning,
335  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c
336  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c with eta cut
337  AliVTrack *checktrack(NULL);
338  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
339  Bool_t isEMCAL(kFALSE), hasTRD(kFALSE);
340  Double_t etaEMCAL(0.), phiEMCAL(0.);
341  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); ++itrk){
342  checktrack = dynamic_cast<AliVTrack *>(fInputEvent->GetTrack(itrk));
343  if(!checktrack) continue;
344  if((checktrack->Eta() < fEtaLabCut[0]) || (checktrack->Eta() > fEtaLabCut[1])) continue;
345  if(TMath::Abs(checktrack->Pt()) < 0.1) continue;
346  if(checktrack->IsA() == AliESDtrack::Class()){
347  AliESDtrack copytrack(*(static_cast<AliESDtrack *>(checktrack)));
348  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
349  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
350  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
351  } else {
352  AliAODTrack copytrack(*(static_cast<AliAODTrack *>(checktrack)));
353  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
354  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
355  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
356  }
357  Int_t supermoduleID = -1;
358  isEMCAL = fGeometry->SuperModuleNumberFromEtaPhi(etaEMCAL, phiEMCAL, supermoduleID);
359  // Exclude supermodules 10 and 11 as they did not participate in the trigger
360  isEMCAL = isEMCAL && supermoduleID < 10;
361  hasTRD = isEMCAL && supermoduleID >= 4; // supermodules 4 - 10 have TRD in front in the 2012-2013 ALICE setup
362 
363  // Calculate eta in cms frame according
364  // EPJC74 (2014) 3054:
365  // eta_cms = - eta_lab - |yshift|
366  Double_t etacent = -1. * checktrack->Eta() - TMath::Abs(fYshift);
367  etacent *= fEtaSign;
368 
369  Bool_t etacentcut = etacent > fEtaCmsCut[0] && etacent < fEtaCmsCut[1];
370 
371  if(!fTrackCuts->IsTrackAccepted(checktrack)) continue;
372 
373  // fill histograms allEta
374  if(isMinBias){
375  FillTrackHistos("MB", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
376  if(isEMCAL) FillPIDHistos("MB", *checktrack);
377  }
378  if(isEMC7){
379  FillTrackHistos("EMC7", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
380  if(isEMCAL) FillPIDHistos("EMC7", *checktrack);
381  if(!isMinBias){
382  FillTrackHistos("EMC7excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
383  if(isEMCAL) FillPIDHistos("EMC7excl", *checktrack);
384  }
385  }
386  if(isEJ2){
387  FillTrackHistos("EJ2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
388  if(isEMCAL) FillPIDHistos("EJ2", *checktrack);
389  // check for exclusive classes
390  if(!isMinBias){
391  FillTrackHistos("EJ2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
392  if(isEMCAL) FillPIDHistos("EJ2excl", *checktrack);
393  }
394  if(isEG1 || isEG2){
395  FillTrackHistos("E2combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
396  if(isEMCAL) FillPIDHistos("E2combined", *checktrack);
397  } else {
398  FillTrackHistos("E2Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
399  if(isEMCAL) FillPIDHistos("E2Jonly", *checktrack);
400  }
401  }
402  if(isEJ1){
403  FillTrackHistos("EJ1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
404  if(isEMCAL) FillPIDHistos("EJ1", *checktrack);
405  // check for exclusive classes
406  if(!(isMinBias || isEJ2)){
407  FillTrackHistos("EJ1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
408  if(isEMCAL) FillPIDHistos("EJ1excl", *checktrack);
409  }
410  if(isEG1 || isEG2) {
411  FillTrackHistos("E1combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
412  if(isEMCAL) FillPIDHistos("E1combined", *checktrack);
413  } else {
414  FillTrackHistos("E1Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
415  if(isEMCAL) FillPIDHistos("E1Jonly", *checktrack);
416  }
417  }
418  if(isEG2){
419  FillTrackHistos("EG2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
420  if(isEMCAL) FillPIDHistos("EG2", *checktrack);
421  // check for exclusive classes
422  if(!isMinBias){
423  FillTrackHistos("EG2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
424  if(isEMCAL) FillPIDHistos("EG2excl", *checktrack);
425  }
426  if(!(isEJ2 || isEJ1)){
427  FillTrackHistos("E2Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
428  if(isEMCAL) FillPIDHistos("E2Gonly", *checktrack);
429  }
430  }
431  if(isEG1){
432  FillTrackHistos("EG1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
433  if(isEMCAL) FillPIDHistos("EG1", *checktrack);
434  if(!(isMinBias || isEG2)){
435  FillTrackHistos("EG1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
436  if(isEMCAL) FillPIDHistos("EG1excl", *checktrack);
437  }
438  if(!(isEJ1 || isEJ2)){
439  FillTrackHistos("E1Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
440  if(isEMCAL) FillPIDHistos("E1Gonly", *checktrack);
441  }
442  }
443  }
444  PostData(1, fHistos->GetListOfHistograms());
445 }
446 
454  const std::string &triggerclass,
455  double vtxz,
456  bool isSelected
457 )
458 {
459  // Fill reference distribution for the primary vertex before any z-cut
460  fHistos->FillTH1(Form("hVertexBefore%s", triggerclass.c_str()), vtxz);
461  if(isSelected){
462  // Fill Event counter and reference vertex distributions after event selection
463  fHistos->FillTH1(Form("hEventCount%s", triggerclass.c_str()), 1);
464  fHistos->FillTH1(Form("hVertexAfter%s", triggerclass.c_str()), vtxz);
465  }
466 }
467 
479  const std::string &eventclass,
480  Double_t pt,
481  Double_t etalab,
482  Double_t etacent,
483  Double_t phi,
484  Bool_t etacut,
485  Bool_t inEmcal,
486  Bool_t hasTRD
487  )
488 {
489  fHistos->FillTH1(Form("hPtEtaAllNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
490  fHistos->FillTH1(Form("hPtEtaAllOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
491  if(inEmcal){
492  fHistos->FillTH1(Form("hPtEMCALEtaAllNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
493  fHistos->FillTH1(Form("hPtEMCALEtaAllOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
494  if(hasTRD){
495  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
496  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
497  } else {
498  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
499  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
500  }
501  }
502 
503  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
504  for(int icut = 0; icut < 5; icut++){
505  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
506  fHistos->FillTH1(Form("hPhiDistAllPt%d%s", ptmin[icut], eventclass.c_str()), phi);
507  fHistos->FillTH1(Form("hEtaLabDistAllPt%d%s", ptmin[icut], eventclass.c_str()), etalab);
508  fHistos->FillTH1(Form("hEtaCentDistAllPt%d%s", ptmin[icut], eventclass.c_str()), etacent);
509  if(inEmcal){
510  fHistos->FillTH1(Form("hEtaLabDistAllEMCALPt%d%s", ptmin[icut], eventclass.c_str()), etalab);
511  fHistos->FillTH1(Form("hEtaCentDistAllEMCALPt%d%s", ptmin[icut], eventclass.c_str()), etacent);
512  }
513  }
514  }
515 
516  if(etacut){
517  fHistos->FillTH1(Form("hPtEtaCentNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
518  fHistos->FillTH1(Form("hPtEtaCentOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
519  if(inEmcal){
520  fHistos->FillTH1(Form("hPtEMCALEtaCentNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
521  fHistos->FillTH1(Form("hPtEMCALEtaCentOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
522  if(hasTRD){
523  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
524  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
525  } else {
526  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
527  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
528  }
529  }
530  for(int icut = 0; icut < 5; icut++){
531  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
532  fHistos->FillTH1(Form("hEtaLabDistCutPt%d%s", ptmin[icut], eventclass.c_str()), etalab);
533  fHistos->FillTH1(Form("hEtaCentDistCutPt%d%s", ptmin[icut], eventclass.c_str()), etacent);
534  if(inEmcal){
535  fHistos->FillTH1(Form("hEtaLabDistCutEMCALPt%d%s", ptmin[icut], eventclass.c_str()), etalab);
536  fHistos->FillTH1(Form("hEtaCentDistCutEMCALPt%d%s", ptmin[icut], eventclass.c_str()), etacent);
537  }
538  }
539  }
540  }
541 }
542 
544  const std::string &eventclass,
545  const AliVTrack &trk
546 ) {
547  if(TMath::Abs(trk.Eta()) > 0.3) return;
548  double poverz = TMath::Abs(trk.P())/static_cast<double>(trk.Charge());
549  fHistos->FillTH2(Form("hTPCdEdxEMCAL%s", eventclass.c_str()), poverz, trk.GetTPCsignal());
550  if(!(trk.GetStatus() & AliVTrack::kTOFpid)) return;
551  // correct for units - TOF in ps, track length in cm
552  Double_t trtime = (trk.GetTOFsignal() - fInputHandler->GetPIDResponse()->GetTOFResponse().GetTimeZero()) * 1e-12;
553  Double_t v = trk.GetIntegratedLength()/(100. * trtime);
554  Double_t beta = v / TMath::C();
555  fHistos->FillTH2(Form("hTOFBetaEMCAL%s", eventclass.c_str()), poverz, beta);
556 
557 }
558 
566 }
567 
573  std::vector<double> mybinning;
574  std::map<double,double> definitions;
575  definitions.insert(std::pair<double,double>(2.5, 0.1));
576  definitions.insert(std::pair<double,double>(7., 0.25));
577  definitions.insert(std::pair<double,double>(15., 0.5));
578  definitions.insert(std::pair<double,double>(25., 1.));
579  definitions.insert(std::pair<double,double>(40., 2.5));
580  definitions.insert(std::pair<double,double>(50., 5.));
581  definitions.insert(std::pair<double,double>(100., 10.));
582  double currentval = 0;
583  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
584  double limit = id->first, binwidth = id->second;
585  while(currentval < limit){
586  currentval += binwidth;
587  mybinning.push_back(currentval);
588  }
589  }
590  binning.Set(mybinning.size());
591  int ib = 0;
592  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
593  binning[ib++] = *it;
594 }
595 
601  std::vector<double> mybinning;
602  std::map<double,double> definitions;
603  definitions.insert(std::pair<double, double>(1, 0.05));
604  definitions.insert(std::pair<double, double>(2, 0.1));
605  definitions.insert(std::pair<double, double>(4, 0.2));
606  definitions.insert(std::pair<double, double>(7, 0.5));
607  definitions.insert(std::pair<double, double>(16, 1));
608  definitions.insert(std::pair<double, double>(36, 2));
609  definitions.insert(std::pair<double, double>(40, 4));
610  definitions.insert(std::pair<double, double>(50, 5));
611  definitions.insert(std::pair<double, double>(100, 10));
612  definitions.insert(std::pair<double, double>(200, 20));
613  double currentval = 0.;
614  mybinning.push_back(currentval);
615  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
616  double limit = id->first, binwidth = id->second;
617  while(currentval < limit){
618  currentval += binwidth;
619  mybinning.push_back(currentval);
620  }
621  }
622  binning.Set(mybinning.size());
623  int ib = 0;
624  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
625  binning[ib++] = *it;
626 }
627 
633 TString AliAnalysisTaskChargedParticlesRef::GetFiredTriggerClassesFromPatches(const TClonesArray* triggerpatches) const {
634  TString triggerstring = "";
635  Int_t nEJ1 = 0, nEJ2 = 0, nEG1 = 0, nEG2 = 0;
636  double minADC_EJ1 = 260.,
637  minADC_EJ2 = 127.,
638  minADC_EG1 = 140.,
639  minADC_EG2 = 89.;
640  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
641  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
642  if(!patch->IsOfflineSimple()) continue;
643  if(patch->IsJetHighSimple() && patch->GetADCOfflineAmp() > minADC_EJ1) nEJ1++;
644  if(patch->IsJetLowSimple() && patch->GetADCOfflineAmp() > minADC_EJ2) nEJ2++;
645  if(patch->IsGammaHighSimple() && patch->GetADCOfflineAmp() > minADC_EG1) nEG1++;
646  if(patch->IsGammaLowSimple() && patch->GetADCOfflineAmp() > minADC_EG2) nEG2++;
647  }
648  if(nEJ1) triggerstring += "EJ1";
649  if(nEJ2){
650  if(triggerstring.Length()) triggerstring += ",";
651  triggerstring += "EJ2";
652  }
653  if(nEG1){
654  if(triggerstring.Length()) triggerstring += ",";
655  triggerstring += "EG1";
656  }
657  if(nEG2){
658  if(triggerstring.Length()) triggerstring += ",";
659  triggerstring += "EG2";
660  }
661  return triggerstring;
662 }
663 
664 } /* namespace EMCalTriggerPtAnalysis */
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 FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
TString GetFiredTriggerClassesFromPatches(const TClonesArray *triggerpatches) const
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
THashList * GetListOfHistograms() const
Definition: THistManager.h:504
Bool_t fTriggerStringFromPatches
Do rebuild the trigger string from trigger patches.
void FillPIDHistos(const std::string &eventclass, const AliVTrack &track)
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
const Double_t ptmin
void FillEventCounterHists(const std::string &triggerclass, double vtxz, bool isSelected)
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Declaration of class AliEMCalTriggerExtraCuts.
Bool_t IsOfflineSelected(EmcalTriggerClass trgcls, const TClonesArray *const triggerpatches) const
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Double_t fEtaCmsCut[2]
Cut applied in Eta centre-of-mass frame.
Container class for histograms for the high- charged particle analysis.
Definition: THistManager.h:43
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
void FillTrackHistos(const std::string &eventclass, Double_t pt, Double_t eta, Double_t etacent, Double_t phi, Bool_t etacut, Bool_t inEmcal, Bool_t hasTRD)
virtual bool IsTrackAccepted(AliVTrack *const trk)=0