AliPhysics  90acdf5 (90acdf5)
 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  OldPtBinning oldbinning;
113  NewPtBinning newbinning;
114 
115  fHistos = new THistManager("Ref");
116  // Exclusive means classes without higher trigger classes:
117  // EG2excl means EG2 && !EG1
118  // EJ2excl means EJ2 && !EJ1
119  // MBExcl means MinBias && !EMCAL trigger
120  // Combined means: gamma and ANY jet class, jet and ANY gamma class
121  // Jonly means: No gamma class fired at the same time
122  // Gonly means: No jet class fired at the same time
123  TString triggers[17] = {
124  "MB", "EMC7",
125  "EJ1", "EJ2", "EG1", "EG2",
126  "EMC7excl", "EG1excl", "EG2excl", "EJ1excl", "EJ2excl",
127  "E1combined", "E1Jonly", "E1Gonly", "E2combined", "E2Jonly", "E2Gonly"
128  };
129  Double_t ptcuts[5] = {1., 2., 5., 10., 20.};
130  // Binning for the PID histogram
131  const int kdimPID = 3;
132  const int knbinsPID[kdimPID] = {1000, 200, 300};
133  const double kminPID[kdimPID] = {-100., 0., 0.}, kmaxPID[kdimPID] = {100., 200., 1.5};
134  for(TString *trg = triggers; trg < triggers + sizeof(triggers)/sizeof(TString); trg++){
135  fHistos->CreateTH1(Form("hEventCount%s", trg->Data()), Form("Event Counter for trigger class %s", trg->Data()), 1, 0.5, 1.5);
136  fHistos->CreateTH1(Form("hVertexBefore%s", trg->Data()), Form("Vertex distribution before z-cut for trigger class %s", trg->Data()), 500, -50, 50);
137  fHistos->CreateTH1(Form("hVertexAfter%s", trg->Data()), Form("Vertex distribution after z-cut for trigger class %s", trg->Data()), 100, -10, 10);
138  fHistos->CreateTH1(Form("hPtEtaAllOldBinning%s", trg->Data()), Form("Charged particle pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
139  fHistos->CreateTH1(Form("hPtEtaCentOldBinning%s", trg->Data()), Form("Charged particle pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
140  fHistos->CreateTH1(Form("hPtEtaAllNewBinning%s", trg->Data()), Form("Charged particle pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
141  fHistos->CreateTH1(Form("hPtEtaCentNewBinning%s", trg->Data()), Form("Charged particle pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
142  fHistos->CreateTH1(Form("hPtEMCALEtaAllOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
143  fHistos->CreateTH1(Form("hPtEMCALEtaCentOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
144  fHistos->CreateTH1(Form("hPtEMCALEtaAllNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
145  fHistos->CreateTH1(Form("hPtEMCALEtaCentNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
146  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.);
147  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);
148  fHistos->CreateTHnSparse(Form("hPIDcorrEMCAL%s", trg->Data()), Form("Correlation of PID observables for Trigger %s", trg->Data()), kdimPID, knbinsPID, kminPID, kmaxPID);
149  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);
150  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);
151  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);
152  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);
153  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);
154  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);
155  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);
156  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);
157  for(int ipt = 0; ipt < 5; ipt++){
159  Form("hEtaLabDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
160  Form("Eta (lab) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
161  100,
162  -1.,
163  1.
164  );
166  Form("hEtaLabDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
167  Form("Eta (lab) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
168  100,
169  -1.,
170  1.
171  );
173  Form("hEtaCentDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
174  Form("Eta (cent) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s",
175  trg->Data()),
176  160,
177  -1.3,
178  1.3
179  );
181  Form("hEtaCentDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
182  Form("Eta (cent) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
183  160,
184  -1.3,
185  1.3
186  );
188  Form("hEtaLabDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
189  Form("Eta (lab) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
190  100,
191  -1.,
192  1.
193  );
195  Form("hEtaLabDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
196  Form("Eta (lab) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
197  100,
198  -1.,
199  1.
200  );
202  Form("hEtaCentDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
203  Form("Eta (cent) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
204  160,
205  -1.3,
206  1.3
207  );
209  Form("hEtaCentDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
210  Form("Eta (cent) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
211  160,
212  -1.3,
213  1.3
214  );
216  Form("hPhiDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
217  Form("#phi distribution of particles with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
218  300,
219  0.,
220  2*TMath::Pi()
221  );
222  }
223  }
225  PostData(1, fHistos->GetListOfHistograms());
226 }
227 
237  if(!fGeometry){
238  fGeometry = AliEMCALGeometry::GetInstance();
239  if(!fGeometry)
240  fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
241  }
242  // Select event
243  TClonesArray *triggerpatches = static_cast<TClonesArray *>(fInputEvent->FindListObject("EmcalTriggers"));
244  TString triggerstring = "";
246  triggerstring = GetFiredTriggerClassesFromPatches(triggerpatches);
247  } else {
248  triggerstring = fInputEvent->GetFiredTriggerClasses();
249  }
250  UInt_t selectionstatus = fInputHandler->IsEventSelected();
251  Bool_t isMinBias = selectionstatus & AliVEvent::kINT7,
252  isEJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ1"),
253  isEJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ2"),
254  isEG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG1"),
255  isEG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG2"),
256  isEMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("CEMC7");
257  if(triggerpatches && fTriggerSelection){
263  }
264  if(!(isMinBias || isEMC7 || isEG1 || isEG2 || isEJ1 || isEJ2)) return;
265  const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
266  //if(!fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.)) return; // reject pileup event
267  if(vtx->GetNContributors() < 1) return;
268  if(fInputEvent->IsA() == AliESDEvent::Class() && fAnalysisUtil->IsFirstEventInChunk(fInputEvent)) return;
269  bool isSelected = kTRUE;
270  if(!fAnalysisUtil->IsVertexSelected2013pA(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
271  if(fAnalysisUtil->IsPileUpEvent(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
272  // Apply vertex z cut
273  if(vtx->GetZ() < -10. || vtx->GetZ() > 10.) isSelected = kFALSE;
274 
275  // Fill Event counter and reference vertex distributions for the different trigger classes
276  if(isMinBias){
277  FillEventCounterHists("MB", vtx->GetZ(), isSelected);
278  }
279  if(isEMC7){
280  FillEventCounterHists("EMC7", vtx->GetZ(), isSelected);
281  if(!isMinBias){
282  FillEventCounterHists("EMC7excl", vtx->GetZ(), isSelected);
283  }
284  }
285  if(isEJ2){
286  FillEventCounterHists("EJ2", vtx->GetZ(), isSelected);
287  // Check for exclusive classes
288  if(!isMinBias){
289  FillEventCounterHists("EJ2excl", vtx->GetZ(), isSelected);
290  }
291  if(isEG1 || isEG2){
292  FillEventCounterHists("E2combined", vtx->GetZ(), isSelected);
293  } else {
294  FillEventCounterHists("E2Jonly", vtx->GetZ(), isSelected);
295  }
296  }
297  if(isEJ1){
298  FillEventCounterHists("EJ1", vtx->GetZ(), isSelected);
299  // Check for exclusive classes
300  if(!(isMinBias || isEJ2)){
301  FillEventCounterHists("EJ1excl", vtx->GetZ(), isSelected);
302  }
303  if(isEG1 || isEG2){
304  FillEventCounterHists("E1combined", vtx->GetZ(), isSelected);
305  } else {
306  FillEventCounterHists("E1Jonly", vtx->GetZ(), isSelected);
307  }
308  }
309  if(isEG2){
310  FillEventCounterHists("EG2", vtx->GetZ(), isSelected);
311  // Check for exclusive classes
312  if(!isMinBias){
313  FillEventCounterHists("EG2excl", vtx->GetZ(), isSelected);
314  }
315  if(!(isEJ1 || isEJ2)){
316  FillEventCounterHists("E2Gonly", vtx->GetZ(), isSelected);
317  }
318  }
319  if(isEG1){
320  FillEventCounterHists("EG1", vtx->GetZ(), isSelected);
321  // Check for exclusive classes
322  if(!(isMinBias || isEG2 )){
323  FillEventCounterHists("EG1excl", vtx->GetZ(), isSelected);
324  }
325  if(!(isEJ1 || isEJ2)){
326  FillEventCounterHists("E1Gonly", vtx->GetZ(), isSelected);
327  }
328  }
329 
330  if(!isSelected) return;
331 
332  // Loop over tracks, fill select particles
333  // Histograms
334  // - Full eta_{lab} (-0.8, 0.8), new binning
335  // - Full eta_{lab} (-0.8, 0.8), old binning
336  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c without eta cut
337  // - Central eta_{cms} (-0.3, -0.2), new binning,
338  // - Central eta_{cms} (-0.8, -0.2), old binning,
339  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c
340  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c with eta cut
341  AliVTrack *checktrack(NULL);
342  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
343  Bool_t isEMCAL(kFALSE), hasTRD(kFALSE);
344  Double_t etaEMCAL(0.), phiEMCAL(0.);
345  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); ++itrk){
346  checktrack = dynamic_cast<AliVTrack *>(fInputEvent->GetTrack(itrk));
347  if(!checktrack) continue;
348  if((checktrack->Eta() < fEtaLabCut[0]) || (checktrack->Eta() > fEtaLabCut[1])) continue;
349  if(TMath::Abs(checktrack->Pt()) < 0.1) continue;
350  if(checktrack->IsA() == AliESDtrack::Class()){
351  AliESDtrack copytrack(*(static_cast<AliESDtrack *>(checktrack)));
352  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
353  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
354  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
355  } else {
356  AliAODTrack copytrack(*(static_cast<AliAODTrack *>(checktrack)));
357  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
358  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
359  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
360  }
361  Int_t supermoduleID = -1;
362  isEMCAL = fGeometry->SuperModuleNumberFromEtaPhi(etaEMCAL, phiEMCAL, supermoduleID);
363  // Exclude supermodules 10 and 11 as they did not participate in the trigger
364  isEMCAL = isEMCAL && supermoduleID < 10;
365  hasTRD = isEMCAL && supermoduleID >= 4; // supermodules 4 - 10 have TRD in front in the 2012-2013 ALICE setup
366 
367  // Calculate eta in cms frame according
368  // EPJC74 (2014) 3054:
369  // eta_cms = - eta_lab - |yshift|
370  Double_t etacent = -1. * checktrack->Eta() - TMath::Abs(fYshift);
371  etacent *= fEtaSign;
372 
373  Bool_t etacentcut = etacent > fEtaCmsCut[0] && etacent < fEtaCmsCut[1];
374 
375  if(!fTrackCuts->IsTrackAccepted(checktrack)) continue;
376 
377  // fill histograms allEta
378  if(isMinBias){
379  FillTrackHistos("MB", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
380  if(isEMCAL) FillPIDHistos("MB", *checktrack);
381  }
382  if(isEMC7){
383  FillTrackHistos("EMC7", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
384  if(isEMCAL) FillPIDHistos("EMC7", *checktrack);
385  if(!isMinBias){
386  FillTrackHistos("EMC7excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
387  if(isEMCAL) FillPIDHistos("EMC7excl", *checktrack);
388  }
389  }
390  if(isEJ2){
391  FillTrackHistos("EJ2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
392  if(isEMCAL) FillPIDHistos("EJ2", *checktrack);
393  // check for exclusive classes
394  if(!isMinBias){
395  FillTrackHistos("EJ2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
396  if(isEMCAL) FillPIDHistos("EJ2excl", *checktrack);
397  }
398  if(isEG1 || isEG2){
399  FillTrackHistos("E2combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
400  if(isEMCAL) FillPIDHistos("E2combined", *checktrack);
401  } else {
402  FillTrackHistos("E2Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
403  if(isEMCAL) FillPIDHistos("E2Jonly", *checktrack);
404  }
405  }
406  if(isEJ1){
407  FillTrackHistos("EJ1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
408  if(isEMCAL) FillPIDHistos("EJ1", *checktrack);
409  // check for exclusive classes
410  if(!(isMinBias || isEJ2)){
411  FillTrackHistos("EJ1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
412  if(isEMCAL) FillPIDHistos("EJ1excl", *checktrack);
413  }
414  if(isEG1 || isEG2) {
415  FillTrackHistos("E1combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
416  if(isEMCAL) FillPIDHistos("E1combined", *checktrack);
417  } else {
418  FillTrackHistos("E1Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
419  if(isEMCAL) FillPIDHistos("E1Jonly", *checktrack);
420  }
421  }
422  if(isEG2){
423  FillTrackHistos("EG2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
424  if(isEMCAL) FillPIDHistos("EG2", *checktrack);
425  // check for exclusive classes
426  if(!isMinBias){
427  FillTrackHistos("EG2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
428  if(isEMCAL) FillPIDHistos("EG2excl", *checktrack);
429  }
430  if(!(isEJ2 || isEJ1)){
431  FillTrackHistos("E2Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
432  if(isEMCAL) FillPIDHistos("E2Gonly", *checktrack);
433  }
434  }
435  if(isEG1){
436  FillTrackHistos("EG1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
437  if(isEMCAL) FillPIDHistos("EG1", *checktrack);
438  if(!(isMinBias || isEG2)){
439  FillTrackHistos("EG1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
440  if(isEMCAL) FillPIDHistos("EG1excl", *checktrack);
441  }
442  if(!(isEJ1 || isEJ2)){
443  FillTrackHistos("E1Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
444  if(isEMCAL) FillPIDHistos("E1Gonly", *checktrack);
445  }
446  }
447  }
448  PostData(1, fHistos->GetListOfHistograms());
449 }
450 
458  const std::string &triggerclass,
459  double vtxz,
460  bool isSelected
461 )
462 {
463  // Fill reference distribution for the primary vertex before any z-cut
464  fHistos->FillTH1(Form("hVertexBefore%s", triggerclass.c_str()), vtxz);
465  if(isSelected){
466  // Fill Event counter and reference vertex distributions after event selection
467  fHistos->FillTH1(Form("hEventCount%s", triggerclass.c_str()), 1);
468  fHistos->FillTH1(Form("hVertexAfter%s", triggerclass.c_str()), vtxz);
469  }
470 }
471 
483  const std::string &eventclass,
484  Double_t pt,
485  Double_t etalab,
486  Double_t etacent,
487  Double_t phi,
488  Bool_t etacut,
489  Bool_t inEmcal,
490  Bool_t hasTRD
491  )
492 {
493  fHistos->FillTH1(Form("hPtEtaAllNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
494  fHistos->FillTH1(Form("hPtEtaAllOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
495  if(inEmcal){
496  fHistos->FillTH1(Form("hPtEMCALEtaAllNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
497  fHistos->FillTH1(Form("hPtEMCALEtaAllOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
498  if(hasTRD){
499  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
500  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
501  } else {
502  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
503  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
504  }
505  }
506 
507  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
508  for(int icut = 0; icut < 5; icut++){
509  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
510  fHistos->FillTH1(Form("hPhiDistAllPt%d%s", ptmin[icut], eventclass.c_str()), phi);
511  fHistos->FillTH1(Form("hEtaLabDistAllPt%d%s", ptmin[icut], eventclass.c_str()), etalab);
512  fHistos->FillTH1(Form("hEtaCentDistAllPt%d%s", ptmin[icut], eventclass.c_str()), etacent);
513  if(inEmcal){
514  fHistos->FillTH1(Form("hEtaLabDistAllEMCALPt%d%s", ptmin[icut], eventclass.c_str()), etalab);
515  fHistos->FillTH1(Form("hEtaCentDistAllEMCALPt%d%s", ptmin[icut], eventclass.c_str()), etacent);
516  }
517  }
518  }
519 
520  if(etacut){
521  fHistos->FillTH1(Form("hPtEtaCentNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
522  fHistos->FillTH1(Form("hPtEtaCentOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
523  if(inEmcal){
524  fHistos->FillTH1(Form("hPtEMCALEtaCentNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
525  fHistos->FillTH1(Form("hPtEMCALEtaCentOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
526  if(hasTRD){
527  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
528  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
529  } else {
530  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentNewBinning%s", eventclass.c_str()), TMath::Abs(pt));
531  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentOldBinning%s", eventclass.c_str()), TMath::Abs(pt));
532  }
533  }
534  for(int icut = 0; icut < 5; icut++){
535  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
536  fHistos->FillTH1(Form("hEtaLabDistCutPt%d%s", ptmin[icut], eventclass.c_str()), etalab);
537  fHistos->FillTH1(Form("hEtaCentDistCutPt%d%s", ptmin[icut], eventclass.c_str()), etacent);
538  if(inEmcal){
539  fHistos->FillTH1(Form("hEtaLabDistCutEMCALPt%d%s", ptmin[icut], eventclass.c_str()), etalab);
540  fHistos->FillTH1(Form("hEtaCentDistCutEMCALPt%d%s", ptmin[icut], eventclass.c_str()), etacent);
541  }
542  }
543  }
544  }
545 }
546 
548  const std::string &eventclass,
549  const AliVTrack &trk
550 ) {
551  AliPIDResponse *pid = fInputHandler->GetPIDResponse();
552  if(TMath::Abs(trk.Eta()) > 0.5) return;
553  if(!((trk.GetStatus() & AliVTrack::kTOFout) && (trk.GetStatus() & AliVTrack::kTIME))) return;
554 
555  double poverz = TMath::Abs(trk.P())/static_cast<double>(trk.Charge());
556  fHistos->FillTH2(Form("hTPCdEdxEMCAL%s", eventclass.c_str()), poverz, trk.GetTPCsignal());
557  // correct for units - TOF in ps, track length in cm
558  Double_t trtime = (trk.GetTOFsignal() - pid->GetTOFResponse().GetTimeZero()) * 1e-12;
559  Double_t v = trk.GetIntegratedLength()/(100. * trtime);
560  Double_t beta = v / TMath::C();
561  fHistos->FillTH2(Form("hTOFBetaEMCAL%s", eventclass.c_str()), poverz, beta);
562  double datapoint[3] = {poverz, trk.GetTPCsignal(), beta};
563  fHistos->FillTHnSparse(Form("hPIDcorrEMCAL%s", eventclass.c_str()), datapoint);
564 }
565 
573 }
574 
580 TString AliAnalysisTaskChargedParticlesRef::GetFiredTriggerClassesFromPatches(const TClonesArray* triggerpatches) const {
581  TString triggerstring = "";
582  Int_t nEJ1 = 0, nEJ2 = 0, nEG1 = 0, nEG2 = 0;
583  double minADC_EJ1 = 260.,
584  minADC_EJ2 = 127.,
585  minADC_EG1 = 140.,
586  minADC_EG2 = 89.;
587  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
588  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
589  if(!patch->IsOfflineSimple()) continue;
590  if(patch->IsJetHighSimple() && patch->GetADCOfflineAmp() > minADC_EJ1) nEJ1++;
591  if(patch->IsJetLowSimple() && patch->GetADCOfflineAmp() > minADC_EJ2) nEJ2++;
592  if(patch->IsGammaHighSimple() && patch->GetADCOfflineAmp() > minADC_EG1) nEG1++;
593  if(patch->IsGammaLowSimple() && patch->GetADCOfflineAmp() > minADC_EG2) nEG2++;
594  }
595  if(nEJ1) triggerstring += "EJ1";
596  if(nEJ2){
597  if(triggerstring.Length()) triggerstring += ",";
598  triggerstring += "EJ2";
599  }
600  if(nEG1){
601  if(triggerstring.Length()) triggerstring += ",";
602  triggerstring += "EG1";
603  }
604  if(nEG2){
605  if(triggerstring.Length()) triggerstring += ",";
606  triggerstring += "EG2";
607  }
608  return triggerstring;
609 }
610 
617 {
618  this->SetMinimum(0.);
619  this->AddStep(2.5, 0.1);
620  this->AddStep(7., 0.25);
621  this->AddStep(15., 0.5);
622  this->AddStep(25., 1.);
623  this->AddStep(40., 2.5);
624  this->AddStep(50., 5.);
625  this->AddStep(100., 10.);
626 }
627 
634 {
635  this->SetMinimum(0.);
636  this->AddStep(1, 0.05);
637  this->AddStep(2, 0.1);
638  this->AddStep(4, 0.2);
639  this->AddStep(7, 0.5);
640  this->AddStep(16, 1);
641  this->AddStep(36, 2);
642  this->AddStep(40, 4);
643  this->AddStep(50, 5);
644  this->AddStep(100, 10);
645  this->AddStep(200, 20);
646 }
647 
648 } /* 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="")
void AddStep(Double_t max, Double_t binwidth)
TString GetFiredTriggerClassesFromPatches(const TClonesArray *triggerpatches) const
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
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="")
Helper class creating user defined custom binning.
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)
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
virtual bool IsTrackAccepted(AliVTrack *const trk)=0
void SetMinimum(Double_t min)