AliPhysics  9b6b435 (9b6b435)
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  fJetsCont(),
49  fTracksCont(),
50  fJetOutputArray(),
51  fCustomPackages(),
52  fBackgroundModelFileName(""),
53  fBackgroundModelInputParameters(""),
54  fCorrectAlsoMass(kFALSE),
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  fJetsCont(),
67  fTracksCont(),
68  fJetOutputArray(),
69  fCustomPackages("sklearn,numpy"),
70  fBackgroundModelFileName(""),
71  fBackgroundModelInputParameters(""),
72  fCorrectAlsoMass(kFALSE),
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  AddHistogram2D<TH2D>("hJetMassCorrelation", "Jet mass (model vs. corrected)", "COLZ", 400, -100., 300., 400, -100., 300., "m_{ML} (GeV/c2)", "m (GeV/c2)", "dN2^{Jets}/d2m");
98 
99  PostData(1, fOutput);
100 
101 }
102 
103 
104 //________________________________________________________________________
106 {
108 
109  // ### Need to explicitly tell jet container to load rho mass object
110  fJetsCont->LoadRhoMass(InputEvent());
111 
112  #if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
113  fPythonCLI = new TPython();
114  // ### Install custom packages locally on worker node
115  if(!fCustomPackages.IsNull())
116  {
117  std::ofstream outFile;
118  outFile.open("./myScript.sh");
119  outFile << "#!/bin/bash" << std::endl;
120  outFile << "export PYTHONUSERBASE=./my-local-python" << std::endl;
121  outFile << "export PATH=\"$PYTHONUSERBASE/bin:$PATH\"" << std::endl;
122  TObjArray* packages = fCustomPackages.Tokenize(",");
123  for(Int_t iPackage = 0; iPackage < packages->GetEntries(); iPackage++)
124  {
125  TString package = ((TObjString *)(packages->At(iPackage)))->String();
126  outFile << "pip install --user " << package.Data() << std::endl;
127  }
128  outFile.close();
129  gSystem->Exec("bash ./myScript.sh");
130 
131  packages->SetOwner();
132  delete packages;
133  }
134 
135  // ### Get background model from alien and load it
136  TGrid::Connect("alien://");
137  if (gSystem->AccessPathName(fBackgroundModelFileName.Data()))
138  AliFatal(Form("Background model %s does not exist!", fBackgroundModelFileName.Data()));
139  TFile::Cp(fBackgroundModelFileName.Data(), "./Model.pkl");
140 
141  fPythonCLI->Exec("import sys");
142  fPythonCLI->Exec("sys.path.insert(0, './my-local-python/lib/python2.7/site-packages/')");
143  fPythonCLI->Exec("import sklearn, numpy");
144  fPythonCLI->Exec("estimator = sklearn.externals.joblib.load(\"./Model.pkl\")");
145  #endif
146 
147  // ### Prepare jet output array
148  if (!(InputEvent()->FindListObject(Form("%s_RhoMVA_%s", fJetsCont->GetArrayName().Data(), fModelName.Data())))) {
149  fJetOutputArray = new TClonesArray("AliEmcalJet");
150  fJetOutputArray->SetName(Form("%s_RhoMVA_%s", fJetsCont->GetArrayName().Data(), fModelName.Data()));
151  InputEvent()->AddObject(fJetOutputArray);
152  }
153  else {
154  AliFatal(Form("Jet output array with name %s_RhoMVA_%s already in event!", fJetsCont->GetArrayName().Data(), fModelName.Data()));
155  }
156 
157 }
158 
159 //________________________________________________________________________
161 {
162  AliRhoParameter* rhoMass = static_cast<AliRhoParameter*>(InputEvent()->FindListObject(fJetsCont->GetRhoMassName().Data()));
163 
164  // ################################### MAIN JET LOOP
166  Int_t jetCount = 0;
167  while(AliEmcalJet *jet = fJetsCont->GetNextAcceptJet())
168  {
169  Float_t pt_ML = 0;
170  Float_t mass_ML = 0;
171  GetPtAndMassFromModel(jet, pt_ML, mass_ML);
172  AliEmcalJet *outJet = new ((*fJetOutputArray)[jetCount]) AliEmcalJet(*jet);
173  outJet->SetPtEtaPhi(pt_ML, jet->Eta(), jet->Phi());
174  if(fCorrectAlsoMass)
175  outJet->SetMass(mass_ML);
176  FillHistogram("hJetPtCorrelation", pt_ML, jet->Pt()-jet->Area()*fJetsCont->GetRhoVal());
177  FillHistogram("hJetMassCorrelation", mass_ML, (rhoMass) ? jet->GetShapeProperties()->GetSecondOrderSubtracted() : jet->M());
178  jetCount++;
179  }
180 
181  return kTRUE;
182 }
183 
184 //________________________________________________________________________
186 {
187  #if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
188  TString arrayStr = GetBackgroundModelArrayString(jet);
189  // ####### Run Python script that does inference on jet
190  fPythonCLI->Exec(Form("data_inference = numpy.array([[%s]])", arrayStr.Data()));
191  fPythonCLI->Exec("result = estimator.predict(data_inference)");
192  if(fCorrectAlsoMass)
193  {
194  pt_ML = fPythonCLI->Eval("result[0][0]");
195  mass_ML = fPythonCLI->Eval("result[0][1]");
196  }
197  else
198  {
199  pt_ML = fPythonCLI->Eval("result[0]");
200  mass_ML = 0.0;
201  }
202  #endif
203 }
204 
205 //________________________________________________________________________
207 {
208  // ####### Calculate inference input parameters
209  std::vector<PWG::JETFW::AliEmcalParticleJetConstituent> tracks_sorted = jet->GetParticleConstituents();
210  std::sort(tracks_sorted.rbegin(), tracks_sorted.rend());
211  Double_t* trackPts = new Double_t[TMath::Max(Int_t(tracks_sorted.size()), 100)];
212  for(Int_t i = 0; i < TMath::Max(Int_t(tracks_sorted.size()), 100); i++)
213  {
214  const AliVParticle* particle = tracks_sorted[i].GetParticle();
215  trackPts[i] = particle->Pt();
216  }
217 
218  // Calculate jet shapes that could be demanded
219  Double_t leSub_noCorr = 0;
220  Double_t angularity = 0;
221  Double_t momentumDispersion = 0;
222  Double_t trackPtMean = 0;
223  Double_t trackPtMedian = 0;
224  CalculateJetShapes(jet, leSub_noCorr, angularity, momentumDispersion, trackPtMean, trackPtMedian);
225 
226  TString resultStr = "";
227  TObjArray* data_tokens = fBackgroundModelInputParameters.Tokenize(",");
228  for(Int_t iToken = 0; iToken < data_tokens->GetEntries(); iToken++)
229  {
230  TString token = ((TObjString *)(data_tokens->At(iToken)))->String();
231  if(token == "Jet_Pt")
232  resultStr += Form("%E", jet->Pt() - fJetsCont->GetRhoVal()*jet->Area());
233  else if(token == "Jet_NumConstituents")
234  resultStr += Form("%E", (Double_t)tracks_sorted.size());
235  else if(token == "Jet_Shape_Mass_NoCorr")
236  resultStr += Form("%E", jet->M());
237  else if(token == "Jet_Shape_Mass_DerivCorr_1")
238  resultStr += Form("%E", jet->GetShapeProperties()->GetFirstOrderSubtracted());
239  else if(token == "Jet_Shape_Mass_DerivCorr_2")
240  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtracted());
241  else if(token == "Jet_Shape_pTD_DerivCorr_1")
242  resultStr += Form("%E", jet->GetShapeProperties()->GetFirstOrderSubtractedpTD());
243  else if(token == "Jet_Shape_pTD_DerivCorr_2")
244  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedpTD());
245  else if(token == "Jet_Shape_LeSub_NoCorr")
246  resultStr += Form("%E", leSub_noCorr);
247  else if(token == "Jet_Shape_LeSub_DerivCorr")
248  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedLeSub());
249  else if(token == "Jet_Shape_Sigma2_DerivCorr_1")
250  resultStr += Form("%E", jet->GetShapeProperties()->GetFirstOrderSubtractedSigma2());
251  else if(token == "Jet_Shape_Sigma2_DerivCorr_2")
252  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedSigma2());
253  else if(token == "Jet_Shape_Angularity_NoCorr")
254  resultStr += Form("%E", angularity);
255  else if(token == "Jet_Shape_Angularity_DerivCorr_1")
256  resultStr += Form("%E", jet->GetShapeProperties()->GetFirstOrderSubtractedAngularity());
257  else if(token == "Jet_Shape_Angularity_DerivCorr_2")
258  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedAngularity());
259  else if(token == "Jet_Shape_Circularity_DerivCorr_1")
260  resultStr += Form("%E", jet->GetShapeProperties()->GetFirstOrderSubtractedCircularity());
261  else if(token == "Jet_Shape_Circularity_DerivCorr_2")
262  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedCircularity());
263  else if(token == "Jet_Shape_NumConst_DerivCorr")
264  resultStr += Form("%E", jet->GetShapeProperties()->GetSecondOrderSubtractedConstituent());
265  else if(token == "Jet_Shape_MomentumDispersion")
266  resultStr += Form("%E", momentumDispersion);
267  else if(token == "Jet_Shape_TrackPtMean")
268  resultStr += Form("%E", trackPtMean);
269  else if(token == "Jet_Shape_TrackPtMedian")
270  resultStr += Form("%E", trackPtMedian);
271  else if(token == "Event_BackgroundDensity")
272  resultStr += Form("%E", fJetsCont->GetRhoVal());
273  else if(token == "Event_BackgroundDensityMass")
274  resultStr += Form("%E", fJetsCont->GetRhoMassVal());
275  else if(token == "Jet_Area")
276  resultStr += Form("%E", jet->Area());
277  else if(token.BeginsWith("Jet_TrackPt"))
278  {
279  TString num = token(17,(token.Length()-17));
280  resultStr += Form("%E", trackPts[num.Atoi()]);
281  }
282 
283  // Add comma after numbers
284  if((iToken < data_tokens->GetEntries()-1))
285  resultStr += ", ";
286  }
287 
288  data_tokens->SetOwner();
289  delete data_tokens;
290  delete[] trackPts;
291  return resultStr;
292 }
293 
294 //________________________________________________________________________
295 void AliAnalysisTaskEmcalJetCorrection::CalculateJetShapes(AliEmcalJet* jet, Double_t& leSub_noCorr, Double_t& angularity, Double_t& momentumDispersion, Double_t& trackPtMean, Double_t& trackPtMedian)
296 {
297  // #### Calculate mean, median of constituents, radial moment (angularity), momentum dispersion, leSub (no correction)
298  Double_t jetLeadingHadronPt = -999.;
299  Double_t jetSubleadingHadronPt = -999.;
300  Double_t jetSummedPt = 0;
301  Double_t jetSummedPt2 = 0;
302  trackPtMean = 0;
303  trackPtMedian = 0;
304  angularity = 0;
305  momentumDispersion = 0;
306  std::vector<PWG::JETFW::AliEmcalParticleJetConstituent> tracks_sorted = jet->GetParticleConstituents();
307  std::sort(tracks_sorted.rbegin(), tracks_sorted.rend());
308  Int_t numTracks = tracks_sorted.size();
309  if(!numTracks) return;
310  Double_t* trackPts = new Double_t[numTracks];
311 
312  // Loop over all constituents and do jet shape calculations
313  for (Int_t i=0;i<numTracks;i++)
314  {
315  const AliVParticle* particle = tracks_sorted[i].GetParticle();
316  trackPtMean += particle->Pt();
317  trackPts[i] = particle->Pt();
318  if(particle->Pt() > jetLeadingHadronPt)
319  {
320  jetSubleadingHadronPt = jetLeadingHadronPt;
321  jetLeadingHadronPt = particle->Pt();
322  }
323  else if(particle->Pt() > jetSubleadingHadronPt)
324  jetSubleadingHadronPt = particle->Pt();
325 
326  Double_t deltaR = GetDistance(particle->Eta(), jet->Eta(), particle->Phi(), jet->Phi());
327  jetSummedPt += particle->Pt();
328  jetSummedPt2 += particle->Pt()*particle->Pt();
329  angularity += particle->Pt() * deltaR;
330  }
331 
332  if(numTracks)
333  {
334  trackPtMean /= numTracks;
335  trackPtMedian = TMath::Median(numTracks, trackPts);
336  }
337 
338  if(numTracks > 1)
339  leSub_noCorr = jetLeadingHadronPt - jetSubleadingHadronPt;
340  else
341  leSub_noCorr = jetLeadingHadronPt;
342 
343  if(jetSummedPt)
344  {
345  momentumDispersion = TMath::Sqrt(jetSummedPt2)/jetSummedPt;
346  angularity /= jetSummedPt;
347  }
348 }
349 
350 
351 //########################################################################
352 // HELPERS
353 //########################################################################
354 
355 //________________________________________________________________________
357 {
358  TH1* tmpHist = static_cast<TH1*>(fOutput->FindObject(key));
359  if(!tmpHist)
360  {
361  AliError(Form("Cannot find histogram <%s> ",key)) ;
362  return;
363  }
364 
365  tmpHist->Fill(x);
366 }
367 
368 //________________________________________________________________________
370 {
371  TH1* tmpHist = static_cast<TH1*>(fOutput->FindObject(key));
372  if(!tmpHist)
373  {
374  AliError(Form("Cannot find histogram <%s> ",key));
375  return;
376  }
377 
378  if (tmpHist->IsA()->GetBaseClass("TH1"))
379  static_cast<TH1*>(tmpHist)->Fill(x,y); // Fill x with y
380  else if (tmpHist->IsA()->GetBaseClass("TH2"))
381  static_cast<TH2*>(tmpHist)->Fill(x,y); // Fill x,y with 1
382 }
383 
384 //________________________________________________________________________
386 {
387  TH2* tmpHist = static_cast<TH2*>(fOutput->FindObject(key));
388  if(!tmpHist)
389  {
390  AliError(Form("Cannot find histogram <%s> ",key));
391  return;
392  }
393 
394  tmpHist->Fill(x,y,add);
395 }
396 
397 //________________________________________________________________________
399 {
400  TH3* tmpHist = static_cast<TH3*>(fOutput->FindObject(key));
401  if(!tmpHist)
402  {
403  AliError(Form("Cannot find histogram <%s> ",key));
404  return;
405  }
406 
407  if(add)
408  tmpHist->Fill(x,y,z,add);
409  else
410  tmpHist->Fill(x,y,z);
411 }
412 
413 
414 //________________________________________________________________________
415 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)
416 {
417  T* tmpHist = new T(name, title, xBins, xMin, xMax);
418 
419  tmpHist->GetXaxis()->SetTitle(xTitle);
420  tmpHist->GetYaxis()->SetTitle(yTitle);
421  tmpHist->SetOption(options);
422  tmpHist->SetMarkerStyle(kFullCircle);
423  tmpHist->Sumw2();
424 
425  fOutput->Add(tmpHist);
426 
427  return tmpHist;
428 }
429 
430 //________________________________________________________________________
431 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)
432 {
433  T* tmpHist = new T(name, title, xBins, xMin, xMax, yBins, yMin, yMax);
434  tmpHist->GetXaxis()->SetTitle(xTitle);
435  tmpHist->GetYaxis()->SetTitle(yTitle);
436  tmpHist->GetZaxis()->SetTitle(zTitle);
437  tmpHist->SetOption(options);
438  tmpHist->SetMarkerStyle(kFullCircle);
439  tmpHist->Sumw2();
440 
441  fOutput->Add(tmpHist);
442 
443  return tmpHist;
444 }
445 
446 //________________________________________________________________________
447 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)
448 {
449  T* tmpHist = new T(name, title, xBins, xMin, xMax, yBins, yMin, yMax, zBins, zMin, zMax);
450  tmpHist->GetXaxis()->SetTitle(xTitle);
451  tmpHist->GetYaxis()->SetTitle(yTitle);
452  tmpHist->GetZaxis()->SetTitle(zTitle);
453  tmpHist->SetOption(options);
454  tmpHist->SetMarkerStyle(kFullCircle);
455  tmpHist->Sumw2();
456 
457  fOutput->Add(tmpHist);
458 
459  return tmpHist;
460 }
461 
462 //________________________________________________________________________
464 {
465  // Called once at the end of the analysis.
466 }
467 
468 // ### ADDTASK MACRO
469 //________________________________________________________________________
470 AliAnalysisTaskEmcalJetCorrection* AliAnalysisTaskEmcalJetCorrection::AddTaskEmcalJetCorrection(TString modelName, TString trackArray, TString jetArray, TString rhoObject, Double_t jetRadius, const char* taskNameSuffix)
471 {
472  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
473  Double_t minJetEta = 0.5;
474  Double_t minJetPt = 0.15;
475  Double_t minTrackPt = 0.15;
476  Double_t minJetAreaPerc = 0.557;
477  TString suffix = "";
478  if(taskNameSuffix != 0)
479  suffix = taskNameSuffix;
480 
481  // ###### Task name
482  TString name("AliAnalysisTaskEmcalJetCorrection");
483  if (jetArray != "") {
484  name += "_";
485  name += jetArray;
486  }
487  if (rhoObject != "") {
488  name += "_";
489  name += rhoObject;
490  }
491  if(modelName != "") {
492  name += "_";
493  name += modelName;
494  }
495  if (suffix != "") {
496  name += "_";
497  name += suffix;
498  }
499 
500  // ###### Setup task with default settings
501  AliAnalysisTaskEmcalJetCorrection* myTask = new AliAnalysisTaskEmcalJetCorrection(name);
502  myTask->SetVzRange(-10.,10.);
503  myTask->SetModelName(modelName);
504 
505  // Particle container and track pt cut
506  AliParticleContainer* trackCont = 0;
507  if(trackArray == "mcparticles")
508  trackCont = myTask->AddMCParticleContainer(trackArray);
509  else if(trackArray =="mctracks")
510  trackCont = myTask->AddParticleContainer(trackArray);
511  else
512  trackCont = myTask->AddTrackContainer(trackArray);
513  trackCont->SetParticlePtCut(minTrackPt);
514 
515  // Jet container
516  AliJetContainer *jetCont = myTask->AddJetContainer(jetArray,6,jetRadius);
517  if (jetCont) {
518  jetCont->SetRhoName(rhoObject);
519  jetCont->SetPercAreaCut(minJetAreaPerc);
520  jetCont->SetJetPtCut(minJetPt);
521  jetCont->SetLeadingHadronType(0);
522  jetCont->SetPtBiasJetTrack(minTrackPt);
523  jetCont->SetJetEtaLimits(-minJetEta, +minJetEta);
524  jetCont->ConnectParticleContainer(trackCont);
525  jetCont->SetMaxTrackPt(1000);
526  }
527 
528  mgr->AddTask(myTask);
529 
530  // ###### Connect inputs/outputs
531  mgr->ConnectInput (myTask, 0, mgr->GetCommonInputContainer() );
532  mgr->ConnectOutput (myTask, 1, mgr->CreateContainer(Form("%s", name.Data()), AliEmcalList::Class(), AliAnalysisManager::kOutputContainer, Form("%s", mgr->GetCommonFileName())) );
533 
534  return myTask;
535 }
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 SetMass(Double_t mass)
Set jet mass.
Definition: AliEmcalJet.h:290
const TString & GetRhoMassName() const
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 pip packages to be installed.
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
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 GetPtAndMassFromModel(AliEmcalJet *jet, Float_t &pt_ML, Float_t &mass_ML)
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
Bool_t fCorrectAlsoMass
mass is also approximated by model or not
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/mass with Python code.