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