AliPhysics  7b9e818 (7b9e818)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetHMEC.cxx
Go to the documentation of this file.
1 //Measure Jet-hadron correlations
3 //Does event Mixing using AliEventPoolManager
5 
7 
8 #include <TH1F.h>
9 #include <TH2F.h>
10 #include <TH3F.h>
11 #include <THnSparse.h>
12 #include <TVector3.h>
13 #include <TFile.h>
14 
15 #include "AliAnalysisManager.h"
16 #include "AliInputEventHandler.h"
17 #include "AliEventPoolManager.h"
18 #include "AliBasicParticle.h"
19 #include "AliVTrack.h"
20 #include "AliEmcalJet.h"
21 #include "AliTLorentzVector.h"
22 #include "AliLog.h"
23 
24 #include "AliClusterContainer.h"
25 #include "AliTrackContainer.h"
26 
28 
29 //________________________________________________________________________
32  fTrackBias(5),
33  fClusterBias(5),
34  fDoEventMixing(kFALSE),
35  fNMixingTracks(50000), fMinNTracksMixedEvents(5000), fMinNEventsMixedEvents(5), fNCentBinsMixedEvent(10),
36  fPoolMgr(0),
37  fTriggerType(AliVEvent::kEMCEJE), fMixingEventType(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral),
38  fDoEffCorrection(0), fEffFunctionCorrection(0),
39  fEmbeddingCorrectionHist(0),
40  fDoLessSparseAxes(0), fDoWiderTrackBin(0),
41  fHistTrackPt(0),
42  fHistJetEtaPhi(0),
43  fHistJHPsi(0),
44  fHistJetHEtaPhi(0),
45  fhnMixedEvents(0),
46  fhnJH(0)
47 {
48  // Default Constructor
49  InitializeArraysToZero();
50 }
51 
52 //________________________________________________________________________
54  AliAnalysisTaskEmcalJet(name, kTRUE),
55  fTrackBias(5),
56  fClusterBias(5),
57  fDoEventMixing(kFALSE),
58  fNMixingTracks(50000), fMinNTracksMixedEvents(5000), fMinNEventsMixedEvents(5), fNCentBinsMixedEvent(10),
59  fPoolMgr(0),
60  fTriggerType(AliVEvent::kEMCEJE), fMixingEventType(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral),
61  fDoEffCorrection(0), fEffFunctionCorrection(0),
62  fEmbeddingCorrectionHist(0),
63  fDoLessSparseAxes(0), fDoWiderTrackBin(0),
64  fHistTrackPt(0),
65  fHistJetEtaPhi(0),
66  fHistJHPsi(0),
67  fHistJetHEtaPhi(0),
68  fhnMixedEvents(0),
69  fhnJH(0)
70 {
71  // Constructor
73 }
74 
75 //________________________________________________________________________
77 {
78  for(Int_t trackPtBin = 0; trackPtBin < kMaxTrackPtBins; trackPtBin++){
79  fHistTrackEtaPhi[trackPtBin]=0;
80  }
81  for(Int_t centralityBin = 0; centralityBin < kMaxCentralityBins; ++centralityBin){
82  fHistJetPt[centralityBin]=0;
83  fHistJetPtBias[centralityBin]=0;
84  for(Int_t jetPtBin = 0; jetPtBin < kMaxJetPtBins; ++jetPtBin){
85  for(Int_t etaBin = 0; etaBin < kMaxEtaBins; ++etaBin){
86  fHistJetH[centralityBin][jetPtBin][etaBin]=0;
87  fHistJetHBias[centralityBin][jetPtBin][etaBin]=0;
88  }
89  }
90  }
91 }
92 
93 //________________________________________________________________________
95  // Called once
97  OpenFile(1);
98 
99  // Create histograms
100  fHistTrackPt = new TH1F("fHistTrackPt", "P_{T} distribution", 1000, 0.0, 100.0);
101  fHistJetEtaPhi = new TH2F("fHistJetEtaPhi","Jet eta-phi",900,-1.8,1.8,720,-3.2,3.2);
102  fHistJetHEtaPhi = new TH2F("fHistJetHEtaPhi","Jet-Hadron deta-dphi",900,-1.8,1.8,720,-1.6,4.8);
103 
104  fHistJHPsi = new TH3F("fHistJHPsi","Jet-Hadron ntr-trpt-dpsi",20,0,100,200,0,20,120,0,180);
105 
106  fOutput->Add(fHistTrackPt);
107  fOutput->Add(fHistJetEtaPhi);
108  fOutput->Add(fHistJetHEtaPhi);
109  fOutput->Add(fHistJHPsi);
110 
111  TString name;
112 
113  for(Int_t trackPtBin = 0; trackPtBin < kMaxTrackPtBins; ++trackPtBin){
114  name = Form("fHistTrackEtaPhi_%i", trackPtBin);
115  fHistTrackEtaPhi[trackPtBin] = new TH2F(name,name,400,-1,1,720,0.0,2.0*TMath::Pi());
116  fOutput->Add(fHistTrackEtaPhi[trackPtBin]);
117  }
118 
119  for(Int_t centralityBin = 0; centralityBin < kMaxCentralityBins; ++centralityBin){
120  name = Form("fHistJetPt_%i",centralityBin);
121  fHistJetPt[centralityBin] = new TH1F(name,name,200,0,200);
122  fOutput->Add(fHistJetPt[centralityBin]);
123 
124  name = Form("fHistJetPtBias_%i",centralityBin);
125  fHistJetPtBias[centralityBin] = new TH1F(name,name,200,0,200);
126  fOutput->Add(fHistJetPtBias[centralityBin]);
127 
128  for(Int_t jetPtBin = 0; jetPtBin < kMaxJetPtBins; ++jetPtBin){
129  for(Int_t etaBin = 0; etaBin < kMaxEtaBins; ++etaBin){
130  name = Form("fHistJetH_%i_%i_%i",centralityBin,jetPtBin,etaBin);
131  fHistJetH[centralityBin][jetPtBin][etaBin]=new TH2F(name,name,72,-0.5*TMath::Pi(),1.5*TMath::Pi(),300,0,30);
132  fOutput->Add(fHistJetH[centralityBin][jetPtBin][etaBin]);
133 
134  name = Form("fHistJetHBias_%i_%i_%i",centralityBin,jetPtBin,etaBin);
135  fHistJetHBias[centralityBin][jetPtBin][etaBin]=new TH2F(name,name,72,-0.5*TMath::Pi(),1.5*TMath::Pi(),300,0,30);
136  fOutput->Add(fHistJetHBias[centralityBin][jetPtBin][etaBin]);
137  }
138  }
139  }
140 
141  UInt_t cifras = 0; // bit coded, see GetDimParams() below
142  if(fDoLessSparseAxes) {
143  cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5;
144  } else {
145  cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<7;
146  //cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7;
147  }
148  fhnJH = NewTHnSparseF("fhnJH", cifras);
149  fhnJH->Sumw2();
150  fOutput->Add(fhnJH);
151 
152  if(fDoEventMixing){
153  if(fDoLessSparseAxes) {
154  cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5;
155  } else {
156  cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<7;
157  //cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7;
158  }
159  fhnMixedEvents = NewTHnSparseF("fhnMixedEvents", cifras);
160  fhnMixedEvents->Sumw2();
161  fOutput->Add(fhnMixedEvents);
162  }
163 
164  PostData(1, fOutput);
165 
166  // Event Mixing
167  Int_t poolSize = 1000; // Maximum number of events, ignored in the present implemented of AliEventPoolManager
168  // ZVertex
169  Int_t nZVertexBins = 10;
170  Double_t* zVertexBins = GenerateFixedBinArray(nZVertexBins, -10, 10);
171  // Event activity (centrality of multiplicity)
172  Int_t nEventActivityBins = 8;
173  Double_t* eventActivityBins = 0;
174  // +1 to accomodate the fact that we define bins rather than array entries.
175  Double_t multiplicityBins[kMixedEventMulitplictyBins+1] = {0., 4., 9., 15., 25., 35., 55., 100., 500.};
176 
177  if (fForceBeamType != kpp ) { //all besides pp
178  // Event Activity is centrality in AA, pA
179  nEventActivityBins = fNCentBinsMixedEvent;
180  eventActivityBins = GenerateFixedBinArray(nEventActivityBins, 0, 100);
181  }
182  else if (fForceBeamType == kpp) { //for pp only
183  // Event Activity is multiplicity in pp
184  eventActivityBins = multiplicityBins;
185  }
186 
187  fPoolMgr = new AliEventPoolManager(poolSize, fNMixingTracks, nEventActivityBins, eventActivityBins, nZVertexBins, zVertexBins);
188 }
189 
190 //________________________________________________________________________
192  // Get eta bin for histos.
193 
194  Int_t etabin = -1;
195  eta = TMath::Abs(eta);
196  if (eta <= 0.4) etabin = 0;
197  else if (eta > 0.4 && eta < 0.8) etabin = 1;
198  else if (eta >= 0.8) etabin = 2;
199  return etabin;
200 }
201 
202 //________________________________________________________________________
204 {
205  Int_t ptBin = -1;
206  if (pt < 0.5) ptBin = 0;
207  else if (pt < 1 ) ptBin = 1;
208  else if (pt < 2 ) ptBin = 2;
209  else if (pt < 3 ) ptBin = 3;
210  else if (pt < 5 ) ptBin = 4;
211  else if (pt < 8 ) ptBin = 5;
212  else if (pt < 20 ) ptBin = 6;
213 
214  return ptBin;
215 }
216 
217 //________________________________________________________________________
219 {
220  // Get jet pt bin for histos.
221 
222  Int_t ptBin = -1;
223  if (pt >= 15 && pt < 20) ptBin = 0;
224  else if (pt >= 20 && pt < 25) ptBin = 1;
225  else if (pt >= 25 && pt < 30) ptBin = 2;
226  else if (pt >= 30 && pt < 60) ptBin = 3;
227  else if (pt >= 60) ptBin = 4;
228 
229  return ptBin;
230 }
231 
232 //________________________________________________________________________
235 }
236 
237 //________________________________________________________________________
239  // Main loop called for each event
240 
241  // Retrieve clusters
243  if (!clusters) {
244  AliError(Form("%s: Unable to retrieve clusters!", GetName()));
245  return kTRUE;
246  }
247 
248  // Retrieve tracks
249  AliTrackContainer * tracks = static_cast<AliTrackContainer * >(GetParticleContainer("tracksForCorrelations"));
250  if (!tracks) {
251  AliError(Form("%s: Unable to retrieve tracks!", GetName()));
252  return kTRUE;
253  }
254 
255  // Retrieve jets
256  AliJetContainer * jets = GetJetContainer(0);
257  if (!jets) {
258  AliError(Form("%s: Unable to retrieve jets!", GetName()));
259  return kTRUE;
260  }
261 
262 
263  // Used to calculate the angle betwene the jet and the hadron
264  TVector3 jetVector;
265  // Get z vertex
266  Double_t zVertex=fVertex[2];
267  // Flags
268  Bool_t biasedJet = kFALSE;
269  Bool_t leadJet = kFALSE;
270  // Relative angles and distances
271  Double_t deltaPhi = 0;
272  Double_t deltaEta = 0;
273  Double_t deltaR = 0;
274  // Event activity (centrality or multipilicity)
275  Double_t eventActivity = 0;
276  // Efficiency correction
277  Double_t efficiency = -999;
278  // Determining bins for histogram indices
279  Int_t jetPtBin = -1;
280  Int_t etaBin = -1;
281  // For comparison to the current jet
282  AliEmcalJet * leadingJet = jets->GetLeadingJet();
283  // For getting the proper properties of tracks
284  AliTLorentzVector track;
285 
286  // Determine the trigger for the current event
287  UInt_t eventTrigger = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
288 
289  for (auto jet : jets->accepted()) {
290  // Selects only events that we are interested in (ie triggered)
291  if (!(eventTrigger & fTriggerType)) continue;
292 
293  // Jet properties
294  // Determine if we have the lead jet
295  leadJet = kFALSE;
296  if (jet == leadingJet) leadJet = kTRUE;
297 
298  // Determine if the jet is biased
299  biasedJet = BiasedJet(jet);
300 
301  // Calculate vector
302  jetVector.SetXYZ(jet->Px(), jet->Py(), jet->Pz());
303 
304  // Fill jet properties
305  FillHist(fHistJetPt[fCentBin], jet->Pt());
306  if (biasedJet == kTRUE) {
307  FillHist(fHistJetPtBias[fCentBin], jet->Pt());
308  }
309 
310  fHistJetEtaPhi->Fill(jet->Eta(), jet->Phi());
311 
312  if (jet->Pt() > 15) {
313 
314  for (auto trackIter : tracks->accepted_momentum()) {
315 
316  // Get proper track proeprties
317  track.Clear();
318  track = trackIter.first;
319 
320  // Determine relative angles and distances and set the respective variables
321  GetDeltaEtaDeltaPhiDeltaR(track, jet, deltaEta, deltaPhi, deltaR);
322 
323  // Determine bins for filling histograms
324  // jet Pt
325  jetPtBin = GetJetPtBin(jet->Pt());
326  if (jetPtBin < 0)
327  {
328  AliError(Form("Jet Pt Bin negative: %f", jet->Pt()));
329  continue;
330  }
331  // eta
332  etaBin = GetEtaBin(deltaEta);
333  if (etaBin < 0) {
334  AliError(Form("Eta Bin negative: %f", deltaEta));
335  continue;
336  }
337 
338  // Fill track properties
339  fHistTrackPt->Fill(track.Pt());
340 
341  if ( (jet->Pt() > 20.) && (jet->Pt() < 60.) ) {
342  fHistJHPsi->Fill(tracks->GetNTracks(), track.Pt(), track.Vect().Angle(jetVector) * TMath::RadToDeg() );
343  }
344 
345  fHistJetH[fCentBin][jetPtBin][etaBin]->Fill(deltaPhi, track.Pt());
346  fHistJetHEtaPhi->Fill(deltaEta, deltaPhi);
347 
348  // Calculate single particle tracking efficiency for correlations
349  efficiency = EffCorrection(track.Eta(), track.Pt(), fDoEffCorrection);
350 
351  if (biasedJet == kTRUE) {
352  fHistJetHBias[fCentBin][jetPtBin][etaBin]->Fill(deltaPhi, track.Pt());
353 
354  if (fBeamType == kAA || fBeamType == kpA) { //pA and AA
355  eventActivity = fCent;
356  }
357  else if (fBeamType == kpp) {
358  eventActivity = static_cast<Double_t>(tracks->GetNTracks());
359  }
360 
361  if(fDoLessSparseAxes) { // check if we want all dimensions
362  Double_t triggerEntries[6] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi, static_cast<Double_t>(leadJet)};
363  FillHist(fhnJH, triggerEntries, 1.0/efficiency);
364  } else {
365  Double_t triggerEntries[7] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi, static_cast<Double_t>(leadJet), deltaR};
366  FillHist(fhnJH, triggerEntries, 1.0/efficiency);
367  }
368  }
369 
370  } //track loop
371  }//jet pt cut
372  }//jet loop
373 
374  //Prepare to do event mixing
375 
376  // create a list of reduced objects. This speeds up processing and reduces memory consumption for the event pool
377  TObjArray* tracksClone = 0;
378 
379  if(fDoEventMixing == kTRUE){
380 
381  // event mixing
382 
383  // 1. First get an event pool corresponding in mult (cent) and
384  // zvertex to the current event. Once initialized, the pool
385  // should contain nMix (reduced) events. This routine does not
386  // pre-scan the chain. The first several events of every chain
387  // will be skipped until the needed pools are filled to the
388  // specified depth. If the pool categories are not too rare, this
389  // should not be a problem. If they are rare, you could lose
390  // statistics.
391 
392  // 2. Collect the whole pool's content of tracks into one TObjArray
393  // (bgTracks), which is effectively a single background super-event.
394 
395  // 3. The reduced and bgTracks arrays must both be passed into
396  // FillCorrelations(). Also nMix should be passed in, so a weight
397  // of 1./nMix can be applied.
398 
399  AliEventPool *pool = 0;
400  if (fBeamType == kAA || fBeamType == kpA) {//everything but pp
401  pool = fPoolMgr->GetEventPool(fCent, zVertex);
402  }
403  else if (fBeamType == kpp) {//pp only
404  pool = fPoolMgr->GetEventPool(static_cast<Double_t>(tracks->GetNTracks()), zVertex);
405  }
406 
407  if (!pool){
408  if (fBeamType == kAA || fBeamType == kpA) AliFatal(Form("No pool found for centrality = %f, zVertex = %f", fCent, zVertex));
409  else if (fBeamType == kpp) AliFatal(Form("No pool found for ntracks_pp = %d, zVertex = %f", tracks->GetNTracks(), zVertex));
410  return kTRUE;
411  }
412 
413  // The number of events in the pool
414  Int_t nMix = pool->GetCurrentNEvents();
415 
416  if(eventTrigger & fTriggerType) {
417  // check for a trigger jet
418  if (pool->IsReady() || pool->NTracksInPool() >= fMinNTracksMixedEvents || nMix >= fMinNEventsMixedEvents) {
419 
420  for (auto jet : jets->accepted()) {
421 
422  // Jet properties
423  // Determine if we have the lead jet
424  leadJet = kFALSE;
425  if (jet == leadingJet) { leadJet = kTRUE; }
426 
427  // Determine if the jet is biased
428  biasedJet = BiasedJet(jet);
429 
430  // Make sure event contains jet above our threshold (reduce stats of sparse)
431  if (jet->Pt() < 15) continue;
432 
433  // Fill for biased jet triggers only
434  if (biasedJet == kTRUE) {
435 
436  // Fill mixed-event histos here
437  for (Int_t jMix=0; jMix < nMix; jMix++) {
438  TObjArray* bgTracks = pool->GetEvent(jMix);
439 
440  for(Int_t ibg=0; ibg < bgTracks->GetEntries(); ibg++){
441 
442  AliBasicParticle *bgTrack = static_cast<AliBasicParticle*>(bgTracks->At(ibg));
443  if(!bgTrack)
444  {
445  AliError(Form("%s:Failed to retrieve tracks from mixed events", GetName()));
446  }
447 
448  // Fill into TLorentzVector for use with functions below
449  track.Clear();
450  track.SetPtEtaPhiE(bgTrack->Pt(), bgTrack->Eta(), bgTrack->Phi(), 0);
451 
452  // Calculate single particle tracking efficiency of mixed events for correlations
453  efficiency = EffCorrection(track.Eta(), track.Pt(), fDoEffCorrection);
454 
455  // Phi is [-0.5*TMath::Pi(), 3*TMath::Pi()/2.]
456  GetDeltaEtaDeltaPhiDeltaR(track, jet, deltaEta, deltaPhi, deltaR);
457 
458  if (fBeamType == kAA || fBeamType == kpA) { //pA and AA
459  eventActivity = fCent;
460  }
461  else if (fBeamType == kpp) {
462  eventActivity = static_cast<Double_t>(tracks->GetNTracks());
463  }
464 
465  if(fDoLessSparseAxes) { // check if we want all the axis filled
466  Double_t triggerEntries[6] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi, static_cast<Double_t>(leadJet)};
467  FillHist(fhnMixedEvents, triggerEntries, 1./(nMix*efficiency), kTRUE);
468  } else {
469  Double_t triggerEntries[7] = {eventActivity, jet->Pt(), track.Pt(), deltaEta, deltaPhi, static_cast<Double_t>(leadJet), deltaR};
470  FillHist(fhnMixedEvents, triggerEntries, 1./(nMix*efficiency), kTRUE);
471  }
472  }
473  }
474  }
475  }
476  }
477  }
478 
479  if(eventTrigger & fMixingEventType) {
480  tracksClone = CloneAndReduceTrackList();
481 
482  //update pool if jet in event or not
483  pool->UpdatePool(tracksClone);
484  }
485 
486  } // end of event mixing
487 
488  return kTRUE;
489 }
490 
491 //________________________________________________________________________
493 {
494  //just terminate
495 }
496 
497 //________________________________________________________________________
499 {
500  if ((jet->MaxTrackPt() > fTrackBias) || (jet->MaxClusterPt() > fClusterBias))
501  {
502  return kTRUE;
503  }
504  return kFALSE;
505 }
506 
507 //________________________________________________________________________
508 void AliAnalysisTaskEmcalJetHMEC::GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector & particleOne, AliVParticle * particleTwo, Double_t & deltaEta, Double_t & deltaPhi, Double_t & deltaR)
509 {
510  // TODO: Understand order of arguments to DeltaPhi vs DeltaEta
511  // Returns deltaPhi in symmetric range so that we can calculate DeltaR.
512  deltaPhi = DeltaPhi(particleTwo->Phi(), particleOne.Phi(), -1.0*TMath::Pi(), TMath::Pi());
513  deltaEta = particleOne.Eta() - particleTwo->Eta();
514  deltaR = TMath::Sqrt(deltaPhi*deltaPhi + deltaEta*deltaEta);
515 
516  // Adjust to the normal range after the DeltaR caluclation
517  deltaPhi = DeltaPhi(particleTwo->Phi(), particleOne.Phi(), -0.5*TMath::Pi(), 3*TMath::Pi()/2.);
518 }
519 
520 //________________________________________________________________________
521 THnSparse* AliAnalysisTaskEmcalJetHMEC::NewTHnSparseF(const char* name, UInt_t entries){
522  // generate new THnSparseF, axes are defined in GetDimParams()
523 
524  Int_t count = 0;
525  UInt_t tmp = entries;
526  while(tmp!=0){
527  count++;
528  tmp = tmp &~ -tmp; // clear lowest bit
529  }
530 
531  TString hnTitle(name);
532  const Int_t dim = count;
533  Int_t nbins[dim];
534  Double_t xmin[dim];
535  Double_t xmax[dim];
536 
537  Int_t i=0;
538  Int_t c=0;
539  while(c<dim && i<32){
540  if(entries&(1<<i)){
541 
542  TString label("");
543  GetDimParams(i, label, nbins[c], xmin[c], xmax[c]);
544  hnTitle += Form(";%s",label.Data());
545  c++;
546  }
547 
548  i++;
549  }
550  hnTitle += ";";
551 
552  return new THnSparseF(name, hnTitle.Data(), dim, nbins, xmin, xmax);
553 }
554 
555 //________________________________________________________________________
557 {
558  // stores label and binning of axis for THnSparse
559 
560  const Double_t pi = TMath::Pi();
561 
562  switch(iEntry){
563 
564  case 0:
565  label = "V0 centrality (%)";
566  nbins = 10;
567  xmin = 0.;
568  xmax = 100.;
569  break;
570 
571  case 1:
572  label = "corrected jet pt";
573  nbins = 20;
574  xmin = 0.;
575  xmax = 200.;
576  break;
577 
578  case 2:
579  if(fDoWiderTrackBin) {
580  label = "track pT";
581  nbins = 40;
582  xmin = 0.;
583  xmax = 10.;
584  } else {
585  label = "track pT";
586  nbins = 100;
587  xmin = 0.;
588  xmax = 10;
589  }
590  break;
591 
592  case 3:
593  label = "deltaEta";
594  nbins = 24;
595  xmin = -1.2;
596  xmax = 1.2;
597  break;
598 
599  case 4:
600  label = "deltaPhi";
601  nbins = 72;
602  xmin = -0.5*pi;
603  xmax = 1.5*pi;
604  break;
605 
606  case 5:
607  label = "leading jet";
608  nbins = 3;
609  xmin = -0.5;
610  xmax = 2.5;
611  break;
612 
613  case 6:
614  label = "trigger track";
615  nbins =10;
616  xmin = 0;
617  xmax = 50;
618  break;
619 
620  case 7:
621  label = "deltaR";
622  nbins = 10;
623  xmin = 0.;
624  xmax = 5.0;
625  break;
626 
627  case 8:
628  label = "leading track";
629  nbins = 13;
630  xmin = 0;
631  xmax = 50;
632  break;
633  }
634 }
635 
636 //_________________________________________________
637 // From CF event mixing code PhiCorrelations
639 {
640  // clones a track list by using AliBasicTrack which uses much less memory (used for event mixing)
641  TObjArray* tracksClone = new TObjArray;
642  tracksClone->SetOwner(kTRUE);
643 
644  // Loop over all tracks
645  AliBasicParticle * clone = 0;
646  AliTrackContainer * tracks = GetTrackContainer("tracksForCorrelations");
647 
648  for (auto particle : tracks->accepted())
649  {
650  // Fill some QA information about the tracks
651  Int_t trackPtBin = GetTrackPtBin(particle->Pt());
652  if(trackPtBin > -1) fHistTrackEtaPhi[trackPtBin]->Fill(particle->Eta(),particle->Phi());
653 
654  // Create new particle
655  clone = new AliBasicParticle(particle->Eta(), particle->Phi(), particle->Pt(), particle->Charge());
656  // Set so that we can do comparisons using the IsEqual() function.
657  clone ->SetUniqueID(particle->GetUniqueID());
658 
659  tracksClone->Add(clone);
660  }
661 
662  return tracksClone;
663 }
664 
665 //________________________________________________________________________
667  // default (current) parameters
668  // x-variable = track pt, y-variable = track eta
669  Double_t x = trackPT;
670  Double_t y = trackETA;
671  Double_t TRefficiency = -999;
672  Int_t runNUM = fCurrentRunNumber;
673  Int_t runSwitchGood = -999;
674  //Int_t centbin = -99;
675 
676  Double_t etaaxis = 0;
677  Double_t ptaxis = 0;
678 
679  if(effSwitch < 1) {
680  if ((runNUM == 169975 || runNUM == 169981 || runNUM == 170038 || runNUM == 170040 || runNUM == 170083 || runNUM == 170084 || runNUM == 170085 || runNUM == 170088 || runNUM == 170089 || runNUM == 170091 || runNUM == 170152 || runNUM == 170155 || runNUM == 170159 || runNUM == 170163 || runNUM == 170193 || runNUM == 170195 || runNUM == 170203 || runNUM == 170204 || runNUM == 170228 || runNUM == 170230 || runNUM == 170268 || runNUM == 170269 || runNUM == 170270 || runNUM == 170306 || runNUM == 170308 || runNUM == 170309)) runSwitchGood = 0;
681 
682  if ((runNUM == 167902 || runNUM == 167903 || runNUM == 167915 || runNUM == 167920 || runNUM == 167987 || runNUM == 167988 || runNUM == 168066 || runNUM == 168068 || runNUM == 168069 || runNUM == 168076 || runNUM == 168104 || runNUM == 168107 || runNUM == 168108 || runNUM == 168115 || runNUM == 168212 || runNUM == 168310 || runNUM == 168311 || runNUM == 168322 || runNUM == 168325 || runNUM == 168341 || runNUM == 168342 || runNUM == 168361 || runNUM == 168362 || runNUM == 168458 || runNUM == 168460 || runNUM == 168461 || runNUM == 168464 || runNUM == 168467 || runNUM == 168511 || runNUM == 168512 || runNUM == 168777 || runNUM == 168826 || runNUM == 168984 || runNUM == 168988 || runNUM == 168992 || runNUM == 169035 || runNUM == 169091 || runNUM == 169094 || runNUM == 169138 || runNUM == 169143 || runNUM == 169144 || runNUM == 169145 || runNUM == 169148 || runNUM == 169156 || runNUM == 169160 || runNUM == 169167 || runNUM == 169238 || runNUM == 169411 || runNUM == 169415 || runNUM == 169417 || runNUM == 169835 || runNUM == 169837 || runNUM == 169838 || runNUM == 169846 || runNUM == 169855 || runNUM == 169858 || runNUM == 169859 || runNUM == 169923 || runNUM == 169956 || runNUM == 170027 || runNUM == 170036 || runNUM == 170081)) runSwitchGood = 1;
683 
684  // Determine which efficiency to use.
685  // This is just a way to map all possible values of the cent bin and runSwitchGood to a unique flag.
686  // 4 is the number of cent bins, and we want to index the effSwitch starting at 2.
687  effSwitch = 2 + runSwitchGood*4 + fCentBin;
688  }
689 
690  // 0-10% centrality: Semi-Good Runs
691  Double_t p0_10SG[17] = {0.906767, 0.0754127, 1.11638, -0.0233078, 0.795454, 0.00935385, -0.000327857, 1.08903, 0.0107272, 0.443252, -0.143411, 0.965822, 0.359156, -0.581221, 1.0739, 0.00632828, 0.706356};
692  // 10-30% centrality: Semi-Good Runs
693  Double_t p10_30SG[17] = {0.908011, 0.0769254, 1.11912, -0.0249449, 0.741488, 0.0361252, -0.00367954, 1.10424, 0.011472, 0.452059, -0.133282, 0.980633, 0.358222, -0.620256, 1.06871, 0.00564449, 0.753168};
694  // 30-50% centrality: Semi-Good Runs
695  Double_t p30_50SG[17] = {0.958708, 0.0799197, 1.10817, -0.0357678, 0.75051, 0.0607808, -0.00929713, 0.998801, 0.00692244, 0.615452, -0.0480328, 0.968431, 0.321634, -0.619066, 1.03412, 0.00656201, 0.798666};
696  // 50-90% centrality: Semi-Good Runs
697  Double_t p50_90SG[17] = {0.944565, 0.0807258, 1.12709, -0.0324746, 0.666452, 0.0842476, -0.00963837, 1.02829, 0.00666852, 0.549625, -0.0603107, 0.981374, 0.309374, -0.619181, 1.05367, 0.005925, 0.744887};
698 
699  // 0-10% centrality: Good Runs
700  Double_t p0_10G[17] = {0.971679, 0.0767571, 1.13355, -0.0274484, 0.856652, 0.00536795, 3.90795e-05, 1.06889, 0.011007, 0.447046, -0.146626, 0.919777, 0.192601, -0.268515, 1.00243, 0.00620849, 0.709477};
701  // 10-30% centrality: Good Runs
702  Double_t p10_30G[17] = {0.97929, 0.0776039, 1.12213, -0.0300645, 0.844722, 0.0134788, -0.0012333, 1.07955, 0.0116835, 0.456608, -0.132743, 0.930964, 0.174175, -0.267154, 0.993118, 0.00574892, 0.765256};
703  // 30-50% centrality: Good Runs
704  Double_t p30_50G[17] = {0.997696, 0.0816769, 1.14341, -0.0353734, 0.752151, 0.0744259, -0.0102926, 1.01561, 0.00713274, 0.57203, -0.0640248, 0.947747, 0.102007, -0.194698, 0.999164, 0.00568476, 0.7237};
705  // 50-90% centrality: Good Runs
706  Double_t p50_90G[17] = {0.97041, 0.0813559, 1.12151, -0.0368797, 0.709327, 0.0701501, -0.00784043, 1.06276, 0.00676173, 0.53607, -0.0703117, 0.982534, 0.0947881, -0.18073, 1.03229, 0.00580109, 0.737801};
707 
708  // set up a switch for different parameter values...
709  switch(effSwitch) {
710  case 1 :
711  // first switch value - TRefficiency not used so = 1
712  TRefficiency = 1.0;
713  break;
714 
715  case 2 :
716  // Parameter values for Semi-GOOD TPC (LHC11h) runs (0-10%):
717  ptaxis = (x<2.9)*(p0_10SG[0]*exp(-pow(p0_10SG[1]/x,p0_10SG[2])) + p0_10SG[3]*x) + (x>=2.9)*(p0_10SG[4] + p0_10SG[5]*x + p0_10SG[6]*x*x);
718  etaaxis = (y<-0.07)*(p0_10SG[7]*exp(-pow(p0_10SG[8]/TMath::Abs(y+0.91),p0_10SG[9])) + p0_10SG[10]*y) + (y>=-0.07 && y<=0.4)*(p0_10SG[11] + p0_10SG[12]*y + p0_10SG[13]*y*y) + (y>0.4)*(p0_10SG[14]*exp(-pow(p0_10SG[15]/TMath::Abs(-y+0.91),p0_10SG[16])));
719  TRefficiency = ptaxis*etaaxis;
720  break;
721 
722  case 3 :
723  // Parameter values for Semi-GOOD TPC (LHC11h) runs (10-30%):
724  ptaxis = (x<2.9)*(p10_30SG[0]*exp(-pow(p10_30SG[1]/x,p10_30SG[2])) + p10_30SG[3]*x) + (x>=2.9)*(p10_30SG[4] + p10_30SG[5]*x + p10_30SG[6]*x*x);
725  etaaxis = (y<-0.07)*(p10_30SG[7]*exp(-pow(p10_30SG[8]/TMath::Abs(y+0.91),p10_30SG[9])) + p10_30SG[10]*y) + (y>=-0.07 && y<=0.4)*(p10_30SG[11] + p10_30SG[12]*y + p10_30SG[13]*y*y) + (y>0.4)*(p10_30SG[14]*exp(-pow(p10_30SG[15]/TMath::Abs(-y+0.91),p10_30SG[16])));
726  TRefficiency = ptaxis*etaaxis;
727  break;
728 
729  case 4 :
730  // Parameter values for Semi-GOOD TPC (LHC11h) runs (30-50%):
731  ptaxis = (x<2.9)*(p30_50SG[0]*exp(-pow(p30_50SG[1]/x,p30_50SG[2])) + p30_50SG[3]*x) + (x>=2.9)*(p30_50SG[4] + p30_50SG[5]*x + p30_50SG[6]*x*x);
732  etaaxis = (y<-0.07)*(p30_50SG[7]*exp(-pow(p30_50SG[8]/TMath::Abs(y+0.91),p30_50SG[9])) + p30_50SG[10]*y) + (y>=-0.07 && y<=0.4)*(p30_50SG[11] + p30_50SG[12]*y + p30_50SG[13]*y*y) + (y>0.4)*(p30_50SG[14]*exp(-pow(p30_50SG[15]/TMath::Abs(-y+0.91),p30_50SG[16])));
733  TRefficiency = ptaxis*etaaxis;
734  break;
735 
736  case 5 :
737  // Parameter values for Semi-GOOD TPC (LHC11h) runs (50-90%):
738  ptaxis = (x<2.9)*(p50_90SG[0]*exp(-pow(p50_90SG[1]/x,p50_90SG[2])) + p50_90SG[3]*x) + (x>=2.9)*(p50_90SG[4] + p50_90SG[5]*x + p50_90SG[6]*x*x);
739  etaaxis = (y<-0.07)*(p50_90SG[7]*exp(-pow(p50_90SG[8]/TMath::Abs(y+0.91),p50_90SG[9])) + p50_90SG[10]*y) + (y>=-0.07 && y<=0.4)*(p50_90SG[11] + p50_90SG[12]*y + p50_90SG[13]*y*y) + (y>0.4)*(p50_90SG[14]*exp(-pow(p50_90SG[15]/TMath::Abs(-y+0.91),p50_90SG[16])));
740  TRefficiency = ptaxis*etaaxis;
741  break;
742 
743  case 6 :
744  // Parameter values for GOOD TPC (LHC11h) runs (0-10%):
745  ptaxis = (x<2.9)*(p0_10G[0]*exp(-pow(p0_10G[1]/x,p0_10G[2])) + p0_10G[3]*x) + (x>=2.9)*(p0_10G[4] + p0_10G[5]*x + p0_10G[6]*x*x);
746  etaaxis = (y<0.0)*(p0_10G[7]*exp(-pow(p0_10G[8]/TMath::Abs(y+0.91),p0_10G[9])) + p0_10G[10]*y) + (y>=0.0 && y<=0.4)*(p0_10G[11] + p0_10G[12]*y + p0_10G[13]*y*y) + (y>0.4)*(p0_10G[14]*exp(-pow(p0_10G[15]/TMath::Abs(-y+0.91),p0_10G[16])));
747  TRefficiency = ptaxis*etaaxis;
748  break;
749 
750  case 7 :
751  // Parameter values for GOOD TPC (LHC11h) runs (10-30%):
752  ptaxis = (x<2.9)*(p10_30G[0]*exp(-pow(p10_30G[1]/x,p10_30G[2])) + p10_30G[3]*x) + (x>=2.9)*(p10_30G[4] + p10_30G[5]*x + p10_30G[6]*x*x);
753  etaaxis = (y<0.0)*(p10_30G[7]*exp(-pow(p10_30G[8]/TMath::Abs(y+0.91),p10_30G[9])) + p10_30G[10]*y) + (y>=0.0 && y<=0.4)*(p10_30G[11] + p10_30G[12]*y + p10_30G[13]*y*y) + (y>0.4)*(p10_30G[14]*exp(-pow(p10_30G[15]/TMath::Abs(-y+0.91),p10_30G[16])));
754  TRefficiency = ptaxis*etaaxis;
755  break;
756 
757  case 8 :
758  // Parameter values for GOOD TPC (LHC11h) runs (30-50%):
759  ptaxis = (x<2.9)*(p30_50G[0]*exp(-pow(p30_50G[1]/x,p30_50G[2])) + p30_50G[3]*x) + (x>=2.9)*(p30_50G[4] + p30_50G[5]*x + p30_50G[6]*x*x);
760  etaaxis = (y<0.0)*(p30_50G[7]*exp(-pow(p30_50G[8]/TMath::Abs(y+0.91),p30_50G[9])) + p30_50G[10]*y) + (y>=0.0 && y<=0.4)*(p30_50G[11] + p30_50G[12]*y + p30_50G[13]*y*y) + (y>0.4)*(p30_50G[14]*exp(-pow(p30_50G[15]/TMath::Abs(-y+0.91),p30_50G[16])));
761  TRefficiency = ptaxis*etaaxis;
762  break;
763 
764  case 9 :
765  // Parameter values for GOOD TPC (LHC11h) runs (50-90%):
766  ptaxis = (x<2.9)*(p50_90G[0]*exp(-pow(p50_90G[1]/x,p50_90G[2])) + p50_90G[3]*x) + (x>=2.9)*(p50_90G[4] + p50_90G[5]*x + p50_90G[6]*x*x);
767  etaaxis = (y<0.0)*(p50_90G[7]*exp(-pow(p50_90G[8]/TMath::Abs(y+0.91),p50_90G[9])) + p50_90G[10]*y) + (y>=0.0 && y<=0.4)*(p50_90G[11] + p50_90G[12]*y + p50_90G[13]*y*y) + (y>0.4)*(p50_90G[14]*exp(-pow(p50_90G[15]/TMath::Abs(-y+0.91),p50_90G[16])));
768  TRefficiency = ptaxis*etaaxis;
769  break;
770 
771  default :
772  // no Efficiency Switch option selected.. therefore don't correct, and set eff = 1
773  TRefficiency = 1.0;
774 
775  }
776 
777  return TRefficiency;
778 }
779 
780 //________________________________________________________________________
781 void AliAnalysisTaskEmcalJetHMEC::FillHist(TH1 * hist, Double_t fillValue, Double_t weight, Bool_t noCorrection)
782 {
783  if (fEmbeddingCorrectionHist == 0 || noCorrection == kTRUE)
784  {
785  hist->Fill(fillValue, weight);
786  }
787  else
788  {
789  // Determine where to get the values in the correction hist
790  Int_t xBin = fEmbeddingCorrectionHist->GetXaxis()->FindBin(fillValue);
791 
792  std::vector <Double_t> yBinsContent;
793  accessSetOfYBinValues(fEmbeddingCorrectionHist, xBin, yBinsContent);
794 
795  // Loop over all possible bins to contribute.
796  // If content is 0 then calling Fill won't make a difference
797  for (Int_t index = 1; index <= fEmbeddingCorrectionHist->GetYaxis()->GetNbins(); index++)
798  {
799  // Determine the value to fill based on the center of the bins.
800  // This in principle allows the binning between the correction and hist to be different
801  Double_t fillLocation = fEmbeddingCorrectionHist->GetYaxis()->GetBinCenter(index);
802  Printf("fillLocation: %f, weight: %f", fillLocation, yBinsContent.at(index-1));
803  // minus 1 since loop starts at 1
804  hist->Fill(fillLocation, weight*yBinsContent.at(index-1));
805  }
806 
807  //TEMP
808  //hist->Draw();
809  //END TEMP
810  }
811 }
812 
813 //________________________________________________________________________
814 void AliAnalysisTaskEmcalJetHMEC::FillHist(THnSparse * hist, Double_t *fillValue, Double_t weight, Bool_t noCorrection)
815 {
816  if (fEmbeddingCorrectionHist == 0 || noCorrection == kTRUE)
817  {
818  hist->Fill(fillValue, weight);
819  }
820  else
821  {
822  // Jet pt is always located in the second position
823  Double_t jetPt = fillValue[1];
824 
825  // Determine where to get the values in the correction hist
826  Int_t xBin = fEmbeddingCorrectionHist->GetXaxis()->FindBin(jetPt);
827 
828  std::vector <Double_t> yBinsContent;
829  accessSetOfYBinValues(fEmbeddingCorrectionHist, xBin, yBinsContent);
830 
831  // Loop over all possible bins to contribute.
832  // If content is 0 then calling Fill won't make a difference
833  for (Int_t index = 1; index <= fEmbeddingCorrectionHist->GetYaxis()->GetNbins(); index++)
834  {
835  // Determine the value to fill based on the center of the bins.
836  // This in principle allows the binning between the correction and hist to be different
837  fillValue[1] = fEmbeddingCorrectionHist->GetYaxis()->GetBinCenter(index);
838  Printf("fillValue[1]: %f, weight: %f", fillValue[1], yBinsContent.at(index-1));
839  // minus 1 since loop starts at 1
840  hist->Fill(fillValue, weight*yBinsContent.at(index-1));
841  }
842  }
843 }
844 
845 //________________________________________________________________________
846 void AliAnalysisTaskEmcalJetHMEC::accessSetOfYBinValues(TH2F * hist, Int_t xBin, std::vector <Double_t> & yBinsContent, Double_t scaleFactor)
847 {
848  for (Int_t index = 1; index <= hist->GetYaxis()->GetNbins(); index++)
849  {
850  //yBinsContent[index-1] = hist->GetBinContent(hist->GetBin(xBin,index));
851  yBinsContent.push_back(hist->GetBinContent(hist->GetBin(xBin,index)));
852 
853  if (scaleFactor >= 0)
854  {
855  // -1 since index starts at 1
856  hist->SetBinContent(hist->GetBin(xBin,index), yBinsContent.at(index-1)/scaleFactor);
857  }
858  }
859 }
860 
867  const char *nTracks,
868  const char *nCaloClusters,
869  // Jet options
870  const Double_t trackBias,
871  const Double_t clusterBias,
872  const Double_t minJetArea,
873  // Mixed event options
874  const Int_t nTracksMixedEvent, // Additionally acts as a switch for enabling mixed events
875  const Int_t minNTracksMixedEvent,
876  const Int_t minNEventsMixedEvent,
877  const UInt_t nCentBinsMixedEvent,
878  // Triggers
879  UInt_t trigEvent,
880  UInt_t mixEvent,
881  // Options
882  const char *CentEst,
883  const Int_t nCentBins,
884  const Double_t trackEta,
885  const Bool_t lessSparseAxes,
886  const Bool_t widerTrackBin,
887  // Corrections
888  const Int_t doEffCorrSW,
889  const Bool_t embeddingCorrection,
890  const char * embeddingCorrectionFilename,
891  const char * embeddingCorrectionHistName,
892  const char *suffix
893  )
894 {
895  // Get the pointer to the existing analysis manager via the static access method.
896  //==============================================================================
897  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
898  if (!mgr)
899  {
900  AliErrorClass("No analysis manager to connect to.");
901  return NULL;
902  }
903 
904  // Check the analysis type using the event handlers connected to the analysis manager.
905  //==============================================================================
906  AliVEventHandler* handler = mgr->GetInputEventHandler();
907  if (!handler)
908  {
909  AliErrorClass("This task requires an input event handler");
910  return NULL;
911  }
912 
913  //-------------------------------------------------------
914  // Init the task and do settings
915  //-------------------------------------------------------
916 
917  // Determine data type
918  enum EDataType_t {
919  kUnknown,
920  kESD,
921  kAOD
922  };
923 
924  EDataType_t dataType = kUnknown;
925 
926  if (handler->InheritsFrom("AliESDInputHandler")) {
927  dataType = kESD;
928  }
929  else if (handler->InheritsFrom("AliAODInputHandler")) {
930  dataType = kAOD;
931  }
932 
933  // Determine cluster and track names
934  TString trackName(nTracks);
935  TString clusName(nCaloClusters);
936 
937  if (trackName == "usedefault") {
938  if (dataType == kESD) {
939  trackName = "Tracks";
940  }
941  else if (dataType == kAOD) {
942  trackName = "tracks";
943  }
944  else {
945  trackName = "";
946  }
947  }
948 
949  if (clusName == "usedefault") {
950  if (dataType == kESD) {
951  clusName = "CaloClusters";
952  }
953  else if (dataType == kAOD) {
954  clusName = "caloClusters";
955  }
956  else {
957  clusName = "";
958  }
959  }
960 
961  TString name("AliAnalysisTaskJetH");
962  if (!trackName.IsNull()) {
963  name += TString::Format("_%s", trackName.Data());
964  }
965  if (!clusName.IsNull()) {
966  name += TString::Format("_%s", clusName.Data());
967  }
968  if (strcmp(suffix, "") != 0) {
969  name += TString::Format("_%s", suffix);
970  }
971 
972  AliAnalysisTaskEmcalJetHMEC *correlationTask = new AliAnalysisTaskEmcalJetHMEC(name);
973  // Set jet bias
974  correlationTask->SetTrackBias(trackBias);
975  correlationTask->SetClusterBias(clusterBias);
976  // Mixed events
977  correlationTask->SetEventMixing(static_cast<Bool_t>(nTracksMixedEvent));
978  correlationTask->SetNumberOfMixingTracks(nTracksMixedEvent);
979  correlationTask->SetMinNTracksForMixedEvents(minNTracksMixedEvent);
980  correlationTask->SetMinNEventsForMixedEvents(minNEventsMixedEvent);
981  correlationTask->SetNCentBinsMixedEvent(nCentBinsMixedEvent);
982  // Triggers
983  correlationTask->SetTriggerType(trigEvent);
984  correlationTask->SetMixedEventTriggerType(mixEvent);
985  // Options
986  correlationTask->SetCentralityEstimator(CentEst);
987  correlationTask->SetNCentBins(nCentBins);
988  correlationTask->SetVzRange(-10,10);
989  correlationTask->SetDoLessSparseAxes(lessSparseAxes);
990  correlationTask->SetDoWiderTrackBin(widerTrackBin);
991  // Corrections
992  correlationTask->SetDoEffCorr(doEffCorrSW);
993  if (embeddingCorrection == kTRUE)
994  {
995  // Open file containing the correction
996  TFile * embeddingCorrectionFile = TFile::Open(embeddingCorrectionFilename);
997  if (!embeddingCorrectionFile || embeddingCorrectionFile->IsZombie()) {
998  AliErrorClass(TString::Format("Could not open embedding correction file %s", embeddingCorrectionFilename));
999  return NULL;
1000  }
1001 
1002  // Retrieve the histogram containing the correction and save add it to the task.
1003  TH2F * embeddingCorrectionHist = dynamic_cast<TH2F*>(embeddingCorrectionFile->Get(embeddingCorrectionHistName));
1004  if (embeddingCorrectionHist) {
1005  AliInfoClass(TString::Format("Embedding correction %s loaded from file %s.", embeddingCorrectionHistName, embeddingCorrectionFilename));
1006  }
1007  else {
1008  AliErrorClass(TString::Format("Embedding correction %s not found in file %s.", embeddingCorrectionHistName, embeddingCorrectionFilename));
1009  return NULL;
1010  }
1011 
1012  correlationTask->SetEmbeddingCorrectionHist(embeddingCorrectionHist);
1013  }
1014 
1015  // Jet parameters determined by how we ran the jet finder
1016  Double_t jetRadius = 0.2;
1017  Double_t minClusterPt = 3;
1018  Double_t minTrackPt = 3;
1019 
1020  // Add Containers
1021  // Clusters
1022  AliClusterContainer * clusterContainer = correlationTask->AddClusterContainer(clusName);
1023  clusterContainer->SetMinE(minClusterPt);
1024 
1025  // Tracks
1026  // For jet finding
1027  AliTrackContainer * tracksForJets = new AliTrackContainer(trackName);
1028  tracksForJets->SetName("tracksForJets");
1029  tracksForJets->SetMinPt(minTrackPt);
1030  tracksForJets->SetEtaLimits(-1.0*trackEta, trackEta);
1031  // Adopt the container
1032  correlationTask->AdoptParticleContainer(tracksForJets);
1033  // For correlations
1034  AliTrackContainer * tracksForCorrelations = new AliTrackContainer(trackName);
1035  tracksForCorrelations->SetName("tracksForCorrelations");
1036  tracksForCorrelations->SetMinPt(0.15);
1037  tracksForCorrelations->SetEtaLimits(-1.0*trackEta, trackEta);
1038  // Adopt the container
1039  correlationTask->AdoptParticleContainer(tracksForCorrelations);
1040 
1041  // Jets
1042  AliJetContainer * jetContainer = correlationTask->AddJetContainer(AliJetContainer::kFullJet,
1045  jetRadius,
1047  tracksForJets,
1048  clusterContainer);
1049  jetContainer->SetJetAreaCut(minJetArea);
1050  jetContainer->SetMaxTrackPt(100);
1051  jetContainer->SetJetPtCut(0.1);
1052 
1053  //-------------------------------------------------------
1054  // Final settings, pass to manager and set the containers
1055  //-------------------------------------------------------
1056 
1057  mgr->AddTask(correlationTask);
1058 
1059  // Create containers for input/output
1060  mgr->ConnectInput (correlationTask, 0, mgr->GetCommonInputContainer() );
1061  AliAnalysisDataContainer * cojeth = mgr->CreateContainer(name,
1062  TList::Class(),
1063  AliAnalysisManager::kOutputContainer,
1064  Form("%s", AliAnalysisManager::GetCommonFileName()));
1065  mgr->ConnectOutput(correlationTask, 1, cojeth);
1066 
1067  return correlationTask;
1068 }
1069 
void accessSetOfYBinValues(TH2F *hist, Int_t xBin, std::vector< Double_t > &yBinsContent, Double_t scaleFactor=-1.0)
virtual void SetTriggerType(UInt_t te)
void GetDeltaEtaDeltaPhiDeltaR(AliTLorentzVector &particleOne, AliVParticle *particleTwo, Double_t &deltaEta, Double_t &deltaPhi, Double_t &deltaR)
Bool_t fDoEventMixing
flag to do evt mixing
double Double_t
Definition: External.C:58
Definition: External.C:260
Int_t fMinNEventsMixedEvents
threshold to use event pool # events
static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin=-TMath::Pi()/2, Double_t rMax=3 *TMath::Pi()/2)
UInt_t fNCentBinsMixedEvent
N cent bins for the event mixing pool.
Definition: External.C:236
Int_t GetNTracks() const
AliJetContainer * GetJetContainer(Int_t i=0) const
virtual Int_t GetTrackPtBin(Double_t pt) const
void AdoptParticleContainer(AliParticleContainer *cont)
const AliTrackIterableContainer accepted() const
Container with name, TClonesArray and cuts for particles.
Declaration of class AliTLorentzVector.
TCanvas * c
Definition: TestFitELoss.C:172
AliJetContainer * AddJetContainer(const char *n, TString defaultCutType, Float_t jetRadius=0.4)
AliEventPoolManager * fPoolMgr
! Event pool manager
Int_t fCentBin
!event centrality bin
Int_t nCentBins
void SetVzRange(Double_t min, Double_t max)
virtual Double_t Pt() const
virtual Int_t GetJetPtBin(Double_t pt) const
virtual Double_t Eta() const
AliClusterContainer * AddClusterContainer(const char *n)
Int_t fMinNTracksMixedEvents
threshold to use event pool # tracks
virtual THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
static AliAnalysisTaskEmcalJetHMEC * AddTaskEmcalJetHMEC(const char *nTracks="usedefault", const char *nCaloClusters="usedefault", const Double_t trackBias=5, const Double_t clusterBias=5, const Double_t minJetArea=0.4, const Int_t nTracksMixedEvent=0, const Int_t minNTracksMixedEvent=5000, const Int_t minNEventsMixedEvent=5, const UInt_t nCentBinsMixedEvent=10, UInt_t trigEvent=AliVEvent::kAny, UInt_t mixEvent=AliVEvent::kAny, const char *CentEst="V0M", const Int_t nCentBins=5, const Double_t trackEta=0.9, const Bool_t lessSparseAxes=0, const Bool_t widerTrackBin=0, const Int_t doEffCorrSW=0, const Bool_t embeddingCorrection=kFALSE, const char *embeddingCorrectionFilename="alien:///alice/cern.ch/user/r/rehlersi/embeddingCorrection.root", const char *embeddingCorrectionHistName="embeddingCorrection", const char *suffix="biased")
AliEmcalJet * GetLeadingJet(const char *opt="")
int Int_t
Definition: External.C:63
void SetJetPtCut(Float_t cut)
unsigned int UInt_t
Definition: External.C:33
TH3 * fHistJHPsi
! Psi angle distribution
virtual void SetMinNTracksForMixedEvents(Int_t nmt)
BeamType fForceBeamType
forced beam type
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Double_t MaxTrackPt() const
Definition: AliEmcalJet.h:142
virtual Int_t GetEtaBin(Double_t eta) const
BeamType fBeamType
!event beam type
void FillHist(TH1 *hist, Double_t fillValue, Double_t weight=1.0, Bool_t noCorrection=kTRUE)
Double_t fCent
!event centrality
Double_t fClusterBias
Jet cluster bias.
virtual void SetClusterBias(Double_t b)
virtual void SetNCentBins(Int_t n)
virtual void SetEventMixing(Bool_t enable)
ClassImp(AliAnalysisTaskEmcalJetHMEC) AliAnalysisTaskEmcalJetHMEC
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
AliEmcalList * fOutput
!output list
virtual void SetNumberOfMixingTracks(Int_t tracks)
Double_t fVertex[3]
!event vertex
AliTrackContainer * GetTrackContainer(Int_t i=0) const
THnSparse * fhnMixedEvents
! Mixed events THnSparse
Base task in the EMCAL jet framework.
Double_t MaxClusterPt() const
Definition: AliEmcalJet.h:141
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
virtual void SetMixedEventTriggerType(UInt_t me)
const AliTrackIterableMomentumContainer accepted_momentum() const
const char Option_t
Definition: External.C:48
virtual void SetMinNEventsForMixedEvents(Int_t nme)
const Double_t pi
const Int_t nbins
const AliJetIterableContainer accepted() const
bool Bool_t
Definition: External.C:53
Int_t fNMixingTracks
size of track buffer for event mixing
EDataType_t
Switch for the data type.
void SetCentralityEstimator(const char *c)
virtual Double_t EffCorrection(Double_t trkETA, Double_t trkPT, Int_t effswitch) const
void SetMaxTrackPt(Float_t b)
virtual Double_t Phi() const
Container structure for EMCAL clusters.
EMCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Definition: AliEmcalJet.h:61
Container for jet within the EMCAL jet framework.
Definition: External.C:196
virtual void SetNCentBinsMixedEvent(Bool_t centbins)
virtual void SetTrackBias(Double_t b)
void SetJetAreaCut(Float_t cut)
THnSparse * fhnJH
! JetH THnSparse
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
virtual void GetDimParams(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)