AliPhysics  a9863a5 (a9863a5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskJetShapeBase.cxx
Go to the documentation of this file.
1 #include <TClonesArray.h>
2 #include <TH1F.h>
3 #include <TH2F.h>
4 #include <TH3F.h>
5 #include <THnSparse.h>
6 #include <TF1.h>
7 #include <TList.h>
8 #include <TLorentzVector.h>
9 #include <TProfile.h>
10 #include <TChain.h>
11 #include <TSystem.h>
12 #include <TFile.h>
13 #include <TKey.h>
14 #include <TTree.h>
15 #include <TGrid.h>
16 
17 #include "AliVCluster.h"
18 #include "AliVTrack.h"
19 #include "AliEmcalJet.h"
20 #include "AliRhoParameter.h"
21 #include "AliLog.h"
22 #include "AliEmcalParticle.h"
23 #include "AliMCEvent.h"
24 #include "AliAODEvent.h"
25 #include "AliGenPythiaEventHeader.h"
26 #include "AliAODMCHeader.h"
27 #include "AliAnalysisManager.h"
28 #include "AliJetContainer.h"
29 #include "AliParticleContainer.h"
30 
32 
34 
35 //________________________________________________________________________
38  fContainerBase(0),
39  fContainerSub(1),
40  fContainerNoEmb(2),
41  fContainerOverlap(3),
42  fMinFractionShared(0),
43  fSingleTrackEmb(kFALSE),
44  fCreateTree(kFALSE),
45  fJetMassVarType(kMass),
46  fResponseReference(kDet),
47  fUseSumw2(0),
48  fOverlap(0),
49  fRadius(0.4),
50  fTreeJetBkg(),
51  fJet1Vec(new TLorentzVector()),
52  fJet2Vec(new TLorentzVector()),
53  fJetSubVec(new TLorentzVector()),
54  fArea(0),
55  fAreaPhi(0),
56  fAreaEta(0),
57  fRho(0),
58  fRhoM(0),
59  fNConst(0),
60  fMatch(0),
61  fMinLabelEmb(-kMaxInt),
62  fMaxLabelEmb(kMaxInt),
63  fSmallSyst(0),
64  fh2MSubMatch(0x0),
65  fh2MSubPtRawAll(0x0),
66  fh3MSubPtRawDRMatch(0x0),
67  fh3MSubPtTrueLeadPt(0x0),
68  fh3MTruePtTrueLeadPt(0x0),
69  fh3PtTrueDeltaMLeadPt(0x0),
70  fh3PtTrueDeltaMRelLeadPt(0x0),
71  fhnMassResponse(0x0),
72  fhnDeltaMass(0),
73  fhRjetTrvspTj(0x0),
74  fhNJetsSelEv(0x0),
75  fhJetEtaPhiOvl(0x0),
76  fhpTTracksJet1(0x0),
77  fhpTTracksJetO(0x0),
78  fhpTTracksCont(0x0),
79  fhptjetSMinusSingleTrack(0x0),
80  fhJetSubMatchEtaPhiPt(0x0),
81  fTreeEmb(0),
82  fFromTree(0),
83  fPathTreeinputFile(""),
84  fTreeinputName("fTreeJet"),
85  fBranchJDetName("fJetDet"),
86  fBranchJParName("fJetPar"),
87  fThisEntry(0),
88  fMaxTreeEntries(0),
89  fVecD(0x0),
90  fVecP(0x0)
91 {
92  // Default constructor.
93 
94  fh2MSubMatch = new TH2F*[fNcentBins];
95  fh2MSubPtRawAll = new TH2F*[fNcentBins];
96  fh3MSubPtRawDRMatch = new TH3F*[fNcentBins];
97  fh3MSubPtTrueLeadPt = new TH3F*[fNcentBins];
98  fh3MTruePtTrueLeadPt = new TH3F*[fNcentBins];
99  fh3PtTrueDeltaMLeadPt = new TH3F*[fNcentBins];
100  fh3PtTrueDeltaMRelLeadPt = new TH3F*[fNcentBins];
101  fhnMassResponse = new THnSparse*[fNcentBins];
102  fhnDeltaMass = new THnSparse*[fNcentBins];
103 
104  for (Int_t i = 0; i < fNcentBins; i++) {
105  fh2MSubMatch[i] = 0;
106  fh2MSubPtRawAll[i] = 0;
107  fh3MSubPtRawDRMatch[i] = 0;
108  fh3MSubPtTrueLeadPt[i] = 0;
109  fh3MTruePtTrueLeadPt[i] = 0;
110  fh3PtTrueDeltaMLeadPt[i] = 0;
111  fh3PtTrueDeltaMRelLeadPt[i] = 0;
112  fhnMassResponse[i] = 0;
113  fhnDeltaMass[i] = 0;
114  }
115 
116  SetMakeGeneralHistograms(kTRUE);
117  if(fCreateTree) DefineOutput(2, TTree::Class());
118 }
119 
120 //________________________________________________________________________
122  AliAnalysisTaskEmcalJet(name, kTRUE),
123  fContainerBase(0),
124  fContainerSub(1),
125  fContainerNoEmb(2),
126  fContainerOverlap(3),
127  fMinFractionShared(0),
128  fSingleTrackEmb(kFALSE),
129  fCreateTree(kFALSE),
130  fJetMassVarType(kMass),
131  fResponseReference(kDet),
132  fUseSumw2(0),
133  fOverlap(0),
134  fRadius(0.4),
135  fTreeJetBkg(0),
136  fJet1Vec(new TLorentzVector()),
137  fJet2Vec(new TLorentzVector()),
138  fJetSubVec(new TLorentzVector()),
139  fArea(0),
140  fAreaPhi(0),
141  fAreaEta(0),
142  fRho(0),
143  fRhoM(0),
144  fNConst(0),
145  fMatch(0),
146  fMinLabelEmb(-kMaxInt),
147  fMaxLabelEmb(kMaxInt),
148  fSmallSyst(0),
149  fh2MSubMatch(0x0),
150  fh2MSubPtRawAll(0x0),
151  fh3MSubPtRawDRMatch(0x0),
152  fh3MSubPtTrueLeadPt(0x0),
153  fh3MTruePtTrueLeadPt(0x0),
154  fh3PtTrueDeltaMLeadPt(0x0),
155  fh3PtTrueDeltaMRelLeadPt(0x0),
156  fhnMassResponse(0x0),
157  fhnDeltaMass(0),
158  fhRjetTrvspTj(0x0),
159  fhNJetsSelEv(0x0),
160  fhJetEtaPhiOvl(0x0),
161  fhpTTracksJet1(0x0),
162  fhpTTracksJetO(0x0),
163  fhpTTracksCont(0x0),
164  fhptjetSMinusSingleTrack(0x0),
165  fhJetSubMatchEtaPhiPt(0x0),
166  fTreeEmb(0),
167  fFromTree(0),
168  fPathTreeinputFile(""),
169  fTreeinputName("fTreeJet"),
170  fBranchJDetName("fJetDet"),
171  fBranchJParName("fJetPar"),
172  fThisEntry(0),
173  fMaxTreeEntries(0),
174  fVecD(0x0),
175  fVecP(0x0)
176 {
177  // Standard constructor.
178 
179  fh2MSubMatch = new TH2F*[fNcentBins];
180  fh2MSubPtRawAll = new TH2F*[fNcentBins];
181  fh3MSubPtRawDRMatch = new TH3F*[fNcentBins];
182  fh3MSubPtTrueLeadPt = new TH3F*[fNcentBins];
183  fh3MTruePtTrueLeadPt = new TH3F*[fNcentBins];
184  fh3PtTrueDeltaMLeadPt = new TH3F*[fNcentBins];
186  fhnMassResponse = new THnSparse*[fNcentBins];
187  fhnDeltaMass = new THnSparse*[fNcentBins];
188 
189  for (Int_t i = 0; i < fNcentBins; i++) {
190  fh2MSubMatch[i] = 0;
191  fh2MSubPtRawAll[i] = 0;
192  fh3MSubPtRawDRMatch[i] = 0;
193  fh3MSubPtTrueLeadPt[i] = 0;
194  fh3MTruePtTrueLeadPt[i] = 0;
195  fh3PtTrueDeltaMLeadPt[i] = 0;
197  fhnMassResponse[i] = 0;
198  fhnDeltaMass[i] = 0;
199  }
200 
202  if(fCreateTree) DefineOutput(2, TTree::Class());
203 }
204 
205 //________________________________________________________________________
207 {
208  // Destructor.
209  delete fTreeEmb;
210  delete fVecD;
211  delete fVecP;
212 }
213 
214 //________________________________________________________________________
216 {
217  // Create user output.
218 
220 
221  Bool_t oldStatus = TH1::AddDirectoryStatus();
222  TH1::AddDirectory(kFALSE);
223 
224  if(!fPathTreeinputFile.IsNull()){
226  if(!fTreeEmb) AliFatal("Something went wrong in setting the tree");
227 
228  fTreeEmb->SetBranchAddress(fBranchJDetName, &fVecD);
229  fTreeEmb->SetBranchAddress(fBranchJParName, &fVecP);
230 
231  fMaxTreeEntries = fTreeEmb->GetEntries();
232 
233  fTreeEmb->GetEntry(0);
234  fTreeEmb->Show();
235 
236 
237  }
238 
239  const Int_t nBinsPt = 200;
240  const Double_t minPt = -50.;
241  const Double_t maxPt = 150.;
242 
243  Int_t nBinsM = 100;
244  Double_t minM = -20.;
245  Double_t maxM = 80.;
246  if(fSmallSyst) maxM = 40.;
247  if(fJetMassVarType==kRatMPt) {
248  nBinsM = 100;
249  minM = -0.2;
250  maxM = 0.8;
251  }
252 
253  Int_t nBinsDM = 100;
254  Double_t minDM = -25.;
255  Double_t maxDM = 25.;
256  if(fJetMassVarType==kRatMPt) {
257  nBinsDM = 100;
258  minDM = -0.5;
259  maxDM = 0.5;
260  }
261  Int_t nBinsDpT = 100;
262  Double_t minDpT = -50.;
263  Double_t maxDpT = 50.;
264 
265  const Int_t nBinsDRToLJ = 20; //distance to leading jet in Pb-Pb only event
266  const Double_t minDRToLJ = 0.;
267  const Double_t maxDRToLJ = 1.;
268 
269  const Int_t nBinsPtLead = 20;
270  const Double_t minPtLead = 0.;
271  const Double_t maxPtLead = 20.;
272 
273  //These are good for pPb
274  Int_t nBinsRho = 50;
275  Double_t minRho = 0.;
276  Double_t maxRho = 20.;
277  Int_t nBinsRhom = 50;
278  Double_t minRhom = 0.;
279  Double_t maxRhom = 1.;
280 
281  //Binning for THnSparse
282  const Int_t nBinsSparse0 = 5;
283  //Mass sub;Mass true;#it{p}_{T,sub};#it{p}_{T,true};#it{p}_{T,lead trk}
284  const Int_t nBins0[nBinsSparse0] = {nBinsM,nBinsM,nBinsPt,nBinsPt,nBinsPtLead};
285  const Double_t xmin0[nBinsSparse0] = { minM, minM, minPt, minPt, minPtLead};
286  const Double_t xmax0[nBinsSparse0] = { maxM, maxM, maxPt, maxPt, maxPtLead};
287 
288  const Int_t nBinsSparse0b = 6;
289  //Mass sub;Mass true;#it{p}_{T,sub};#it{p}_{T,true};#it{p}_{T,lead trk}
290  const Int_t nBins0b[nBinsSparse0b] = {nBinsM, nBinsM, nBinsPt, nBinsPt, nBinsM, nBinsPt};
291  const Double_t xmin0b[nBinsSparse0b] = { minM, minM, minPt, minPt, minM, minPt};
292  const Double_t xmax0b[nBinsSparse0b] = { maxM, maxM, maxPt, maxPt, maxM, maxPt};
293 
294  const Int_t nBinsSparse1 = 7;
295  // #it{M}_{det,Const} - #it{M}_{part}; #it{p}_{T,det,Const} - #it{p}_{T,part}; #it{M}_{det,Const}; #it{M}_{part}; #it{p}_{T,det,Const}; #it{p}_{T,part}; #it{p}_{T,det,A}
296  const Int_t nBins1[nBinsSparse1] = {nBinsDM,nBinsDpT,nBinsM,nBinsM,nBinsPt,nBinsPt,nBinsPt};
297  const Double_t xmin1[nBinsSparse1] = { minDM, minDpT, minM, minM, minPt, minPt, minPt};
298  const Double_t xmax1[nBinsSparse1] = { maxDM, maxDpT, maxM, maxM, maxPt, maxPt, maxPt};
299 
300  const Int_t nBinsSparse2 = 8;
301  //#it{M}_{det} - #it{M}_{part}; #it{p}_{T,det} - #it{p}_{T,part}; #it{M}_{det}; #it{M}_{unsub}; #it{p}_{T,det}; #it{p}_{T,unsub}; #rho ; #rho_{m}
302  const Int_t nBins2[nBinsSparse2] = {nBinsDM, nBinsDpT, nBinsM, nBinsM, nBinsPt, nBinsPt, nBinsRho, nBinsRhom};
303  const Double_t xmin2[nBinsSparse2] = {minDM, minDpT, minM, minM, minPt, minPt, minRho, minRhom};
304  const Double_t xmax2[nBinsSparse2] = {maxDM, maxDpT, maxM, maxM, maxPt, maxPt, maxRho, maxRhom};
305 
306  TString histName = "";
307  TString histTitle = "";
308  TString varName = "#it{M}_{jet}";
309  if(fJetMassVarType==kRatMPt) varName = "#it{M}_{jet}/#it{p}_{T,jet}";
310 
311  for (Int_t i = 0; i < fNcentBins; i++) {
312  histName = Form("fh2MSubMatch_%d",i);
313  histTitle = Form("fh2MSubMatch_%d;%s;match",i,varName.Data());
314  fh2MSubMatch[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,2,-0.5,1.5);
315  fOutput->Add(fh2MSubMatch[i]);
316 
317  histName = Form("fh2MSubPtRawAll_%d",i);
318  histTitle = Form("fh2MSubPtRawAll_%d;%s;#it{p}_{T}",i,varName.Data());
319  fh2MSubPtRawAll[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt);
320  fOutput->Add(fh2MSubPtRawAll[i]);
321 
322  histName = Form("fh3MSubPtRawDRMatch_%d",i);
323  histTitle = Form("fh3MSubPtRawDRMatch_%d;%s;#it{p}_{T}",i,varName.Data());
324  fh3MSubPtRawDRMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt,nBinsDRToLJ,minDRToLJ,maxDRToLJ);
325  fOutput->Add(fh3MSubPtRawDRMatch[i]);
326 
327  histName = Form("fh3MSubPtTrueLeadPt_%d",i);
328  histTitle = Form("fh3MSubPtTrueLeadPt_%d;%s;#it{p}_{T}",i,varName.Data());
329  fh3MSubPtTrueLeadPt[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt,nBinsPtLead,minPtLead,maxPtLead);
330  fOutput->Add(fh3MSubPtTrueLeadPt[i]);
331 
332  histName = Form("fh3MTruePtTrueLeadPt_%d",i);
333  histTitle = Form("fh3MTruePtTrueLeadPt_%d;%s;#it{p}_{T}",i,varName.Data());
334  fh3MTruePtTrueLeadPt[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt,nBinsPtLead,minPtLead,maxPtLead);
335  fOutput->Add(fh3MTruePtTrueLeadPt[i]);
336 
337  histName = Form("fh3PtTrueDeltaMLeadPt_%d",i);
338  histTitle = Form("fh3PtTrueDeltaMLeadPt_%d;#it{p}_{T,true};#Delta %s",i,varName.Data());
339  fh3PtTrueDeltaMLeadPt[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsDM,minDM,maxDM,nBinsPtLead,minPtLead,maxPtLead);
340  fOutput->Add(fh3PtTrueDeltaMLeadPt[i]);
341 
342  histName = Form("fh3PtTrueDeltaMRelLeadPt_%d",i);
343  histTitle = Form("fh3PtTrueDeltaMRelLeadPt_%d;#it{p}_{T,true};Rel #Delta %s",i,varName.Data());
344  fh3PtTrueDeltaMRelLeadPt[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,400,-1.,3.,nBinsPtLead,minPtLead,maxPtLead);
345  fOutput->Add(fh3PtTrueDeltaMRelLeadPt[i]);
346 
347  histName = Form("fhnMassResponse_%d",i);
348  Printf("What is fFromTree ? %d", fFromTree);
349  if(fFromTree) {
350  histTitle = Form("fhnMassResponse_%d; %s sub; %s true;#it{p}_{T,sub};#it{p}_{T,true};%s (emb, det); #it{p}_{T,emb det}", i, varName.Data(),varName.Data(), varName.Data());
351  fhnMassResponse[i] = new THnSparseF(histName.Data(),histTitle.Data(),nBinsSparse0b, nBins0b, xmin0b, xmax0b);
352 
353  } else{
354  histTitle = Form("fhnMassResponse_%d;%s sub;%s true;#it{p}_{T,sub};#it{p}_{T,true};#it{p}_{T,lead trk}",i,varName.Data(),varName.Data());
355  fhnMassResponse[i] = new THnSparseF(histName.Data(),histTitle.Data(),nBinsSparse0,nBins0,xmin0,xmax0);
356  }
357  fOutput->Add(fhnMassResponse[i]);
358 
359  histName = Form("fhnDeltaMass_%d", i);
360  histTitle = Form("%s; #it{M}_{det,Const} - #it{M}_{part}; #it{p}_{T,det,Const} - #it{p}_{T,part}; #it{M}_{det,Const}; #it{M}_{part}; #it{p}_{T,det,Const}; #it{p}_{T,part}; #it{p}_{T,det,A}",histName.Data());
361  Printf("Nuber of bins %d - write first %d, %f, %f , building %s", nBinsSparse1, nBins1[0], xmin1[0], xmax1[0], histName.Data());
362  fhnDeltaMass[i] = new THnSparseF(histName.Data(),histTitle.Data(),nBinsSparse1,nBins1,xmin1,xmax1);
363  fOutput->Add(fhnDeltaMass[i]);
364 
365  }
366 
367  //Chiara's histograms: rho and rhom correlation with pT and mass at reco level with no subtraction
368  histName = "fhnDeltaMassAndBkgInfo";
369  histTitle = Form("%s; #it{M}_{det} - #it{M}_{part}; #it{p}_{T,det} - #it{p}_{T,part}; #it{M}_{det}; #it{M}_{unsub}; #it{p}_{T,det}; #it{p}_{T,unsub}; #rho ; #rho_{m}",histName.Data()); // #it{M}_{unsub} is also deltaM unsub when M_part is zero
370 
371  fhnDeltaMassAndBkgInfo = new THnSparseF(histName.Data(),histTitle.Data(),nBinsSparse2,nBins2,xmin2,xmax2);
372  fOutput->Add(fhnDeltaMassAndBkgInfo);
373 
374  if(fOverlap){
375  fhRjetTrvspTj = new TH2F("fhRjetTrvspTj", ";R(jet, track);p_{T,jet}", 100, 0., 10., nBinsPt, minPt, maxPt);
376  fOutput->Add(fhRjetTrvspTj);
377  fhNJetsSelEv = new TH1F("fhNJetsSelEv", "N of jets selected; #it{N}_{jets}/ev;Entries", 20., 0.,19);
378  fOutput->Add(fhNJetsSelEv);
379 
380  fhJetEtaPhiOvl = new TH2F("fhJetEtaPhiOvl", "#eta - #varphi distribution of selected jets; #eta; #varphi", 24., -0.6, 0.6, 50, (-1)*TMath::Pi(), TMath::Pi());
381  fOutput->Add(fhJetEtaPhiOvl);
382 
383  fhpTTracksJetO = new TH1F("hTrackpTO", "Track pT (signal jet); p_{T}", 500,0.,50.);
384  fOutput->Add(fhpTTracksJetO);
385 
386  }
387 
388  fhJetSubMatchEtaPhiPt = new TH3F("fhJetSubMatchEtaPhiPt", "Bkg-subtracted matched jet;#eta ; #phi; #it{p}_{T} (GeV/#it{c})", 24., -0.6, 0.6, 50, (-1)*TMath::Pi(), TMath::Pi(), nBinsPt, minPt, maxPt);
390 
391  fhpTTracksJet1 = new TH1F("hTrackpT1", "Track pT ; p_{T}", 500,0.,50.);
392  fOutput->Add(fhpTTracksJet1);
393  fhpTTracksCont = new TH1F(Form("fhpTTracksCont"), "Track pT (container) ; p_{T}", 500,0.,50.);
394  fOutput->Add(fhpTTracksCont);
395 
396 
397 
398  if(fUseSumw2) {
399  // =========== Switch on Sumw2 for all histos ===========
400  for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
401  TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
402  if (h1){
403  h1->Sumw2();
404  continue;
405  }
406  THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
407  if(hn)hn->Sumw2();
408  }
409  }
410 
411  TH1::AddDirectory(oldStatus);
412 
413  // Create a tree.
414  if(fCreateTree) {
415  fTreeJetBkg = new TTree("fTreeJetSubConst", "fTreeJetSubConst");
416  fTreeJetBkg->Branch("fJet1Vec","TLorentzVector",&fJet1Vec);
417  fTreeJetBkg->Branch("fJet2Vec","TLorentzVector",&fJet2Vec);
418  fTreeJetBkg->Branch("fJetSubVec","TLorentzVector",&fJetSubVec);
419  fTreeJetBkg->Branch("fArea",&fArea,"fArea/F");
420  fTreeJetBkg->Branch("fAreaPhi",&fAreaPhi,"fAreaPhi/F");
421  fTreeJetBkg->Branch("fAreaEta",&fAreaEta,"fAreaEta/F");
422  fTreeJetBkg->Branch("fRho",&fRho,"fRho/F");
423  fTreeJetBkg->Branch("fRhoM",&fRhoM,"fRhoM/F");
424  fTreeJetBkg->Branch("fMatch",&fMatch,"fMatch/I");
425  }
426 
427  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
428  if(fCreateTree) PostData(2, fTreeJetBkg);
429 }
430 
431 //________________________________________________________________________
433 {
434  // Run analysis code here, if needed. It will be executed before FillHistograms().
435 
436  return kTRUE;
437 }
438 
439 //________________________________________________________________________
441 
442  AliParticleContainer *partContEmb = GetParticleContainer(); //the first particle container given is the one with embedded track(s)
443 
444  AliVParticle *vpe = 0x0; //embedded particle
445  for(Int_t ip = partContEmb->GetNParticles()-1; ip>-1; ip--){
446  AliVParticle *vp = partContEmb->GetParticle(ip);
447  if(!vp){
448  AliDebug(2, Form("Particle %d not found", ip));
449  continue;
450  }
451  Int_t lab = TMath::Abs(vp->GetLabel());
452  if (lab < fMinLabelEmb || lab > fMaxLabelEmb + fMaxTreeEntries)
453  continue;
454  if(!vpe) vpe = vp;
455  else if(vp->Pt()>vpe->Pt()) vpe =vp;
456  fThisEntry = lab - fMinLabelEmb;
457  //Printf("Label of embedded track %d - %d = %d", lab, fMinLabelEmb, fThisEntry);
458  }
459 
460  Double_t deltaR = 99;
461  if(vpe && jet) deltaR = jet->DeltaR(vpe);
462  if(deltaR < 0.2) return vpe;
463  else return 0x0;
464 }
465 
466 //__________________________________________________________________________________________________
467 
469  if(!fTreeEmb) return 0;
470 
471  Int_t entry = fTreeEmb->GetEntry(fThisEntry);
472  return entry;
473 
474 }
475 
476 
477 //________________________________________________________________________
479  if(!tree){
480  AliError("Null tree");
481  return;
482  }
483  fFromTree = kTRUE;
484  fTreeEmb = (TTree*)tree->Clone(Form("%sCpShC", tree->GetName()));
485  AliInfo(Form("Input tree set %d (%p -> %p)", fTreeEmb->GetNbranches(), tree, fTreeEmb));
486  //fTreeEmb->SetDirectory(0x0);
487 
488  return;
489 }
490 
491 //________________________________________________________________________
492 
493 void AliAnalysisTaskJetShapeBase::SetTreeFromFile(TString filename, TString treename){
494 
495  if(filename.Contains("alien")) {
496  TGrid::Connect("alien://");
497  }
498  TFile *f = TFile::Open(filename);
499  if(!f->IsOpen()){
500  Printf("File %s not found, cannot SetTree", filename.Data());
501  return;
502  }
503 
504  TTree *tree = dynamic_cast<TTree*>(f->Get(treename));
505  if(!tree){
506  Printf("Tree %s not found!!!", treename.Data());
507  f->ls();
508  return;
509  }
510  SetTree(tree);
511 
512  //f->Close();
513  //delete f;
514 
515  return;
516 }
517 //________________________________________________________________________
519  //
520  // retrieve event objects
521  //
522 
524  return kFALSE;
525 
527  jetCont->LoadRhoMass(InputEvent());
528 
529  return kTRUE;
530 }
531 
532 //_______________________________________________________________________
534 {
535  // Called once at the end of the analysis.
536 }
537 
TString fBranchJDetName
name of the detector level jet branch in the TTree
TTree * fTreeEmb
! tree with the TLorentzVector of the jet detector and particle level
TH3F ** fh3PtTrueDeltaMLeadPt
! true jet pT vs (Msub - Mtrue) vs LeadPt for matched jets
AliJetContainer * GetJetContainer(Int_t i=0) const
Bool_t fSmallSyst
flag for the axes ranges in pPb
Bool_t fUseSumw2
activate sumw2 for output histograms
Int_t GetNParticles() const
THnSparse * fhnDeltaMassAndBkgInfo
! DeltaM, DeltapT bkg-unsubtracted M and pT, rho and rhom
Int_t fThisEntry
current entry in the embedded TTree
void LoadRhoMass(const AliVEvent *event)
TH3F * fhJetSubMatchEtaPhiPt
! eta, phi, pt distribution of jet subtracted and matched
TList * fOutput
!output list
Container for particles within the EMCAL framework.
TH3F ** fh3MSubPtTrueLeadPt
! subtracted jet mass vs true jet pT vs LeadPt for matched jets for matched jets
TH2F * fhJetEtaPhiOvl
! eta-phi distribution of the selected signal jets
AliParticleContainer * GetParticleContainer(Int_t i=0) const
TLorentzVector * fVecD
! vector with detector level jet
Int_t fMaxLabelEmb
max label of embedded particles
void SetTreeFromFile(TString filenameM, TString treename)
TLorentzVector * fJet1Vec
jet1(AA) vector
virtual AliVParticle * GetParticle(Int_t i=-1) const
Int_t fNcentBins
how many centrality bins
TString fBranchJParName
name of the detector level jet branch in the TTree
TH3F ** fh3MSubPtRawDRMatch
! subtracted jet mass vs subtracted jet pT vs distance to leading Pb-Pb jet
THnSparse ** fhnDeltaMass
! deltaM vs deltapT
Double_t DeltaR(const AliVParticle *part) const
THnSparse ** fhnMassResponse
! Msub vs Mtrue vs PtCorr vs PtTrue vs DR
ClassImp(AliAnalysisTaskJetShapeBase) AliAnalysisTaskJetShapeBase
TH1F * fhNJetsSelEv
! number of selected signal jets per event
Bool_t fOverlap
activate the check on overlap between single particle embedded and jetO (jet with a pT of at least 5 ...
TH3F ** fh3MTruePtTrueLeadPt
! true jet mass vs true jet pT vs LeadPt for matched jets for matched jets
JetMassVarType fJetMassVarType
observable to use
TH2F ** fh2MSubMatch
! subtracted jet mass vs match index (0: no match; 1:match)
Int_t fMatch
1: matched to MC jet; 0: no match
TTree * fTreeJetBkg
! tree with jet and bkg variables
TH2F ** fh2MSubPtRawAll
! subtracted jet mass vs subtracted jet pT
Int_t fMaxTreeEntries
number of entries in the TTree
Int_t fMinLabelEmb
min label of embedded particles
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
AliVParticle * GetEmbeddedConstituent(AliEmcalJet *jet)
TH2F * fhRjetTrvspTj
! distance in R between each jetO and embedded single track (those below fRadius are rejected) ...
TString fPathTreeinputFile
path to the file where the external input Tree is (can be from alien)
Bool_t fFromTree
Input embedding from tree.
TLorentzVector * fJetSubVec
subtracted AA jet vector
TLorentzVector * fJet2Vec
jet2(probe) vector
TLorentzVector * fVecP
! vector with particle level jet
Bool_t fCreateTree
create output tree
TString fTreeinputName
name of the external input Tree
Background fluctuation studies: dMdpT spectrum for PYTHIA and single track embedding.
Container for jet within the EMCAL jet framework.
Int_t fContainerBase
jets to be analyzed
TH3F ** fh3PtTrueDeltaMRelLeadPt
! true jet pT vs (Msub - Mtrue)/Mtrue vs LeadPt for matched jets