AliPhysics  master (3d17d9d)
AliAnalysisTaskEmcalJetCorrection.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2019, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: R. Haake. *
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 <iostream>
17 #include <cstdlib>
18 #include <algorithm>
19 #include <vector>
20 #include <TClonesArray.h>
21 #include <TH1F.h>
22 #include <TH2F.h>
23 #include <TH3F.h>
24 #include <TGrid.h>
25 #include <TFile.h>
26 #include <TSystem.h>
27 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
28  #include <TPython.h>
29 #endif
30 
31 #include "AliAnalysisManager.h"
32 #include "AliRhoParameter.h"
35 
36 
40 
41 
42 //________________________________________________________________________
45  #if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
46  fPythonCLI(),
47  #endif
48  fCustomPackages(),
49  fPythonModulePath("lib/python3.6/site-packages/"),
50  fJetsCont(),
51  fTracksCont(),
52  fJetOutputArray(),
53  fBackgroundModelFileName(""),
54  fBackgroundModelInputParameters(""),
55  fModelName("Model")
56 {
57  // nothing to do
58 }
59 
60 //________________________________________________________________________
62  AliAnalysisTaskEmcalJet(name, kTRUE),
63  #if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
64  fPythonCLI(),
65  #endif
66  fCustomPackages(),
67  fPythonModulePath("lib/python3.6/site-packages/"),
68  fJetsCont(),
69  fTracksCont(),
70  fJetOutputArray(),
71  fBackgroundModelFileName(""),
72  fBackgroundModelInputParameters(""),
73  fModelName("Model")
74  {
75  // nothing to do
76 }
77 
78 //________________________________________________________________________
80 {
81  // Destructor.
82 }
83 
84 //________________________________________________________________________
86 {
88 
90  if(!fJetsCont)
91  AliFatal("Jet input container not found!");
93  if(!fTracksCont)
94  AliFatal("Particle input container not found attached to jets!");
95 
96  AddHistogram2D<TH2D>("hJetPtCorrelation", "Jet p_{T} (model vs. area-based)", "COLZ", 400, -100., 300., 400, -100., 300., "p_{T, ML} (GeV/c)", "p_{T} (GeV/c)", "dN2^{Jets}/d2p_{T}");
97 
98  PostData(1, fOutput);
99 
100 }
101 
102 
103 //________________________________________________________________________
105 {
107 
108  // ### Need to explicitly tell jet container to load rho mass object
109  fJetsCont->LoadRhoMass(InputEvent());
110 
111  #if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
112  fPythonCLI = new TPython();
113  // ### Install custom packages locally on worker node
114  if(!fCustomPackages.IsNull())
115  {
116  std::ofstream outFile;
117  outFile.open("./myScript.sh");
118  outFile << "#!/bin/bash" << std::endl;
119  outFile << "export PYTHONUSERBASE=./my-local-python" << std::endl;
120  outFile << "export PATH=\"$PYTHONUSERBASE/bin:$PATH\"" << std::endl;
121  TObjArray* packages = fCustomPackages.Tokenize(",");
122  for(Int_t iPackage = 0; iPackage < packages->GetEntries(); iPackage++)
123  {
124  TString package = ((TObjString *)(packages->At(iPackage)))->String();
125  outFile << "pip install --user " << package.Data() << std::endl;
126  }
127  outFile.close();
128  gSystem->Exec("bash ./myScript.sh");
129 
130  packages->SetOwner();
131  delete packages;
132  }
133  // ### Get background model from alien and load it
134  TGrid::Connect("alien://");
135  if (gSystem->AccessPathName(fBackgroundModelFileName.Data()))
136  AliFatal(Form("Background model %s does not exist!", fBackgroundModelFileName.Data()));
137  TFile::Cp(fBackgroundModelFileName.Data(), "./Model.joblib");
138  fPythonCLI->Exec("import sys");
139  fPythonCLI->Exec(Form("sys.path.insert(0, './my-local-python/%s')", fPythonModulePath.Data()));
140  fPythonCLI->Exec("import sklearn, numpy, joblib");
141  fPythonCLI->Exec("estimator = joblib.load(\"./Model.joblib\")");
142  #endif
143 
144  // ### Prepare jet output array
145  if (!(InputEvent()->FindListObject(Form("%s_RhoMVA_%s", fJetsCont->GetArrayName().Data(), fModelName.Data())))) {
146  fJetOutputArray = new TClonesArray("AliEmcalJet");
147  fJetOutputArray->SetName(Form("%s_RhoMVA_%s", fJetsCont->GetArrayName().Data(), fModelName.Data()));
148  InputEvent()->AddObject(fJetOutputArray);
149  }
150  else {
151  AliFatal(Form("Jet output array with name %s_RhoMVA_%s already in event!", fJetsCont->GetArrayName().Data(), fModelName.Data()));
152  }
153 
154 }
155 
156 //________________________________________________________________________
158 {
159 
160  // ################################### MAIN JET LOOP
162  Int_t jetCount = 0;
163  while(AliEmcalJet *jet = fJetsCont->GetNextAcceptJet())
164  {
165  Float_t pt_ML = 0;
166  GetPtFromModel(jet, pt_ML);
167  AliEmcalJet *outJet = new ((*fJetOutputArray)[jetCount]) AliEmcalJet(*jet);
168  outJet->SetPtEtaPhi(pt_ML, jet->Eta(), jet->Phi());
169  FillHistogram("hJetPtCorrelation", pt_ML, jet->Pt()-jet->Area()*fJetsCont->GetRhoVal());
170  jetCount++;
171  }
172 
173  return kTRUE;
174 }
175 
176 //________________________________________________________________________
178 {
179  #if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
180  TString arrayStr = GetBackgroundModelArrayString(jet);
181  // ####### Run Python script that does inference on jet
182  fPythonCLI->Exec(Form("data_inference = numpy.array([[%s]])", arrayStr.Data()));
183  fPythonCLI->Exec("result = estimator.predict(data_inference)");
184  pt_ML = fPythonCLI->Eval("result[0]");
185  #endif
186 }
187 
188 //________________________________________________________________________
190 {
191  // ####### Calculate inference input parameters
192  std::vector<PWG::JETFW::AliEmcalParticleJetConstituent> tracks_sorted = jet->GetParticleConstituents();
193  std::sort(tracks_sorted.rbegin(), tracks_sorted.rend());
194  Double_t trackPts[100] = {0};
195  for(Int_t i = 0; i < TMath::Min(Int_t(tracks_sorted.size()), 100); i++)
196  {
197  const AliVParticle* particle = tracks_sorted[i].GetParticle();
198  trackPts[i] = particle->Pt();
199  }
200 
201  // Calculate jet shapes that could be demanded
202  Double_t leSub_noCorr = 0;
203  Double_t angularity = 0;
204  Double_t momentumDispersion = 0;
205  Double_t trackPtMean = 0;
206  Double_t trackPtMedian = 0;
207  CalculateJetShapes(jet, leSub_noCorr, angularity, momentumDispersion, trackPtMean, trackPtMedian);
208 
209  TString resultStr = "";
210  TObjArray* data_tokens = fBackgroundModelInputParameters.Tokenize(",");
211  for(Int_t iToken = 0; iToken < data_tokens->GetEntries(); iToken++)
212  {
213  TString token = ((TObjString *)(data_tokens->At(iToken)))->String();
214  if(token == "Jet_Pt")
215  resultStr += Form("%E", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
216  else if(token == "Jet_NumTracks")
217  resultStr += Form("%E", (Double_t)tracks_sorted.size());
218  else if(token == "Jet_Shape_Mass")
219  resultStr += Form("%E", jet->M());
220  else if(token == "Jet_Shape_Mass_DerivCorr_1")
221  resultStr += Form("%E", jet->GetShapeProperties()->GetFirstOrderSubtracted());
222  else if(token == "Jet_Shape_Mass_DerivCorr_2")
223  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtracted());
224  else if(token == "Jet_Shape_pTD_DerivCorr_1")
225  resultStr += Form("%E", jet->GetShapeProperties()->GetFirstOrderSubtractedpTD());
226  else if(token == "Jet_Shape_pTD_DerivCorr_2")
227  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedpTD());
228  else if(token == "Jet_Shape_LeSub")
229  resultStr += Form("%E", leSub_noCorr);
230  else if(token == "Jet_Shape_LeSub_DerivCorr")
231  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedLeSub());
232  else if(token == "Jet_Shape_Sigma2_DerivCorr_1")
233  resultStr += Form("%E", jet->GetShapeProperties()->GetFirstOrderSubtractedSigma2());
234  else if(token == "Jet_Shape_Sigma2_DerivCorr_2")
235  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedSigma2());
236  else if(token == "Jet_Shape_Angularity")
237  resultStr += Form("%E", angularity);
238  else if(token == "Jet_Shape_Angularity_DerivCorr_1")
239  resultStr += Form("%E", jet->GetShapeProperties()->GetFirstOrderSubtractedAngularity());
240  else if(token == "Jet_Shape_Angularity_DerivCorr_2")
241  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedAngularity());
242  else if(token == "Jet_Shape_Circularity_DerivCorr_1")
243  resultStr += Form("%E", jet->GetShapeProperties()->GetFirstOrderSubtractedCircularity());
244  else if(token == "Jet_Shape_Circularity_DerivCorr_2")
245  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedCircularity());
246  else if(token == "Jet_Shape_NumTracks_DerivCorr")
247  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedConstituent());
248  else if(token == "Jet_Shape_MomentumDispersion")
249  resultStr += Form("%E", momentumDispersion);
250  else if(token == "Jet_Shape_TrackPtMean")
251  resultStr += Form("%E", trackPtMean);
252  else if(token == "Jet_Shape_TrackPtMedian")
253  resultStr += Form("%E", trackPtMedian);
254  else if(token == "Event_BackgroundDensity")
255  resultStr += Form("%E", fJetsCont->GetRhoVal());
256  else if(token == "Event_BackgroundDensityMass")
257  resultStr += Form("%E", fJetsCont->GetRhoMassVal());
258  else if(token == "Jet_Area")
259  resultStr += Form("%E", jet->Area());
260  else if(token.BeginsWith("Jet_TrackPt"))
261  {
262  TString num = token(11,(token.Length()-11));
263  resultStr += Form("%E", trackPts[num.Atoi()]);
264  }
265 
266  // Add comma after numbers
267  if((iToken < data_tokens->GetEntries()-1))
268  resultStr += ", ";
269  }
270 
271  data_tokens->SetOwner();
272  delete data_tokens;
273  return resultStr;
274 }
275 
276 //________________________________________________________________________
277 void AliAnalysisTaskEmcalJetCorrection::CalculateJetShapes(AliEmcalJet* jet, Double_t& leSub_noCorr, Double_t& angularity, Double_t& momentumDispersion, Double_t& trackPtMean, Double_t& trackPtMedian)
278 {
279  // #### Calculate mean, median of constituents, radial moment (angularity), momentum dispersion, leSub (no correction)
280  Double_t jetLeadingHadronPt = -999.;
281  Double_t jetSubleadingHadronPt = -999.;
282  Double_t jetSummedPt = 0;
283  Double_t jetSummedPt2 = 0;
284  trackPtMean = 0;
285  trackPtMedian = 0;
286  angularity = 0;
287  momentumDispersion = 0;
288  std::vector<PWG::JETFW::AliEmcalParticleJetConstituent> tracks_sorted = jet->GetParticleConstituents();
289  std::sort(tracks_sorted.rbegin(), tracks_sorted.rend());
290  Int_t numTracks = tracks_sorted.size();
291  if(!numTracks) return;
292  Double_t* trackPts = new Double_t[numTracks];
293 
294  // Loop over all constituents and do jet shape calculations
295  for (Int_t i=0;i<numTracks;i++)
296  {
297  const AliVParticle* particle = tracks_sorted[i].GetParticle();
298  trackPtMean += particle->Pt();
299  trackPts[i] = particle->Pt();
300  if(particle->Pt() > jetLeadingHadronPt)
301  {
302  jetSubleadingHadronPt = jetLeadingHadronPt;
303  jetLeadingHadronPt = particle->Pt();
304  }
305  else if(particle->Pt() > jetSubleadingHadronPt)
306  jetSubleadingHadronPt = particle->Pt();
307 
308  Double_t deltaR = GetDistance(particle->Eta(), jet->Eta(), particle->Phi(), jet->Phi());
309  jetSummedPt += particle->Pt();
310  jetSummedPt2 += particle->Pt()*particle->Pt();
311  angularity += particle->Pt() * deltaR;
312  }
313 
314  if(numTracks)
315  {
316  trackPtMean /= numTracks;
317  trackPtMedian = TMath::Median(numTracks, trackPts);
318  }
319 
320  if(numTracks > 1)
321  leSub_noCorr = jetLeadingHadronPt - jetSubleadingHadronPt;
322  else
323  leSub_noCorr = jetLeadingHadronPt;
324 
325  if(jetSummedPt)
326  {
327  momentumDispersion = TMath::Sqrt(jetSummedPt2)/jetSummedPt;
328  angularity /= jetSummedPt;
329  }
330 }
331 
332 
333 //########################################################################
334 // HELPERS
335 //########################################################################
336 
337 //________________________________________________________________________
339 {
340  TH1* tmpHist = static_cast<TH1*>(fOutput->FindObject(key));
341  if(!tmpHist)
342  {
343  AliError(Form("Cannot find histogram <%s> ",key)) ;
344  return;
345  }
346 
347  tmpHist->Fill(x);
348 }
349 
350 //________________________________________________________________________
352 {
353  TH1* tmpHist = static_cast<TH1*>(fOutput->FindObject(key));
354  if(!tmpHist)
355  {
356  AliError(Form("Cannot find histogram <%s> ",key));
357  return;
358  }
359 
360  if (tmpHist->IsA()->GetBaseClass("TH1"))
361  static_cast<TH1*>(tmpHist)->Fill(x,y); // Fill x with y
362  else if (tmpHist->IsA()->GetBaseClass("TH2"))
363  static_cast<TH2*>(tmpHist)->Fill(x,y); // Fill x,y with 1
364 }
365 
366 //________________________________________________________________________
368 {
369  TH2* tmpHist = static_cast<TH2*>(fOutput->FindObject(key));
370  if(!tmpHist)
371  {
372  AliError(Form("Cannot find histogram <%s> ",key));
373  return;
374  }
375 
376  tmpHist->Fill(x,y,add);
377 }
378 
379 //________________________________________________________________________
381 {
382  TH3* tmpHist = static_cast<TH3*>(fOutput->FindObject(key));
383  if(!tmpHist)
384  {
385  AliError(Form("Cannot find histogram <%s> ",key));
386  return;
387  }
388 
389  if(add)
390  tmpHist->Fill(x,y,z,add);
391  else
392  tmpHist->Fill(x,y,z);
393 }
394 
395 
396 //________________________________________________________________________
397 template <class T> T* AliAnalysisTaskEmcalJetCorrection::AddHistogram1D(const char* name, const char* title, const char* options, Int_t xBins, Double_t xMin, Double_t xMax, const char* xTitle, const char* yTitle)
398 {
399  T* tmpHist = new T(name, title, xBins, xMin, xMax);
400 
401  tmpHist->GetXaxis()->SetTitle(xTitle);
402  tmpHist->GetYaxis()->SetTitle(yTitle);
403  tmpHist->SetOption(options);
404  tmpHist->SetMarkerStyle(kFullCircle);
405  tmpHist->Sumw2();
406 
407  fOutput->Add(tmpHist);
408 
409  return tmpHist;
410 }
411 
412 //________________________________________________________________________
413 template <class T> T* AliAnalysisTaskEmcalJetCorrection::AddHistogram2D(const char* name, const char* title, const char* options, Int_t xBins, Double_t xMin, Double_t xMax, Int_t yBins, Double_t yMin, Double_t yMax, const char* xTitle, const char* yTitle, const char* zTitle)
414 {
415  T* tmpHist = new T(name, title, xBins, xMin, xMax, yBins, yMin, yMax);
416  tmpHist->GetXaxis()->SetTitle(xTitle);
417  tmpHist->GetYaxis()->SetTitle(yTitle);
418  tmpHist->GetZaxis()->SetTitle(zTitle);
419  tmpHist->SetOption(options);
420  tmpHist->SetMarkerStyle(kFullCircle);
421  tmpHist->Sumw2();
422 
423  fOutput->Add(tmpHist);
424 
425  return tmpHist;
426 }
427 
428 //________________________________________________________________________
429 template <class T> T* AliAnalysisTaskEmcalJetCorrection::AddHistogram3D(const char* name, const char* title, const char* options, Int_t xBins, Double_t xMin, Double_t xMax, Int_t yBins, Double_t yMin, Double_t yMax, Int_t zBins, Double_t zMin, Double_t zMax, const char* xTitle, const char* yTitle, const char* zTitle)
430 {
431  T* tmpHist = new T(name, title, xBins, xMin, xMax, yBins, yMin, yMax, zBins, zMin, zMax);
432  tmpHist->GetXaxis()->SetTitle(xTitle);
433  tmpHist->GetYaxis()->SetTitle(yTitle);
434  tmpHist->GetZaxis()->SetTitle(zTitle);
435  tmpHist->SetOption(options);
436  tmpHist->SetMarkerStyle(kFullCircle);
437  tmpHist->Sumw2();
438 
439  fOutput->Add(tmpHist);
440 
441  return tmpHist;
442 }
443 
444 //________________________________________________________________________
446 {
447  // Called once at the end of the analysis.
448 }
449 
450 // ### ADDTASK MACRO
451 //________________________________________________________________________
452 AliAnalysisTaskEmcalJetCorrection* AliAnalysisTaskEmcalJetCorrection::AddTaskEmcalJetCorrection(TString modelName, TString trackArray, TString jetArray, TString rhoObject, Double_t jetRadius, const char* taskNameSuffix)
453 {
454  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
455  Double_t minJetEta = 0.5;
456  Double_t minJetPt = 0.15;
457  Double_t minTrackPt = 0.15;
458  Double_t minJetAreaPerc = 0.557;
459  TString suffix = "";
460  if(taskNameSuffix != 0)
461  suffix = taskNameSuffix;
462 
463  // ###### Task name
464  TString name("AliAnalysisTaskEmcalJetCorrection");
465  if (jetArray != "") {
466  name += "_";
467  name += jetArray;
468  }
469  if (rhoObject != "") {
470  name += "_";
471  name += rhoObject;
472  }
473  if(modelName != "") {
474  name += "_";
475  name += modelName;
476  }
477  if (suffix != "") {
478  name += "_";
479  name += suffix;
480  }
481 
482  // ###### Setup task with default settings
483  AliAnalysisTaskEmcalJetCorrection* myTask = new AliAnalysisTaskEmcalJetCorrection(name);
484  myTask->SetVzRange(-10.,10.);
485  myTask->SetModelName(modelName);
486 
487  // Particle container and track pt cut
488  AliParticleContainer* trackCont = 0;
489  if(trackArray == "mcparticles")
490  trackCont = myTask->AddMCParticleContainer(trackArray);
491  else if(trackArray =="mctracks")
492  trackCont = myTask->AddParticleContainer(trackArray);
493  else
494  trackCont = myTask->AddTrackContainer(trackArray);
495  trackCont->SetParticlePtCut(minTrackPt);
496 
497  // Jet container
498  AliJetContainer *jetCont = myTask->AddJetContainer(jetArray,6,jetRadius);
499  if (jetCont) {
500  jetCont->SetRhoName(rhoObject);
501  jetCont->SetPercAreaCut(minJetAreaPerc);
502  jetCont->SetJetPtCut(minJetPt);
503  jetCont->SetLeadingHadronType(0);
504  jetCont->SetPtBiasJetTrack(minTrackPt);
505  jetCont->SetJetEtaLimits(-minJetEta, +minJetEta);
506  jetCont->ConnectParticleContainer(trackCont);
507  jetCont->SetMaxTrackPt(1000);
508  }
509 
510  mgr->AddTask(myTask);
511 
512  // ###### Connect inputs/outputs
513  mgr->ConnectInput (myTask, 0, mgr->GetCommonInputContainer() );
514  mgr->ConnectOutput (myTask, 1, mgr->CreateContainer(Form("%s", name.Data()), AliEmcalList::Class(), AliAnalysisManager::kOutputContainer, Form("%s", mgr->GetCommonFileName())) );
515 
516  return myTask;
517 }
void CalculateJetShapes(AliEmcalJet *jet, Double_t &leSub_noCorr, Double_t &angularity, Double_t &momentumDispersion, Double_t &trackPtMean, Double_t &trackPtMedian)
Double_t GetFirstOrderSubtractedAngularity() const
Double_t Area() const
Definition: AliEmcalJet.h:130
void SetParticlePtCut(Double_t cut)
Double_t GetRhoVal() const
double Double_t
Definition: External.C:58
Double_t GetSecondOrderSubtractedSigma2() const
const char * title
Definition: MakeQAPdf.C:27
AliJetContainer * GetJetContainer(Int_t i=0) const
Definition: External.C:244
T * AddHistogram3D(const char *name="CustomHistogram", const char *title="NO_TITLE", const char *options="", Int_t xBins=100, Double_t xMin=0.0, Double_t xMax=20.0, Int_t yBins=100, Double_t yMin=0.0, Double_t yMax=20.0, Int_t zBins=100, Double_t zMin=0.0, Double_t zMax=20.0, const char *xTitle="x axis", const char *yTitle="y axis", const char *zTitle="z axis")
Double_t GetSecondOrderSubtractedConstituent() const
Double_t Eta() const
Definition: AliEmcalJet.h:121
T * AddHistogram2D(const char *name="CustomHistogram", const char *title="NO_TITLE", const char *options="", Int_t xBins=100, Double_t xMin=0.0, Double_t xMax=20.0, Int_t yBins=100, Double_t yMin=0.0, Double_t yMax=20.0, const char *xTitle="x axis", const char *yTitle="y axis", const char *zTitle="z axis")
void SetLeadingHadronType(Int_t t)
Double_t Phi() const
Definition: AliEmcalJet.h:117
void SetPtBiasJetTrack(Float_t b)
TSystem * gSystem
TString fBackgroundModelInputParameters
MVA model input parameters (comma-separated)
AliJetContainer * AddJetContainer(const char *n, TString defaultCutType, Float_t jetRadius=0.4)
const std::vector< PWG::JETFW::AliEmcalParticleJetConstituent > & GetParticleConstituents() const
Get container with particle (track / MC particle) constituents.
Definition: AliEmcalJet.h:184
void LoadRhoMass(const AliVEvent *event)
void SetPercAreaCut(Float_t p)
TClonesArray * fJetOutputArray
! Array of corr. jets, attached to event
void SetVzRange(Double_t min, Double_t max)
Set pre-configured event cut object.
void ExecOnce()
Perform steps needed to initialize the analysis.
Container for particles within the EMCAL framework.
UShort_t T(UShort_t m, UShort_t t)
Definition: RingBits.C:60
void SetRhoName(const char *n)
AliParticleContainer * GetParticleContainer() const
T * AddHistogram1D(const char *name="CustomHistogram", const char *title="NO_TITLE", const char *options="", Int_t xBins=100, Double_t xMin=0.0, Double_t xMax=20.0, const char *xTitle="x axis", const char *yTitle="y axis")
int Int_t
Definition: External.C:63
void SetJetPtCut(Float_t cut)
float Float_t
Definition: External.C:68
TString fCustomPackages
Custom python modules to be installed locally.
void GetPtFromModel(AliEmcalJet *jet, Float_t &pt_ML)
AliParticleContainer * AddParticleContainer(const char *n)
Create new particle container and attach it to the task.
Double_t GetSecondOrderSubtractedAngularity() const
Double_t GetRhoMassVal() const
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
AliEmcalJet * GetNextAcceptJet()
TString fBackgroundModelFileName
MVA model file name.
void ConnectParticleContainer(AliParticleContainer *c)
Double_t Pt() const
Definition: AliEmcalJet.h:109
const TString & GetArrayName() const
Double_t GetFirstOrderSubtractedCircularity() const
AliEmcalList * fOutput
!output list
Double_t GetDistance(Double_t eta1, Double_t eta2, Double_t phi1, Double_t phi2)
static AliAnalysisTaskEmcalJetCorrection * AddTaskEmcalJetCorrection(TString modelName, TString trackArray, TString jetArray, TString rhoObject, Double_t jetRadius, const char *taskNameSuffix)
Definition: External.C:220
AliTrackContainer * AddTrackContainer(const char *n)
Create new track container and attach it to the task.
Double_t GetSecondOrderSubtractedCircularity() const
TString fPythonModulePath
The path of custom python modules (depends on local python version)
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
const char Option_t
Definition: External.C:48
TString fModelName
Name of model (used for jet collection suffix)
void FillHistogram3D(const char *key, Double_t x, Double_t y, Double_t z, Double_t add=0)
void UserCreateOutputObjects()
Main initialization function on the worker.
Double_t GetFirstOrderSubtractedSigma2() const
bool Bool_t
Definition: External.C:53
AliEmcalJetShapeProperties * GetShapeProperties() const
Definition: AliEmcalJet.h:375
Double_t yMin
void SetMaxTrackPt(Float_t b)
void SetJetEtaLimits(Float_t min, Float_t max)
Double_t M() const
Definition: AliEmcalJet.h:120
void ResetCurrentID(Int_t i=-1)
Reset the iterator to a given index.
Container for jet within the EMCAL jet framework.
Definition: External.C:196
Double_t yMax
void SetPtEtaPhi(Double_t pT, Double_t eta, Double_t phi)
Set pT, eta, phi of jet.
Definition: AliEmcalJet.h:284
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
Analysis task that corrects jet pT with scikit-learn models.