AliPhysics  vAN-20151012 (2287573)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskChargedParticlesRef.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 #include <vector>
16 #include <map>
17 
18 #include <TArrayD.h>
19 #include <TMath.h>
20 #include <THashList.h>
21 #include <TString.h>
22 
23 #include "AliAnalysisUtils.h"
24 #include "AliAODTrack.h"
25 #include "AliEMCALGeometry.h"
26 #include "AliEMCALRecoUtils.h"
27 #include "AliESDtrackCuts.h"
28 #include "AliESDEvent.h"
29 #include "AliESDtrack.h"
30 #include "AliInputEventHandler.h"
31 #include "AliVVertex.h"
32 
34 #include "AliEMCalHistoContainer.h"
36 
40 
41 namespace EMCalTriggerPtAnalysis {
42 
46 AliAnalysisTaskChargedParticlesRef::AliAnalysisTaskChargedParticlesRef() :
47  AliAnalysisTaskSE(),
48  fTrackCuts(NULL),
49  fAnalysisUtil(NULL),
50  fHistos(NULL),
51  fGeometry(NULL),
52  fTriggerStringFromPatches(kFALSE),
53  fYshift(0.465),
54  fEtaSign(1)
55 {
56  // Restrict analysis to the EMCAL acceptance
57  fEtaLabCut[0] = -0.6;
58  fEtaLabCut[1] = 0.6;
59  fEtaCmsCut[0] = -0.13;
60  fEtaCmsCut[1] = 0.13;
61  for(int itrg = 0; itrg < kCPRntrig; itrg++){
62  fOfflineEnergyThreshold[itrg] = -1.;
63  }
64 }
65 
71  AliAnalysisTaskSE(name),
72  fTrackCuts(NULL),
73  fAnalysisUtil(NULL),
74  fHistos(NULL),
75  fGeometry(NULL),
76  fTriggerStringFromPatches(kFALSE),
77  fYshift(0.465),
78  fEtaSign(1)
79 {
80  // Restrict analysis to the EMCAL acceptance
81  fEtaLabCut[0] = -0.6;
82  fEtaLabCut[1] = 0.6;
83  fEtaCmsCut[0] = -0.13;
84  fEtaCmsCut[1] = 0.13;
85  for(int itrg = 0; itrg < kCPRntrig; itrg++){
86  fOfflineEnergyThreshold[itrg] = -1.;
87  }
88  DefineOutput(1, TList::Class());
89 }
90 
95  if(fTrackCuts) delete fTrackCuts;
96  if(fAnalysisUtil) delete fAnalysisUtil;
97  if(fHistos) delete fHistos;
98 }
99 
104  fAnalysisUtil = new AliAnalysisUtils;
105 
106  fTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(true, 1);
107  fTrackCuts->SetName("Standard Track cuts");
108  fTrackCuts->SetMinNCrossedRowsTPC(120);
109  fTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
110 
111  TArrayD oldbinning, newbinning;
112  CreateOldPtBinning(oldbinning);
113  CreateNewPtBinning(newbinning);
114 
115  fHistos = new AliEMCalHistoContainer("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  for(TString *trg = triggers; trg < triggers + sizeof(triggers)/sizeof(TString); trg++){
131  fHistos->CreateTH1(Form("hEventCount%s", trg->Data()), Form("Event Counter for trigger class %s", trg->Data()), 1, 0.5, 1.5);
132  fHistos->CreateTH1(Form("hVertexBefore%s", trg->Data()), Form("Vertex distribution before z-cut for trigger class %s", trg->Data()), 500, -50, 50);
133  fHistos->CreateTH1(Form("hVertexAfter%s", trg->Data()), Form("Vertex distribution after z-cut for trigger class %s", trg->Data()), 100, -10, 10);
134  fHistos->CreateTH1(Form("hPtEtaAllOldBinning%s", trg->Data()), Form("Charged particle pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
135  fHistos->CreateTH1(Form("hPtEtaCentOldBinning%s", trg->Data()), Form("Charged particle pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
136  fHistos->CreateTH1(Form("hPtEtaAllNewBinning%s", trg->Data()), Form("Charged particle pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
137  fHistos->CreateTH1(Form("hPtEtaCentNewBinning%s", trg->Data()), Form("Charged particle pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
138  fHistos->CreateTH1(Form("hPtEMCALEtaAllOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta old binning trigger %s", trg->Data()), oldbinning);
139  fHistos->CreateTH1(Form("hPtEMCALEtaCentOldBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta old binning trigger %s", trg->Data()), oldbinning);
140  fHistos->CreateTH1(Form("hPtEMCALEtaAllNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta new binning trigger %s", trg->Data()), newbinning);
141  fHistos->CreateTH1(Form("hPtEMCALEtaCentNewBinning%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta new binning trigger %s", trg->Data()), newbinning);
142  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);
143  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);
144  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);
145  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);
146  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);
147  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);
148  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);
149  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);
150  for(int ipt = 0; ipt < 5; ipt++){
152  Form("hEtaLabDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
153  Form("Eta (lab) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
154  100,
155  -1.,
156  1.
157  );
159  Form("hEtaLabDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
160  Form("Eta (lab) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
161  100,
162  -1.,
163  1.
164  );
166  Form("hEtaCentDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
167  Form("Eta (cent) distribution without etacut for tracks with Pt above 1 GeV/c trigger %s",
168  trg->Data()),
169  160,
170  -1.3,
171  1.3
172  );
174  Form("hEtaCentDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
175  Form("Eta (cent) distribution with etacut for tracks with Pt above 1 GeV/c trigger %s", trg->Data()),
176  160,
177  -1.3,
178  1.3
179  );
181  Form("hEtaLabDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
182  Form("Eta (lab) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
183  100,
184  -1.,
185  1.
186  );
188  Form("hEtaLabDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
189  Form("Eta (lab) distribution with 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("hEtaCentDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
196  Form("Eta (cent) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
197  160,
198  -1.3,
199  1.3
200  );
202  Form("hEtaCentDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
203  Form("Eta (cent) distribution with 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("hPhiDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
210  Form("#phi distribution of particles with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
211  300,
212  0.,
213  2*TMath::Pi()
214  );
215  }
216  }
217  PostData(1, fHistos->GetListOfHistograms());
218 }
219 
229  if(!fGeometry){
230  fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
231  }
232  // Select event
233  TClonesArray *triggerpatches = static_cast<TClonesArray *>(fInputEvent->FindListObject("EmcalTriggers"));
234  TString triggerstring = "";
236  triggerstring = GetFiredTriggerClassesFromPatches(triggerpatches);
237  } else {
238  triggerstring = fInputEvent->GetFiredTriggerClasses();
239  }
240  UInt_t selectionstatus = fInputHandler->IsEventSelected();
241  Bool_t isMinBias = selectionstatus & AliVEvent::kINT7,
242  isEJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ1") && IsOfflineSelected(kCPREJ1, triggerpatches),
243  isEJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ2") && IsOfflineSelected(kCPREJ2, triggerpatches),
244  isEG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG1") && IsOfflineSelected(kCPREG1, triggerpatches),
245  isEG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG2") && IsOfflineSelected(kCPREG2, triggerpatches),
246  isEMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("CEMC7") && IsOfflineSelected(kCPREL0, triggerpatches);
247  if(!(isMinBias || isEMC7 || isEG1 || isEG2 || isEJ1 || isEJ2)) return;
248  const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
249  //if(!fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.)) return; // reject pileup event
250  if(vtx->GetNContributors() < 1) return;
251  if(fInputEvent->IsA() == AliESDEvent::Class() && fAnalysisUtil->IsFirstEventInChunk(fInputEvent)) return;
252  bool isSelected = kTRUE;
253  if(!fAnalysisUtil->IsVertexSelected2013pA(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
254  if(fAnalysisUtil->IsPileUpEvent(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
255  // Apply vertex z cut
256  if(vtx->GetZ() < -10. || vtx->GetZ() > 10.) isSelected = kFALSE;
257 
258  // Fill Event counter and reference vertex distributions for the different trigger classes
259  if(isMinBias){
260  FillEventCounterHists("MB", vtx->GetZ(), isSelected);
261  }
262  if(isEMC7){
263  FillEventCounterHists("EMC7", vtx->GetZ(), isSelected);
264  if(!isMinBias){
265  FillEventCounterHists("EMC7excl", vtx->GetZ(), isSelected);
266  }
267  }
268  if(isEJ2){
269  FillEventCounterHists("EJ2", vtx->GetZ(), isSelected);
270  // Check for exclusive classes
271  if(!isMinBias){
272  FillEventCounterHists("EJ2excl", vtx->GetZ(), isSelected);
273  }
274  if(isEG1 || isEG2){
275  FillEventCounterHists("E2combined", vtx->GetZ(), isSelected);
276  } else {
277  FillEventCounterHists("E2Jonly", vtx->GetZ(), isSelected);
278  }
279  }
280  if(isEJ1){
281  FillEventCounterHists("EJ1", vtx->GetZ(), isSelected);
282  // Check for exclusive classes
283  if(!(isMinBias || isEJ2)){
284  FillEventCounterHists("EJ1excl", vtx->GetZ(), isSelected);
285  }
286  if(isEG1 || isEG2){
287  FillEventCounterHists("E1combined", vtx->GetZ(), isSelected);
288  } else {
289  FillEventCounterHists("E1Jonly", vtx->GetZ(), isSelected);
290  }
291  }
292  if(isEG2){
293  FillEventCounterHists("EG2", vtx->GetZ(), isSelected);
294  // Check for exclusive classes
295  if(!isMinBias){
296  FillEventCounterHists("EG2excl", vtx->GetZ(), isSelected);
297  }
298  if(!(isEJ1 || isEJ2)){
299  FillEventCounterHists("E2Gonly", vtx->GetZ(), isSelected);
300  }
301  }
302  if(isEG1){
303  FillEventCounterHists("EG1", vtx->GetZ(), isSelected);
304  // Check for exclusive classes
305  if(!(isMinBias || isEG2 )){
306  FillEventCounterHists("EG1excl", vtx->GetZ(), isSelected);
307  }
308  if(!(isEJ1 || isEJ2)){
309  FillEventCounterHists("E1Gonly", vtx->GetZ(), isSelected);
310  }
311  }
312 
313  if(!isSelected) return;
314 
315  // Loop over tracks, fill select particles
316  // Histograms
317  // - Full eta_{lab} (-0.8, 0.8), new binning
318  // - Full eta_{lab} (-0.8, 0.8), old binning
319  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c without eta cut
320  // - Central eta_{cms} (-0.3, -0.2), new binning,
321  // - Central eta_{cms} (-0.8, -0.2), old binning,
322  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c
323  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c with eta cut
324  AliVTrack *checktrack(NULL);
325  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
326  Bool_t isEMCAL(kFALSE), hasTRD(kFALSE);
327  Double_t etaEMCAL(0.), phiEMCAL(0.);
328  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); ++itrk){
329  checktrack = dynamic_cast<AliVTrack *>(fInputEvent->GetTrack(itrk));
330  if(!checktrack) continue;
331  if((checktrack->Eta() < fEtaLabCut[0]) || (checktrack->Eta() > fEtaLabCut[1])) continue;
332  if(TMath::Abs(checktrack->Pt()) < 0.1) continue;
333  if(checktrack->IsA() == AliESDtrack::Class()){
334  AliESDtrack copytrack(*(static_cast<AliESDtrack *>(checktrack)));
335  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
336  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
337  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
338  } else {
339  AliAODTrack copytrack(*(static_cast<AliAODTrack *>(checktrack)));
340  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
341  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
342  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
343  }
344  Int_t supermoduleID = -1;
345  isEMCAL = fGeometry->SuperModuleNumberFromEtaPhi(etaEMCAL, phiEMCAL, supermoduleID);
346  // Exclude supermodules 10 and 11 as they did not participate in the trigger
347  isEMCAL = isEMCAL && supermoduleID < 10;
348  hasTRD = isEMCAL && supermoduleID >= 4; // supermodules 4 - 10 have TRD in front in the 2012-2013 ALICE setup
349 
350  // Calculate eta in cms frame according
351  // EPJC74 (2014) 3054:
352  // eta_cms = - eta_lab - |yshift|
353  Double_t etacent = -1. * checktrack->Eta() - TMath::Abs(fYshift);
354  etacent *= fEtaSign;
355 
356  Bool_t etacentcut = etacent > fEtaCmsCut[0] && etacent < fEtaCmsCut[1];
357 
358  // Distinguish track selection for ESD and AOD tracks
359  AliESDtrack *esdtrack(NULL);
360  AliAODTrack *aodtrack(NULL);
361  if((esdtrack = dynamic_cast<AliESDtrack *>(checktrack))){
362  if(!TrackSelectionESD(esdtrack)) continue;
363  } else if((aodtrack = dynamic_cast<AliAODTrack *>(checktrack))){
364  if(!TrackSelectionAOD(aodtrack)) continue;
365  } else {
366  continue;
367  }
368 
369  // fill histograms allEta
370  if(isMinBias){
371  FillTrackHistos("MB", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
372  }
373  if(isEMC7){
374  FillTrackHistos("EMC7", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
375  if(!isMinBias){
376  FillTrackHistos("EMC7excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
377  }
378  }
379  if(isEJ2){
380  FillTrackHistos("EJ2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
381  // check for exclusive classes
382  if(!isMinBias){
383  FillTrackHistos("EJ2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
384  }
385  if(isEG1 || isEG2){
386  FillTrackHistos("E2combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
387  } else {
388  FillTrackHistos("E2Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
389  }
390  }
391  if(isEJ1){
392  FillTrackHistos("EJ1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
393  // check for exclusive classes
394  if(!(isMinBias || isEJ2)){
395  FillTrackHistos("EJ1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
396  }
397  if(isEG1 || isEG2) {
398  FillTrackHistos("E1combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
399  } else {
400  FillTrackHistos("E1Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
401  }
402  }
403  if(isEG2){
404  FillTrackHistos("EG2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
405  // check for exclusive classes
406  if(!isMinBias){
407  FillTrackHistos("EG2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
408  }
409  if(!(isEJ2 || isEJ1)){
410  FillTrackHistos("E2Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
411  }
412  }
413  if(isEG1){
414  FillTrackHistos("EG1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
415  if(!(isMinBias || isEG2)){
416  FillTrackHistos("EG1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
417  }
418  if(!(isEJ1 || isEJ2)){
419  FillTrackHistos("E1Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
420  }
421  }
422  }
423  PostData(1, fHistos->GetListOfHistograms());
424 }
425 
433  const char *triggerclass,
434  double vtxz,
435  bool isSelected
436 )
437 {
438  // Fill reference distribution for the primary vertex before any z-cut
439  fHistos->FillTH1(Form("hVertexBefore%s", triggerclass), vtxz);
440  if(isSelected){
441  // Fill Event counter and reference vertex distributions after event selection
442  fHistos->FillTH1(Form("hEventCount%s", triggerclass), 1);
443  fHistos->FillTH1(Form("hVertexAfter%s", triggerclass), vtxz);
444  }
445 }
446 
458  const char *eventclass,
459  Double_t pt,
460  Double_t etalab,
461  Double_t etacent,
462  Double_t phi,
463  Bool_t etacut,
464  Bool_t inEmcal,
465  Bool_t hasTRD
466  )
467 {
468  fHistos->FillTH1(Form("hPtEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
469  fHistos->FillTH1(Form("hPtEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
470  if(inEmcal){
471  fHistos->FillTH1(Form("hPtEMCALEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
472  fHistos->FillTH1(Form("hPtEMCALEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
473  if(hasTRD){
474  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
475  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
476  } else {
477  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
478  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
479  }
480  }
481 
482  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
483  for(int icut = 0; icut < 5; icut++){
484  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
485  fHistos->FillTH1(Form("hPhiDistAllPt%d%s", ptmin[icut], eventclass), phi);
486  fHistos->FillTH1(Form("hEtaLabDistAllPt%d%s", ptmin[icut], eventclass), etalab);
487  fHistos->FillTH1(Form("hEtaCentDistAllPt%d%s", ptmin[icut], eventclass), etacent);
488  if(inEmcal){
489  fHistos->FillTH1(Form("hEtaLabDistAllEMCALPt%d%s", ptmin[icut], eventclass), etalab);
490  fHistos->FillTH1(Form("hEtaCentDistAllEMCALPt%d%s", ptmin[icut], eventclass), etacent);
491  }
492  }
493  }
494 
495  if(etacut){
496  fHistos->FillTH1(Form("hPtEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
497  fHistos->FillTH1(Form("hPtEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
498  if(inEmcal){
499  fHistos->FillTH1(Form("hPtEMCALEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
500  fHistos->FillTH1(Form("hPtEMCALEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
501  if(hasTRD){
502  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
503  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
504  } else {
505  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
506  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
507  }
508  }
509  for(int icut = 0; icut < 5; icut++){
510  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
511  fHistos->FillTH1(Form("hEtaLabDistCutPt%d%s", ptmin[icut], eventclass), etalab);
512  fHistos->FillTH1(Form("hEtaCentDistCutPt%d%s", ptmin[icut], eventclass), etacent);
513  if(inEmcal){
514  fHistos->FillTH1(Form("hEtaLabDistCutEMCALPt%d%s", ptmin[icut], eventclass), etalab);
515  fHistos->FillTH1(Form("hEtaCentDistCutEMCALPt%d%s", ptmin[icut], eventclass), etacent);
516  }
517  }
518  }
519  }
520 }
521 
522 
528  std::vector<double> mybinning;
529  std::map<double,double> definitions;
530  definitions.insert(std::pair<double,double>(2.5, 0.1));
531  definitions.insert(std::pair<double,double>(7., 0.25));
532  definitions.insert(std::pair<double,double>(15., 0.5));
533  definitions.insert(std::pair<double,double>(25., 1.));
534  definitions.insert(std::pair<double,double>(40., 2.5));
535  definitions.insert(std::pair<double,double>(50., 5.));
536  definitions.insert(std::pair<double,double>(100., 10.));
537  double currentval = 0;
538  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
539  double limit = id->first, binwidth = id->second;
540  while(currentval < limit){
541  currentval += binwidth;
542  mybinning.push_back(currentval);
543  }
544  }
545  binning.Set(mybinning.size());
546  int ib = 0;
547  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
548  binning[ib++] = *it;
549 }
550 
556  std::vector<double> mybinning;
557  std::map<double,double> definitions;
558  definitions.insert(std::pair<double, double>(1, 0.05));
559  definitions.insert(std::pair<double, double>(2, 0.1));
560  definitions.insert(std::pair<double, double>(4, 0.2));
561  definitions.insert(std::pair<double, double>(7, 0.5));
562  definitions.insert(std::pair<double, double>(16, 1));
563  definitions.insert(std::pair<double, double>(36, 2));
564  definitions.insert(std::pair<double, double>(40, 4));
565  definitions.insert(std::pair<double, double>(50, 5));
566  definitions.insert(std::pair<double, double>(100, 10));
567  definitions.insert(std::pair<double, double>(200, 20));
568  double currentval = 0.;
569  mybinning.push_back(currentval);
570  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
571  double limit = id->first, binwidth = id->second;
572  while(currentval < limit){
573  currentval += binwidth;
574  mybinning.push_back(currentval);
575  }
576  }
577  binning.Set(mybinning.size());
578  int ib = 0;
579  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
580  binning[ib++] = *it;
581 }
582 
589  return fTrackCuts->AcceptTrack(track);
590 }
591 
598  if(!track->TestFilterBit(AliAODTrack::kTrkGlobal)) return false;
599  if(track->GetTPCNCrossedRows() < 120) return false;
600  return true;
601 }
602 
611 Bool_t AliAnalysisTaskChargedParticlesRef::IsOfflineSelected(EmcalTriggerClass trgcls, const TClonesArray * const triggerpatches) const {
612  if(fOfflineEnergyThreshold[trgcls] < 0) return true;
613  bool isSingleShower = ((trgcls == kCPREL0) || (trgcls == kCPREG1) || (trgcls == kCPREG2));
614  int nfound = 0;
615  AliEmcalTriggerPatchInfo *patch = NULL;
616  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
617  patch = static_cast<AliEmcalTriggerPatchInfo *>(*patchIter);
618  if(!patch->IsOfflineSimple()) continue;
619  if(isSingleShower){
620  if(!patch->IsGammaLowSimple()) continue;
621  } else {
622  if(!patch->IsJetLowSimple()) continue;
623  }
624  if(patch->GetPatchE() > fOfflineEnergyThreshold[trgcls]) nfound++;
625  }
626  return nfound > 0;
627 }
628 
634 TString AliAnalysisTaskChargedParticlesRef::GetFiredTriggerClassesFromPatches(const TClonesArray* triggerpatches) const {
635  TString triggerstring = "";
636  Int_t nEJ1 = 0, nEJ2 = 0, nEG1 = 0, nEG2 = 0;
637  double minADC_EJ1 = 260.,
638  minADC_EJ2 = 127.,
639  minADC_EG1 = 140.,
640  minADC_EG2 = 89.;
641  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
642  AliEmcalTriggerPatchInfo *patch = dynamic_cast<AliEmcalTriggerPatchInfo *>(*patchIter);
643  if(!patch->IsOfflineSimple()) continue;
644  if(patch->IsJetHighSimple() && patch->GetADCOfflineAmp() > minADC_EJ1) nEJ1++;
645  if(patch->IsJetLowSimple() && patch->GetADCOfflineAmp() > minADC_EJ2) nEJ2++;
646  if(patch->IsGammaHighSimple() && patch->GetADCOfflineAmp() > minADC_EG1) nEG1++;
647  if(patch->IsGammaLowSimple() && patch->GetADCOfflineAmp() > minADC_EG2) nEG2++;
648  }
649  if(nEJ1) triggerstring += "EJ1";
650  if(nEJ2){
651  if(triggerstring.Length()) triggerstring += ",";
652  triggerstring += "EJ2";
653  }
654  if(nEG1){
655  if(triggerstring.Length()) triggerstring += ",";
656  triggerstring += "EG1";
657  }
658  if(nEG2){
659  if(triggerstring.Length()) triggerstring += ",";
660  triggerstring += "EG2";
661  }
662  return triggerstring;
663 }
664 
665 } /* 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
Main data structure storing all relevant information of EMCAL/DCAL trigger patches.
Bool_t fTriggerStringFromPatches
Do rebuild the trigger string from trigger patches.
Declarartion of class AliEMCalHistoContainer.
void FillEventCounterHists(const char *triggerclass, double vtxz, bool isSelected)
const Double_t ptmin
Bool_t IsOfflineSelected(EmcalTriggerClass trgcls, const TClonesArray *const triggerpatches) const
Double_t fEtaCmsCut[2]
Cut applied in Eta centre-of-mass frame.
Class to make array of trigger patch objects in AOD/ESD events.
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
void FillTH1(const char *hname, double x, double weight=1.)