AliPhysics  7dff9e1 (7dff9e1)
 All Classes Namespaces Files Functions Variables Typedefs 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 
33 #include "AliEMCALTriggerPatchInfo.h"
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  fSwitchoffSPDcut(kFALSE),
56  fSwitchoffITScut(kFALSE)
57 {
58  // Restrict analysis to the EMCAL acceptance
59  fEtaLabCut[0] = -0.6;
60  fEtaLabCut[1] = 0.6;
61  fEtaCmsCut[0] = -0.13;
62  fEtaCmsCut[1] = 0.13;
63  for(int itrg = 0; itrg < kCPRntrig; itrg++){
64  fOfflineEnergyThreshold[itrg] = -1.;
65  }
66 }
67 
73  AliAnalysisTaskSE(name),
74  fTrackCuts(NULL),
75  fAnalysisUtil(NULL),
76  fHistos(NULL),
77  fGeometry(NULL),
78  fTriggerStringFromPatches(kFALSE),
79  fYshift(0.465),
80  fEtaSign(1),
81  fSwitchoffSPDcut(kFALSE),
82  fSwitchoffITScut(kFALSE)
83 {
84  // Restrict analysis to the EMCAL acceptance
85  fEtaLabCut[0] = -0.6;
86  fEtaLabCut[1] = 0.6;
87  fEtaCmsCut[0] = -0.13;
88  fEtaCmsCut[1] = 0.13;
89  for(int itrg = 0; itrg < kCPRntrig; itrg++){
90  fOfflineEnergyThreshold[itrg] = -1.;
91  }
92  DefineOutput(1, TList::Class());
93 }
94 
99  //if(fTrackCuts) delete fTrackCuts;
100  if(fAnalysisUtil) delete fAnalysisUtil;
101  if(fHistos) delete fHistos;
102 }
103 
108  fAnalysisUtil = new AliAnalysisUtils;
109 
110  fTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(true, 1);
111  fTrackCuts->DefineHistograms(kRed);
112  fTrackCuts->SetName("Standard Track cuts");
113  fTrackCuts->SetMinNCrossedRowsTPC(120);
114  fTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
116  fTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
117  }
118  if(fSwitchoffITScut){
119  fTrackCuts->SetRequireITSRefit(kFALSE); // Allows also TPC-only tracks
120  fTrackCuts->SetMinNClustersITS(0);
121  }
122 
123  TArrayD oldbinning, newbinning;
124  CreateOldPtBinning(oldbinning);
125  CreateNewPtBinning(newbinning);
126 
127  fHistos = new AliEMCalHistoContainer("Ref");
128  // Exclusive means classes without higher trigger classes:
129  // EG2excl means EG2 && !EG1
130  // EJ2excl means EJ2 && !EJ1
131  // MBExcl means MinBias && !EMCAL trigger
132  // Combined means: gamma and ANY jet class, jet and ANY gamma class
133  // Jonly means: No gamma class fired at the same time
134  // Gonly means: No jet class fired at the same time
135  TString triggers[17] = {
136  "MB", "EMC7",
137  "EJ1", "EJ2", "EG1", "EG2",
138  "EMC7excl", "EG1excl", "EG2excl", "EJ1excl", "EJ2excl",
139  "E1combined", "E1Jonly", "E1Gonly", "E2combined", "E2Jonly", "E2Gonly"
140  };
141  Double_t ptcuts[5] = {1., 2., 5., 10., 20.};
142  for(TString *trg = triggers; trg < triggers + sizeof(triggers)/sizeof(TString); trg++){
143  fHistos->CreateTH1(Form("hEventCount%s", trg->Data()), Form("Event Counter for trigger class %s", trg->Data()), 1, 0.5, 1.5);
144  fHistos->CreateTH1(Form("hVertexBefore%s", trg->Data()), Form("Vertex distribution before z-cut for trigger class %s", trg->Data()), 500, -50, 50);
145  fHistos->CreateTH1(Form("hVertexAfter%s", trg->Data()), Form("Vertex distribution after z-cut for trigger class %s", trg->Data()), 100, -10, 10);
146  fHistos->CreateTH1(Form("hPtEtaAllOldBinning%s", trg->Data()), Form("Charged particle pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
147  fHistos->CreateTH1(Form("hPtEtaCentOldBinning%s", trg->Data()), Form("Charged particle pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
148  fHistos->CreateTH1(Form("hPtEtaAllNewBinning%s", trg->Data()), Form("Charged particle pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
149  fHistos->CreateTH1(Form("hPtEtaCentNewBinning%s", trg->Data()), Form("Charged particle pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
150  fHistos->CreateTH1(Form("hPtEMCALEtaAllOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
151  fHistos->CreateTH1(Form("hPtEMCALEtaCentOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
152  fHistos->CreateTH1(Form("hPtEMCALEtaAllNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
153  fHistos->CreateTH1(Form("hPtEMCALEtaCentNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
154  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);
155  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);
156  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);
157  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);
158  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);
159  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);
160  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);
161  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);
162  for(int ipt = 0; ipt < 5; ipt++){
164  Form("hEtaLabDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
165  Form("Eta (lab) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
166  100,
167  -1.,
168  1.
169  );
171  Form("hEtaLabDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
172  Form("Eta (lab) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
173  100,
174  -1.,
175  1.
176  );
178  Form("hEtaCentDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
179  Form("Eta (cent) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s",
180  trg->Data()),
181  160,
182  -1.3,
183  1.3
184  );
186  Form("hEtaCentDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
187  Form("Eta (cent) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
188  160,
189  -1.3,
190  1.3
191  );
193  Form("hEtaLabDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
194  Form("Eta (lab) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
195  100,
196  -1.,
197  1.
198  );
200  Form("hEtaLabDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
201  Form("Eta (lab) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
202  100,
203  -1.,
204  1.
205  );
207  Form("hEtaCentDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
208  Form("Eta (cent) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
209  160,
210  -1.3,
211  1.3
212  );
214  Form("hEtaCentDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
215  Form("Eta (cent) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
216  160,
217  -1.3,
218  1.3
219  );
221  Form("hPhiDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
222  Form("#phi distribution of particles with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
223  300,
224  0.,
225  2*TMath::Pi()
226  );
227  }
228  }
230  PostData(1, fHistos->GetListOfHistograms());
231 }
232 
242  if(!fGeometry){
243  fGeometry = AliEMCALGeometry::GetInstance();
244  if(!fGeometry)
245  fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
246  }
247  // Select event
248  TClonesArray *triggerpatches = static_cast<TClonesArray *>(fInputEvent->FindListObject("EmcalTriggers"));
249  TString triggerstring = "";
251  triggerstring = GetFiredTriggerClassesFromPatches(triggerpatches);
252  } else {
253  triggerstring = fInputEvent->GetFiredTriggerClasses();
254  }
255  UInt_t selectionstatus = fInputHandler->IsEventSelected();
256  Bool_t isMinBias = selectionstatus & AliVEvent::kINT7,
257  isEJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ1") && IsOfflineSelected(kCPREJ1, triggerpatches),
258  isEJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ2") && IsOfflineSelected(kCPREJ2, triggerpatches),
259  isEG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG1") && IsOfflineSelected(kCPREG1, triggerpatches),
260  isEG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG2") && IsOfflineSelected(kCPREG2, triggerpatches),
261  isEMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("CEMC7") && IsOfflineSelected(kCPREL0, triggerpatches);
262  if(!(isMinBias || isEMC7 || isEG1 || isEG2 || isEJ1 || isEJ2)) return;
263  const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
264  //if(!fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.)) return; // reject pileup event
265  if(vtx->GetNContributors() < 1) return;
266  if(fInputEvent->IsA() == AliESDEvent::Class() && fAnalysisUtil->IsFirstEventInChunk(fInputEvent)) return;
267  bool isSelected = kTRUE;
268  if(!fAnalysisUtil->IsVertexSelected2013pA(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
269  if(fAnalysisUtil->IsPileUpEvent(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
270  // Apply vertex z cut
271  if(vtx->GetZ() < -10. || vtx->GetZ() > 10.) isSelected = kFALSE;
272 
273  // Fill Event counter and reference vertex distributions for the different trigger classes
274  if(isMinBias){
275  FillEventCounterHists("MB", vtx->GetZ(), isSelected);
276  }
277  if(isEMC7){
278  FillEventCounterHists("EMC7", vtx->GetZ(), isSelected);
279  if(!isMinBias){
280  FillEventCounterHists("EMC7excl", vtx->GetZ(), isSelected);
281  }
282  }
283  if(isEJ2){
284  FillEventCounterHists("EJ2", vtx->GetZ(), isSelected);
285  // Check for exclusive classes
286  if(!isMinBias){
287  FillEventCounterHists("EJ2excl", vtx->GetZ(), isSelected);
288  }
289  if(isEG1 || isEG2){
290  FillEventCounterHists("E2combined", vtx->GetZ(), isSelected);
291  } else {
292  FillEventCounterHists("E2Jonly", vtx->GetZ(), isSelected);
293  }
294  }
295  if(isEJ1){
296  FillEventCounterHists("EJ1", vtx->GetZ(), isSelected);
297  // Check for exclusive classes
298  if(!(isMinBias || isEJ2)){
299  FillEventCounterHists("EJ1excl", vtx->GetZ(), isSelected);
300  }
301  if(isEG1 || isEG2){
302  FillEventCounterHists("E1combined", vtx->GetZ(), isSelected);
303  } else {
304  FillEventCounterHists("E1Jonly", vtx->GetZ(), isSelected);
305  }
306  }
307  if(isEG2){
308  FillEventCounterHists("EG2", vtx->GetZ(), isSelected);
309  // Check for exclusive classes
310  if(!isMinBias){
311  FillEventCounterHists("EG2excl", vtx->GetZ(), isSelected);
312  }
313  if(!(isEJ1 || isEJ2)){
314  FillEventCounterHists("E2Gonly", vtx->GetZ(), isSelected);
315  }
316  }
317  if(isEG1){
318  FillEventCounterHists("EG1", vtx->GetZ(), isSelected);
319  // Check for exclusive classes
320  if(!(isMinBias || isEG2 )){
321  FillEventCounterHists("EG1excl", vtx->GetZ(), isSelected);
322  }
323  if(!(isEJ1 || isEJ2)){
324  FillEventCounterHists("E1Gonly", vtx->GetZ(), isSelected);
325  }
326  }
327 
328  if(!isSelected) return;
329 
330  // Loop over tracks, fill select particles
331  // Histograms
332  // - Full eta_{lab} (-0.8, 0.8), new binning
333  // - Full eta_{lab} (-0.8, 0.8), old binning
334  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c without eta cut
335  // - Central eta_{cms} (-0.3, -0.2), new binning,
336  // - Central eta_{cms} (-0.8, -0.2), old binning,
337  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c
338  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c with eta cut
339  AliVTrack *checktrack(NULL);
340  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
341  Bool_t isEMCAL(kFALSE), hasTRD(kFALSE);
342  Double_t etaEMCAL(0.), phiEMCAL(0.);
343  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); ++itrk){
344  checktrack = dynamic_cast<AliVTrack *>(fInputEvent->GetTrack(itrk));
345  if(!checktrack) continue;
346  if((checktrack->Eta() < fEtaLabCut[0]) || (checktrack->Eta() > fEtaLabCut[1])) continue;
347  if(TMath::Abs(checktrack->Pt()) < 0.1) continue;
348  if(checktrack->IsA() == AliESDtrack::Class()){
349  AliESDtrack copytrack(*(static_cast<AliESDtrack *>(checktrack)));
350  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
351  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
352  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
353  } else {
354  AliAODTrack copytrack(*(static_cast<AliAODTrack *>(checktrack)));
355  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
356  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
357  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
358  }
359  Int_t supermoduleID = -1;
360  isEMCAL = fGeometry->SuperModuleNumberFromEtaPhi(etaEMCAL, phiEMCAL, supermoduleID);
361  // Exclude supermodules 10 and 11 as they did not participate in the trigger
362  isEMCAL = isEMCAL && supermoduleID < 10;
363  hasTRD = isEMCAL && supermoduleID >= 4; // supermodules 4 - 10 have TRD in front in the 2012-2013 ALICE setup
364 
365  // Calculate eta in cms frame according
366  // EPJC74 (2014) 3054:
367  // eta_cms = - eta_lab - |yshift|
368  Double_t etacent = -1. * checktrack->Eta() - TMath::Abs(fYshift);
369  etacent *= fEtaSign;
370 
371  Bool_t etacentcut = etacent > fEtaCmsCut[0] && etacent < fEtaCmsCut[1];
372 
373  // Distinguish track selection for ESD and AOD tracks
374  AliESDtrack *esdtrack(NULL);
375  AliAODTrack *aodtrack(NULL);
376  if((esdtrack = dynamic_cast<AliESDtrack *>(checktrack))){
377  if(!TrackSelectionESD(esdtrack)) continue;
378  } else if((aodtrack = dynamic_cast<AliAODTrack *>(checktrack))){
379  if(!TrackSelectionAOD(aodtrack)) continue;
380  } else {
381  continue;
382  }
383 
384  // fill histograms allEta
385  if(isMinBias){
386  FillTrackHistos("MB", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
387  }
388  if(isEMC7){
389  FillTrackHistos("EMC7", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
390  if(!isMinBias){
391  FillTrackHistos("EMC7excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
392  }
393  }
394  if(isEJ2){
395  FillTrackHistos("EJ2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
396  // check for exclusive classes
397  if(!isMinBias){
398  FillTrackHistos("EJ2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
399  }
400  if(isEG1 || isEG2){
401  FillTrackHistos("E2combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
402  } else {
403  FillTrackHistos("E2Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
404  }
405  }
406  if(isEJ1){
407  FillTrackHistos("EJ1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
408  // check for exclusive classes
409  if(!(isMinBias || isEJ2)){
410  FillTrackHistos("EJ1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
411  }
412  if(isEG1 || isEG2) {
413  FillTrackHistos("E1combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
414  } else {
415  FillTrackHistos("E1Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
416  }
417  }
418  if(isEG2){
419  FillTrackHistos("EG2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
420  // check for exclusive classes
421  if(!isMinBias){
422  FillTrackHistos("EG2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
423  }
424  if(!(isEJ2 || isEJ1)){
425  FillTrackHistos("E2Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
426  }
427  }
428  if(isEG1){
429  FillTrackHistos("EG1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
430  if(!(isMinBias || isEG2)){
431  FillTrackHistos("EG1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
432  }
433  if(!(isEJ1 || isEJ2)){
434  FillTrackHistos("E1Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
435  }
436  }
437  }
438  PostData(1, fHistos->GetListOfHistograms());
439 }
440 
448  const char *triggerclass,
449  double vtxz,
450  bool isSelected
451 )
452 {
453  // Fill reference distribution for the primary vertex before any z-cut
454  fHistos->FillTH1(Form("hVertexBefore%s", triggerclass), vtxz);
455  if(isSelected){
456  // Fill Event counter and reference vertex distributions after event selection
457  fHistos->FillTH1(Form("hEventCount%s", triggerclass), 1);
458  fHistos->FillTH1(Form("hVertexAfter%s", triggerclass), vtxz);
459  }
460 }
461 
473  const char *eventclass,
474  Double_t pt,
475  Double_t etalab,
476  Double_t etacent,
477  Double_t phi,
478  Bool_t etacut,
479  Bool_t inEmcal,
480  Bool_t hasTRD
481  )
482 {
483  fHistos->FillTH1(Form("hPtEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
484  fHistos->FillTH1(Form("hPtEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
485  if(inEmcal){
486  fHistos->FillTH1(Form("hPtEMCALEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
487  fHistos->FillTH1(Form("hPtEMCALEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
488  if(hasTRD){
489  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
490  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
491  } else {
492  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
493  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
494  }
495  }
496 
497  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
498  for(int icut = 0; icut < 5; icut++){
499  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
500  fHistos->FillTH1(Form("hPhiDistAllPt%d%s", ptmin[icut], eventclass), phi);
501  fHistos->FillTH1(Form("hEtaLabDistAllPt%d%s", ptmin[icut], eventclass), etalab);
502  fHistos->FillTH1(Form("hEtaCentDistAllPt%d%s", ptmin[icut], eventclass), etacent);
503  if(inEmcal){
504  fHistos->FillTH1(Form("hEtaLabDistAllEMCALPt%d%s", ptmin[icut], eventclass), etalab);
505  fHistos->FillTH1(Form("hEtaCentDistAllEMCALPt%d%s", ptmin[icut], eventclass), etacent);
506  }
507  }
508  }
509 
510  if(etacut){
511  fHistos->FillTH1(Form("hPtEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
512  fHistos->FillTH1(Form("hPtEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
513  if(inEmcal){
514  fHistos->FillTH1(Form("hPtEMCALEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
515  fHistos->FillTH1(Form("hPtEMCALEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
516  if(hasTRD){
517  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
518  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
519  } else {
520  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
521  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
522  }
523  }
524  for(int icut = 0; icut < 5; icut++){
525  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
526  fHistos->FillTH1(Form("hEtaLabDistCutPt%d%s", ptmin[icut], eventclass), etalab);
527  fHistos->FillTH1(Form("hEtaCentDistCutPt%d%s", ptmin[icut], eventclass), etacent);
528  if(inEmcal){
529  fHistos->FillTH1(Form("hEtaLabDistCutEMCALPt%d%s", ptmin[icut], eventclass), etalab);
530  fHistos->FillTH1(Form("hEtaCentDistCutEMCALPt%d%s", ptmin[icut], eventclass), etacent);
531  }
532  }
533  }
534  }
535 }
536 
537 
543  std::vector<double> mybinning;
544  std::map<double,double> definitions;
545  definitions.insert(std::pair<double,double>(2.5, 0.1));
546  definitions.insert(std::pair<double,double>(7., 0.25));
547  definitions.insert(std::pair<double,double>(15., 0.5));
548  definitions.insert(std::pair<double,double>(25., 1.));
549  definitions.insert(std::pair<double,double>(40., 2.5));
550  definitions.insert(std::pair<double,double>(50., 5.));
551  definitions.insert(std::pair<double,double>(100., 10.));
552  double currentval = 0;
553  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
554  double limit = id->first, binwidth = id->second;
555  while(currentval < limit){
556  currentval += binwidth;
557  mybinning.push_back(currentval);
558  }
559  }
560  binning.Set(mybinning.size());
561  int ib = 0;
562  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
563  binning[ib++] = *it;
564 }
565 
571  std::vector<double> mybinning;
572  std::map<double,double> definitions;
573  definitions.insert(std::pair<double, double>(1, 0.05));
574  definitions.insert(std::pair<double, double>(2, 0.1));
575  definitions.insert(std::pair<double, double>(4, 0.2));
576  definitions.insert(std::pair<double, double>(7, 0.5));
577  definitions.insert(std::pair<double, double>(16, 1));
578  definitions.insert(std::pair<double, double>(36, 2));
579  definitions.insert(std::pair<double, double>(40, 4));
580  definitions.insert(std::pair<double, double>(50, 5));
581  definitions.insert(std::pair<double, double>(100, 10));
582  definitions.insert(std::pair<double, double>(200, 20));
583  double currentval = 0.;
584  mybinning.push_back(currentval);
585  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
586  double limit = id->first, binwidth = id->second;
587  while(currentval < limit){
588  currentval += binwidth;
589  mybinning.push_back(currentval);
590  }
591  }
592  binning.Set(mybinning.size());
593  int ib = 0;
594  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
595  binning[ib++] = *it;
596 }
597 
604  return fTrackCuts->AcceptTrack(track);
605 }
606 
613  if(!track->TestFilterBit(AliAODTrack::kTrkGlobal)) return false;
614  if(track->GetTPCNCrossedRows() < 120) return false;
615  return true;
616 }
617 
626 Bool_t AliAnalysisTaskChargedParticlesRef::IsOfflineSelected(EmcalTriggerClass trgcls, const TClonesArray * const triggerpatches) const {
627  if(fOfflineEnergyThreshold[trgcls] < 0) return true;
628  bool isSingleShower = ((trgcls == kCPREL0) || (trgcls == kCPREG1) || (trgcls == kCPREG2));
629  int nfound = 0;
630  AliEMCALTriggerPatchInfo *patch = NULL;
631  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
632  patch = static_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
633  if(!patch->IsOfflineSimple()) continue;
634  if(isSingleShower){
635  if(!patch->IsGammaLowSimple()) continue;
636  } else {
637  if(!patch->IsJetLowSimple()) continue;
638  }
639  if(patch->GetPatchE() > fOfflineEnergyThreshold[trgcls]) nfound++;
640  }
641  return nfound > 0;
642 }
643 
649 TString AliAnalysisTaskChargedParticlesRef::GetFiredTriggerClassesFromPatches(const TClonesArray* triggerpatches) const {
650  TString triggerstring = "";
651  Int_t nEJ1 = 0, nEJ2 = 0, nEG1 = 0, nEG2 = 0;
652  double minADC_EJ1 = 260.,
653  minADC_EJ2 = 127.,
654  minADC_EG1 = 140.,
655  minADC_EG2 = 89.;
656  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
657  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
658  if(!patch->IsOfflineSimple()) continue;
659  if(patch->IsJetHighSimple() && patch->GetADCOfflineAmp() > minADC_EJ1) nEJ1++;
660  if(patch->IsJetLowSimple() && patch->GetADCOfflineAmp() > minADC_EJ2) nEJ2++;
661  if(patch->IsGammaHighSimple() && patch->GetADCOfflineAmp() > minADC_EG1) nEG1++;
662  if(patch->IsGammaLowSimple() && patch->GetADCOfflineAmp() > minADC_EG2) nEG2++;
663  }
664  if(nEJ1) triggerstring += "EJ1";
665  if(nEJ2){
666  if(triggerstring.Length()) triggerstring += ",";
667  triggerstring += "EJ2";
668  }
669  if(nEG1){
670  if(triggerstring.Length()) triggerstring += ",";
671  triggerstring += "EG1";
672  }
673  if(nEG2){
674  if(triggerstring.Length()) triggerstring += ",";
675  triggerstring += "EG2";
676  }
677  return triggerstring;
678 }
679 
680 } /* namespace EMCalTriggerPtAnalysis */
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Double_t fEtaSign
Sign of the eta distribution (swaps when beam directions swap): p-Pb: +1, Pb-p: -1.
Double_t fOfflineEnergyThreshold[kCPRntrig]
Threhold applied on offline patches.
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
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
Bool_t IsOfflineSelected(EmcalTriggerClass trgcls, const TClonesArray *const triggerpatches) const
Double_t fEtaCmsCut[2]
Cut applied in Eta centre-of-mass frame.
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
void FillTH1(const char *hname, double x, double weight=1.)
Bool_t fSwitchoffITScut
Switch off ITS cut completely (no refit, no cluster requirement)