AliPhysics  fde8a9f (fde8a9f)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 <THistManager.h>
29 #include <TList.h>
30 #include <TKey.h>
31 #include <TMath.h>
32 #include <TObjArray.h>
33 #include <TObjString.h>
34 #include <TString.h>
35 #include <TVector2.h>
36 
37 #include "AliAODEvent.h"
38 #include "AliESDEvent.h"
39 #include "AliInputEventHandler.h"
40 #include "AliMCEvent.h"
41 #include "AliParticleContainer.h"
42 #include "AliVCluster.h"
43 #include "AliVParticle.h"
44 #include "AliVTrack.h"
45 #include "AliVVertex.h"
46 
47 #include "AliClusterContainer.h"
48 #include "AliEmcalJet.h"
49 #include "AliEMCALTriggerPatchInfo.h"
52 #include "AliEmcalTrackSelection.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():
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.);
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 THistManager("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  std::string patchnames[] = {"Level0", "JetHigh", "JetLow", "GammaHigh", "GammaLow"};
238  for(std::string * triggerpatch = patchnames; triggerpatch < patchnames + sizeof(patchnames)/sizeof(std::string); ++triggerpatch){
239  fHistos->CreateTHnSparse(Form("Energy%s", triggerpatch->c_str()), Form("Patch energy for %s trigger patches", triggerpatch->c_str()), 5, patchenergyaxes, "s");
240  fHistos->CreateTHnSparse(Form("EnergyRough%s", triggerpatch->c_str()), Form("Rough patch energy for %s trigger patches", triggerpatch->c_str()), 5, patchenergyaxes, "s");
241  fHistos->CreateTHnSparse(Form("Amplitude%s", triggerpatch->c_str()), Form("Patch amplitude for %s trigger patches", triggerpatch->c_str()), 5, patchampaxes, "s");
242  }
243 
244  // Create histogram for MC-truth
245  fHistos->CreateTHnSparse("hMCtrueParticles", "Particle-based histogram for MC-true particles", 5, trackaxes, "s");
246  if(fJetCollArray.GetEntries()){
247  for(int irad = 0; irad < kNJetRadii; irad++){
248  fHistos->CreateTHnSparse(Form("hMCtrueParticlesRad%02d", int(kJetRadii[irad]*10)),
249  Form("Particle-based histogram for MC-true particles in Jets with radius %.1f", kJetRadii[irad]*10), 5, trackaxes, "s");
250  }
251  // histogram for isolated particles
252  fHistos->CreateTHnSparse("hMCtrueParticlesIsolated", "Particle-based histogram for isolated MC-true particles", 5, trackaxes, "s");
253  }
254  for(std::map<std::string,std::string>::iterator it = triggerCombinations.begin(); it != triggerCombinations.end(); ++it){
255  const std::string name = it->first, &title = it->second;
256  // Create event-based histogram
257  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);
258  // Create track-based histogram
259  fHistos->CreateTHnSparse(Form("hTrackHist%s", name.c_str()), Form("Track-based data for %s events", title.c_str()), 7, trackaxes, "s");
260  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");
261  fHistos->CreateTHnSparse(Form("hMCTrackHist%s", name.c_str()), Form("Track-based data for %s events with MC kinematics", title.c_str()), 7, trackaxes, "s");
262  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");
263  // Create cluster-based histogram (Uncalibrated and calibrated clusters)
264  fHistos->CreateTHnSparse(Form("hClusterCalibHist%s", name.c_str()), Form("Calib. cluster-based histogram for %s events", title.c_str()), 4, clusteraxes, "s");
265  fHistos->CreateTHnSparse(Form("hClusterUncalibHist%s", name.c_str()), Form("Uncalib. cluster-based histogram for %s events", title.c_str()), 4, clusteraxes, "s");
266  if(fJetCollArray.GetEntries()){
267  // Create histograms for particles in different jetfinder radii, only track-based
268  for(int irad = 0; irad < kNJetRadii; irad++){
269  fHistos->CreateTHnSparse(Form("hTrackHist%sRad%02d", name.c_str(), int(kJetRadii[irad]*10)),
270  Form("Track-based data for %s events for tracks in jets with Radius %.1f", title.c_str(), kJetRadii[irad]), 7, trackaxes, "s");
271  fHistos->CreateTHnSparse(Form("hTrackInAcceptanceHist%sRad%02d", name.c_str(), int(kJetRadii[irad]*10)),
272  Form("Track-based data for %s events for tracks matched to EMCal clusters in jets with Radius %.1f", title.c_str(), kJetRadii[irad]),
273  7, trackaxes, "s");
274  fHistos->CreateTHnSparse(Form("hMCTrackHist%sRad%02d", name.c_str(), int(kJetRadii[irad]*10)),
275  Form("Track-based data for %s events with MC kinematics for tracks in jets with Radius %.1f", title.c_str(), kJetRadii[irad]),
276  7, trackaxes, "s");
277  fHistos->CreateTHnSparse(Form("hMCTrackInAcceptanceHist%sRad%02d", name.c_str(), int(kJetRadii[irad]*10)),
278  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]),
279  7, trackaxes, "s");
280  fHistos->CreateTHnSparse(Form("hClusterCalibHist%sRad%02d", name.c_str(), int(kJetRadii[irad]*10)),
281  Form("Calib. cluster-based histogram for %s events for clusters in Jets with radius %.1f", title.c_str(), kJetRadii[irad]), 4, clusteraxes, "s");
282  }
283  }
284  // Create also histograms for isolated particles
285  fHistos->CreateTHnSparse(Form("hTrackHist%sIsolated", name.c_str()), Form("Track-based data for %s events for isolated tracks", title.c_str()), 7, trackaxes, "s");
286  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");
287  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");
288  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");
289  }
290  fHistos->CreateTHnSparse("hEventTriggers", "Trigger type per event", 5, triggeraxis);
291  fHistos->CreateTHnSparse("hEventsTriggerbit", "Trigger bits for the different events", 4, bitaxes);
293  if(fListTrackCuts && fListTrackCuts->GetEntries()){
294  TIter cutIter(fListTrackCuts);
295  AliEmcalTrackSelection *cutObject(NULL);
296  while((cutObject = dynamic_cast<AliEmcalTrackSelection *>(cutIter()))){
297  AliESDtrackCuts *cuts = dynamic_cast<AliESDtrackCuts *>(cutObject->GetTrackCuts(0));
298  if(cuts){
299  cuts->DefineHistograms();
300  fOutput->Add(cuts);
301  }
302  }
303  }
304  PostData(1, fOutput);
305  }
306 
313  // Common checks: Have SPD vertex and primary vertex from tracks, and both need to have at least one contributor
314  AliDebug(1,Form("Number of calibrated clusters: %d", fCaloClusters->GetEntries()));
315  AliDebug(1,Form("Number of matched tracks: %d", fTracks->GetEntries()));
316  if(fMCEvent){
317  // Build always trigger strig from the trigger maker in case of MC
319  }
320 
321  Bool_t emcalGood = fInputHandler->IsEventSelected() & AliEmcalPhysicsSelection::kEmcalOk;
322 
323  // Loop over trigger patches, fill patch energy
324  AliEMCALTriggerPatchInfo *triggerpatch(NULL);
325  TIter patchIter(this->fTriggerPatchInfo);
326  while((triggerpatch = dynamic_cast<AliEMCALTriggerPatchInfo *>(patchIter()))){
327  double triggerpatchinfo[5] = {triggerpatch->GetPatchE(), triggerpatch->GetEtaGeo(), triggerpatch->GetPhiGeo(), triggerpatch->IsMainTrigger() ? 1. : 0., emcalGood ? 1. : 0.};
328  double triggerpatchinfoamp[5] = {static_cast<double>(triggerpatch->GetADCAmp()), triggerpatch->GetEtaGeo(), triggerpatch->GetPhiGeo(), triggerpatch->IsMainTrigger() ? 1. : 0., emcalGood ? 1. : 0.};
329  double triggerpatchinfoer[5] = {triggerpatch->GetADCAmpGeVRough(), triggerpatch->GetEtaGeo(), triggerpatch->GetPhiGeo(), triggerpatch->IsMainTrigger() ? 1. : 0., emcalGood ? 1. : 0.};
330  if(triggerpatch->IsJetHigh()){
331  fHistos->FillTHnSparse("EnergyJetHigh", triggerpatchinfo);
332  fHistos->FillTHnSparse("AmplitudeJetHigh", triggerpatchinfoamp);
333  fHistos->FillTHnSparse("EnergyRoughJetHigh", triggerpatchinfoer);
334  }
335  if(triggerpatch->IsJetLow()){
336  fHistos->FillTHnSparse("EnergyJetLow", triggerpatchinfo);
337  fHistos->FillTHnSparse("AmplitudeJetLow", triggerpatchinfoamp);
338  fHistos->FillTHnSparse("EnergyRoughJetLow", triggerpatchinfoer);
339  }
340  if(triggerpatch->IsGammaHigh()){
341  fHistos->FillTHnSparse("EnergyGammaHigh", triggerpatchinfo);
342  fHistos->FillTHnSparse("AmplitudeGammaHigh", triggerpatchinfoamp);
343  fHistos->FillTHnSparse("EnergyRoughGammaHigh", triggerpatchinfoer);
344  }
345  if(triggerpatch->IsGammaLow()){
346  fHistos->FillTHnSparse("EnergyGammaLow", triggerpatchinfo);
347  fHistos->FillTHnSparse("AmplitudeGammaLow", triggerpatchinfoamp);
348  fHistos->FillTHnSparse("EnergyRoughGammaLow", triggerpatchinfoer);
349  }
350  if(triggerpatch->IsLevel0()){
351  fHistos->FillTHnSparse("EnergyLevel0", triggerpatchinfo);
352  fHistos->FillTHnSparse("AmplitudeLevel0", triggerpatchinfoamp);
353  fHistos->FillTHnSparse("EnergyRoughLevel0", triggerpatchinfoer);
354  }
355  }
356 
357  const AliVVertex *vtxTracks = fInputEvent->GetPrimaryVertex(),
358  *vtxSPD = GetSPDVertex();
359  if(!(vtxTracks && vtxSPD)) return false;
360  if(!fVertexRange.IsInRange(vtxTracks->GetZ())) return false;
361  if(vtxTracks->GetNContributors() < 1 || vtxSPD->GetNContributors() < 1) return false;
362 
363  double triggers[5]; memset(triggers, 0, sizeof(double) * 5);
364  double triggerbits[4]; memset(triggerbits, 0, sizeof(double) * 4);
365  if(fInputHandler->IsEventSelected() & AliVEvent::kINT7){
366  triggers[0] = 1.;
367  triggerbits[0] = 1.;
368  }
369 
370  // check triggerbits
371  if(fInputHandler->IsEventSelected() & AliVEvent::kEMC7){
372  triggerbits[1] = 1.;
373  }
374  if(fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA){
375  triggerbits[2] = 1.;
376  }
377  if(fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE){
378  triggerbits[3] = 1.;
379  }
380  fHistos->FillTHnSparse("hEventsTriggerbit", triggerbits);
381 
382  std::vector<std::string> triggerstrings;
383  // EMCal-triggered event, distinguish types
384  TString trgstr(fUseTriggersFromTriggerMaker ? BuildTriggerString() : fInputEvent->GetFiredTriggerClasses());
385  AliDebug(1, Form("Triggerstring: %s\n", trgstr.Data()));
386  if(trgstr.Contains("EJ1")){
387  triggerstrings.push_back("EMCJHigh");
388  triggers[1] = 1;
389  if(trgstr.Contains("EG1"))
390  triggerstrings.push_back("EMCHighBoth");
391  else
392  triggerstrings.push_back("EMCHighJetOnly");
393  }
394  if(trgstr.Contains("EJ2")){
395  triggerstrings.push_back("EMCJLow");
396  triggers[2] = 1;
397  if(trgstr.Contains("EG2"))
398  triggerstrings.push_back("EMCLowBoth");
399  else
400  triggerstrings.push_back("EMCLowJetOnly");
401  }
402  if(trgstr.Contains("EG1")){
403  triggerstrings.push_back("EMCGHigh");
404  triggers[3] = 1;
405  if(!trgstr.Contains("EJ1"))
406  triggerstrings.push_back("EMCHighGammaOnly");
407  }
408  if(trgstr.Contains("EG2")){
409  triggerstrings.push_back("EMCGLow");
410  triggers[4] = 1;
411  if(!trgstr.Contains("EJ2"))
412  triggerstrings.push_back("EMCLowGammaOnly");
413  }
414 
415  fHistos->FillTHnSparse("hEventTriggers", triggers);
416 
417  // apply event selection: Combine the Pileup cut from SPD with the other pA Vertex selection cuts.
418  bool isPileupEvent = fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.);
419  isPileupEvent = isPileupEvent || (TMath::Abs(vtxTracks->GetZ() - vtxSPD->GetZ()) > 0.5);
420  double covSPD[6]; vtxSPD->GetCovarianceMatrix(covSPD);
421  isPileupEvent = isPileupEvent || (vtxSPD->IsFromVertexerZ() && TMath::Sqrt(covSPD[5]) > 0.25); // selection effectively inactive in old versions of the code
422 
423  // Fill event-based histogram
424  const double &zv = vtxTracks->GetZ();
425  if(triggers[0]) FillEventHist("MinBias", zv, isPileupEvent);
426  if(!triggerstrings.size()) // Non-EMCal-triggered
427  FillEventHist("NoEMCal", zv, isPileupEvent);
428  else{
429  // EMCal-triggered events
430  for(std::vector<std::string>::iterator it = triggerstrings.begin(); it != triggerstrings.end(); ++it)
431  FillEventHist(it->c_str(), zv, isPileupEvent);
432  }
433 
434  const AliEmcalJet *foundJet(NULL);
435  char histname[1024];
436  std::vector<double> coneradii;
437  AliJetContainer *jetContMC(NULL), *jetContData(NULL);
438 
439  // Fill MC truth
440  AliVParticle *part(NULL);
441  if(fMCEvent){
442  if(fJetCollArray.GetEntries() &&
443  (jetContMC = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject((static_cast<TObjString *>(fJetContainersMC.At(0)))->String().Data())))){
444  // In case we have a jet array we loop over all MC selected particles in the particle container of the jet array
445  TIter particles(jetContMC->GetParticleContainer()->GetArray());
446  while((part = dynamic_cast<AliVParticle *>(particles()))){
447  if(part->Charge() == 0) continue;
448  if(!fEtaRange.IsInRange(part->Eta())) continue;
449  if(!fPtRange.IsInRange(part->Pt())) continue;
450  FillMCParticleHist("hMCtrueParticles", part, zv, isPileupEvent);
451 
452  /*
453  * Jet part: Find track in jet container,
454  * check according to number of particles in jet, and
455  * check for different cone radii
456  */
457  foundJet = FoundTrackInJet(part, jetContMC);
458  if(foundJet && foundJet->GetNumberOfConstituents() > 1){
459  for(int irad = 0; irad < kNJetRadii; irad++){
460  if(IsInRadius(part, foundJet, kJetRadii[irad])){
461  sprintf(histname, "hMCtrueParticlesRad%02d", int(kJetRadii[irad]*10));
462  FillMCParticleHist(histname, part, zv, isPileupEvent);
463  }
464  }
465  } else {
466  // isolated track
467  FillMCParticleHist("hMCtrueParticlesIsolated", part, zv, isPileupEvent);
468  }
469  }
470  } else {
471  // Use MC Event
472  for(int ipart = 0; ipart < fMCEvent->GetNumberOfTracks(); ipart++){
473  // Select only physical primary particles
474  part = fMCEvent->GetTrack(ipart);
475  if(part->Charge() == 0) continue;
476  if(!fEtaRange.IsInRange(part->Eta())) continue;
477  if(!fPtRange.IsInRange(part->Pt())) continue;
478  if(!fMCEvent->IsPhysicalPrimary(ipart)) continue;
479  FillMCParticleHist("hMCtrueParticles", part, zv, isPileupEvent);
480  }
481  }
482  }
483 
484  AliVTrack *track(NULL);
485  AliPicoTrack *picoTrack(NULL);
486  TObject *containerObject(NULL);
487  // Loop over all tracks (No cuts applied)
488  if(fSelectAllTracks){
489  // loop over all tracks only if requested
490  TIter allTrackIter(fTracks);
491  while((containerObject = dynamic_cast<TObject *>(allTrackIter()))){
492  if((picoTrack = dynamic_cast<AliPicoTrack *>(containerObject))){
493  track = picoTrack->GetTrack();
494  } else
495  track = dynamic_cast<AliVTrack *>(containerObject);
496  if(!IsTrueTrack(track)) continue;
497  if(!fEtaRange.IsInRange(track->Eta())) continue;
498  if(!fPtRange.IsInRange(track->Pt())) continue;
499  if(triggers[0]) FillTrackHist("MinBias", track, zv, isPileupEvent, 0, triggers[0]);
500  if(!triggerstrings.size()) // Non-EMCal-triggered
501  FillTrackHist("NoEMCal", track, zv, isPileupEvent, 0, triggers[0]);
502  else {
503  // EMCal-triggered events
504  for(std::vector<std::string>::iterator it = triggerstrings.begin(); it != triggerstrings.end(); ++it)
505  FillTrackHist(it->c_str(), track, zv, isPileupEvent, 0, triggers[0]);
506  }
507  }
508  }
509 
510  // Now apply track selection cuts
511  // allow for several track selections to be tested at the same time
512  // each track selection gets a different cut ID starting from 1
513  // cut ID 0 is reserved for the case of no cuts
514  // In case we have a jet container attached we check whether the track is
515  // found in a jet, and check for different cone radii around a jet
516  if(fListTrackCuts && fListTrackCuts->GetEntries()){
517  for(int icut = 0; icut < fListTrackCuts->GetEntries(); icut++){
518  AliEmcalTrackSelection *trackSelection = static_cast<AliEmcalTrackSelection *>(fListTrackCuts->At(icut));
519  TIter trackIter(trackSelection->GetAcceptedTracks(fTracks));
520  while((track = dynamic_cast<AliVTrack *>(trackIter()))){
521  if(fMCEvent && !IsTrueTrack(track)) continue; // Reject fake tracks in case of MC
522  if(!fEtaRange.IsInRange(track->Eta())) continue;
523  if(!fPtRange.IsInRange(track->Pt())) continue;
524  coneradii.clear();
525  if(this->fJetCollArray.GetEntries() &&
526  (jetContData = dynamic_cast<AliJetContainer *>(this->fJetCollArray.FindObject((static_cast<TObjString *>(this->fJetContainersData.At(0)))->String().Data())))){
527  foundJet = FoundTrackInJet(track, jetContData);
528  if(foundJet){
529  for(int irad = 0; irad < kNJetRadii; irad++){
530  if(IsInRadius(track, foundJet, kJetRadii[irad])) coneradii.push_back(kJetRadii[irad]);
531  }
532  }
533  }
534  if(triggers[0]){
535  FillTrackHist("MinBias", track, zv, isPileupEvent, icut + 1, triggers[0]);
536  if(coneradii.size()){
537  for(std::vector<double>::iterator radIter = coneradii.begin(); radIter != coneradii.end(); radIter++)
538  FillTrackHist("MinBias", track, zv, isPileupEvent, icut + 1, triggers[0], *radIter);
539  }
540  }
541  if(!triggerstrings.size()){ // Non-EMCal-triggered
542  FillTrackHist("NoEMCal", track, zv, isPileupEvent, icut + 1, triggers[0]);
543  for(std::vector<double>::iterator radIter = coneradii.begin(); radIter != coneradii.end(); radIter++)
544  FillTrackHist("NoEMCal", track, zv, isPileupEvent, icut + 1, triggers[0], *radIter);
545  } else {
546  // EMCal-triggered events
547  for(std::vector<std::string>::iterator it = triggerstrings.begin(); it != triggerstrings.end(); ++it){
548  FillTrackHist(it->c_str(), track, zv, isPileupEvent, icut + 1, triggers[0]);
549  for(std::vector<double>::iterator radIter = coneradii.begin(); radIter != coneradii.end(); radIter++)
550  FillTrackHist(it->c_str(), track, zv, isPileupEvent, icut + 1, triggers[0], *radIter);
551  }
552  }
553  }
554  }
555  }
556 
557  // Next step we loop over the (uncalibrated) emcal clusters and fill histograms with the cluster energy
558  const AliVCluster *clust(NULL);
559  for(int icl = 0; icl < fInputEvent->GetNumberOfCaloClusters(); icl++){
560  clust = fInputEvent->GetCaloCluster(icl);
561  if(!clust->IsEMCAL()) continue;
562  if(!fEnergyRange.IsInRange(clust->E())) continue;
563  if(triggers[0]) FillClusterHist("hClusterUncalibHistMinBias", clust, zv, isPileupEvent, triggers[0]);
564  if(!triggerstrings.size()){ // Non-EMCal-triggered
565  FillClusterHist("hClusterUncalibHistNoEMCal", clust, zv, isPileupEvent, triggers[0]);
566  } else{
567  for(std::vector<std::string>::iterator it = triggerstrings.begin(); it != triggerstrings.end(); ++it){
568  sprintf(histname, "hClusterUncalibHist%s", it->c_str());
569  FillClusterHist(histname, clust, zv, isPileupEvent, triggers[0]);
570  }
571  }
572  }
573 
574  if(fCaloClusters){
575  TIter clustIter(fCaloClusters);
576  while((clust = dynamic_cast<const AliVCluster *>(clustIter()))){
577  if(!clust->IsEMCAL()) continue;
578  if(!fEnergyRange.IsInRange(clust->E())) continue;
579  if(triggers[0]) FillClusterHist("hClusterCalibHistMinBias", clust, zv, isPileupEvent, triggers[0]);
580  if(!triggerstrings.size()) // Non-EMCal-triggered
581  FillClusterHist("hClusterCalibHistNoEMCal", clust, zv, isPileupEvent, triggers[0]);
582  else{
583  for(std::vector<std::string>::iterator it = triggerstrings.begin(); it != triggerstrings.end(); ++it){
584  sprintf(histname, "hClusterCalibHist%s", it->c_str());
585  FillClusterHist(histname, clust, zv, isPileupEvent, triggers[0]);
586  }
587  }
588  }
589  }
590 
591  PostData(1, fOutput);
592  return true;
593  }
594 
601  std::vector<double> mybinning;
602  std::map<double,double> definitions;
603  definitions.insert(std::pair<double,double>(2.5, 0.1));
604  definitions.insert(std::pair<double,double>(7., 0.25));
605  definitions.insert(std::pair<double,double>(15., 0.5));
606  definitions.insert(std::pair<double,double>(25., 1.));
607  definitions.insert(std::pair<double,double>(40., 2.5));
608  definitions.insert(std::pair<double,double>(50., 5.));
609  definitions.insert(std::pair<double,double>(100., 10.));
610  double currentval = 0;
611  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
612  double limit = id->first, binwidth = id->second;
613  while(currentval < limit){
614  currentval += binwidth;
615  mybinning.push_back(currentval);
616  }
617  }
618  binning.Set(mybinning.size());
619  int ib = 0;
620  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
621  binning[ib++] = *it;
622  }
623 
630  std::vector<double> mybinning;
631  double currentval = -10;
632  mybinning.push_back(currentval);
633  while(currentval <= 10.){
634  currentval += 5.;
635  mybinning.push_back(currentval);
636  }
637  binning.Set(mybinning.size());
638  int ib = 0;
639  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
640  binning[ib++] = *it;
641  }
642 
649  std::vector<double> mybinning;
650  double currentval = -0.8;
651  mybinning.push_back(currentval);
652  while(currentval <= 0.8){
653  currentval += 0.1;
654  mybinning.push_back(currentval);
655  }
656  binning.Set(mybinning.size());
657  int ib = 0;
658  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
659  binning[ib++] = *it;
660  }
661 
671  void AliAnalysisTaskPtEMCalTrigger::DefineAxis(TAxis& axis, const char* name,
672  const char* title, const TArrayD& binning, const char** labels) {
673  axis.Set(binning.GetSize()-1, binning.GetArray());
674  axis.SetName(name);
675  axis.SetTitle(title);
676  if(labels){
677  for(int ib = 1; ib <= axis.GetNbins(); ++ib)
678  axis.SetBinLabel(ib, labels[ib-1]);
679  }
680  }
681 
693  void AliAnalysisTaskPtEMCalTrigger::DefineAxis(TAxis& axis, const char* name,
694  const char* title, int nbins, double min, double max,
695  const char** labels) {
696  axis.Set(nbins, min, max);
697  axis.SetName(name);
698  axis.SetTitle(title);
699  if(labels){
700  for(int ib = 1; ib <= axis.GetNbins(); ++ib)
701  axis.SetBinLabel(ib, labels[ib-1]);
702  }
703  }
704 
713  double vz, bool isPileup) {
714  char histname[1024];
715  sprintf(histname, "hEventHist%s", trigger);
716  fHistos->FillTH2(histname, 0., vz);
717  if(!isPileup){
718  fHistos->FillTH2(histname, 1., vz);
719  }
720  }
721 
732  const AliVTrack* track, double vz, bool isPileup, int cut, bool isMinBias, double jetradius) {
733  double etasign = fSwapEta ? -1. : 1.;
734  double data[7] = {TMath::Abs(track->Pt()), etasign * track->Eta(), track->Phi(), vz, 0, static_cast<double>(cut), isMinBias ? 1. : 0.};
735  double dataMC[7] = {0., 0., 0., vz, 0, static_cast<double>(cut), isMinBias ? 1. : 0.};
736  AliVParticle *assocMC(NULL);
737  if(fMCEvent && (assocMC = fMCEvent->GetTrack(TMath::Abs(track->GetLabel())))){
738  // Select track onl
739  dataMC[0] = TMath::Abs(assocMC->Pt());
740  dataMC[1] = etasign * assocMC->Eta();
741  dataMC[2] = assocMC->Phi();
742  }
743  char histname[1024], histnameAcc[1024], histnameMC[1024], histnameMCAcc[1024];
744  sprintf(histname, "hTrackHist%s", trigger);
745  sprintf(histnameAcc, "hTrackInAcceptanceHist%s", trigger);
746  sprintf(histnameMC, "hMCTrackHist%s", trigger);
747  sprintf(histnameMCAcc, "hMCTrackInAcceptanceHist%s", trigger);
748  if(jetradius > 0.){
749  char *hnames[] = {histname, histnameAcc, histnameMC, histnameMCAcc};
750  for(unsigned int iname = 0; iname < sizeof(hnames)/sizeof(char *); iname++){
751  char *myhname = hnames[iname];
752  sprintf(myhname, "%sRad%02d", myhname, int(jetradius * 10.));
753  }
754  }
755  Bool_t isEMCAL = kFALSE;
756  if(track->IsEMCAL()){
757  // Check if the cluster is matched to only one track
758  AliVCluster *emcclust(NULL);
759  AliDebug(2, Form("cluster id: %d\n", track->GetEMCALcluster()));
760  if(fCaloClusters) {
761  AliDebug(2, "Using calibrated clusters");
762  emcclust = dynamic_cast<AliVCluster *>(fCaloClusters->At(track->GetEMCALcluster()));
763  } else {
764  AliDebug(2, "Using uncalibrated clusters");
765  emcclust = fInputEvent->GetCaloCluster(track->GetEMCALcluster());
766  }
767  if(!emcclust) AliError("Null pointer to EMCal cluster");
768  if(emcclust && emcclust->GetNTracksMatched() <= 1){
769  isEMCAL = kTRUE;
770  }
771  }
772  fHistos->FillTHnSparse(histname, data);
773  if(fMCEvent) fHistos->FillTHnSparse(histnameMC, dataMC);
774  if(isEMCAL){
775  fHistos->FillTHnSparse(histnameAcc, data);
776  if(fMCEvent) fHistos->FillTHnSparse(histnameMCAcc, dataMC);
777  }
778  if(!isPileup){
779  data[4] = 1;
780  dataMC[4] = 1;
781  fHistos->FillTHnSparse(histname, data);
782  if(fMCEvent) fHistos->FillTHnSparse(histnameMC, dataMC);
783  if(isEMCAL){
784  fHistos->FillTHnSparse(histnameAcc, data);
785  if(fMCEvent) fHistos->FillTHnSparse(histnameMCAcc, dataMC);
786  }
787  }
788  }
789 
799  const AliVCluster* clust, double vz, bool isPileup, bool isMinBias) {
800  double data[4] = {clust->E(), vz, 0, isMinBias ? 1. : 0.};
801  fHistos->FillTHnSparse(histname, data);
802  if(!isPileup){
803  data[2] = 1.;
804  fHistos->FillTHnSparse(histname, data);
805  }
806  }
807 
813  void AliAnalysisTaskPtEMCalTrigger::FillMCParticleHist(const char *histname, const AliVParticle * const track, double vz, bool isPileup){
814  double data[5] = {TMath::Abs(track->Pt()), track->Eta(), track->Phi(), vz, 0.};
815  fHistos->FillTHnSparse(histname, data);
816  if(!isPileup){
817  data[4] = 1.;
818  fHistos->FillTHnSparse(histname, data);
819  }
820  }
821 
829  bool AliAnalysisTaskPtEMCalTrigger::IsTrueTrack(const AliVTrack *const track) const{
830  if(!fMCEvent) return true;
831  AliVParticle *mcassociate = fMCEvent->GetTrack(TMath::Abs(track->GetLabel()));
832  if(!mcassociate) return false;
833  return fMCEvent->IsPhysicalPrimary(TMath::Abs(track->GetLabel()));
834  }
835 
841  void AliAnalysisTaskPtEMCalTrigger::AddESDTrackCuts(AliESDtrackCuts* trackCuts) {
842  fListTrackCuts->AddLast(new AliEmcalTrackSelectionESD(trackCuts));
843  }
844 
850  void AliAnalysisTaskPtEMCalTrigger::AddCutsForAOD(AliESDtrackCuts* trackCuts, UInt_t filterbits) {
851  fListTrackCuts->AddLast(new AliEmcalTrackSelectionAOD(trackCuts, filterbits));
852  }
853 
854 
861  AliDebug(1, "trigger checking");
862  TString result = "";
863  if(HasTriggerType(kJ1)) result += "EJ1 ";
864  if(HasTriggerType(kJ2)) result += "EJ2 ";
865  if(HasTriggerType(kG1)) result += "EG1 ";
866  if(HasTriggerType(kG2)) result += "EG2 ";
867  return result;
868  }
869 
876  AliESDEvent *esd = dynamic_cast<AliESDEvent *>(fInputEvent);
877  if(esd){
878  return esd->GetPrimaryVertexSPD();
879  } else {
880  AliAODEvent *aod = dynamic_cast<AliAODEvent *>(fInputEvent);
881  if(aod){
882  return aod->GetPrimaryVertexSPD();
883  }
884  }
885  return NULL;
886  }
887 
896  const AliVParticle * const track, AliJetContainer *const jets) const
897  {
898 
899  const AliEmcalJet *result = NULL;
900  jets->ResetCurrentID();
901  const AliEmcalJet *tmp = jets->GetNextAcceptJet();
902  while(tmp){
903  if(TrackInJet(track, tmp, jets->GetParticleContainer())){
904  result = tmp;
905  break;
906  }
907  tmp = jets->GetNextAcceptJet();
908  }
909  return result;
910  }
911 
920  bool AliAnalysisTaskPtEMCalTrigger::IsInRadius(const AliVParticle *const track, const AliEmcalJet *reconstructedJet, Double_t radius) const {
921  return reconstructedJet->DeltaR(track) < radius;
922  }
923 
932  bool AliAnalysisTaskPtEMCalTrigger::IsInRadius(const AliVCluster *const clust, const AliEmcalJet *reconstructedJet, Double_t radius) const {
933  double vertexPos[3];
934  fInputEvent->GetPrimaryVertex()->GetXYZ(vertexPos);
935  TLorentzVector clustVect;
936  clust->GetMomentum(clustVect, vertexPos);
937 
938  Double_t dPhi = reconstructedJet->Phi() - clustVect.Phi();
939  Double_t dEta = reconstructedJet->Eta() - clustVect.Eta();
940  dPhi = TVector2::Phi_mpi_pi ( dPhi );
941 
942  double deltaR = TMath::Sqrt ( dPhi * dPhi + dEta * dEta );
943  return deltaR < radius;
944  }
945 
954  bool AliAnalysisTaskPtEMCalTrigger::TrackInJet(const AliVParticle* const track,
955  const AliEmcalJet* reconstructedJet, const AliParticleContainer * const particles) const {
956  bool found = false;
957  const AliPicoTrack *picotmp(NULL);
958  const AliVParticle *tmp(NULL);
959  for(int ipart = 0; ipart < reconstructedJet->GetNumberOfTracks(); ipart++){
960  tmp = dynamic_cast<const AliVParticle *>(reconstructedJet->TrackAt(ipart, particles->GetArray()));
961  if((picotmp = dynamic_cast<const AliPicoTrack *>(tmp))) // handle pico tracks
962  tmp = picotmp->GetTrack();
963  if(!tmp->Compare(track)){
964  found = true;
965  break;
966  }
967  }
968  return found;
969  }
970 
978  const AliEmcalJet* AliAnalysisTaskPtEMCalTrigger::FoundClusterInJet(const AliVCluster* const clust, AliJetContainer* const jets) const {
979 
980  const AliEmcalJet *result = NULL;
981  jets->ResetCurrentID();
982  const AliEmcalJet *tmp = jets->GetNextAcceptJet();
983  while(tmp){
984  if(ClusterInJet(clust, tmp, jets->GetClusterContainer())){
985  result = tmp;
986  break;
987  }
988  tmp =jets->GetNextAcceptJet();
989  }
990  return result;
991  }
992 
1001  bool AliAnalysisTaskPtEMCalTrigger::ClusterInJet(const AliVCluster* const clust,
1002  const AliEmcalJet* reconstructedJet, const AliClusterContainer* const clusters) const {
1003  bool found = false;
1004  const AliVCluster *tmp(NULL);
1005  for(int ipart = 0; ipart < reconstructedJet->GetNumberOfTracks(); ipart++){
1006  tmp = dynamic_cast<const AliVCluster *>(reconstructedJet->ClusterAt(ipart, clusters->GetArray()));
1007  if(!tmp->Compare(clust)){
1008  found = true;
1009  break;
1010  }
1011  }
1012  return found;
1013  }
1014 
1022  TList &mycontainer = isMC ? fJetContainersMC : fJetContainersData;
1023  mycontainer.Add(new TObjString(contname));
1024  }
1025 }
Interface for virtual track selection.
double Double_t
Definition: External.C:58
EMCAL Level1 gamma trigger, low threshold.
const char * title
Definition: MakeQAPdf.C:26
AliCutValueRange< double > fEnergyRange
Cluster energy selection range.
EMCAL Level1 jet trigger, low threshold.
Bool_t HasTriggerType(TriggerType triggersel)
Double_t Eta() const
Definition: AliEmcalJet.h:108
Double_t Phi() const
Definition: AliEmcalJet.h:104
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
void FillTrackHist(const char *trigger, const AliVTrack *track, double vz, bool isPileup, int cut, bool isMinBias, double jetradius=-1.)
char Char_t
Definition: External.C:18
AliClusterContainer * GetClusterContainer() const
const AliEmcalJet * FoundClusterInJet(const AliVCluster *const clust, AliJetContainer *const jets) const
void AddCutsForAOD(AliESDtrackCuts *trackCuts, UInt_t filterBits)
THistManager * fHistos
Histogram container for the task.
void FillEventHist(const char *trigger, double vz, bool isPileup)
bool IsInRadius(const AliVParticle *const track, const AliEmcalJet *reconstructedJet, Double_t radius) const
UShort_t GetNumberOfConstituents() const
Definition: AliEmcalJet.h:127
Container for particles within the EMCAL framework.
void SetCaloTriggerPatchInfoName(const char *n)
void AddJetContainerName(const Char_t *contname, Bool_t isMC=kFALSE)
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:126
AliParticleContainer * GetParticleContainer() const
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
TClonesArray * fCaloClusters
!clusters
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Short_t ClusterAt(Int_t idx) const
Definition: AliEmcalJet.h:124
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
THashList * GetListOfHistograms() const
Definition: THistManager.h:504
void FillClusterHist(const char *trigger, const AliVCluster *clust, double vz, bool isPileup, bool isMinBias)
void ReleaseOwner()
Definition: THistManager.h:180
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.
void FillMCParticleHist(const char *histname, const AliVParticle *const part, double vz, bool isPileup)
AliVCuts * GetTrackCuts(Int_t icut)
const AliEmcalJet * FoundTrackInJet(const AliVParticle *const track, AliJetContainer *const jets) const
EMCAL Level1 jet trigger, high threshold.
const Double_t jetRadVals[AliAnalysisTaskPtEMCalTrigger::kNJetRadii]
Implement virtual track selection for AOD analysis.
AliEmcalJet * GetNextAcceptJet()
TObjArray fJetCollArray
jet collection array
Double_t DeltaR(const AliVParticle *part) const
AliVTrack * GetTrack() const
Definition: AliPicoTrack.h:59
Bool_t isMC
TObjArray * GetAcceptedTracks(const TClonesArray *const tracks)
AliEmcalList * fOutput
!output list
AliCutValueRange< double > fPtRange
Pt Selection Range.
TClonesArray * fTracks
!tracks
Short_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:147
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
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
void SetMakeGeneralHistograms(Bool_t g)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
Container class for histograms.
Definition: THistManager.h:43
AliCutValueRange< double > fEtaRange
Eta Selection Range.
Bool_t fUseTriggersFromTriggerMaker
Use trigger classes from trigger maker.
EMCAL Level1 gamma trigger, high threshold.
const Int_t nbins
bool Bool_t
Definition: External.C:53
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Implementation of virtual track selection for ESDs.
Container structure for EMCAL clusters.
Container for jet within the EMCAL jet framework.