AliPhysics  1168478 (1168478)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskRhoBaseDev.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2017, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 #include <TFile.h>
17 #include <TF1.h>
18 #include <TH1F.h>
19 #include <TH2F.h>
20 #include <TClonesArray.h>
21 #include <TGrid.h>
22 
23 #include <AliLog.h>
24 #include <AliVEventHandler.h>
25 #include <AliAnalysisManager.h>
26 
27 #include "AliRhoParameter.h"
28 #include "AliEmcalJet.h"
29 #include "AliParticleContainer.h"
30 #include "AliClusterContainer.h"
31 #include "AliJetContainer.h"
32 
34 
38 
44  fOutRhoName(),
45  fOutRhoScaledName(),
46  fRhoFunction(0),
47  fScaleFunction(0),
48  fAttachToEvent(kTRUE),
49  fNbins(250),
50  fMinBinPt(0),
51  fMaxBinPt(500),
52  fTaskConfigured(kFALSE),
53  fNtracks(0),
54  fNclusters(0),
55  fNjets(),
56  fTotJetArea(),
57  fLeadingParticle(0),
58  fLeadingCluster(0),
59  fLeadingJet(),
60  fSortedJets(),
61  fOutRho(0),
62  fOutRhoScaled(0),
63  fHistRhoVsCent(0),
64  fHistRhoVsLeadJetPt(),
65  fHistLeadJetPtVsCent(),
66  fHistLeadJetPtDensityVsCent(),
67  fHistTotJetAreaVsCent(),
68  fHistLeadJetNconstVsCent(),
69  fHistLeadJetNconstVsPt(),
70  fHistNjetVsCent(),
71  fHistNjetVsNtrack(),
72  fHistRhoVsLeadTrackPt(0),
73  fHistRhoVsNtrack(0),
74  fHistLeadTrackPtVsCent(0),
75  fHistNtrackVsCent(0),
76  fHistRhoVsLeadClusterE(0),
77  fHistRhoVsNcluster(0),
78  fHistLeadClusterEVsCent(0),
79  fHistNclusterVsCent(0),
80  fHistRhoScaledVsCent(0),
81  fHistRhoScaledVsNtrack(0),
82  fHistRhoScaledVsNcluster(0)
83 {
84 }
85 
93  AliAnalysisTaskEmcalJetLight(name, histo),
94  fOutRhoName(),
95  fOutRhoScaledName(),
96  fRhoFunction(0),
97  fScaleFunction(0),
98  fAttachToEvent(kTRUE),
99  fNbins(250),
100  fMinBinPt(0),
101  fMaxBinPt(500),
102  fTaskConfigured(kFALSE),
103  fNtracks(0),
104  fNclusters(0),
105  fNjets(),
106  fTotJetArea(),
107  fLeadingParticle(0),
108  fLeadingCluster(0),
109  fLeadingJet(),
110  fSortedJets(),
111  fOutRho(0),
112  fOutRhoScaled(0),
113  fHistRhoVsCent(0),
114  fHistRhoVsLeadJetPt(),
115  fHistLeadJetPtVsCent(),
116  fHistLeadJetPtDensityVsCent(),
117  fHistTotJetAreaVsCent(),
118  fHistLeadJetNconstVsCent(),
119  fHistLeadJetNconstVsPt(),
120  fHistNjetVsCent(),
121  fHistNjetVsNtrack(),
122  fHistRhoVsLeadTrackPt(0),
123  fHistRhoVsNtrack(0),
124  fHistLeadTrackPtVsCent(0),
125  fHistNtrackVsCent(0),
126  fHistRhoVsLeadClusterE(0),
127  fHistRhoVsNcluster(0),
128  fHistLeadClusterEVsCent(0),
129  fHistNclusterVsCent(0),
130  fHistRhoScaledVsCent(0),
131  fHistRhoScaledVsNtrack(0),
132  fHistRhoScaledVsNcluster(0)
133 {
135 }
136 
142 {
143  if (!fCreateHisto) return;
144 
146 
147  ::Info("UserCreateOutputObjects", "CreateOutputObjects of task %s", GetName());
148 
149  TString name;
150 
151  //ranges for PbPb
152  Float_t Ntrackrange[2] = {0, 6000};
153  //set multiplicity related axes to a smaller max value
154  if (fBeamType != kAA) Ntrackrange[1] = 200.;
155 
156  fHistRhoVsCent = new TH2F("fHistRhoVsCent", "fHistRhoVsCent", 100, 0, 100, fNbins, fMinBinPt, fMaxBinPt);
157  fHistRhoVsCent->GetXaxis()->SetTitle("Centrality (%)");
158  fHistRhoVsCent->GetYaxis()->SetTitle("#rho (GeV/#it{c} #times rad^{-1})");
159  fOutput->Add(fHistRhoVsCent);
160 
161  if (fParticleCollArray.size() > 0) {
162  fHistRhoVsNtrack = new TH2F("fHistRhoVsNtrack", "fHistRhoVsNtrack", 200, Ntrackrange[0], Ntrackrange[1], fNbins, fMinBinPt, fMaxBinPt);
163  fHistRhoVsNtrack->GetXaxis()->SetTitle("No. of tracks");
164  fHistRhoVsNtrack->GetYaxis()->SetTitle("#rho (GeV/#it{c} #times rad^{-1})");
166 
167  fHistNtrackVsCent = new TH2F("fHistNtrackVsCent", "fHistNtrackVsCent", 100, 0, 100, 200, Ntrackrange[0], Ntrackrange[1]);
168  fHistNtrackVsCent->GetXaxis()->SetTitle("Centrality (%)");
169  fHistNtrackVsCent->GetYaxis()->SetTitle("No. of tracks");
171 
172  fHistRhoVsLeadTrackPt = new TH2F("fHistRhoVsLeadTrackPt", "fHistRhoVsLeadTrackPt", fNbins, fMinBinPt, fMaxBinPt*2, fNbins, fMinBinPt, fMaxBinPt);
173  fHistRhoVsLeadTrackPt->GetXaxis()->SetTitle("#it{p}_{T,track} (GeV/c)");
174  fHistRhoVsLeadTrackPt->GetYaxis()->SetTitle("#rho (GeV/#it{c} #times rad^{-1})");
176 
177  fHistLeadTrackPtVsCent = new TH2F("fHistLeadTrackPtVsCent", "fHistLeadTrackPtVsCent", 100, 0, 100, fNbins, fMinBinPt, fMaxBinPt*2);
178  fHistLeadTrackPtVsCent->GetXaxis()->SetTitle("Centrality (%)");
179  fHistLeadTrackPtVsCent->GetYaxis()->SetTitle("#it{p}_{T,track} (GeV/c)");
181  }
182 
183  if (fClusterCollArray.size()>0) {
184  fHistRhoVsNcluster = new TH2F("fHistRhoVsNcluster", "fHistRhoVsNcluster", 50, Ntrackrange[0] / 4, Ntrackrange[1] / 4, fNbins, fMinBinPt, fMaxBinPt);
185  fHistRhoVsNcluster->GetXaxis()->SetTitle("No. of clusters");
186  fHistRhoVsNcluster->GetYaxis()->SetTitle("#rho (GeV/#it{c} #times rad^{-1})");
188 
189  fHistNclusterVsCent = new TH2F("fHistNclusterVsCent", "fHistNclusterVsCent", 100, 0, 100, 50, Ntrackrange[0] / 4, Ntrackrange[1] / 4);
190  fHistNclusterVsCent->GetXaxis()->SetTitle("Centrality (%)");
191  fHistNclusterVsCent->GetYaxis()->SetTitle("No. of clusters");
193 
194  fHistRhoVsLeadClusterE = new TH2F("fHistRhoVsLeadClusterE", "fHistRhoVsLeadClusterE", fNbins, fMinBinPt, fMaxBinPt*2, fNbins, fMinBinPt, fMaxBinPt);
195  fHistRhoVsLeadClusterE->GetXaxis()->SetTitle("#it{p}_{T,track} (GeV/c)");
196  fHistRhoVsLeadClusterE->GetYaxis()->SetTitle("#rho (GeV/#it{c} #times rad^{-1})");
198 
199  fHistLeadClusterEVsCent = new TH2F("fHistLeadClusterEVsCent", "fHistLeadClusterEVsCent", 100, 0, 100, fNbins, fMinBinPt, fMaxBinPt*2);
200  fHistLeadClusterEVsCent->GetXaxis()->SetTitle("Centrality (%)");
201  fHistLeadClusterEVsCent->GetYaxis()->SetTitle("#it{p}_{T,track} (GeV/c)");
203  }
204 
205  for (auto jetCont : fJetCollArray) {
206  name = TString::Format("%s_fHistRhoVsLeadJetPt", jetCont.first.c_str());
207  fHistRhoVsLeadJetPt[jetCont.first] = new TH2F(name, name, fNbins, fMinBinPt, fMaxBinPt*2, fNbins, fMinBinPt, fMaxBinPt);
208  fHistRhoVsLeadJetPt[jetCont.first]->GetXaxis()->SetTitle("#it{p}_{T,jet} (GeV/c)");
209  fHistRhoVsLeadJetPt[jetCont.first]->GetYaxis()->SetTitle("#rho (GeV/#it{c} #times rad^{-1})");
210  fOutput->Add(fHistRhoVsLeadJetPt[jetCont.first]);
211 
212  name = TString::Format("%s_fHistLeadJetPtVsCent", jetCont.first.c_str());
213  fHistLeadJetPtVsCent[jetCont.first] = new TH2F(name, name, 100, 0, 100, fNbins, fMinBinPt, fMaxBinPt*2);
214  fHistLeadJetPtVsCent[jetCont.first]->GetXaxis()->SetTitle("Centrality (%)");
215  fHistLeadJetPtVsCent[jetCont.first]->GetYaxis()->SetTitle("#it{p}_{T,jet} (GeV/c)");
216  fOutput->Add(fHistLeadJetPtVsCent[jetCont.first]);
217 
218  name = TString::Format("%s_fHistLeadJetPtDensityVsCent", jetCont.first.c_str());
219  fHistLeadJetPtDensityVsCent[jetCont.first] = new TH2F(name, name, 100, 0, 100, fNbins, fMinBinPt, fMaxBinPt*4);
220  fHistLeadJetPtDensityVsCent[jetCont.first]->GetXaxis()->SetTitle("Centrality (%)");
221  fHistLeadJetPtDensityVsCent[jetCont.first]->GetYaxis()->SetTitle("#it{p}_{T,jet} / #it{A}_{jet} (GeV/#it{c})");
222  fOutput->Add(fHistLeadJetPtDensityVsCent[jetCont.first]);
223 
224  name = TString::Format("%s_fHistLeadJetNconstVsCent", jetCont.first.c_str());
225  fHistLeadJetNconstVsCent[jetCont.first] = new TH2F(name, name, 100, 0, 100, 150, -0.5, 149.5);
226  fHistLeadJetNconstVsCent[jetCont.first]->GetXaxis()->SetTitle("Centrality (%)");
227  fHistLeadJetNconstVsCent[jetCont.first]->GetYaxis()->SetTitle("No. of constituents");
228  fOutput->Add(fHistLeadJetNconstVsCent[jetCont.first]);
229 
230  if (fCentBins.size() > 1) {
231  fHistLeadJetNconstVsPt[jetCont.first] = new TH2*[fCentBins.size()-1];
232  for (Int_t i = 0; i < fCentBins.size()-1; i++) {
233  name = TString::Format("%s_fHistJetNconstVsPt_Cent%d_%d", jetCont.first.c_str(), TMath::FloorNint(fCentBins[i]), TMath::FloorNint(fCentBins[i+1]));
234  fHistLeadJetNconstVsPt[jetCont.first][i] = new TH2F(name, name, fNbins, fMinBinPt, fMaxBinPt*2, 150, -0.5, 149.5);
235  fHistLeadJetNconstVsPt[jetCont.first][i]->GetXaxis()->SetTitle("#it{p}_{T,jet} (GeV/#it{c})");
236  fHistLeadJetNconstVsPt[jetCont.first][i]->GetYaxis()->SetTitle("No. of constituents");
237  fOutput->Add(fHistLeadJetNconstVsPt[jetCont.first][i]);
238  }
239  }
240 
241  name = TString::Format("%s_fHistTotJetAreaVsCent", jetCont.first.c_str());
242  fHistTotJetAreaVsCent[jetCont.first] = new TH2F(name, name, 100, 0, 100, 500, 0, 15);
243  fHistTotJetAreaVsCent[jetCont.first]->GetXaxis()->SetTitle("Centrality (%)");
244  fHistTotJetAreaVsCent[jetCont.first]->GetYaxis()->SetTitle("Jet area");
245  fOutput->Add(fHistTotJetAreaVsCent[jetCont.first]);
246 
247  name = TString::Format("%s_fHistNjetVsCent", jetCont.first.c_str());
248  fHistNjetVsCent[jetCont.first] = new TH2F(name, name, 100, 0, 100, 150, -0.5, 149.5);
249  fHistNjetVsCent[jetCont.first]->GetXaxis()->SetTitle("Centrality (%)");
250  fHistNjetVsCent[jetCont.first]->GetYaxis()->SetTitle("No. of jets");
251  fOutput->Add(fHistNjetVsCent[jetCont.first]);
252 
253  if (fParticleCollArray.size() > 0) {
254  name = TString::Format("%s_fHistNjetVsNtrack", jetCont.first.c_str());
255  fHistNjetVsNtrack[jetCont.first] = new TH2F(name, name, 200, Ntrackrange[0], Ntrackrange[1], 150, -0.5, 149.5);
256  fHistNjetVsNtrack[jetCont.first]->GetXaxis()->SetTitle("No. of tracks");
257  fHistNjetVsNtrack[jetCont.first]->GetYaxis()->SetTitle("No. of jets");
258  fOutput->Add(fHistNjetVsNtrack[jetCont.first]);
259  }
260  }
261 
262  if (fScaleFunction) {
263  fHistRhoScaledVsCent = new TH2F("fHistRhoScaledVsCent", "fHistRhoScaledVsCent", 100, 0, 100, fNbins, fMinBinPt , fMaxBinPt);
264  fHistRhoScaledVsCent->GetXaxis()->SetTitle("Centrality (%)");
265  fHistRhoScaledVsCent->GetYaxis()->SetTitle("#rho_{scaled} (GeV/#it{c} #times rad^{-1})");
267 
268  if (fParticleCollArray.size() > 0) {
269  fHistRhoScaledVsNtrack = new TH2F("fHistRhoScaledVsNtrack", "fHistRhoScaledVsNtrack", 200, Ntrackrange[0], Ntrackrange[1], fNbins, fMinBinPt, fMaxBinPt);
270  fHistRhoScaledVsNtrack->GetXaxis()->SetTitle("No. of tracks");
271  fHistRhoScaledVsNtrack->GetYaxis()->SetTitle("#rho (GeV/#it{c} #times rad^{-1})");
273  }
274 
275  if (fClusterCollArray.size() > 0) {
276  fHistRhoScaledVsNcluster = new TH2F("fHistRhoScaledVsNcluster", "fHistRhoScaledVsNcluster", 50, Ntrackrange[0] / 4, Ntrackrange[1] / 4, fNbins, fMinBinPt, fMaxBinPt);
277  fHistRhoScaledVsNcluster->GetXaxis()->SetTitle("No. of clusters");
278  fHistRhoScaledVsNcluster->GetYaxis()->SetTitle("#rho_{scaled} (GeV/#it{c} #times rad^{-1})");
280  }
281  }
282 }
283 
288 {
289  fNtracks = 0;
290  fNclusters = 0;
291  fLeadingParticle = nullptr;
292  fLeadingCluster = nullptr;
293 
294  // Loop over all possible containers
295  for (auto partCont : fParticleCollArray) {
296  for (auto track : partCont.second->accepted()) {
297  if (!fLeadingParticle || track->Pt() > fLeadingParticle->Pt()) fLeadingParticle = track;
298  fNtracks++;
299  }
300  }
301 
302  // Loop over all possible containers
303  for (auto clusCont : fClusterCollArray) {
304  for (auto clus : clusCont.second->accepted()) {
305  if (!fLeadingCluster || clus->E() > fLeadingCluster->E()) fLeadingCluster = clus;
306  fNclusters++;
307  }
308  }
309 
310  SortJets();
311 }
312 
317 {
318  for (auto jetCont : fJetCollArray) {
319  fLeadingJet[jetCont.first] = nullptr;
320  fNjets[jetCont.first] = 0;
321  fTotJetArea[jetCont.first] = 0;
322  auto itSortedJets = fSortedJets.find(jetCont.first);
323  if (itSortedJets == fSortedJets.end()) {
324  auto res = fSortedJets.emplace(jetCont.first, std::list<AliEmcalJet*>());
325  if (res.second) {
326  itSortedJets = res.first;
327  }
328  else {
329  AliError(Form("Error while trying to insert in the map fSortedJets for jet collection %s", jetCont.first.c_str()));
330  continue;
331  }
332  }
333  else {
334  itSortedJets->second.clear();
335  }
336  for (auto jet1 : jetCont.second->accepted()) {
337  if (!jet1->IsGhost()) {
338  fNjets[jetCont.first]++;
339  fTotJetArea[jetCont.first] += jet1->Area();
340  }
341  std::list<AliEmcalJet*>::iterator itJet2 = itSortedJets->second.begin();
342  while (itJet2 != itSortedJets->second.end()) {
343  AliEmcalJet* jet2 = *itJet2;
344  if (jet1->Pt() > jet2->Pt()) break;
345  itJet2++;
346  }
347  itSortedJets->second.insert(itJet2, jet1);
348  }
349  if (!itSortedJets->second.empty()) fLeadingJet[jetCont.first] = *(itSortedJets->second.begin());
350  }
351 
352 
353 }
354 
360 {
361  Double_t rho = GetRhoFactor(fCent);
362  fOutRho->SetVal(rho);
363 }
364 
369 {
370  fOutRho->SetVal(0);
371  if (fOutRhoScaled) fOutRhoScaled->SetVal(0);
372 
374 
375  CalculateRho();
376 
377  if (fScaleFunction) {
378  Double_t rhoScaled = fOutRho->GetVal() * GetScaleFactor(fCent);
379  fOutRhoScaled->SetVal(rhoScaled);
380  }
381 
382  return kTRUE;
383 }
384 
389 {
390  for (auto jetCont : fJetCollArray) {
391  fHistTotJetAreaVsCent[jetCont.first]->Fill(fCent, fTotJetArea[jetCont.first]);
392  if (fLeadingJet[jetCont.first]) {
393  fHistLeadJetPtVsCent[jetCont.first]->Fill(fCent, fLeadingJet[jetCont.first]->Pt());
394  fHistLeadJetPtDensityVsCent[jetCont.first]->Fill(fCent, fLeadingJet[jetCont.first]->Pt() / fLeadingJet[jetCont.first]->Area());
395  fHistLeadJetNconstVsCent[jetCont.first]->Fill(fCent, fLeadingJet[jetCont.first]->GetNumberOfConstituents());
396  fHistRhoVsLeadJetPt[jetCont.first]->Fill(fLeadingJet[jetCont.first]->Pt(), fOutRho->GetVal());
397  if (fCentBin >=0 && fCentBin < fCentBins.size()-1 && fHistLeadJetNconstVsPt[jetCont.first]) fHistLeadJetNconstVsPt[jetCont.first][fCentBin]->Fill(fLeadingJet[jetCont.first]->Pt(), fLeadingJet[jetCont.first]->GetNumberOfConstituents());
398  }
399  if (fHistNjetVsCent[jetCont.first]) fHistNjetVsCent[jetCont.first]->Fill(fCent, fNjets[jetCont.first]);
400 
401  if (fHistNjetVsNtrack[jetCont.first]) fHistNjetVsNtrack[jetCont.first]->Fill(fNtracks, fNjets[jetCont.first]);
402  }
403 }
404 
409 {
410  fHistRhoVsCent->Fill(fCent, fOutRho->GetVal());
411 
412  if (fLeadingParticle) {
414  fHistRhoVsLeadTrackPt->Fill(fLeadingParticle->Pt(), fOutRho->GetVal());
415  }
416 
417  if (fLeadingCluster) {
419  fHistRhoVsLeadClusterE->Fill(fLeadingCluster->E(), fOutRho->GetVal());
420  }
421 
424 
425 
426  if (fHistRhoVsNtrack) fHistRhoVsNtrack->Fill(fNtracks, fOutRho->GetVal());
428 
429  if (fOutRhoScaled) {
430  fHistRhoScaledVsCent->Fill(fCent, fOutRhoScaled->GetVal());
433  }
434 
436 
437  return kTRUE;
438 }
439 
444 {
445  if (!fOutRho) {
447 
448  if (fAttachToEvent) {
449  if (!(InputEvent()->FindListObject(fOutRhoName))) {
450  InputEvent()->AddObject(fOutRho);
451  } else {
452  AliFatal(Form("%s: Container with same name %s already present. Aborting", GetName(), fOutRhoName.Data()));
453  return;
454  }
455  }
456  }
457 
458  if (fScaleFunction && !fOutRhoScaled) {
460 
461  if (fAttachToEvent) {
462  if (!(InputEvent()->FindListObject(fOutRhoScaledName))) {
463  InputEvent()->AddObject(fOutRhoScaled);
464  } else {
465  AliFatal(Form("%s: Container with same name %s already present. Aborting", GetName(), fOutRhoScaledName.Data()));
466  return;
467  }
468  }
469  }
470 
472 
474 }
475 
482 {
483  Double_t rho = 0;
484  if (fRhoFunction) rho = fRhoFunction->Eval(cent);
485  return rho;
486 }
487 
494 {
495  Double_t scale = 1;
496  if (fScaleFunction) scale = fScaleFunction->Eval(cent);
497  return scale;
498 }
499 
506 TF1* AliAnalysisTaskRhoBaseDev::LoadRhoFunction(const char* path, const char* name)
507 {
508  TString fname(path);
509  if (fname.BeginsWith("alien://")) {
510  TGrid::Connect("alien://");
511  }
512 
513  TFile* file = TFile::Open(path);
514 
515  if (!file || file->IsZombie()) {
516  ::Error("AddTaskRho", "Could not open scale function file");
517  return 0;
518  }
519 
520  TF1* sfunc = dynamic_cast<TF1*>(file->Get(name));
521 
522  if (sfunc) {
523  ::Info("AliAnalysisTaskRhoBaseDev::LoadRhoFunction", "Scale function %s loaded from file %s.", name, path);
524  }
525  else {
526  ::Error("AliAnalysisTaskRhoBaseDev::LoadRhoFunction", "Scale function %s not found in file %s.", name, path);
527  return 0;
528  }
529 
530  fScaleFunction = static_cast<TF1*>(sfunc->Clone());
531 
532  file->Close();
533  delete file;
534 
535  return fScaleFunction;
536 }
537 
552 {
553  // Get the pointer to the existing analysis manager via the static access method.
554  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
555  if (!mgr) {
556  ::Error("AliAnalysisTaskRhoBaseDev::AddTaskRhoBaseDev", "No analysis manager to connect to.");
557  return nullptr;
558  }
559 
560  // Check the analysis type using the event handlers connected to the analysis manager.
561  AliVEventHandler* handler = mgr->GetInputEventHandler();
562  if (!handler) {
563  ::Error("AliAnalysisTaskRhoBaseDev::AddTaskRhoBaseDev", "This task requires an input event handler");
564  return nullptr;
565  }
566 
567  EDataType_t dataType = kUnknownDataType;
568 
569  if (handler->InheritsFrom("AliESDInputHandler")) {
570  dataType = kESD;
571  }
572  else if (handler->InheritsFrom("AliAODInputHandler")) {
573  dataType = kAOD;
574  }
575 
576  // Init the task and do settings
577  if (trackName == "usedefault") {
578  if (dataType == kESD) {
579  trackName = "Tracks";
580  }
581  else if (dataType == kAOD) {
582  trackName = "tracks";
583  }
584  else {
585  trackName = "";
586  }
587  }
588 
589  if (clusName == "usedefault") {
590  if (dataType == kESD) {
591  clusName = "CaloClusters";
592  }
593  else if (dataType == kAOD) {
594  clusName = "caloClusters";
595  }
596  else {
597  clusName = "";
598  }
599  }
600 
601  TString name("AliAnalysisTaskRhoBaseDev");
602  if (!suffix.IsNull()) {
603  name += "_";
604  name += suffix;
605  }
606 
607  AliAnalysisTaskRhoBaseDev* mgrTask = dynamic_cast<AliAnalysisTaskRhoBaseDev*>(mgr->GetTask(name.Data()));
608  if (mgrTask) {
609  ::Warning("AliAnalysisTaskRhoBaseDev::AddTaskRhoBaseDev", "Not adding the task again, since a task with the same name '%s' already exists", name.Data());
610  return mgrTask;
611  }
612 
613  AliAnalysisTaskRhoBaseDev* rhotask = new AliAnalysisTaskRhoBaseDev(name, histo);
614  rhotask->SetOutRhoName(nRho);
615 
616  AliParticleContainer* partCont = rhotask->AddParticleContainer(trackName.Data());
617  AliClusterContainer *clusterCont = rhotask->AddClusterContainer(clusName.Data());
618  if (clusterCont) {
619  clusterCont->SetClusECut(0.);
620  clusterCont->SetClusPtCut(0.);
621  clusterCont->SetClusHadCorrEnergyCut(0.3);
622  clusterCont->SetDefaultClusterEnergy(AliVCluster::kHadCorr);
623  }
624 
625  AliJetContainer *jetCont = new AliJetContainer(jetType, AliJetContainer::kt_algorithm, rscheme, jetradius, partCont, clusterCont);
626  if (jetCont) {
627  jetCont->SetJetPtCut(0);
628  jetCont->SetJetAcceptanceType(acceptance);
629  jetCont->SetName("Background");
630  rhotask->AdoptJetContainer(jetCont);
631  }
632 
633  // Final settings, pass to manager and set the containers
634  mgr->AddTask(rhotask);
635 
636  // Create containers for input/output
637  mgr->ConnectInput(rhotask, 0, mgr->GetCommonInputContainer());
638  if (histo) {
639  TString contname(name);
640  contname += "_histos";
641  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
642  TList::Class(), AliAnalysisManager::kOutputContainer,
643  Form("%s", AliAnalysisManager::GetCommonFileName()));
644  mgr->ConnectOutput(rhotask, 1, coutput1);
645  }
646 
647  return rhotask;
648 }
TString fOutRhoName
name of output rho object
AliClusterContainer * AddClusterContainer(std::string branchName, std::string contName="")
EBeamType_t fBeamType
!event beam type
double Double_t
Definition: External.C:58
EDataType_t
Switch for the data type.
Definition: External.C:236
TF1 * fScaleFunction
pre-computed scale factor as a function of centrality
TString fOutRhoScaledName
name of output scaled rho object
virtual Double_t GetRhoFactor(Double_t cent)
Double_t fMaxBinPt
max pt in histograms
TH2 * fHistRhoVsCent
!rho vs. centrality
Base class for a task that calculates the UE.
Bool_t fAttachToEvent
whether or not attach rho to the event objects list
std::map< std::string, TH2 * > fHistRhoVsLeadJetPt
!rho vs. leading jet pt
Bool_t fTaskConfigured
!kTRUE if the task is properly configured
std::map< std::string, TH2 * > fHistLeadJetPtVsCent
!leading jet pt vs. centrality
std::vector< double > fCentBins
how many centrality bins
std::map< std::string, TH2 * > fHistTotJetAreaVsCent
!total area covered by jets vs. centrality
TH2 * fHistNtrackVsCent
!no. of tracks vs. centrality
TH2 * fHistRhoVsLeadClusterE
!rho vs. leading cluster energy
std::map< std::string, Int_t > fNjets
Container for particles within the EMCAL framework.
std::map< std::string, TH2 * > fHistLeadJetPtDensityVsCent
!leading jet area vs. centrality
std::map< std::string, TH2 ** > fHistLeadJetNconstVsPt
!leading jet constituents vs. pt
Bool_t fCreateHisto
whether or not create histograms
int Int_t
Definition: External.C:63
void SetJetPtCut(Float_t cut)
void SetOutRhoName(const char *name)
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
TF1 * LoadRhoFunction(const char *path, const char *name)
TH2 * fHistRhoScaledVsCent
!rhoscaled vs. centrality
TH2 * fHistLeadClusterEVsCent
!leading cluster energy vs. centrality
Base task in the EMCAL jet framework (lighter version of AliAnalysisTaskEmcalJet) ...
Int_t fCentBin
!event centrality bin
TH2 * fHistRhoScaledVsNcluster
!rhoscaled vs. no. of clusters
std::map< std::string, TH2 * > fHistLeadJetNconstVsCent
!leading jet constituents vs. cent
virtual Double_t GetScaleFactor(Double_t cent)
static AliAnalysisTaskRhoBaseDev * AddTaskRhoBaseDev(TString nTracks="usedefault", TString nClusters="usedefault", TString nRho="Rho", Double_t jetradius=0.2, UInt_t acceptance=AliEmcalJet::kTPCfid, AliJetContainer::EJetType_t jetType=AliJetContainer::kChargedJet, AliJetContainer::ERecoScheme_t rscheme=AliJetContainer::pt_scheme, Bool_t histo=kTRUE, TString suffix="")
TH2 * fHistRhoVsNcluster
!rho vs. no. of clusters
std::map< std::string, TH2 * > fHistNjetVsNtrack
!no. of jets vs. no. of tracks
TH2 * fHistRhoVsLeadTrackPt
!rho vs. leading track pt
Double_t fMinBinPt
min pt in histograms
Double_t Pt() const
Definition: AliEmcalJet.h:102
AliParticleContainer * AddParticleContainer(std::string branchName, std::string contName="")
Definition: External.C:220
std::map< std::string, Double_t > fTotJetArea
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
TH2 * fHistNclusterVsCent
!no. of cluster vs. centrality
TH2 * fHistRhoVsNtrack
!rho vs. no. of tracks
std::map< std::string, AliEmcalJet * > fLeadingJet
std::map< std::string, std::list< AliEmcalJet * > > fSortedJets
!jets sorted by momentum
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
TFile * file
TList with histograms for a given trigger.
TF1 * fRhoFunction
pre-computed rho as a function of centrality
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
TH2 * fHistRhoScaledVsNtrack
!rhoscaled vs. no. of tracks
void SetClusPtCut(Double_t cut)
void AdoptJetContainer(AliJetContainer *cont)
std::map< std::string, AliJetContainer * > fJetCollArray
jet collection array
void SetJetAcceptanceType(UInt_t type)
bool Bool_t
Definition: External.C:53
Declaration of class AliAnalysisTaskRhoBaseDev.
AliRhoParameter * fOutRhoScaled
!output scaled rho object
void SetClusECut(Double_t cut)
void SetDefaultClusterEnergy(Int_t d)
std::map< std::string, AliClusterContainer * > fClusterCollArray
cluster collection array
Container structure for EMCAL clusters.
Int_t fNtracks
!number of tracks
AliRhoParameter * fOutRho
!output rho object
Double_t fCent
!event centrality
Container for jet within the EMCAL jet framework.
std::map< std::string, TH2 * > fHistNjetVsCent
!no. of jets vs. centrality
TH2 * fHistLeadTrackPtVsCent
!leading track pt vs. centrality
void SetClusHadCorrEnergyCut(Double_t cut)
Int_t fNclusters
!number of clusters