AliPhysics  29d4213 (29d4213)
 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 
33 #include "AliEmcalTriggerPatchInfoAP.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 {
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::GetInstance();
231  if(!fGeometry)
232  fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
233  }
234  // Select event
235  TClonesArray *triggerpatches = static_cast<TClonesArray *>(fInputEvent->FindListObject("EmcalTriggers"));
236  TString triggerstring = "";
238  triggerstring = GetFiredTriggerClassesFromPatches(triggerpatches);
239  } else {
240  triggerstring = fInputEvent->GetFiredTriggerClasses();
241  }
242  UInt_t selectionstatus = fInputHandler->IsEventSelected();
243  Bool_t isMinBias = selectionstatus & AliVEvent::kINT7,
244  isEJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ1") && IsOfflineSelected(kCPREJ1, triggerpatches),
245  isEJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ2") && IsOfflineSelected(kCPREJ2, triggerpatches),
246  isEG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG1") && IsOfflineSelected(kCPREG1, triggerpatches),
247  isEG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG2") && IsOfflineSelected(kCPREG2, triggerpatches),
248  isEMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("CEMC7") && IsOfflineSelected(kCPREL0, triggerpatches);
249  if(!(isMinBias || isEMC7 || isEG1 || isEG2 || isEJ1 || isEJ2)) return;
250  const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
251  //if(!fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.)) return; // reject pileup event
252  if(vtx->GetNContributors() < 1) return;
253  if(fInputEvent->IsA() == AliESDEvent::Class() && fAnalysisUtil->IsFirstEventInChunk(fInputEvent)) return;
254  bool isSelected = kTRUE;
255  if(!fAnalysisUtil->IsVertexSelected2013pA(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
256  if(fAnalysisUtil->IsPileUpEvent(fInputEvent)) isSelected = kFALSE; // Apply new vertex cut
257  // Apply vertex z cut
258  if(vtx->GetZ() < -10. || vtx->GetZ() > 10.) isSelected = kFALSE;
259 
260  // Fill Event counter and reference vertex distributions for the different trigger classes
261  if(isMinBias){
262  FillEventCounterHists("MB", vtx->GetZ(), isSelected);
263  }
264  if(isEMC7){
265  FillEventCounterHists("EMC7", vtx->GetZ(), isSelected);
266  if(!isMinBias){
267  FillEventCounterHists("EMC7excl", vtx->GetZ(), isSelected);
268  }
269  }
270  if(isEJ2){
271  FillEventCounterHists("EJ2", vtx->GetZ(), isSelected);
272  // Check for exclusive classes
273  if(!isMinBias){
274  FillEventCounterHists("EJ2excl", vtx->GetZ(), isSelected);
275  }
276  if(isEG1 || isEG2){
277  FillEventCounterHists("E2combined", vtx->GetZ(), isSelected);
278  } else {
279  FillEventCounterHists("E2Jonly", vtx->GetZ(), isSelected);
280  }
281  }
282  if(isEJ1){
283  FillEventCounterHists("EJ1", vtx->GetZ(), isSelected);
284  // Check for exclusive classes
285  if(!(isMinBias || isEJ2)){
286  FillEventCounterHists("EJ1excl", vtx->GetZ(), isSelected);
287  }
288  if(isEG1 || isEG2){
289  FillEventCounterHists("E1combined", vtx->GetZ(), isSelected);
290  } else {
291  FillEventCounterHists("E1Jonly", vtx->GetZ(), isSelected);
292  }
293  }
294  if(isEG2){
295  FillEventCounterHists("EG2", vtx->GetZ(), isSelected);
296  // Check for exclusive classes
297  if(!isMinBias){
298  FillEventCounterHists("EG2excl", vtx->GetZ(), isSelected);
299  }
300  if(!(isEJ1 || isEJ2)){
301  FillEventCounterHists("E2Gonly", vtx->GetZ(), isSelected);
302  }
303  }
304  if(isEG1){
305  FillEventCounterHists("EG1", vtx->GetZ(), isSelected);
306  // Check for exclusive classes
307  if(!(isMinBias || isEG2 )){
308  FillEventCounterHists("EG1excl", vtx->GetZ(), isSelected);
309  }
310  if(!(isEJ1 || isEJ2)){
311  FillEventCounterHists("E1Gonly", vtx->GetZ(), isSelected);
312  }
313  }
314 
315  if(!isSelected) return;
316 
317  // Loop over tracks, fill select particles
318  // Histograms
319  // - Full eta_{lab} (-0.8, 0.8), new binning
320  // - Full eta_{lab} (-0.8, 0.8), old binning
321  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c without eta cut
322  // - Central eta_{cms} (-0.3, -0.2), new binning,
323  // - Central eta_{cms} (-0.8, -0.2), old binning,
324  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c
325  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c with eta cut
326  AliVTrack *checktrack(NULL);
327  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
328  Bool_t isEMCAL(kFALSE), hasTRD(kFALSE);
329  Double_t etaEMCAL(0.), phiEMCAL(0.);
330  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); ++itrk){
331  checktrack = dynamic_cast<AliVTrack *>(fInputEvent->GetTrack(itrk));
332  if(!checktrack) continue;
333  if((checktrack->Eta() < fEtaLabCut[0]) || (checktrack->Eta() > fEtaLabCut[1])) continue;
334  if(TMath::Abs(checktrack->Pt()) < 0.1) continue;
335  if(checktrack->IsA() == AliESDtrack::Class()){
336  AliESDtrack copytrack(*(static_cast<AliESDtrack *>(checktrack)));
337  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
338  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
339  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
340  } else {
341  AliAODTrack copytrack(*(static_cast<AliAODTrack *>(checktrack)));
342  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
343  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
344  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
345  }
346  Int_t supermoduleID = -1;
347  isEMCAL = fGeometry->SuperModuleNumberFromEtaPhi(etaEMCAL, phiEMCAL, supermoduleID);
348  // Exclude supermodules 10 and 11 as they did not participate in the trigger
349  isEMCAL = isEMCAL && supermoduleID < 10;
350  hasTRD = isEMCAL && supermoduleID >= 4; // supermodules 4 - 10 have TRD in front in the 2012-2013 ALICE setup
351 
352  // Calculate eta in cms frame according
353  // EPJC74 (2014) 3054:
354  // eta_cms = - eta_lab - |yshift|
355  Double_t etacent = -1. * checktrack->Eta() - TMath::Abs(fYshift);
356  etacent *= fEtaSign;
357 
358  Bool_t etacentcut = etacent > fEtaCmsCut[0] && etacent < fEtaCmsCut[1];
359 
360  // Distinguish track selection for ESD and AOD tracks
361  AliESDtrack *esdtrack(NULL);
362  AliAODTrack *aodtrack(NULL);
363  if((esdtrack = dynamic_cast<AliESDtrack *>(checktrack))){
364  if(!TrackSelectionESD(esdtrack)) continue;
365  } else if((aodtrack = dynamic_cast<AliAODTrack *>(checktrack))){
366  if(!TrackSelectionAOD(aodtrack)) continue;
367  } else {
368  continue;
369  }
370 
371  // fill histograms allEta
372  if(isMinBias){
373  FillTrackHistos("MB", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
374  }
375  if(isEMC7){
376  FillTrackHistos("EMC7", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
377  if(!isMinBias){
378  FillTrackHistos("EMC7excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
379  }
380  }
381  if(isEJ2){
382  FillTrackHistos("EJ2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
383  // check for exclusive classes
384  if(!isMinBias){
385  FillTrackHistos("EJ2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
386  }
387  if(isEG1 || isEG2){
388  FillTrackHistos("E2combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
389  } else {
390  FillTrackHistos("E2Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
391  }
392  }
393  if(isEJ1){
394  FillTrackHistos("EJ1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
395  // check for exclusive classes
396  if(!(isMinBias || isEJ2)){
397  FillTrackHistos("EJ1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
398  }
399  if(isEG1 || isEG2) {
400  FillTrackHistos("E1combined", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
401  } else {
402  FillTrackHistos("E1Jonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
403  }
404  }
405  if(isEG2){
406  FillTrackHistos("EG2", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
407  // check for exclusive classes
408  if(!isMinBias){
409  FillTrackHistos("EG2excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
410  }
411  if(!(isEJ2 || isEJ1)){
412  FillTrackHistos("E2Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
413  }
414  }
415  if(isEG1){
416  FillTrackHistos("EG1", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
417  if(!(isMinBias || isEG2)){
418  FillTrackHistos("EG1excl", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
419  }
420  if(!(isEJ1 || isEJ2)){
421  FillTrackHistos("E1Gonly", checktrack->Pt(), checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD);
422  }
423  }
424  }
425  PostData(1, fHistos->GetListOfHistograms());
426 }
427 
435  const char *triggerclass,
436  double vtxz,
437  bool isSelected
438 )
439 {
440  // Fill reference distribution for the primary vertex before any z-cut
441  fHistos->FillTH1(Form("hVertexBefore%s", triggerclass), vtxz);
442  if(isSelected){
443  // Fill Event counter and reference vertex distributions after event selection
444  fHistos->FillTH1(Form("hEventCount%s", triggerclass), 1);
445  fHistos->FillTH1(Form("hVertexAfter%s", triggerclass), vtxz);
446  }
447 }
448 
460  const char *eventclass,
461  Double_t pt,
462  Double_t etalab,
463  Double_t etacent,
464  Double_t phi,
465  Bool_t etacut,
466  Bool_t inEmcal,
467  Bool_t hasTRD
468  )
469 {
470  fHistos->FillTH1(Form("hPtEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
471  fHistos->FillTH1(Form("hPtEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
472  if(inEmcal){
473  fHistos->FillTH1(Form("hPtEMCALEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
474  fHistos->FillTH1(Form("hPtEMCALEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
475  if(hasTRD){
476  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
477  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
478  } else {
479  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllNewBinning%s", eventclass), TMath::Abs(pt));
480  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAllOldBinning%s", eventclass), TMath::Abs(pt));
481  }
482  }
483 
484  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
485  for(int icut = 0; icut < 5; icut++){
486  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
487  fHistos->FillTH1(Form("hPhiDistAllPt%d%s", ptmin[icut], eventclass), phi);
488  fHistos->FillTH1(Form("hEtaLabDistAllPt%d%s", ptmin[icut], eventclass), etalab);
489  fHistos->FillTH1(Form("hEtaCentDistAllPt%d%s", ptmin[icut], eventclass), etacent);
490  if(inEmcal){
491  fHistos->FillTH1(Form("hEtaLabDistAllEMCALPt%d%s", ptmin[icut], eventclass), etalab);
492  fHistos->FillTH1(Form("hEtaCentDistAllEMCALPt%d%s", ptmin[icut], eventclass), etacent);
493  }
494  }
495  }
496 
497  if(etacut){
498  fHistos->FillTH1(Form("hPtEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
499  fHistos->FillTH1(Form("hPtEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
500  if(inEmcal){
501  fHistos->FillTH1(Form("hPtEMCALEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
502  fHistos->FillTH1(Form("hPtEMCALEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
503  if(hasTRD){
504  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
505  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
506  } else {
507  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentNewBinning%s", eventclass), TMath::Abs(pt));
508  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCentOldBinning%s", eventclass), TMath::Abs(pt));
509  }
510  }
511  for(int icut = 0; icut < 5; icut++){
512  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
513  fHistos->FillTH1(Form("hEtaLabDistCutPt%d%s", ptmin[icut], eventclass), etalab);
514  fHistos->FillTH1(Form("hEtaCentDistCutPt%d%s", ptmin[icut], eventclass), etacent);
515  if(inEmcal){
516  fHistos->FillTH1(Form("hEtaLabDistCutEMCALPt%d%s", ptmin[icut], eventclass), etalab);
517  fHistos->FillTH1(Form("hEtaCentDistCutEMCALPt%d%s", ptmin[icut], eventclass), etacent);
518  }
519  }
520  }
521  }
522 }
523 
524 
530  std::vector<double> mybinning;
531  std::map<double,double> definitions;
532  definitions.insert(std::pair<double,double>(2.5, 0.1));
533  definitions.insert(std::pair<double,double>(7., 0.25));
534  definitions.insert(std::pair<double,double>(15., 0.5));
535  definitions.insert(std::pair<double,double>(25., 1.));
536  definitions.insert(std::pair<double,double>(40., 2.5));
537  definitions.insert(std::pair<double,double>(50., 5.));
538  definitions.insert(std::pair<double,double>(100., 10.));
539  double currentval = 0;
540  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
541  double limit = id->first, binwidth = id->second;
542  while(currentval < limit){
543  currentval += binwidth;
544  mybinning.push_back(currentval);
545  }
546  }
547  binning.Set(mybinning.size());
548  int ib = 0;
549  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
550  binning[ib++] = *it;
551 }
552 
558  std::vector<double> mybinning;
559  std::map<double,double> definitions;
560  definitions.insert(std::pair<double, double>(1, 0.05));
561  definitions.insert(std::pair<double, double>(2, 0.1));
562  definitions.insert(std::pair<double, double>(4, 0.2));
563  definitions.insert(std::pair<double, double>(7, 0.5));
564  definitions.insert(std::pair<double, double>(16, 1));
565  definitions.insert(std::pair<double, double>(36, 2));
566  definitions.insert(std::pair<double, double>(40, 4));
567  definitions.insert(std::pair<double, double>(50, 5));
568  definitions.insert(std::pair<double, double>(100, 10));
569  definitions.insert(std::pair<double, double>(200, 20));
570  double currentval = 0.;
571  mybinning.push_back(currentval);
572  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
573  double limit = id->first, binwidth = id->second;
574  while(currentval < limit){
575  currentval += binwidth;
576  mybinning.push_back(currentval);
577  }
578  }
579  binning.Set(mybinning.size());
580  int ib = 0;
581  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
582  binning[ib++] = *it;
583 }
584 
591  return fTrackCuts->AcceptTrack(track);
592 }
593 
600  if(!track->TestFilterBit(AliAODTrack::kTrkGlobal)) return false;
601  if(track->GetTPCNCrossedRows() < 120) return false;
602  return true;
603 }
604 
613 Bool_t AliAnalysisTaskChargedParticlesRef::IsOfflineSelected(EmcalTriggerClass trgcls, const TClonesArray * const triggerpatches) const {
614  if(fOfflineEnergyThreshold[trgcls] < 0) return true;
615  bool isSingleShower = ((trgcls == kCPREL0) || (trgcls == kCPREG1) || (trgcls == kCPREG2));
616  int nfound = 0;
617  AliEmcalTriggerPatchInfo *patch = NULL;
618  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
619  patch = static_cast<AliEmcalTriggerPatchInfo *>(*patchIter);
620  if(!patch->IsOfflineSimple()) continue;
621  if(isSingleShower){
622  if(!patch->IsGammaLowSimple()) continue;
623  } else {
624  if(!patch->IsJetLowSimple()) continue;
625  }
626  if(patch->GetPatchE() > fOfflineEnergyThreshold[trgcls]) nfound++;
627  }
628  return nfound > 0;
629 }
630 
636 TString AliAnalysisTaskChargedParticlesRef::GetFiredTriggerClassesFromPatches(const TClonesArray* triggerpatches) const {
637  TString triggerstring = "";
638  Int_t nEJ1 = 0, nEJ2 = 0, nEG1 = 0, nEG2 = 0;
639  double minADC_EJ1 = 260.,
640  minADC_EJ2 = 127.,
641  minADC_EG1 = 140.,
642  minADC_EG2 = 89.;
643  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
644  AliEmcalTriggerPatchInfo *patch = dynamic_cast<AliEmcalTriggerPatchInfo *>(*patchIter);
645  if(!patch->IsOfflineSimple()) continue;
646  if(patch->IsJetHighSimple() && patch->GetADCOfflineAmp() > minADC_EJ1) nEJ1++;
647  if(patch->IsJetLowSimple() && patch->GetADCOfflineAmp() > minADC_EJ2) nEJ2++;
648  if(patch->IsGammaHighSimple() && patch->GetADCOfflineAmp() > minADC_EG1) nEG1++;
649  if(patch->IsGammaLowSimple() && patch->GetADCOfflineAmp() > minADC_EG2) nEG2++;
650  }
651  if(nEJ1) triggerstring += "EJ1";
652  if(nEJ2){
653  if(triggerstring.Length()) triggerstring += ",";
654  triggerstring += "EJ2";
655  }
656  if(nEG1){
657  if(triggerstring.Length()) triggerstring += ",";
658  triggerstring += "EG1";
659  }
660  if(nEG2){
661  if(triggerstring.Length()) triggerstring += ",";
662  triggerstring += "EG2";
663  }
664  return triggerstring;
665 }
666 
667 } /* 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.)