AliPhysics  vAN-20151012 (2287573)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskPtEMCalTrigger.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2014, 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 
16 #include <map>
17 #include <cstring>
18 #include <iostream>
19 #include <memory>
20 #include <vector>
21 #include <string>
22 #include <sstream>
23 
24 #include <TClonesArray.h>
25 #include <TDirectory.h>
26 #include <TH1.h>
27 #include <THashList.h>
28 #include <TList.h>
29 #include <TKey.h>
30 #include <TMath.h>
31 #include <TObjArray.h>
32 #include <TObjString.h>
33 #include <TString.h>
34 #include <TVector2.h>
35 
36 #include "AliAODEvent.h"
37 #include "AliESDEvent.h"
38 #include "AliInputEventHandler.h"
39 #include "AliMCEvent.h"
40 #include "AliParticleContainer.h"
41 #include "AliVCluster.h"
42 #include "AliVParticle.h"
43 #include "AliVTrack.h"
44 #include "AliVVertex.h"
45 
46 #include "AliClusterContainer.h"
47 #include "AliEmcalJet.h"
51 #include "AliEMCalHistoContainer.h"
55 #include "AliJetContainer.h"
56 #include "AliParticleContainer.h"
57 #include "AliPicoTrack.h"
58 
62 
63 namespace EMCalTriggerPtAnalysis {
64 
65  /*
66  * constants
67  */
68  const Int_t AliAnalysisTaskPtEMCalTrigger::kNJetRadii = 4;
69  const Double_t jetRadVals[AliAnalysisTaskPtEMCalTrigger::kNJetRadii] = {0.2, 0.3, 0.4, 0.5};
70  const Double_t *AliAnalysisTaskPtEMCalTrigger::kJetRadii = jetRadVals;
71 
75  AliAnalysisTaskPtEMCalTrigger::AliAnalysisTaskPtEMCalTrigger():
76  AliAnalysisTaskEmcalJet(),
77  fHistos(NULL),
78  fListTrackCuts(NULL),
79  fEtaRange(),
80  fPtRange(),
81  fEnergyRange(),
82  fVertexRange(),
83  fJetContainersMC(),
84  fJetContainersData(),
85  fSelectAllTracks(kFALSE),
86  fSwapEta(kFALSE),
87  fUseTriggersFromTriggerMaker(kFALSE)
88  {
89  }
90 
96  AliAnalysisTaskEmcalJet(name, kTRUE),
97  fHistos(NULL),
98  fListTrackCuts(NULL),
99  fEtaRange(),
100  fPtRange(),
101  fEnergyRange(),
102  fVertexRange(),
103  fJetContainersMC(),
104  fJetContainersData(),
105  fSelectAllTracks(kFALSE),
106  fSwapEta(kFALSE),
107  fUseTriggersFromTriggerMaker(kFALSE)
108  {
109 
110  fListTrackCuts = new TList;
111  fListTrackCuts->SetOwner(false);
112 
113  // Set default cuts
114  fEtaRange.SetLimits(-0.8, 0.8);
115  fPtRange.SetLimits(0.15, 100.);
116  fEnergyRange.SetLimits(0., 1000.);
117  fVertexRange.SetLimits(-10., 10.);
118  SetMakeGeneralHistograms(kTRUE);
119  }
120 
125  //if(fTrackSelection) delete fTrackSelection;
126  if(fHistos) delete fHistos;
127  if(fListTrackCuts) delete fListTrackCuts;
128  }
129 
136  SetCaloTriggerPatchInfoName("EmcalTriggers");
137  fHistos = new AliEMCalHistoContainer("PtEMCalTriggerHistograms");
139 
140  if(fJetContainersMC.GetEntries()){
141  AliDebug(1,"Jet containers for MC truth:");
142  TObjString *contname(NULL);
143  TIter contMCIter(&fJetContainersMC);
144  while((contname = dynamic_cast<TObjString *>(contMCIter.Next())))
145  AliDebug(1, Form("Next container: %s", contname->String().Data()));
146  }
147  if(fJetContainersData.GetEntries()){
148  AliDebug(1, "Jet containers for Data:");
149  TObjString *contname(NULL);
150  TIter contDataIter(&fJetContainersData);
151  while((contname = dynamic_cast<TObjString *>(contDataIter.Next())))
152  AliDebug(1, Form("Next container: %s", contname->String().Data()));
153  }
154  if(fJetCollArray.GetEntries()){
155  AliDebug(1, "Jet containers attached to this task:");
156  AliJetContainer *cont(NULL);
157  TIter contIter(&fJetCollArray);
158  while((cont = dynamic_cast<AliJetContainer *>(contIter.Next())))
159  AliDebug(1, Form("Container: %s", cont->GetName()));
160  }
161 
162  std::map<std::string, std::string> triggerCombinations;
163  const char *triggernames[12] = {"MinBias", "EMCJHigh", "EMCJLow", "EMCGHigh", "EMCGLow", "NoEMCal", "EMCHighBoth", "EMCHighGammaOnly", "EMCHighJetOnly", "EMCLowBoth", "EMCLowGammaOnly", "EMCLowJetOnly"},
164  *bitnames[4] = {"CINT7", "EMC7", "kEMCEGA", "kEMCEJE"};
165  // Define axes for the trigger correlation histogram
166  const TAxis *triggeraxis[5]; memset(triggeraxis, 0, sizeof(const TAxis *) * 5);
167  const TAxis *bitaxes[4]; memset(bitaxes, 0, sizeof(TAxis *) * 4);
168  const char *binlabels[2] = {"OFF", "ON"};
169  TAxis mytrgaxis[5], mybitaxis[4];
170  for(int itrg = 0; itrg < 5; ++itrg){
171  DefineAxis(mytrgaxis[itrg], triggernames[itrg], triggernames[itrg], 2, -0.5, 1.5, binlabels);
172  triggeraxis[itrg] = mytrgaxis+itrg;
173  if(itrg < 4){
174  DefineAxis(mybitaxis[itrg], bitnames[itrg], bitnames[itrg], 2, -0.5, 1.5, binlabels);
175  bitaxes[itrg] = mybitaxis+itrg;
176  }
177  }
178  // Define names and titles for different triggers in the histogram container
179  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[0], "min. bias events"));
180  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[1], "jet-triggered events (high threshold)"));
181  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[2], "jet-triggered events (low threshold)"));
182  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[3], "gamma-triggered events (high threshold)"));
183  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[4], "gamma-triggered events (low threshold)"));
184  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[5], "non-EMCal-triggered events"));
185  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[6], "jet and gamma triggered events (high threshold)"));
186  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[7], "exclusively gamma-triggered events (high threshold)"));
187  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[8], "exclusively jet-triggered events (high threshold)"));
188  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[9], "jet and gamma triggered events (low threshold)"));
189  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[10], "exclusively gamma-triggered events (low threshold)"));
190  triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[11], "exclusively-triggered events (low threshold)"));
191  // Define axes for the pt histogram
192  // Dimensions:
193  // 1. pt
194  // 2. eta
195  // 3. phi
196  // 4. vertex
197  // 5. pileup (0 = all events, 1 = after pileup rejection)
198  // 6. track cuts (0 = no cuts; 1 = after std cuts)
199  TArrayD ptbinning, zvertexBinning, etabinning, pileupaxis(3);
200  pileupaxis[0] = -0.5; pileupaxis[1] = 0.5; pileupaxis[2] = 1.5;
201  CreateDefaultPtBinning(ptbinning);
202  CreateDefaultZVertexBinning(zvertexBinning);
203  CreateDefaultEtaBinning(etabinning);
204  TAxis htrackaxes[7];
205  DefineAxis(htrackaxes[0], "pt", "p_{t} (GeV/c)", ptbinning);
206  DefineAxis(htrackaxes[1], "eta", "#eta", etabinning);
207  DefineAxis(htrackaxes[2], "phi", "#phi", 20, 0, 2 * TMath::Pi());
208  DefineAxis(htrackaxes[3], "zvertex", "z_{V} (cm)", zvertexBinning);
209  DefineAxis(htrackaxes[4], "pileup", "Pileup rejection", 2, -0.5, 1.5);
210  DefineAxis(htrackaxes[5], "trackcuts", "Track Cuts", (fListTrackCuts ? fListTrackCuts->GetEntries() : 0) + 1, -0.5, (fListTrackCuts ? fListTrackCuts->GetEntries() : 0) + 0.5);
211  DefineAxis(htrackaxes[6], "mbtrigger", "Has MB trigger", 2, -0.5, 1.5);
212  const TAxis *trackaxes[7];
213  for(int iaxis = 0; iaxis < 7; ++iaxis) trackaxes[iaxis] = htrackaxes + iaxis;
214  TAxis hclusteraxes[4];
215  DefineAxis(hclusteraxes[0], "energy", "E (GeV)", ptbinning);
216  DefineAxis(hclusteraxes[1], "zvertex", "z_{V} (cm)", zvertexBinning);
217  DefineAxis(hclusteraxes[2], "pileup", "Pileup rejection", 2,1 -0.5, 1.5);
218  DefineAxis(hclusteraxes[3], "mbtrigger", "Has MB trigger", 2, -0.5, 1.5);
219  const TAxis *clusteraxes[4];
220  for(int iaxis = 0; iaxis < 4; ++iaxis) clusteraxes[iaxis] = hclusteraxes + iaxis;
221  TAxis hpatchenergyaxes[5];
222  DefineAxis(hpatchenergyaxes[0], "energy", "Patch energy (GeV)", 100, 0., 100);
223  DefineAxis(hpatchenergyaxes[1], "eta", "#eta", etabinning);
224  DefineAxis(hpatchenergyaxes[2], "phi", "#phi", 20, 0, 2 * TMath::Pi());
225  DefineAxis(hpatchenergyaxes[3], "isMain", "Main trigger", 2, -0.5, 1.5);
226  DefineAxis(hpatchenergyaxes[4], "emcalgood", "EMCAL good event", 2, -0.5, 1.5);
227  const TAxis *patchenergyaxes[5];
228  for(int iaxis = 0; iaxis < 5; ++iaxis) patchenergyaxes[iaxis] = hpatchenergyaxes + iaxis;
229  TAxis hpatchampaxes[5];
230  DefineAxis(hpatchampaxes[0], "amplitude", "Patch energy (GeV)", 10000, 0., 10000.);
231  DefineAxis(hpatchampaxes[1], "eta", "#eta", etabinning);
232  DefineAxis(hpatchampaxes[2], "phi", "#phi", 20, 0, 2 * TMath::Pi());
233  DefineAxis(hpatchampaxes[3], "isMain", "Main trigger", 2, -0.5, 1.5);
234  DefineAxis(hpatchampaxes[4], "emcalgood", "EMCAL good event", 2, -0.5, 1.5);
235  const TAxis *patchampaxes[5];
236  for(int iaxis = 0; iaxis < 5; ++iaxis) patchampaxes[iaxis] = hpatchampaxes + iaxis;
237  try{
238  std::string patchnames[] = {"Level0", "JetHigh", "JetLow", "GammaHigh", "GammaLow"};
239  for(std::string * triggerpatch = patchnames; triggerpatch < patchnames + sizeof(patchnames)/sizeof(std::string); ++triggerpatch){
240  fHistos->CreateTHnSparse(Form("Energy%s", triggerpatch->c_str()), Form("Patch energy for %s trigger patches", triggerpatch->c_str()), 5, patchenergyaxes, "s");
241  fHistos->CreateTHnSparse(Form("EnergyRough%s", triggerpatch->c_str()), Form("Rough patch energy for %s trigger patches", triggerpatch->c_str()), 5, patchenergyaxes, "s");
242  fHistos->CreateTHnSparse(Form("Amplitude%s", triggerpatch->c_str()), Form("Patch amplitude for %s trigger patches", triggerpatch->c_str()), 5, patchampaxes, "s");
243  }
244 
245  // Create histogram for MC-truth
246  fHistos->CreateTHnSparse("hMCtrueParticles", "Particle-based histogram for MC-true particles", 5, trackaxes, "s");
247  if(fJetCollArray.GetEntries()){
248  for(int irad = 0; irad < kNJetRadii; irad++){
249  fHistos->CreateTHnSparse(Form("hMCtrueParticlesRad%02d", int(kJetRadii[irad]*10)),
250  Form("Particle-based histogram for MC-true particles in Jets with radius %.1f", kJetRadii[irad]*10), 5, trackaxes, "s");
251  }
252  // histogram for isolated particles
253  fHistos->CreateTHnSparse("hMCtrueParticlesIsolated", "Particle-based histogram for isolated MC-true particles", 5, trackaxes, "s");
254  }
255  for(std::map<std::string,std::string>::iterator it = triggerCombinations.begin(); it != triggerCombinations.end(); ++it){
256  const std::string name = it->first, &title = it->second;
257  // Create event-based histogram
258  fHistos->CreateTH2(Form("hEventHist%s", name.c_str()), Form("Event-based data for %s events; pileup rejection; z_{V} (cm)", title.c_str()), pileupaxis, zvertexBinning);
259  // Create track-based histogram
260  fHistos->CreateTHnSparse(Form("hTrackHist%s", name.c_str()), Form("Track-based data for %s events", title.c_str()), 7, trackaxes, "s");
261  fHistos->CreateTHnSparse(Form("hTrackInAcceptanceHist%s", name.c_str()), Form("Track-based data for %s events for tracks matched to EMCal clusters", title.c_str()), 7, trackaxes, "s");
262  fHistos->CreateTHnSparse(Form("hMCTrackHist%s", name.c_str()), Form("Track-based data for %s events with MC kinematics", title.c_str()), 7, trackaxes, "s");
263  fHistos->CreateTHnSparse(Form("hMCTrackInAcceptanceHist%s", name.c_str()), Form("Track-based data for %s events with MC kinematics for tracks matched to EMCal clusters", title.c_str()), 7, trackaxes, "s");
264  // Create cluster-based histogram (Uncalibrated and calibrated clusters)
265  fHistos->CreateTHnSparse(Form("hClusterCalibHist%s", name.c_str()), Form("Calib. cluster-based histogram for %s events", title.c_str()), 4, clusteraxes, "s");
266  fHistos->CreateTHnSparse(Form("hClusterUncalibHist%s", name.c_str()), Form("Uncalib. cluster-based histogram for %s events", title.c_str()), 4, clusteraxes, "s");
267  if(fJetCollArray.GetEntries()){
268  // Create histograms for particles in different jetfinder radii, only track-based
269  for(int irad = 0; irad < kNJetRadii; irad++){
270  fHistos->CreateTHnSparse(Form("hTrackHist%sRad%02d", name.c_str(), int(kJetRadii[irad]*10)),
271  Form("Track-based data for %s events for tracks in jets with Radius %.1f", title.c_str(), kJetRadii[irad]), 7, trackaxes, "s");
272  fHistos->CreateTHnSparse(Form("hTrackInAcceptanceHist%sRad%02d", name.c_str(), int(kJetRadii[irad]*10)),
273  Form("Track-based data for %s events for tracks matched to EMCal clusters in jets with Radius %.1f", title.c_str(), kJetRadii[irad]),
274  7, trackaxes, "s");
275  fHistos->CreateTHnSparse(Form("hMCTrackHist%sRad%02d", name.c_str(), int(kJetRadii[irad]*10)),
276  Form("Track-based data for %s events with MC kinematics for tracks in jets with Radius %.1f", title.c_str(), kJetRadii[irad]),
277  7, trackaxes, "s");
278  fHistos->CreateTHnSparse(Form("hMCTrackInAcceptanceHist%sRad%02d", name.c_str(), int(kJetRadii[irad]*10)),
279  Form("Track-based data for %s events with MC kinematics for tracks matched to EMCal clusters in jets with Radius %.1f", title.c_str(), kJetRadii[irad]),
280  7, trackaxes, "s");
281  fHistos->CreateTHnSparse(Form("hClusterCalibHist%sRad%02d", name.c_str(), int(kJetRadii[irad]*10)),
282  Form("Calib. cluster-based histogram for %s events for clusters in Jets with radius %.1f", title.c_str(), kJetRadii[irad]), 4, clusteraxes, "s");
283  }
284  }
285  // Create also histograms for isolated particles
286  fHistos->CreateTHnSparse(Form("hTrackHist%sIsolated", name.c_str()), Form("Track-based data for %s events for isolated tracks", title.c_str()), 7, trackaxes, "s");
287  fHistos->CreateTHnSparse(Form("hTrackInAcceptanceHist%sIsolated", name.c_str()), Form("Track-based data for %s events for isolated tracks matched to EMCal clusters", title.c_str()), 7, trackaxes, "s");
288  fHistos->CreateTHnSparse(Form("hMCTrackHist%sIsolated", name.c_str()), Form("Track-based data for %s events with MC kinematics for isolated tracks", title.c_str()), 7, trackaxes, "s");
289  fHistos->CreateTHnSparse(Form("hMCTrackInAcceptanceHist%sIsolated", name.c_str()), Form("Track-based data for %s events with MC kinematics for isolated tracks matched to EMCal clusters", title.c_str()), 7, trackaxes, "s");
290  }
291  fHistos->CreateTHnSparse("hEventTriggers", "Trigger type per event", 5, triggeraxis);
292  fHistos->CreateTHnSparse("hEventsTriggerbit", "Trigger bits for the different events", 4, bitaxes);
293  } catch (HistoContainerContentException &e){
294  std::stringstream errormessage;
295  errormessage << "Creation of histogram failed: " << e.what();
296  AliError(errormessage.str().c_str());
297  }
298  fOutput->Add(fHistos->GetListOfHistograms());
299  if(fListTrackCuts && fListTrackCuts->GetEntries()){
300  TIter cutIter(fListTrackCuts);
301  AliEMCalPtTaskVTrackSelection *cutObject(NULL);
302  while((cutObject = dynamic_cast<AliEMCalPtTaskVTrackSelection *>(cutIter()))){
303  AliESDtrackCuts *cuts = dynamic_cast<AliESDtrackCuts *>(cutObject->GetTrackCuts(0));
304  if(cuts){
305  cuts->DefineHistograms();
306  fOutput->Add(cuts);
307  }
308  }
309  }
310  PostData(1, fOutput);
311  }
312 
319  // Common checks: Have SPD vertex and primary vertex from tracks, and both need to have at least one contributor
320  AliDebug(1,Form("Number of calibrated clusters: %d", fCaloClusters->GetEntries()));
321  AliDebug(1,Form("Number of matched tracks: %d", fTracks->GetEntries()));
322  if(fMCEvent){
323  // Build always trigger strig from the trigger maker in case of MC
325  }
326 
327  Bool_t emcalGood = fInputHandler->IsEventSelected() & AliEmcalPhysicsSelection::kEmcalOk;
328 
329  // Loop over trigger patches, fill patch energy
330  AliEmcalTriggerPatchInfo *triggerpatch(NULL);
331  TIter patchIter(this->fTriggerPatchInfo);
332  while((triggerpatch = dynamic_cast<AliEmcalTriggerPatchInfo *>(patchIter()))){
333  double triggerpatchinfo[5] = {triggerpatch->GetPatchE(), triggerpatch->GetEtaGeo(), triggerpatch->GetPhiGeo(), triggerpatch->IsMainTrigger() ? 1. : 0., emcalGood ? 1. : 0.};
334  double triggerpatchinfoamp[5] = {static_cast<double>(triggerpatch->GetADCAmp()), triggerpatch->GetEtaGeo(), triggerpatch->GetPhiGeo(), triggerpatch->IsMainTrigger() ? 1. : 0., emcalGood ? 1. : 0.};
335  double triggerpatchinfoer[5] = {triggerpatch->GetADCAmpGeVRough(), triggerpatch->GetEtaGeo(), triggerpatch->GetPhiGeo(), triggerpatch->IsMainTrigger() ? 1. : 0., emcalGood ? 1. : 0.};
336  if(triggerpatch->IsJetHigh()){
337  fHistos->FillTHnSparse("EnergyJetHigh", triggerpatchinfo);
338  fHistos->FillTHnSparse("AmplitudeJetHigh", triggerpatchinfoamp);
339  fHistos->FillTHnSparse("EnergyRoughJetHigh", triggerpatchinfoer);
340  }
341  if(triggerpatch->IsJetLow()){
342  fHistos->FillTHnSparse("EnergyJetLow", triggerpatchinfo);
343  fHistos->FillTHnSparse("AmplitudeJetLow", triggerpatchinfoamp);
344  fHistos->FillTHnSparse("EnergyRoughJetLow", triggerpatchinfoer);
345  }
346  if(triggerpatch->IsGammaHigh()){
347  fHistos->FillTHnSparse("EnergyGammaHigh", triggerpatchinfo);
348  fHistos->FillTHnSparse("AmplitudeGammaHigh", triggerpatchinfoamp);
349  fHistos->FillTHnSparse("EnergyRoughGammaHigh", triggerpatchinfoer);
350  }
351  if(triggerpatch->IsGammaLow()){
352  fHistos->FillTHnSparse("EnergyGammaLow", triggerpatchinfo);
353  fHistos->FillTHnSparse("AmplitudeGammaLow", triggerpatchinfoamp);
354  fHistos->FillTHnSparse("EnergyRoughGammaLow", triggerpatchinfoer);
355  }
356  if(triggerpatch->IsLevel0()){
357  fHistos->FillTHnSparse("EnergyLevel0", triggerpatchinfo);
358  fHistos->FillTHnSparse("AmplitudeLevel0", triggerpatchinfoamp);
359  fHistos->FillTHnSparse("EnergyRoughLevel0", triggerpatchinfoer);
360  }
361  }
362 
363  const AliVVertex *vtxTracks = fInputEvent->GetPrimaryVertex(),
364  *vtxSPD = GetSPDVertex();
365  if(!(vtxTracks && vtxSPD)) return false;
366  if(!fVertexRange.IsInRange(vtxTracks->GetZ())) return false;
367  if(vtxTracks->GetNContributors() < 1 || vtxSPD->GetNContributors() < 1) return false;
368 
369  double triggers[5]; memset(triggers, 0, sizeof(double) * 5);
370  double triggerbits[4]; memset(triggerbits, 0, sizeof(double) * 4);
371  if(fInputHandler->IsEventSelected() & AliVEvent::kINT7){
372  triggers[0] = 1.;
373  triggerbits[0] = 1.;
374  }
375 
376  // check triggerbits
377  if(fInputHandler->IsEventSelected() & AliVEvent::kEMC7){
378  triggerbits[1] = 1.;
379  }
380  if(fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA){
381  triggerbits[2] = 1.;
382  }
383  if(fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE){
384  triggerbits[3] = 1.;
385  }
386  try{
387  fHistos->FillTHnSparse("hEventsTriggerbit", triggerbits);
388  } catch(HistoContainerContentException &e) {
389  std::stringstream errormessage;
390  errormessage << "Filling of histogram failed: " << e.what();
391  AliError(errormessage.str().c_str());
392  }
393 
394  std::vector<std::string> triggerstrings;
395  // EMCal-triggered event, distinguish types
396  TString trgstr(fUseTriggersFromTriggerMaker ? BuildTriggerString() : fInputEvent->GetFiredTriggerClasses());
397  AliDebug(1, Form("Triggerstring: %s\n", trgstr.Data()));
398  if(trgstr.Contains("EJ1")){
399  triggerstrings.push_back("EMCJHigh");
400  triggers[1] = 1;
401  if(trgstr.Contains("EG1"))
402  triggerstrings.push_back("EMCHighBoth");
403  else
404  triggerstrings.push_back("EMCHighJetOnly");
405  }
406  if(trgstr.Contains("EJ2")){
407  triggerstrings.push_back("EMCJLow");
408  triggers[2] = 1;
409  if(trgstr.Contains("EG2"))
410  triggerstrings.push_back("EMCLowBoth");
411  else
412  triggerstrings.push_back("EMCLowJetOnly");
413  }
414  if(trgstr.Contains("EG1")){
415  triggerstrings.push_back("EMCGHigh");
416  triggers[3] = 1;
417  if(!trgstr.Contains("EJ1"))
418  triggerstrings.push_back("EMCHighGammaOnly");
419  }
420  if(trgstr.Contains("EG2")){
421  triggerstrings.push_back("EMCGLow");
422  triggers[4] = 1;
423  if(!trgstr.Contains("EJ2"))
424  triggerstrings.push_back("EMCLowGammaOnly");
425  }
426 
427  try{
428  fHistos->FillTHnSparse("hEventTriggers", triggers);
429  } catch (HistoContainerContentException &e){
430  std::stringstream errormessage;
431  errormessage << "Filling of histogram failed: " << e.what();
432  AliError(errormessage.str().c_str());
433  }
434 
435  // apply event selection: Combine the Pileup cut from SPD with the other pA Vertex selection cuts.
436  bool isPileupEvent = fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.);
437  isPileupEvent = isPileupEvent || (TMath::Abs(vtxTracks->GetZ() - vtxSPD->GetZ()) > 0.5);
438  double covSPD[6]; vtxSPD->GetCovarianceMatrix(covSPD);
439  isPileupEvent = isPileupEvent || (vtxSPD->IsFromVertexerZ() && TMath::Sqrt(covSPD[5]) > 0.25); // selection effectively inactive in old versions of the code
440 
441  // Fill event-based histogram
442  const double &zv = vtxTracks->GetZ();
443  if(triggers[0]) FillEventHist("MinBias", zv, isPileupEvent);
444  if(!triggerstrings.size()) // Non-EMCal-triggered
445  FillEventHist("NoEMCal", zv, isPileupEvent);
446  else{
447  // EMCal-triggered events
448  for(std::vector<std::string>::iterator it = triggerstrings.begin(); it != triggerstrings.end(); ++it)
449  FillEventHist(it->c_str(), zv, isPileupEvent);
450  }
451 
452  const AliEmcalJet *foundJet(NULL);
453  char histname[1024];
454  std::vector<double> coneradii;
455  AliJetContainer *jetContMC(NULL), *jetContData(NULL);
456 
457  // Fill MC truth
458  AliVParticle *part(NULL);
459  if(fMCEvent){
460  if(fJetCollArray.GetEntries() &&
461  (jetContMC = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject((static_cast<TObjString *>(fJetContainersMC.At(0)))->String().Data())))){
462  // In case we have a jet array we loop over all MC selected particles in the particle container of the jet array
463  TIter particles(jetContMC->GetParticleContainer()->GetArray());
464  while((part = dynamic_cast<AliVParticle *>(particles()))){
465  if(part->Charge() == 0) continue;
466  if(!fEtaRange.IsInRange(part->Eta())) continue;
467  if(!fPtRange.IsInRange(part->Pt())) continue;
468  FillMCParticleHist("hMCtrueParticles", part, zv, isPileupEvent);
469 
470  /*
471  * Jet part: Find track in jet container,
472  * check according to number of particles in jet, and
473  * check for different cone radii
474  */
475  foundJet = FoundTrackInJet(part, jetContMC);
476  if(foundJet && foundJet->GetNumberOfConstituents() > 1){
477  for(int irad = 0; irad < kNJetRadii; irad++){
478  if(IsInRadius(part, foundJet, kJetRadii[irad])){
479  sprintf(histname, "hMCtrueParticlesRad%02d", int(kJetRadii[irad]*10));
480  FillMCParticleHist(histname, part, zv, isPileupEvent);
481  }
482  }
483  } else {
484  // isolated track
485  FillMCParticleHist("hMCtrueParticlesIsolated", part, zv, isPileupEvent);
486  }
487  }
488  } else {
489  // Use MC Event
490  for(int ipart = 0; ipart < fMCEvent->GetNumberOfTracks(); ipart++){
491  // Select only physical primary particles
492  part = fMCEvent->GetTrack(ipart);
493  if(part->Charge() == 0) continue;
494  if(!fEtaRange.IsInRange(part->Eta())) continue;
495  if(!fPtRange.IsInRange(part->Pt())) continue;
496  if(!fMCEvent->IsPhysicalPrimary(ipart)) continue;
497  FillMCParticleHist("hMCtrueParticles", part, zv, isPileupEvent);
498  }
499  }
500  }
501 
502  AliVTrack *track(NULL);
503  AliPicoTrack *picoTrack(NULL);
504  TObject *containerObject(NULL);
505  // Loop over all tracks (No cuts applied)
506  if(fSelectAllTracks){
507  // loop over all tracks only if requested
508  TIter allTrackIter(fTracks);
509  while((containerObject = dynamic_cast<TObject *>(allTrackIter()))){
510  if((picoTrack = dynamic_cast<AliPicoTrack *>(containerObject))){
511  track = picoTrack->GetTrack();
512  } else
513  track = dynamic_cast<AliVTrack *>(containerObject);
514  if(!IsTrueTrack(track)) continue;
515  if(!fEtaRange.IsInRange(track->Eta())) continue;
516  if(!fPtRange.IsInRange(track->Pt())) continue;
517  if(triggers[0]) FillTrackHist("MinBias", track, zv, isPileupEvent, 0, triggers[0]);
518  if(!triggerstrings.size()) // Non-EMCal-triggered
519  FillTrackHist("NoEMCal", track, zv, isPileupEvent, 0, triggers[0]);
520  else {
521  // EMCal-triggered events
522  for(std::vector<std::string>::iterator it = triggerstrings.begin(); it != triggerstrings.end(); ++it)
523  FillTrackHist(it->c_str(), track, zv, isPileupEvent, 0, triggers[0]);
524  }
525  }
526  }
527 
528  // Now apply track selection cuts
529  // allow for several track selections to be tested at the same time
530  // each track selection gets a different cut ID starting from 1
531  // cut ID 0 is reserved for the case of no cuts
532  // In case we have a jet container attached we check whether the track is
533  // found in a jet, and check for different cone radii around a jet
534  if(fListTrackCuts && fListTrackCuts->GetEntries()){
535  for(int icut = 0; icut < fListTrackCuts->GetEntries(); icut++){
536  AliEMCalPtTaskVTrackSelection *trackSelection = static_cast<AliEMCalPtTaskVTrackSelection *>(fListTrackCuts->At(icut));
537  TIter trackIter(trackSelection->GetAcceptedTracks(fTracks));
538  while((track = dynamic_cast<AliVTrack *>(trackIter()))){
539  if(fMCEvent && !IsTrueTrack(track)) continue; // Reject fake tracks in case of MC
540  if(!fEtaRange.IsInRange(track->Eta())) continue;
541  if(!fPtRange.IsInRange(track->Pt())) continue;
542  coneradii.clear();
543  if(this->fJetCollArray.GetEntries() &&
544  (jetContData = dynamic_cast<AliJetContainer *>(this->fJetCollArray.FindObject((static_cast<TObjString *>(this->fJetContainersData.At(0)))->String().Data())))){
545  foundJet = FoundTrackInJet(track, jetContData);
546  if(foundJet){
547  for(int irad = 0; irad < kNJetRadii; irad++){
548  if(IsInRadius(track, foundJet, kJetRadii[irad])) coneradii.push_back(kJetRadii[irad]);
549  }
550  }
551  }
552  if(triggers[0]){
553  FillTrackHist("MinBias", track, zv, isPileupEvent, icut + 1, triggers[0]);
554  if(coneradii.size()){
555  for(std::vector<double>::iterator radIter = coneradii.begin(); radIter != coneradii.end(); radIter++)
556  FillTrackHist("MinBias", track, zv, isPileupEvent, icut + 1, triggers[0], *radIter);
557  }
558  }
559  if(!triggerstrings.size()){ // Non-EMCal-triggered
560  FillTrackHist("NoEMCal", track, zv, isPileupEvent, icut + 1, triggers[0]);
561  for(std::vector<double>::iterator radIter = coneradii.begin(); radIter != coneradii.end(); radIter++)
562  FillTrackHist("NoEMCal", track, zv, isPileupEvent, icut + 1, triggers[0], *radIter);
563  } else {
564  // EMCal-triggered events
565  for(std::vector<std::string>::iterator it = triggerstrings.begin(); it != triggerstrings.end(); ++it){
566  FillTrackHist(it->c_str(), track, zv, isPileupEvent, icut + 1, triggers[0]);
567  for(std::vector<double>::iterator radIter = coneradii.begin(); radIter != coneradii.end(); radIter++)
568  FillTrackHist(it->c_str(), track, zv, isPileupEvent, icut + 1, triggers[0], *radIter);
569  }
570  }
571  }
572  }
573  }
574 
575  // Next step we loop over the (uncalibrated) emcal clusters and fill histograms with the cluster energy
576  const AliVCluster *clust(NULL);
577  for(int icl = 0; icl < fInputEvent->GetNumberOfCaloClusters(); icl++){
578  clust = fInputEvent->GetCaloCluster(icl);
579  if(!clust->IsEMCAL()) continue;
580  if(!fEnergyRange.IsInRange(clust->E())) continue;
581  if(triggers[0]) FillClusterHist("hClusterUncalibHistMinBias", clust, zv, isPileupEvent, triggers[0]);
582  if(!triggerstrings.size()){ // Non-EMCal-triggered
583  FillClusterHist("hClusterUncalibHistNoEMCal", clust, zv, isPileupEvent, triggers[0]);
584  } else{
585  for(std::vector<std::string>::iterator it = triggerstrings.begin(); it != triggerstrings.end(); ++it){
586  sprintf(histname, "hClusterUncalibHist%s", it->c_str());
587  FillClusterHist(histname, clust, zv, isPileupEvent, triggers[0]);
588  }
589  }
590  }
591 
592  if(fCaloClusters){
593  TIter clustIter(fCaloClusters);
594  while((clust = dynamic_cast<const AliVCluster *>(clustIter()))){
595  if(!clust->IsEMCAL()) continue;
596  if(!fEnergyRange.IsInRange(clust->E())) continue;
597  if(triggers[0]) FillClusterHist("hClusterCalibHistMinBias", clust, zv, isPileupEvent, triggers[0]);
598  if(!triggerstrings.size()) // Non-EMCal-triggered
599  FillClusterHist("hClusterCalibHistNoEMCal", clust, zv, isPileupEvent, triggers[0]);
600  else{
601  for(std::vector<std::string>::iterator it = triggerstrings.begin(); it != triggerstrings.end(); ++it){
602  sprintf(histname, "hClusterCalibHist%s", it->c_str());
603  FillClusterHist(histname, clust, zv, isPileupEvent, triggers[0]);
604  }
605  }
606  }
607  }
608 
609  PostData(1, fOutput);
610  return true;
611  }
612 
619  std::vector<double> mybinning;
620  std::map<double,double> definitions;
621  definitions.insert(std::pair<double,double>(2.5, 0.1));
622  definitions.insert(std::pair<double,double>(7., 0.25));
623  definitions.insert(std::pair<double,double>(15., 0.5));
624  definitions.insert(std::pair<double,double>(25., 1.));
625  definitions.insert(std::pair<double,double>(40., 2.5));
626  definitions.insert(std::pair<double,double>(50., 5.));
627  definitions.insert(std::pair<double,double>(100., 10.));
628  double currentval = 0;
629  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
630  double limit = id->first, binwidth = id->second;
631  while(currentval < limit){
632  currentval += binwidth;
633  mybinning.push_back(currentval);
634  }
635  }
636  binning.Set(mybinning.size());
637  int ib = 0;
638  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
639  binning[ib++] = *it;
640  }
641 
648  std::vector<double> mybinning;
649  double currentval = -10;
650  mybinning.push_back(currentval);
651  while(currentval <= 10.){
652  currentval += 5.;
653  mybinning.push_back(currentval);
654  }
655  binning.Set(mybinning.size());
656  int ib = 0;
657  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
658  binning[ib++] = *it;
659  }
660 
667  std::vector<double> mybinning;
668  double currentval = -0.8;
669  mybinning.push_back(currentval);
670  while(currentval <= 0.8){
671  currentval += 0.1;
672  mybinning.push_back(currentval);
673  }
674  binning.Set(mybinning.size());
675  int ib = 0;
676  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
677  binning[ib++] = *it;
678  }
679 
689  void AliAnalysisTaskPtEMCalTrigger::DefineAxis(TAxis& axis, const char* name,
690  const char* title, const TArrayD& binning, const char** labels) {
691  axis.Set(binning.GetSize()-1, binning.GetArray());
692  axis.SetName(name);
693  axis.SetTitle(title);
694  if(labels){
695  for(int ib = 1; ib <= axis.GetNbins(); ++ib)
696  axis.SetBinLabel(ib, labels[ib-1]);
697  }
698  }
699 
711  void AliAnalysisTaskPtEMCalTrigger::DefineAxis(TAxis& axis, const char* name,
712  const char* title, int nbins, double min, double max,
713  const char** labels) {
714  axis.Set(nbins, min, max);
715  axis.SetName(name);
716  axis.SetTitle(title);
717  if(labels){
718  for(int ib = 1; ib <= axis.GetNbins(); ++ib)
719  axis.SetBinLabel(ib, labels[ib-1]);
720  }
721  }
722 
731  double vz, bool isPileup) {
732  char histname[1024];
733  sprintf(histname, "hEventHist%s", trigger);
734  try{
735  fHistos->FillTH2(histname, 0., vz);
736  } catch (HistoContainerContentException &e){
737  std::stringstream errormessage;
738  errormessage << "Filling of histogram failed: " << e.what();
739  AliError(errormessage.str().c_str());
740  }
741  if(!isPileup){
742  try{
743  fHistos->FillTH2(histname, 1., vz);
744  } catch(HistoContainerContentException &e){
745  std::stringstream errormessage;
746  errormessage << "Filling of histogram failed: " << e.what();
747  AliError(errormessage.str().c_str());
748  }
749  }
750  }
751 
762  const AliVTrack* track, double vz, bool isPileup, int cut, bool isMinBias, double jetradius) {
763  double etasign = fSwapEta ? -1. : 1.;
764  double data[7] = {TMath::Abs(track->Pt()), etasign * track->Eta(), track->Phi(), vz, 0, static_cast<double>(cut), isMinBias ? 1. : 0.};
765  double dataMC[7] = {0., 0., 0., vz, 0, static_cast<double>(cut), isMinBias ? 1. : 0.};
766  AliVParticle *assocMC(NULL);
767  if(fMCEvent && (assocMC = fMCEvent->GetTrack(TMath::Abs(track->GetLabel())))){
768  // Select track onl
769  dataMC[0] = TMath::Abs(assocMC->Pt());
770  dataMC[1] = etasign * assocMC->Eta();
771  dataMC[2] = assocMC->Phi();
772  }
773  char histname[1024], histnameAcc[1024], histnameMC[1024], histnameMCAcc[1024];
774  sprintf(histname, "hTrackHist%s", trigger);
775  sprintf(histnameAcc, "hTrackInAcceptanceHist%s", trigger);
776  sprintf(histnameMC, "hMCTrackHist%s", trigger);
777  sprintf(histnameMCAcc, "hMCTrackInAcceptanceHist%s", trigger);
778  if(jetradius > 0.){
779  char *hnames[] = {histname, histnameAcc, histnameMC, histnameMCAcc};
780  for(unsigned int iname = 0; iname < sizeof(hnames)/sizeof(char *); iname++){
781  char *myhname = hnames[iname];
782  sprintf(myhname, "%sRad%02d", myhname, int(jetradius * 10.));
783  }
784  }
785  Bool_t isEMCAL = kFALSE;
786  if(track->IsEMCAL()){
787  // Check if the cluster is matched to only one track
788  AliVCluster *emcclust(NULL);
789  AliDebug(2, Form("cluster id: %d\n", track->GetEMCALcluster()));
790  if(fCaloClusters) {
791  AliDebug(2, "Using calibrated clusters");
792  emcclust = dynamic_cast<AliVCluster *>(fCaloClusters->At(track->GetEMCALcluster()));
793  } else {
794  AliDebug(2, "Using uncalibrated clusters");
795  emcclust = fInputEvent->GetCaloCluster(track->GetEMCALcluster());
796  }
797  if(!emcclust) AliError("Null pointer to EMCal cluster");
798  if(emcclust && emcclust->GetNTracksMatched() <= 1){
799  isEMCAL = kTRUE;
800  }
801  }
802  try{
803  fHistos->FillTHnSparse(histname, data);
804  if(fMCEvent) fHistos->FillTHnSparse(histnameMC, dataMC);
805  if(isEMCAL){
806  fHistos->FillTHnSparse(histnameAcc, data);
807  if(fMCEvent) fHistos->FillTHnSparse(histnameMCAcc, dataMC);
808  }
809  } catch (HistoContainerContentException &e){
810  std::stringstream errormessage;
811  errormessage << "Filling of histogram failed: " << e.what();
812  AliError(errormessage.str().c_str());
813  }
814  if(!isPileup){
815  data[4] = 1;
816  dataMC[4] = 1;
817  try{
818  fHistos->FillTHnSparse(histname, data);
819  if(fMCEvent) fHistos->FillTHnSparse(histnameMC, dataMC);
820  if(isEMCAL){
821  fHistos->FillTHnSparse(histnameAcc, data);
822  if(fMCEvent) fHistos->FillTHnSparse(histnameMCAcc, dataMC);
823  }
824  } catch (HistoContainerContentException &e){
825  std::stringstream errormessage;
826  errormessage << "Filling of histogram failed: " << e.what();
827  AliError(errormessage.str().c_str());
828  }
829  }
830  }
831 
841  const AliVCluster* clust, double vz, bool isPileup, bool isMinBias) {
842  double data[4] = {clust->E(), vz, 0, isMinBias ? 1. : 0.};
843  try{
844  fHistos->FillTHnSparse(histname, data);
845  } catch (HistoContainerContentException &e){
846  std::stringstream errormessage;
847  errormessage << "Filling of histogram failed: " << e.what();
848  AliError(errormessage.str().c_str());
849  }
850  if(!isPileup){
851  data[2] = 1.;
852  try{
853  fHistos->FillTHnSparse(histname, data);
854  } catch (HistoContainerContentException &e){
855  std::stringstream errormessage;
856  errormessage << "Filling of histogram failed: " << e.what();
857  AliError(errormessage.str().c_str());
858  }
859  }
860  }
861 
867  void AliAnalysisTaskPtEMCalTrigger::FillMCParticleHist(const char *histname, const AliVParticle * const track, double vz, bool isPileup){
868  double data[5] = {TMath::Abs(track->Pt()), track->Eta(), track->Phi(), vz, 0.};
869  fHistos->FillTHnSparse(histname, data);
870  if(!isPileup){
871  data[4] = 1.;
872  fHistos->FillTHnSparse(histname, data);
873  }
874  }
875 
883  bool AliAnalysisTaskPtEMCalTrigger::IsTrueTrack(const AliVTrack *const track) const{
884  if(!fMCEvent) return true;
885  AliVParticle *mcassociate = fMCEvent->GetTrack(TMath::Abs(track->GetLabel()));
886  if(!mcassociate) return false;
887  return fMCEvent->IsPhysicalPrimary(TMath::Abs(track->GetLabel()));
888  }
889 
895  void AliAnalysisTaskPtEMCalTrigger::AddESDTrackCuts(AliESDtrackCuts* trackCuts) {
896  fListTrackCuts->AddLast(new AliEMCalPtTaskTrackSelectionESD(trackCuts));
897  }
898 
904  void AliAnalysisTaskPtEMCalTrigger::AddCutsForAOD(AliESDtrackCuts* trackCuts, UInt_t filterbits) {
905  fListTrackCuts->AddLast(new AliEMCalPtTaskTrackSelectionAOD(trackCuts, filterbits));
906  }
907 
908 
915  AliDebug(1, "trigger checking");
916  TString result = "";
917  if(HasTriggerType(kJ1)) result += "EJ1 ";
918  if(HasTriggerType(kJ2)) result += "EJ2 ";
919  if(HasTriggerType(kG1)) result += "EG1 ";
920  if(HasTriggerType(kG2)) result += "EG2 ";
921  return result;
922  }
923 
930  AliESDEvent *esd = dynamic_cast<AliESDEvent *>(fInputEvent);
931  if(esd){
932  return esd->GetPrimaryVertexSPD();
933  } else {
934  AliAODEvent *aod = dynamic_cast<AliAODEvent *>(fInputEvent);
935  if(aod){
936  return aod->GetPrimaryVertexSPD();
937  }
938  }
939  return NULL;
940  }
941 
950  const AliVParticle * const track, AliJetContainer *const jets) const
951  {
952 
953  const AliEmcalJet *result = NULL;
954  const AliEmcalJet *tmp = jets->GetNextAcceptJet(0);
955  while(tmp){
956  if(TrackInJet(track, tmp, jets->GetParticleContainer())){
957  result = tmp;
958  break;
959  }
960  tmp = jets->GetNextAcceptJet();
961  }
962  return result;
963  }
964 
973  bool AliAnalysisTaskPtEMCalTrigger::IsInRadius(const AliVParticle *const track, const AliEmcalJet *reconstructedJet, Double_t radius) const {
974  return reconstructedJet->DeltaR(track) < radius;
975  }
976 
985  bool AliAnalysisTaskPtEMCalTrigger::IsInRadius(const AliVCluster *const clust, const AliEmcalJet *reconstructedJet, Double_t radius) const {
986  double vertexPos[3];
987  fInputEvent->GetPrimaryVertex()->GetXYZ(vertexPos);
988  TLorentzVector clustVect;
989  clust->GetMomentum(clustVect, vertexPos);
990 
991  Double_t dPhi = reconstructedJet->Phi() - clustVect.Phi();
992  Double_t dEta = reconstructedJet->Eta() - clustVect.Eta();
993  dPhi = TVector2::Phi_mpi_pi ( dPhi );
994 
995  double deltaR = TMath::Sqrt ( dPhi * dPhi + dEta * dEta );
996  return deltaR < radius;
997  }
998 
1007  bool AliAnalysisTaskPtEMCalTrigger::TrackInJet(const AliVParticle* const track,
1008  const AliEmcalJet* reconstructedJet, const AliParticleContainer * const particles) const {
1009  bool found = false;
1010  const AliPicoTrack *picotmp(NULL);
1011  const AliVParticle *tmp(NULL);
1012  for(int ipart = 0; ipart < reconstructedJet->GetNumberOfTracks(); ipart++){
1013  tmp = dynamic_cast<const AliVParticle *>(reconstructedJet->TrackAt(ipart, particles->GetArray()));
1014  if((picotmp = dynamic_cast<const AliPicoTrack *>(tmp))) // handle pico tracks
1015  tmp = picotmp->GetTrack();
1016  if(!tmp->Compare(track)){
1017  found = true;
1018  break;
1019  }
1020  }
1021  return found;
1022  }
1023 
1031  const AliEmcalJet* AliAnalysisTaskPtEMCalTrigger::FoundClusterInJet(const AliVCluster* const clust, AliJetContainer* const jets) const {
1032 
1033  const AliEmcalJet *result = NULL;
1034  const AliEmcalJet *tmp = jets->GetNextAcceptJet(0);
1035  while(tmp){
1036  if(ClusterInJet(clust, tmp, jets->GetClusterContainer())){
1037  result = tmp;
1038  break;
1039  }
1040  tmp =jets->GetNextAcceptJet();
1041  }
1042  return result;
1043  }
1044 
1053  bool AliAnalysisTaskPtEMCalTrigger::ClusterInJet(const AliVCluster* const clust,
1054  const AliEmcalJet* reconstructedJet, const AliClusterContainer* const clusters) const {
1055  bool found = false;
1056  const AliVCluster *tmp(NULL);
1057  for(int ipart = 0; ipart < reconstructedJet->GetNumberOfTracks(); ipart++){
1058  tmp = dynamic_cast<const AliVCluster *>(reconstructedJet->ClusterAt(ipart, clusters->GetArray()));
1059  if(!tmp->Compare(clust)){
1060  found = true;
1061  break;
1062  }
1063  }
1064  return found;
1065  }
1066 
1074  TList &mycontainer = isMC ? fJetContainersMC : fJetContainersData;
1075  mycontainer.Add(new TObjString(contname));
1076  }
1077 }
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
void FillTH2(const char *hname, double x, double y, double weight=1.)
const char * title
Definition: MakeQAPdf.C:26
AliCutValueRange< double > fEnergyRange
Cluster energy selection range.
AliEMCalHistoContainer * fHistos
Histogram container for the task.
void FillTrackHist(const char *trigger, const AliVTrack *track, double vz, bool isPileup, int cut, bool isMinBias, double jetradius=-1.)
Implement virtual track selection for AOD analysis.
const AliEmcalJet * FoundClusterInJet(const AliVCluster *const clust, AliJetContainer *const jets) const
void AddCutsForAOD(AliESDtrackCuts *trackCuts, UInt_t filterBits)
void FillEventHist(const char *trigger, double vz, bool isPileup)
Container class for histograms for the high- charged particle analysis.
bool IsInRadius(const AliVParticle *const track, const AliEmcalJet *reconstructedJet, Double_t radius) const
void AddJetContainerName(const Char_t *contname, Bool_t isMC=kFALSE)
void FillTHnSparse(const char *name, const double *x, double weight=1.)
Implementation of virtual track selection for ESDs.
Exception thrown by the histogram container in case of problems.
void CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Main data structure storing all relevant information of EMCAL/DCAL trigger patches.
Declarartion of class AliEMCalHistoContainer.
void FillClusterHist(const char *trigger, const AliVCluster *clust, double vz, bool isPileup, bool isMinBias)
Old charged hadron analysis in EMCAL-triggered events.
void DefineAxis(TAxis &axis, const char *name, const char *title, const TArrayD &binning, const char **labels=NULL)
Bool_t fSwapEta
Allow swapping of the eta sign in asymmetric collision systems.
TClonesArray * GetArray() const
void FillMCParticleHist(const char *histname, const AliVParticle *const part, double vz, bool isPileup)
void CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
const AliEmcalJet * FoundTrackInJet(const AliVParticle *const track, AliJetContainer *const jets) const
Declaration of class AliEMCalPtTaskTrackSelectionESD.
const Double_t jetRadVals[AliAnalysisTaskPtEMCalTrigger::kNJetRadii]
AliVTrack * GetTrack() const
Definition: AliPicoTrack.h:59
Bool_t isMC
virtual TObjArray * GetAcceptedTracks(const TClonesArray *const tracks)=0
AliCutValueRange< double > fPtRange
Pt Selection Range.
bool TrackInJet(const AliVParticle *const track, const AliEmcalJet *reconstructedJet, const AliParticleContainer *const particles) const
bool ClusterInJet(const AliVCluster *const clust, const AliEmcalJet *reconstructedJet, const AliClusterContainer *const particles) const
AliCutValueRange< double > fEtaRange
Eta Selection Range.
Class to make array of trigger patch objects in AOD/ESD events.
Bool_t fUseTriggersFromTriggerMaker
Use trigger classes from trigger maker.
Implement virtual track selection for AOD analysis.
const Int_t nbins
Declartion of class AliEMCalPtTaskVTrackSelection.