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),
79 fhptjetSMinusSingleTrack(0x0),
80 fhJetSubMatchEtaPhiPt(0x0),
83 fPathTreeinputFile(""),
84 fTreeinputName("fTreeJet"),
85 fBranchJDetName("fJetDet"),
86 fBranchJParName("fJetPar"),
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];
104 for (
Int_t i = 0; i < fNcentBins; i++) {
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;
116 SetMakeGeneralHistograms(kTRUE);
117 DefineOutput(2, TTree::Class());
126 fContainerOverlap(3),
127 fMinFractionShared(0),
128 fSingleTrackEmb(kFALSE),
130 fJetMassVarType(kMass),
131 fResponseReference(kDet),
146 fMinLabelEmb(-kMaxInt),
147 fMaxLabelEmb(kMaxInt),
150 fh2MSubPtRawAll(0x0),
151 fh3MSubPtRawDRMatch(0x0),
152 fh3MSubPtTrueLeadPt(0x0),
153 fh3MTruePtTrueLeadPt(0x0),
154 fh3PtTrueDeltaMLeadPt(0x0),
155 fh3PtTrueDeltaMRelLeadPt(0x0),
156 fhnMassResponse(0x0),
164 fhptjetSMinusSingleTrack(0x0),
165 fhJetSubMatchEtaPhiPt(0x0),
168 fPathTreeinputFile(
""),
169 fTreeinputName(
"fTreeJet"),
170 fBranchJDetName(
"fJetDet"),
171 fBranchJParName(
"fJetPar"),
202 DefineOutput(2, TTree::Class());
229 Printf(
"Creating tree");
230 fTreeJetBkg =
new TTree(Form(
"%sTree", GetName()), Form(
"%sTree", GetName()));
249 if(!
fTreeEmb) AliFatal(
"Something went wrong in setting the tree");
262 const Int_t nBinsPt = 200;
284 Int_t nBinsDpT = 100;
288 const Int_t nBinsDRToLJ = 20;
292 const Int_t nBinsPtLead = 20;
300 Int_t nBinsRhom = 50;
305 const Int_t nBinsSparse0 = 9;
307 const Int_t nBins0[nBinsSparse0] = {nBinsM,nBinsM,nBinsPt,nBinsPt,nBinsPtLead, nBinsRho, nBinsRhom, nBinsM, nBinsPt};
308 const Double_t xmin0[nBinsSparse0] = { minM, minM, minPt, minPt, minPtLead, minRho, minRhom, minM, minPt};
309 const Double_t xmax0[nBinsSparse0] = { maxM, maxM, maxPt, maxPt, maxPtLead, maxRho, maxRhom, maxM, maxPt};
311 const Int_t nBinsSparse0b = 10;
313 const Int_t nBins0b[nBinsSparse0b] = {nBinsM, nBinsM, nBinsPt, nBinsPt, nBinsM, nBinsPt, nBinsRho, nBinsRhom, nBinsM, nBinsPt};
314 const Double_t xmin0b[nBinsSparse0b] = { minM, minM, minPt, minPt, minM, minPt, minRho, minRhom, minM, minPt};
315 const Double_t xmax0b[nBinsSparse0b] = { maxM, maxM, maxPt, maxPt, maxM, maxPt, maxRho, maxRhom, maxM, maxPt};
317 const Int_t nBinsSparse1 = 7;
319 const Int_t nBins1[nBinsSparse1] = {nBinsDM,nBinsDpT,nBinsM,nBinsM,nBinsPt,nBinsPt,nBinsPt};
320 const Double_t xmin1[nBinsSparse1] = { minDM, minDpT, minM, minM, minPt, minPt, minPt};
321 const Double_t xmax1[nBinsSparse1] = { maxDM, maxDpT, maxM, maxM, maxPt, maxPt, maxPt};
323 const Int_t nBinsSparse2 = 10;
325 const Int_t nBins2[nBinsSparse2] = {nBinsDM, nBinsDpT, nBinsDM, nBinsDpT, nBinsM, nBinsM, nBinsPt, nBinsPt, nBinsRho, nBinsRhom};
326 const Double_t xmin2[nBinsSparse2] = {minDM, minDpT, minDM, minDpT, minM, minM, minPt, minPt, minRho, minRhom};
327 const Double_t xmax2[nBinsSparse2] = {maxDM, maxDpT, maxDM, maxDpT, maxM, maxM, maxPt, maxPt, maxRho, maxRhom};
331 TString varName =
"#it{M}_{jet}";
335 histName = Form(
"fh2MSubMatch_%d",i);
336 histTitle = Form(
"fh2MSubMatch_%d;%s;match",i,varName.Data());
337 fh2MSubMatch[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,2,-0.5,1.5);
340 histName = Form(
"fh2MSubPtRawAll_%d",i);
341 histTitle = Form(
"fh2MSubPtRawAll_%d;%s;#it{p}_{T}",i,varName.Data());
342 fh2MSubPtRawAll[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt);
343 fOutput->Add(fh2MSubPtRawAll[i]);
345 histName = Form(
"fh3MSubPtRawDRMatch_%d",i);
346 histTitle = Form(
"fh3MSubPtRawDRMatch_%d;%s;#it{p}_{T}",i,varName.Data());
347 fh3MSubPtRawDRMatch[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt,nBinsDRToLJ,minDRToLJ,maxDRToLJ);
348 fOutput->Add(fh3MSubPtRawDRMatch[i]);
350 histName = Form(
"fh3MSubPtTrueLeadPt_%d",i);
351 histTitle = Form(
"fh3MSubPtTrueLeadPt_%d;%s;#it{p}_{T}",i,varName.Data());
352 fh3MSubPtTrueLeadPt[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt,nBinsPtLead,minPtLead,maxPtLead);
353 fOutput->Add(fh3MSubPtTrueLeadPt[i]);
355 histName = Form(
"fh3MTruePtTrueLeadPt_%d",i);
356 histTitle = Form(
"fh3MTruePtTrueLeadPt_%d;%s;#it{p}_{T}",i,varName.Data());
357 fh3MTruePtTrueLeadPt[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsPt,minPt,maxPt,nBinsPtLead,minPtLead,maxPtLead);
358 fOutput->Add(fh3MTruePtTrueLeadPt[i]);
360 histName = Form(
"fh3PtTrueDeltaMLeadPt_%d",i);
361 histTitle = Form(
"fh3PtTrueDeltaMLeadPt_%d;#it{p}_{T,true};#Delta %s",i,varName.Data());
362 fh3PtTrueDeltaMLeadPt[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsDM,minDM,maxDM,nBinsPtLead,minPtLead,maxPtLead);
363 fOutput->Add(fh3PtTrueDeltaMLeadPt[i]);
365 histName = Form(
"fh3PtTrueDeltaMRelLeadPt_%d",i);
366 histTitle = Form(
"fh3PtTrueDeltaMRelLeadPt_%d;#it{p}_{T,true};Rel #Delta %s",i,varName.Data());
367 fh3PtTrueDeltaMRelLeadPt[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,400,-1.,3.,nBinsPtLead,minPtLead,maxPtLead);
368 fOutput->Add(fh3PtTrueDeltaMRelLeadPt[i]);
370 histName = Form(
"fhnMassResponse_%d",i);
372 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());
373 fhnMassResponse[i] =
new THnSparseF(histName.Data(),histTitle.Data(),nBinsSparse0b, nBins0b, xmin0b, xmax0b);
376 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());
377 fhnMassResponse[i] =
new THnSparseF(histName.Data(),histTitle.Data(), nBinsSparse0, nBins0, xmin0, xmax0);
391 histName =
"fhnDeltaMassAndBkgInfo";
392 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());
394 fhnDeltaMassAndBkgInfo =
new THnSparseF(histName.Data(),histTitle.Data(),nBinsSparse2,nBins2,xmin2,xmax2);
395 fOutput->Add(fhnDeltaMassAndBkgInfo);
398 fhRjetTrvspTj =
new TH2F(
"fhRjetTrvspTj",
";R(jet, track);p_{T,jet}", 100, 0., 10., nBinsPt, minPt, maxPt);
400 fhNJetsSelEv =
new TH1F(
"fhNJetsSelEv",
"N of jets selected; #it{N}_{jets}/ev;Entries", 20., 0.,19);
403 fhJetEtaPhiOvl =
new TH2F(
"fhJetEtaPhiOvl",
"#eta - #varphi distribution of selected jets; #eta; #varphi", 24., -0.6, 0.6, 50, (-1)*TMath::Pi(), TMath::Pi());
406 fhpTTracksJetO =
new TH1F(
"hTrackpTO",
"Track pT (signal jet); p_{T}", 500,0.,50.);
411 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);
414 fhpTTracksJet1 =
new TH1F(
"hTrackpT1",
"Track pT ; p_{T}", 500,0.,50.);
416 fhpTTracksCont =
new TH1F(Form(
"fhpTTracksCont"),
"Track pT (container) ; p_{T}", 500,0.,50.);
428 THnSparse *hn =
dynamic_cast<THnSparse*
>(
fOutput->At(i));
453 AliVParticle *vpe = 0x0;
457 AliDebug(2, Form(
"Particle %d not found", ip));
460 Int_t lab = TMath::Abs(vp->GetLabel());
464 else if(vp->Pt()>vpe->Pt()) vpe =vp;
470 if(vpe && jet) deltaR = jet->
DeltaR(vpe);
471 if(deltaR < 0.2)
return vpe;
489 AliError(
"Null tree");
493 fTreeEmb = (
TTree*)tree->Clone(Form(
"%sCpShC", tree->GetName()));
494 AliInfo(Form(
"Input tree set %d (%p -> %p)",
fTreeEmb->GetNbranches(), tree,
fTreeEmb));
504 if(filename.Contains(
"alien")) {
505 TGrid::Connect(
"alien://");
507 TFile *f = TFile::Open(filename);
509 Printf(
"File %s not found, cannot SetTree", filename.Data());
513 TTree *tree =
dynamic_cast<TTree*
>(f->Get(treename));
515 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
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
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)
AliEmcalList * fOutput
!output list
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()
TString fPathTreeinputFile
path to the file where the external input Tree is (can be from alien)
Bool_t RetrieveEventObjects()
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)