1 #include <TClonesArray.h>
8 #include <TLorentzVector.h>
17 #include "AliVCluster.h"
18 #include "AliVTrack.h"
23 #include "AliMCEvent.h"
24 #include "AliAODEvent.h"
25 #include "AliGenPythiaEventHeader.h"
26 #include "AliAODMCHeader.h"
27 #include "AliAnalysisManager.h"
42 fMinFractionShared(0),
43 fSingleTrackEmb(kFALSE),
45 fJetMassVarType(kMass),
46 fResponseReference(kDet),
61 fMinLabelEmb(-kMaxInt),
62 fMaxLabelEmb(kMaxInt),
66 fh3MSubPtRawDRMatch(0x0),
67 fh3MSubPtTrueLeadPt(0x0),
68 fh3MTruePtTrueLeadPt(0x0),
69 fh3PtTrueDeltaMLeadPt(0x0),
70 fh3PtTrueDeltaMRelLeadPt(0x0),
73 fhnDeltaMassAndBkgInfo(0x0),
81 fhptjetSMinusSingleTrack(0x0),
82 fhJetSubMatchEtaPhiPt(0x0),
85 fPathTreeinputFile(""),
86 fTreeinputName("fTreeJet"),
87 fBranchJDetName("fJetDet"),
88 fBranchJParName("fJetPar"),
96 fh2MSubMatch =
new TH2F*[fNcentBins];
97 fh2MSubPtRawAll =
new TH2F*[fNcentBins];
98 fh3MSubPtRawDRMatch =
new TH3F*[fNcentBins];
99 fh3MSubPtTrueLeadPt =
new TH3F*[fNcentBins];
100 fh3MTruePtTrueLeadPt =
new TH3F*[fNcentBins];
101 fh3PtTrueDeltaMLeadPt =
new TH3F*[fNcentBins];
102 fh3PtTrueDeltaMRelLeadPt =
new TH3F*[fNcentBins];
103 fhnMassResponse =
new THnSparse*[fNcentBins];
106 for (
Int_t i = 0; i < fNcentBins; i++) {
108 fh2MSubPtRawAll[i] = 0;
109 fh3MSubPtRawDRMatch[i] = 0;
110 fh3MSubPtTrueLeadPt[i] = 0;
111 fh3MTruePtTrueLeadPt[i] = 0;
112 fh3PtTrueDeltaMLeadPt[i] = 0;
113 fh3PtTrueDeltaMRelLeadPt[i] = 0;
114 fhnMassResponse[i] = 0;
118 SetMakeGeneralHistograms(kTRUE);
119 DefineOutput(2, TTree::Class());
128 fContainerOverlap(3),
129 fMinFractionShared(0),
130 fSingleTrackEmb(kFALSE),
132 fJetMassVarType(kMass),
133 fResponseReference(kDet),
148 fMinLabelEmb(-kMaxInt),
149 fMaxLabelEmb(kMaxInt),
152 fh2MSubPtRawAll(0x0),
153 fh3MSubPtRawDRMatch(0x0),
154 fh3MSubPtTrueLeadPt(0x0),
155 fh3MTruePtTrueLeadPt(0x0),
156 fh3PtTrueDeltaMLeadPt(0x0),
157 fh3PtTrueDeltaMRelLeadPt(0x0),
158 fhnMassResponse(0x0),
160 fhnDeltaMassAndBkgInfo(0x0),
168 fhptjetSMinusSingleTrack(0x0),
169 fhJetSubMatchEtaPhiPt(0x0),
172 fPathTreeinputFile(
""),
173 fTreeinputName(
"fTreeJet"),
174 fBranchJDetName(
"fJetDet"),
175 fBranchJParName(
"fJetPar"),
206 DefineOutput(2, TTree::Class());
233 Printf(
"Creating tree");
234 fTreeJetBkg =
new TTree(Form(
"%sTree", GetName()), Form(
"%sTree", GetName()));
253 if(!
fTreeEmb) AliFatal(
"Something went wrong in setting the tree");
266 const Int_t nBinsPt = 200;
288 Int_t nBinsDpT = 100;
292 Int_t nBinsRpT = 160;
305 const Int_t nBinsDRToLJ = 20;
309 const Int_t nBinsPtLead = 20;
317 Int_t nBinsRhom = 50;
322 const Int_t nBinsSparse0 = 9;
324 const Int_t nBins0[nBinsSparse0] = {nBinsM,nBinsM,nBinsPt,nBinsPt,nBinsPtLead, nBinsRho, nBinsRhom, nBinsM, nBinsPt};
325 const Double_t xmin0[nBinsSparse0] = { minM, minM, minPt, minPt, minPtLead, minRho, minRhom, minM, minPt};
326 const Double_t xmax0[nBinsSparse0] = { maxM, maxM, maxPt, maxPt, maxPtLead, maxRho, maxRhom, maxM, maxPt};
328 const Int_t nBinsSparse0b = 10;
330 const Int_t nBins0b[nBinsSparse0b] = {nBinsM, nBinsM, nBinsPt, nBinsPt, nBinsM, nBinsPt, nBinsRho, nBinsRhom, nBinsM, nBinsPt};
331 const Double_t xmin0b[nBinsSparse0b] = { minM, minM, minPt, minPt, minM, minPt, minRho, minRhom, minM, minPt};
332 const Double_t xmax0b[nBinsSparse0b] = { maxM, maxM, maxPt, maxPt, maxM, maxPt, maxRho, maxRhom, maxM, maxPt};
334 const Int_t nBinsSparse1 = 7;
336 const Int_t nBins1[nBinsSparse1] = {nBinsDM,nBinsDpT,nBinsM,nBinsM,nBinsPt,nBinsPt,nBinsPt};
337 const Double_t xmin1[nBinsSparse1] = { minDM, minDpT, minM, minM, minPt, minPt, minPt};
338 const Double_t xmax1[nBinsSparse1] = { maxDM, maxDpT, maxM, maxM, maxPt, maxPt, maxPt};
340 const Int_t nBinsSparse2 = 10;
342 const Int_t nBins2[nBinsSparse2] = {nBinsDM, nBinsDpT, nBinsDM, nBinsDpT, nBinsM, nBinsM, nBinsPt, nBinsPt, nBinsRho, nBinsRhom};
343 const Double_t xmin2[nBinsSparse2] = {minDM, minDpT, minDM, minDpT, minM, minM, minPt, minPt, minRho, minRhom};
344 const Double_t xmax2[nBinsSparse2] = {maxDM, maxDpT, maxDM, maxDpT, maxM, maxM, maxPt, maxPt, maxRho, maxRhom};
346 const Int_t nBinsSparse3 = 6;
347 const Int_t nBins3[nBinsSparse3] = {nBinsRM, nBinsRpT, nBinsM, nBinsPt, nBinsRho, nBinsRhom};
348 const Double_t xmin3[nBinsSparse3] = {minRM, minRpT, minM, minPt, minRho, minRhom};
349 const Double_t xmax3[nBinsSparse3] = {maxRM, maxRpT, maxM, maxPt, maxRho, maxRhom};
354 TString varName =
"#it{M}_{jet}";
358 histName = Form(
"fh2MSubMatch_%d",i);
359 histTitle = Form(
"fh2MSubMatch_%d;%s;match",i,varName.Data());
360 fh2MSubMatch[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,2,-0.5,1.5);
363 histName = Form(
"fh2MSubPtRawAll_%d",i);
364 histTitle = Form(
"fh2MSubPtRawAll_%d;%s;#it{p}_{T}",i,varName.Data());
365 fh2MSubPtRawAll[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt);
366 fOutput->Add(fh2MSubPtRawAll[i]);
368 histName = Form(
"fh3MSubPtRawDRMatch_%d",i);
369 histTitle = Form(
"fh3MSubPtRawDRMatch_%d;%s;#it{p}_{T}",i,varName.Data());
370 fh3MSubPtRawDRMatch[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt,nBinsDRToLJ,minDRToLJ,maxDRToLJ);
371 fOutput->Add(fh3MSubPtRawDRMatch[i]);
373 histName = Form(
"fh3MSubPtTrueLeadPt_%d",i);
374 histTitle = Form(
"fh3MSubPtTrueLeadPt_%d;%s;#it{p}_{T}",i,varName.Data());
375 fh3MSubPtTrueLeadPt[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt,nBinsPtLead,minPtLead,maxPtLead);
376 fOutput->Add(fh3MSubPtTrueLeadPt[i]);
378 histName = Form(
"fh3MTruePtTrueLeadPt_%d",i);
379 histTitle = Form(
"fh3MTruePtTrueLeadPt_%d;%s;#it{p}_{T}",i,varName.Data());
380 fh3MTruePtTrueLeadPt[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt,nBinsPtLead,minPtLead,maxPtLead);
381 fOutput->Add(fh3MTruePtTrueLeadPt[i]);
383 histName = Form(
"fh3PtTrueDeltaMLeadPt_%d",i);
384 histTitle = Form(
"fh3PtTrueDeltaMLeadPt_%d;#it{p}_{T,true};#Delta %s",i,varName.Data());
385 fh3PtTrueDeltaMLeadPt[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsDM,minDM,maxDM,nBinsPtLead,minPtLead,maxPtLead);
386 fOutput->Add(fh3PtTrueDeltaMLeadPt[i]);
388 histName = Form(
"fh3PtTrueDeltaMRelLeadPt_%d",i);
389 histTitle = Form(
"fh3PtTrueDeltaMRelLeadPt_%d;#it{p}_{T,true};Rel #Delta %s",i,varName.Data());
390 fh3PtTrueDeltaMRelLeadPt[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,400,-1.,3.,nBinsPtLead,minPtLead,maxPtLead);
391 fOutput->Add(fh3PtTrueDeltaMRelLeadPt[i]);
393 histName = Form(
"fhnMassResponse_%d",i);
395 histTitle = Form(
"fhnMassResponse_%d; %s sub; %s true;#it{p}_{T,sub};#it{p}_{T,true};%s (emb, det); #it{p}_{T,emb det}; #rho; #rho_{m}; %s unsub; #it{p}_{T,unsub}", i, varName.Data(),varName.Data(), varName.Data(),varName.Data());
396 fhnMassResponse[i] =
new THnSparseF(histName.Data(),histTitle.Data(),nBinsSparse0b, nBins0b, xmin0b, xmax0b);
399 histTitle = Form(
"fhnMassResponse_%d;%s sub;%s true;#it{p}_{T,sub};#it{p}_{T,true};#it{p}_{T,lead trk}; #rho; #rho_{m}",i,varName.Data(),varName.Data());
400 fhnMassResponse[i] =
new THnSparseF(histName.Data(),histTitle.Data(), nBinsSparse0, nBins0, xmin0, xmax0);
414 histName =
"fhnDeltaMassAndBkgInfo";
415 histTitle = Form(
"%s; #it{M}_{det} - #it{M}_{part}; #it{p}_{T,det} - #it{p}_{T,part}; #it{M}_{unsub} - #it{M}_{part}; #it{p}_{T,unsub} - #it{p}_{T,part}; #it{M}_{det}; #it{M}_{unsub}; #it{p}_{T,det}; #it{p}_{T,unsub}; #rho ; #rho_{m}",histName.Data());
417 fhnDeltaMassAndBkgInfo =
new THnSparseF(histName.Data(),histTitle.Data(),nBinsSparse2,nBins2,xmin2,xmax2);
418 fOutput->Add(fhnDeltaMassAndBkgInfo);
420 histName =
"fhnResolution";
421 histTitle = Form(
"%s; (#it{M}_{det} - #it{M}_{part})/#it{M}_{part}; (#it{p}_{T,det} - #it{p}_{T,part})/#it{p}_{T,part}; #it{M}_{part}; #it{p}_{T,part}; #rho ; #rho_{m}",histName.Data());
423 fhnResolution =
new THnSparseF(histName.Data(),histTitle.Data(),nBinsSparse3,nBins3,xmin3,xmax3);
428 fhRjetTrvspTj =
new TH2F(
"fhRjetTrvspTj",
";R(jet, track);p_{T,jet}", 100, 0., 10., nBinsPt, minPt, maxPt);
430 fhNJetsSelEv =
new TH1F(
"fhNJetsSelEv",
"N of jets selected; #it{N}_{jets}/ev;Entries", 20., 0.,19);
433 fhJetEtaPhiOvl =
new TH2F(
"fhJetEtaPhiOvl",
"#eta - #varphi distribution of selected jets; #eta; #varphi", 24., -0.6, 0.6, 50, (-1)*TMath::Pi(), TMath::Pi());
436 fhpTTracksJetO =
new TH1F(
"hTrackpTO",
"Track pT (signal jet); p_{T}", 500,0.,50.);
441 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);
444 fhpTTracksJet1 =
new TH1F(
"hTrackpT1",
"Track pT ; p_{T}", 500,0.,50.);
446 fhpTTracksCont =
new TH1F(Form(
"fhpTTracksCont"),
"Track pT (container) ; p_{T}", 500,0.,50.);
458 THnSparse *hn =
dynamic_cast<THnSparse*
>(
fOutput->At(i));
483 AliVParticle *vpe = 0x0;
487 AliDebug(2, Form(
"Particle %d not found", ip));
490 Int_t lab = TMath::Abs(vp->GetLabel());
494 else if(vp->Pt()>vpe->Pt()) vpe =vp;
500 if(vpe && jet) deltaR = jet->
DeltaR(vpe);
501 if(deltaR < 0.2)
return vpe;
519 AliError(
"Null tree");
523 fTreeEmb = (
TTree*)tree->Clone(Form(
"%sCpShC", tree->GetName()));
524 AliInfo(Form(
"Input tree set %d (%p -> %p)",
fTreeEmb->GetNbranches(), tree,
fTreeEmb));
534 if(filename.Contains(
"alien")) {
535 TGrid::Connect(
"alien://");
537 TFile *f = TFile::Open(filename);
539 Printf(
"File %s not found, cannot SetTree", filename.Data());
543 TTree *tree =
dynamic_cast<TTree*
>(f->Get(treename));
545 Printf(
"Tree %s not found!!!", treename.Data());
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
Bool_t RetrieveEventObjects()
void LoadRhoMass(const AliVEvent *event)
TH3F * fhJetSubMatchEtaPhiPt
! eta, phi, pt distribution of jet subtracted and matched
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
Get particle container attached to this task.
virtual ~AliAnalysisTaskJetShapeBase()
TLorentzVector * fVecD
! vector with detector level jet
Int_t fMaxLabelEmb
max label of embedded particles
void SetTreeFromFile(TString filenameM, TString treename)
void Terminate(Option_t *option)
AliAnalysisTaskJetShapeBase()
TLorentzVector * fJet1Vec
jet1(AA) vector
virtual AliVParticle * GetParticle(Int_t i=-1) const
Int_t MatchEmbeddedConstituentWithParticleLevel()
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
Double_t DeltaR(const AliVParticle *part) const
THnSparse ** fhnMassResponse
! Msub vs Mtrue vs PtCorr vs PtTrue vs DR
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 ...
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.
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)
AliEmcalList * fOutput
!output list
THnSparse * fhnResolution
! Contains mass and pT resolution
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.
AliVParticle * GetEmbeddedConstituent(AliEmcalJet *jet)
Int_t fNConst
N constituents in jet1.
TH2F * fhRjetTrvspTj
! distance in R between each jetO and embedded single track (those below fRadius are rejected) ...
void UserCreateOutputObjects()
Main initialization function on the worker.
TString fPathTreeinputFile
path to the file where the external input Tree is (can be from alien)
Bool_t RetrieveEventObjects()
Retrieve common objects from event.
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
void UserCreateOutputObjects()
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
void SetTree(TTree *tree)