AliPhysics  c923f52 (c923f52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskChargedParticlesRefMC.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 <memory>
17 
18 #include <TArrayD.h>
19 #include <TChain.h>
20 #include <TClonesArray.h>
21 #include <TFile.h>
22 #include <THashList.h>
23 #include <TH1.h>
24 #include <THistManager.h>
25 #include <TKey.h>
26 #include <TList.h>
27 #include <TPDGCode.h>
28 #include <TProfile.h>
29 #include <TMath.h>
30 #include <TString.h>
31 #include <TSystem.h>
32 #include <TTree.h>
33 
34 #include "AliAnalysisManager.h"
35 #include "AliAnalysisUtils.h"
36 #include "AliAODMCHeader.h"
37 #include "AliAODInputHandler.h"
38 #include "AliAODMCParticle.h"
39 #include "AliAODTrack.h"
41 #include "AliEmcalTrackSelection.h"
43 #include "AliEMCALTriggerPatchInfo.h"
44 #include "AliEMCALGeometry.h"
45 #include "AliEMCALRecoUtils.h"
46 #include "AliESDEvent.h"
47 #include "AliESDtrack.h"
48 #include "AliGenPythiaEventHeader.h"
49 #include "AliInputEventHandler.h"
50 #include "AliMCEvent.h"
51 #include "AliVVertex.h"
52 
55 
59 
60 namespace EMCalTriggerPtAnalysis {
61 
65 AliAnalysisTaskChargedParticlesRefMC::AliAnalysisTaskChargedParticlesRefMC():
67  fTrackCuts(nullptr),
68  fTriggerSelection(nullptr),
69  fHistos(nullptr),
70  fWeightHandler(nullptr),
71  fEventTriggers(),
72  fEventWeight(1.),
73  fYshift(0.465),
74  fEtaSign(1),
75  fEtaLabCut(-0.5, 0.5),
76  fEtaCmsCut(-0.13, 0.13),
77  fPhiCut(0., TMath::TwoPi()),
78  fFracPtHard(-1)
79 {
80  SetCaloTriggerPatchInfoName("EmcalTriggers");
81  SetNeedEmcalGeom(true);
82 }
83 
89  AliAnalysisTaskEmcal(name, true),
90  fTrackCuts(nullptr),
91  fTriggerSelection(nullptr),
92  fHistos(nullptr),
93  fWeightHandler(nullptr),
94  fEventTriggers(),
95  fEventWeight(1.),
96  fYshift(0.465),
97  fEtaSign(1),
98  fEtaLabCut(-0.5, 0.5),
99  fEtaCmsCut(-0.13, 0.13),
100  fPhiCut(0., TMath::TwoPi()),
101  fFracPtHard(-1)
102 {
103  SetCaloTriggerPatchInfoName("EmcalTriggers");
104  SetNeedEmcalGeom(true);
105 }
106 
111  //if(fTrackCuts) delete fTrackCuts;
113  if(fHistos) delete fHistos;
114 }
120 
121  if(!fAliAnalysisUtils) fAliAnalysisUtils = new AliAnalysisUtils;
122  fHistos = new THistManager("Ref");
123 
124  if(!fTrackCuts) InitializeTrackCuts("standard",fInputHandler->IsA() == AliAODInputHandler::Class());
125 
126  PtBinning newbinning;
127 
128  fHistos->CreateTH1("hPtHard", "Pt of the hard interaction", 1000, 0., 500);
129  TString triggers[7] = {"True", "MB", "EMC7", "EJ1", "EJ2", "EG1", "EG2"};
130  Double_t ptcuts[5] = {1., 2., 5., 10., 20.};
131  TString species[6] = {"El", "Mu", "Pi", "Ka", "Pr", "Ot"};
132  for(TString *trg = triggers; trg < triggers + sizeof(triggers)/sizeof(TString); trg++){
133  fHistos->CreateTH1(Form("hEventCount%s", trg->Data()), Form("Event Counter for trigger class %s", trg->Data()), 1, 0.5, 1.5);
134  fHistos->CreateTH1(Form("hVertexBefore%s", trg->Data()), Form("Vertex distribution before z-cut for trigger class %s", trg->Data()), 500, -50, 50);
135  fHistos->CreateTH1(Form("hVertexAfter%s", trg->Data()), Form("Vertex distribution after z-cut for trigger class %s", trg->Data()), 100, -10, 10);
136  fHistos->CreateTH1(Form("hPtEtaAll%s", trg->Data()), Form("Charged particle pt distribution all eta trigger %s", trg->Data()), newbinning);
137  fHistos->CreateTH1(Form("hPtEtaCent%s", trg->Data()), Form("Charged particle pt distribution central eta trigger %s", trg->Data()), newbinning);
138  fHistos->CreateTH1(Form("hPtEMCALEtaAll%s", trg->Data()), Form("Charged particle in EMCAL pt distribution all eta trigger %s", trg->Data()), newbinning);
139  fHistos->CreateTH1(Form("hPtEMCALEtaCent%s", trg->Data()), Form("Charged particle in EMCAL pt distribution central eta trigger %s", trg->Data()), newbinning);
140  fHistos->CreateTH1(Form("hPtEMCALNoTRDEtaAll%s", trg->Data()), Form("Charged particle in EMCAL (no TRD in front) pt distribution all eta trigger %s", trg->Data()), newbinning);
141  fHistos->CreateTH1(Form("hPtEMCALNoTRDEtaCent%s", trg->Data()), Form("Charged particle in EMCAL (no TRD in front) pt distribution central eta trigger %s", trg->Data()), newbinning);
142  fHistos->CreateTH1(Form("hPtEMCALWithTRDEtaAll%s", trg->Data()), Form("Charged particle in EMCAL (with TRD in front) pt distribution all eta trigger %s", trg->Data()), newbinning);
143  fHistos->CreateTH1(Form("hPtEMCALWithTRDEtaCent%s", trg->Data()), Form("Charged particle in EMCAL (with TRD in front) pt distribution central eta trigger %s", trg->Data()), newbinning);
144  for(TString *piditer = species; piditer < species + sizeof(species)/sizeof(TString); ++piditer){
145  fHistos->CreateTH1(Form("hPtEtaAll%s%s", piditer->Data(), trg->Data()), Form("Charged %s pt distribution all eta trigger %s", piditer->Data(), trg->Data()), newbinning);
146  fHistos->CreateTH1(Form("hPtEtaCent%s%s", piditer->Data(), trg->Data()), Form("Charged %s pt distribution central eta trigger %s", piditer->Data(), trg->Data()), newbinning);
147  fHistos->CreateTH1(Form("hPtEMCALEtaAll%s%s", piditer->Data(), trg->Data()), Form("Charged %s in EMCAL pt distribution all eta trigger %s", piditer->Data(), trg->Data()), newbinning);
148  fHistos->CreateTH1(Form("hPtEMCALEtaCent%s%s", piditer->Data(), trg->Data()), Form("Charged %s in EMCAL pt distribution central eta trigger %s", piditer->Data(), trg->Data()), newbinning);
149  fHistos->CreateTH1(Form("hPtEMCALNoTRDEtaAll%s%s", piditer->Data(), trg->Data()), Form("Charged %s in EMCAL (no TRD in front) pt distribution all eta trigger %s", piditer->Data(), trg->Data()), newbinning);
150  fHistos->CreateTH1(Form("hPtEMCALNoTRDEtaCent%s%s", piditer->Data(), trg->Data()), Form("Charged %s in EMCAL (no TRD in front) pt distribution central eta trigger %s", piditer->Data(), trg->Data()), newbinning);
151  fHistos->CreateTH1(Form("hPtEMCALWithTRDEtaAll%s%s", piditer->Data(), trg->Data()), Form("Charged %s in EMCAL (with TRD in front) pt distribution all eta trigger %s", piditer->Data(), trg->Data()), newbinning);
152  fHistos->CreateTH1(Form("hPtEMCALWithTRDEtaCent%s%s", piditer->Data(), trg->Data()), Form("Charged %s in EMCAL (with TRD in front) pt distribution central eta trigger %s", piditer->Data(), trg->Data()), newbinning);
153  }
154  for(int ipt = 0; ipt < 5; ipt++){
156  Form("hEtaLabDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
157  Form("Eta (lab) distribution without etacut for tracks with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
158  100,
159  -1.,
160  1.
161  );
163  Form("hEtaLabDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
164  Form("Eta (lab) distribution with etacut for tracks with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
165  100,
166  -1.,
167  1.
168  );
170  Form("hEtaCentDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
171  Form("Eta (cent) distribution without etacut for tracks with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
172  160,
173  -1.3,
174  1.3
175  );
177  Form("hEtaCentDistCutPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
178  Form("Eta (cent) distribution with etacut for tracks with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
179  160,
180  -1.3,
181  1.3
182  );
184  Form("hEtaLabDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
185  Form("Eta (lab) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
186  100,
187  -1.,
188  1.
189  );
191  Form("hEtaLabDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
192  Form("Eta (lab) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
193  100,
194  -1.,
195  1.
196  );
198  Form("hEtaCentDistAllEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
199  Form("Eta (cent) distribution without etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
200  160,
201  -1.3,
202  1.3
203  );
205  Form("hEtaCentDistCutEMCALPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
206  Form("Eta (cent) distribution with etacut for tracks in EMCAL with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
207  160,
208  -1.3,
209  1.3
210  );
212  Form("hPhiDistAllPt%d%s", static_cast<Int_t>(ptcuts[ipt]), trg->Data()),
213  Form("#phi distribution of particles with Pt above %.1f GeV/c trigger %s", ptcuts[ipt], trg->Data()),
214  300,
215  0.,
216  2*TMath::Pi()
217  );
218  }
219  }
220  //fHistos->GetListOfHistograms()->Add(fTrackCuts);
221  for(auto hist : *(fHistos->GetListOfHistograms())){
222  fOutput->Add(hist);
223  }
224 
225  PostData(1, fOutput);
226 }
227 
229  fEventTriggers.clear();
230  AliDebugStream(1) << GetName() << ": Using custom event selection" << std::endl;
231  if(!MCEvent()) return false;
232  if(!fTriggerPatchInfo) return false;
234 
235  // Do MC outlier cut
236  if(fIsPythia){
237  if(!CheckMCOutliers()) return false;
238  }
239 
240 
241  // select trigger
242  bool isMinBias;
243  if((isMinBias = fInputHandler->IsEventSelected() & AliVEvent::kINT7)) fEventTriggers.push_back("MB");
244  // In simulations triggered events are a subset of min. bias events
247  fEventTriggers.push_back("EMC7"); // triggerstring.Contains("EMC7"),
249  fEventTriggers.push_back("EJ1"); // triggerstring.Contains("EJ1"),
251  fEventTriggers.push_back("EJ2"); // triggerstring.Contains("EJ2"),
253  fEventTriggers.push_back("EG1"); // triggerstring.Contains("EG1"),
255  fEventTriggers.push_back("EG2"); // triggerstring.Contains("EG2");
256  }
257  if(!fEventTriggers.size()){
258  AliDebugStream(1) << GetName() << ": No trigger selected" << std::endl;
259  }
260 
261  const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
262  if(vtx->GetNContributors() < 1) return false;
263  if(!fAliAnalysisUtils->IsVertexSelected2013pA(fInputEvent)) return false; // Apply new vertex cut
264  if(fAliAnalysisUtils->IsPileUpEvent(fInputEvent)) return false; // Apply new vertex cut
265  // Fill reference distribution for the primary vertex before any z-cut
266  fHistos->FillTH1("hVertexBeforeTrue", vtx->GetZ(), fEventWeight);
267  for(const auto &trg : fEventTriggers) fHistos->FillTH1(Form("hVertexBefore%s", trg.c_str()), vtx->GetZ(), fEventWeight);
268  // Apply vertex z cut
269  if(vtx->GetZ() < -10. || vtx->GetZ() > 10.) return false;
270 
271 
272  // Fill Event counter and reference vertex distributions for the different trigger classes
273  fHistos->FillTH1("hEventCountTrue", 1, fEventWeight);
274  fHistos->FillTH1("hVertexAfterTrue", vtx->GetZ(), fEventWeight);
275  for(const auto &trg : fEventTriggers){
276  fHistos->FillTH1(Form("hEventCount%s", trg.c_str()), 1, fEventWeight);
277  fHistos->FillTH1(Form("hVertexAfter%s", trg.c_str()), vtx->GetZ(), fEventWeight);
278  }
279 
280  return true;
281 }
282 
284 
285  // MonteCarlo Loop
286  // Histograms
287  // - Full eta (-0.8, 0.8), new binning
288  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c without eta cut
289  // - Central eta_{cms} (-0.3, 0.3), new binning,
290  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c
291  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c with eta cut
292  AliVParticle *truepart = NULL;
293  Bool_t isEMCAL(kFALSE);
294  for(int ipart = 0; ipart < fMCEvent->GetNumberOfTracks(); ipart++){
295  truepart = fMCEvent->GetTrack(ipart);
296 
297  // Select only particles within ALICE acceptance
298  if(!fEtaLabCut.IsInRange(truepart->Eta())) continue;
299  if(!fPhiCut.IsInRange(truepart->Phi())) continue;
300  if(TMath::Abs(truepart->Pt()) < 0.1) continue;
301  if(!truepart->Charge()) continue;
302 
303  if(!IsPhysicalPrimary(truepart, fMCEvent)) continue;
304  isEMCAL = (truepart->Phi() > 1.5 && truepart->Phi() < 3.1) ? kTRUE : kFALSE;
305 
306  // Calculate eta in cms frame according
307  // EPJC74 (2014) 3054:
308  // eta_cms = - eta_lab - |yshift|
309  Double_t etacent = -1. * truepart->Eta() - TMath::Abs(fYshift);
310  etacent *= fEtaSign;
311 
312  Bool_t etacentcut = fEtaCmsCut.IsInRange(etacent);
313 
314  // Get PID
315  TString pid = "";
316  switch(TMath::Abs(truepart->PdgCode())){
317  case kPiPlus: pid = "Pi"; break;
318  case kMuonMinus: pid = "Mu"; break;
319  case kElectron: pid = "El"; break;
320  case kKPlus: pid = "Ka"; break;
321  case kProton: pid = "Pr"; break;
322  default: pid = "Ot"; break;
323  };
324 
325  // Particle selected (do not filter TRD sectors for MC truth)
326  FillTrackHistos("True", fEventWeight, truepart->Pt(), truepart->Eta() * fEtaSign, etacent, truepart->Phi(), etacentcut, isEMCAL, kFALSE, pid);
327  }
328 
329  // Loop over tracks, fill select particles
330  // Histograms
331  // - Full eta (-0.8, 0.8), new binning
332  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c without eta cut
333  // - Central eta (-0.8, -0.2), new binning,
334  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c
335  // - Eta distribution for tracks above 1, 2, 5, 10 GeV/c with eta cut
336  AliVTrack *checktrack(NULL);
337  AliVParticle *assocMC(NULL);
338  double ptparticle(-1.), etaparticle(-100.), etaEMCAL(0.), phiEMCAL(0.);
339  Bool_t hasTRD = kFALSE;
340  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); ++itrk){
341  checktrack = dynamic_cast<AliVTrack *>(fInputEvent->GetTrack(itrk));
342  if(!checktrack) continue;
343  // Find associated particle
344  assocMC = fMCEvent->GetTrack(TMath::Abs(checktrack->GetLabel()));
345  if(!assocMC) continue; // Fake track
346  if(!IsPhysicalPrimary(assocMC, fMCEvent)) continue;
347 
348  // Select only particles within ALICE acceptance
349  if(!fEtaLabCut.IsInRange(checktrack->Eta())) continue;
350  if(!fPhiCut.IsInRange(checktrack->Phi())) continue;
351  if(TMath::Abs(checktrack->Pt()) < 0.1) continue;
352  if(checktrack->IsA() == AliESDtrack::Class()){
353  AliESDtrack copytrack(*(static_cast<AliESDtrack *>(checktrack)));
354  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
355  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
356  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
357  } else {
358  AliAODTrack copytrack(*(static_cast<AliAODTrack *>(checktrack)));
359  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&copytrack);
360  etaEMCAL = copytrack.GetTrackEtaOnEMCal();
361  phiEMCAL = copytrack.GetTrackPhiOnEMCal();
362  }
363  Int_t supermoduleID = -1;
364  isEMCAL = fGeom->SuperModuleNumberFromEtaPhi(etaEMCAL, phiEMCAL, supermoduleID);
365  // Exclude supermodules 10 and 11 as they did not participate in the trigger
366  isEMCAL = isEMCAL && supermoduleID < 10;
367  hasTRD = isEMCAL && supermoduleID >= 4; // supermodules 4 - 10 have TRD in front in the 2012-2013 ALICE setup
368 
369  if(!fTrackCuts->IsTrackAccepted(checktrack)) continue;
370 
371  ptparticle = TMath::Abs(assocMC->Pt());
372  etaparticle = assocMC->Eta();
373 
374  // Calculate eta in cms frame according
375  // EPJC74 (2014) 3054:
376  // eta_cms = - eta_lab - |yshift|
377  Double_t etacent = -1. * checktrack->Eta() - TMath::Abs(fYshift);
378  etacent *= fEtaSign;
379 
380  Bool_t etacentcut = fEtaCmsCut.IsInRange(etacent);
381 
382  // Get PID
383  TString assocpid = "";
384  switch(TMath::Abs(assocMC->PdgCode())){
385  case kPiPlus: assocpid = "Pi"; break;
386  case kMuonMinus: assocpid = "Mu"; break;
387  case kElectron: assocpid = "El"; break;
388  case kKPlus: assocpid = "Ka"; break;
389  case kProton: assocpid = "Pr"; break;
390  default: assocpid = "Ot"; break;
391  };
392  for(const auto &trg : fEventTriggers)
393  FillTrackHistos(trg.c_str(), fEventWeight, ptparticle, checktrack->Eta() * fEtaSign, etacent, checktrack->Phi(), etacentcut, isEMCAL, hasTRD, assocpid);
394  }
395  return true;
396 }
397 
410  const char *eventclass,
411  Double_t weight,
412  Double_t pt,
413  Double_t etalab,
414  Double_t etacent,
415  Double_t phi,
416  Bool_t etacut,
417  Bool_t inEmcal,
418  Bool_t hasTRD,
419  const char *pid
420  )
421 {
422  fHistos->FillTH1(Form("hPtEtaAll%s", eventclass), TMath::Abs(pt), weight);
423  fHistos->FillTH1(Form("hPtEtaAll%s%s", pid, eventclass), TMath::Abs(pt), weight);
424  if(inEmcal){
425  fHistos->FillTH1(Form("hPtEMCALEtaAll%s", eventclass), TMath::Abs(pt), weight);
426  fHistos->FillTH1(Form("hPtEMCALEtaAll%s%s", pid, eventclass), TMath::Abs(pt), weight);
427  if(hasTRD){
428  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAll%s", eventclass), TMath::Abs(pt), weight);
429  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaAll%s%s", pid, eventclass), TMath::Abs(pt), weight);
430  } else {
431  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAll%s", eventclass), TMath::Abs(pt), weight);
432  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaAll%s%s", pid, eventclass), TMath::Abs(pt), weight);
433  }
434  }
435 
436  int ptmin[5] = {1,2,5,10,20}; // for eta distributions
437  for(int icut = 0; icut < 5; icut++){
438  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
439  fHistos->FillTH1(Form("hPhiDistAllPt%d%s", ptmin[icut], eventclass), phi, weight);
440  fHistos->FillTH1(Form("hEtaLabDistAllPt%d%s", ptmin[icut], eventclass), etalab, weight);
441  fHistos->FillTH1(Form("hEtaCentDistAllPt%d%s", ptmin[icut], eventclass), etacent, weight);
442  if(inEmcal){
443  fHistos->FillTH1(Form("hEtaLabDistAllEMCALPt%d%s", ptmin[icut], eventclass), etalab, weight);
444  fHistos->FillTH1(Form("hEtaCentDistAllEMCALPt%d%s", ptmin[icut], eventclass), etacent, weight);
445  }
446  }
447  }
448 
449  if(etacut){
450  fHistos->FillTH1(Form("hPtEtaCent%s", eventclass), TMath::Abs(pt), weight);
451  fHistos->FillTH1(Form("hPtEtaCent%s%s", pid, eventclass), TMath::Abs(pt), weight);
452  if(inEmcal){
453  fHistos->FillTH1(Form("hPtEMCALEtaCent%s", eventclass), TMath::Abs(pt), weight);
454  fHistos->FillTH1(Form("hPtEMCALEtaCent%s%s", pid, eventclass), TMath::Abs(pt), weight);
455  if(hasTRD){
456  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCent%s", eventclass), TMath::Abs(pt), weight);
457  fHistos->FillTH1(Form("hPtEMCALWithTRDEtaCent%s%s", pid, eventclass), TMath::Abs(pt), weight);
458  } else {
459  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCent%s", eventclass), TMath::Abs(pt), weight);
460  fHistos->FillTH1(Form("hPtEMCALNoTRDEtaCent%s%s", pid, eventclass), TMath::Abs(pt), weight);
461  }
462  }
463  for(int icut = 0; icut < 5; icut++){
464  if(TMath::Abs(pt) > static_cast<double>(ptmin[icut])){
465  fHistos->FillTH1(Form("hEtaLabDistCutPt%d%s", ptmin[icut], eventclass), etalab, weight);
466  fHistos->FillTH1(Form("hEtaCentDistCutPt%d%s", ptmin[icut], eventclass), etacent, weight);
467  if(inEmcal){
468  fHistos->FillTH1(Form("hEtaLabDistCutEMCALPt%d%s", ptmin[icut], eventclass), etalab, weight);
469  fHistos->FillTH1(Form("hEtaCentDistCutEMCALPt%d%s", ptmin[icut], eventclass), etacent, weight);
470  }
471  }
472  }
473  }
474 }
475 
476 
484 }
485 
486 
487 
494  TString triggerstring = "";
495  Int_t nEJ1 = 0, nEJ2 = 0, nEG1 = 0, nEG2 = 0;
496  double minADC_EJ1 = 260.,
497  minADC_EJ2 = 127.,
498  minADC_EG1 = 140.,
499  minADC_EG2 = 89.;
500  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
501  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
502  if(!patch->IsOfflineSimple()) continue;
503  if(patch->IsJetHighSimple() && patch->GetADCOfflineAmp() > minADC_EJ1) nEJ1++;
504  if(patch->IsJetLowSimple() && patch->GetADCOfflineAmp() > minADC_EJ2) nEJ2++;
505  if(patch->IsGammaHighSimple() && patch->GetADCOfflineAmp() > minADC_EG1) nEG1++;
506  if(patch->IsGammaLowSimple() && patch->GetADCOfflineAmp() > minADC_EG2) nEG2++;
507  }
508  if(nEJ1) triggerstring += "EJ1";
509  if(nEJ2){
510  if(triggerstring.Length()) triggerstring += ",";
511  triggerstring += "EJ2";
512  }
513  if(nEG1){
514  if(triggerstring.Length()) triggerstring += ",";
515  triggerstring += "EG1";
516  }
517  if(nEG2){
518  if(triggerstring.Length()) triggerstring += ",";
519  triggerstring += "EG2";
520  }
521  return triggerstring;
522 }
523 
532 Bool_t AliAnalysisTaskChargedParticlesRefMC::IsPhysicalPrimary(const AliVParticle* const part, AliMCEvent* const mcevent) {
533  Bool_t physprim = false;
534  const AliAODMCParticle *aodmc = dynamic_cast<const AliAODMCParticle *>(part);
535  if(aodmc){
536  physprim = aodmc->IsPhysicalPrimary();
537  } else {
538  physprim = mcevent->IsPhysicalPrimary(part->GetLabel());
539  }
540  return physprim;
541 }
542 
548 {
549  this->SetMinimum(0.);
550  this->AddStep(1, 0.05);
551  this->AddStep(2, 0.1);
552  this->AddStep(4, 0.2);
553  this->AddStep(7, 0.5);
554  this->AddStep(16, 1);
555  this->AddStep(36, 2);
556  this->AddStep(40, 4);
557  this->AddStep(50, 5);
558  this->AddStep(100, 10);
559  this->AddStep(200, 20);
560 }
561 
562 } /* namespace EMCalTriggerPtAnalysis */
const AliEMCalTriggerWeightHandler * fWeightHandler
Weight handler (optional)
Bool_t fIsPythia
trigger, if it is a PYTHIA production
double Double_t
Definition: External.C:58
std::vector< std::string > fEventTriggers
! Temporary container for selected triggers
static AliEmcalTrackSelection * TrackCutsFactory(TString name, Bool_t isAOD)
Base task in the EMCAL framework.
void AddStep(Double_t max, Double_t binwidth)
void SetCaloTriggerPatchInfoName(const char *n)
AliEmcalTriggerOfflineSelection * fTriggerSelection
Offline trigger selection.
int Int_t
Definition: External.C:63
THashList * GetListOfHistograms() const
Definition: THistManager.h:504
AliEMCALGeometry * fGeom
!emcal geometry
Bool_t IsPhysicalPrimary(const AliVParticle *const part, AliMCEvent *const mcevent)
AliGenPythiaEventHeader * fPythiaHeader
!event Pythia header
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
AliAnalysisUtils * fAliAnalysisUtils
!vertex selection (optional)
Helper class creating user defined custom binning.
const Double_t ptmin
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Bool_t IsOfflineSelected(EmcalTriggerClass trgcls, const TClonesArray *const triggerpatches) const
Unit test class for charged particle distributions (MC case)
double GetEventWeight(const AliMCEvent *const event) const
AliEmcalList * fOutput
!output list
void FillTrackHistos(const char *eventclass, Double_t weight, Double_t pt, Double_t eta, Double_t etacent, Double_t phi, Bool_t etacut, Bool_t inEmcal, Bool_t hasTRD, const char *pid)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
void SetNeedEmcalGeom(Bool_t n)
Double_t fEtaSign
Sign of the -distribution (swaps when beam directions swap): p-Pb: +1, Pb-p: -1.
Container class for histograms for the high- charged particle analysis.
Definition: THistManager.h:43
bool Bool_t
Definition: External.C:53
ClassImp(AliAnalysisTaskCascadeTester) AliAnalysisTaskCascadeTester
virtual bool IsTrackAccepted(AliVTrack *const trk)=0
void SetMinimum(Double_t min)