23 fJetTaggingType(kTag),
24 fJetTaggingMethod(kGeo),
28 fMinFractionShared(0),
34 fh3PtJet1VsDeltaEtaDeltaPhi(0),
36 fh2PtJet2VsFraction(0),
37 fh2PtJet1VsLeadPtAllSel(0),
38 fh2PtJet1VsLeadPtTagged(0),
41 fh3PtJetDEtaDPhiConst(0),
42 fh3PtJetAreaDRConst(0)
128 Bool_t oldStatus = TH1::AddDirectoryStatus();
129 TH1::AddDirectory(kFALSE);
131 const Int_t nBinsPt = 40;
132 const Int_t nBinsDPhi = 72;
133 const Int_t nBinsDEta = 100;
134 const Int_t nBinsDR = 50;
135 const Int_t nBinsFraction = 101;
145 const Double_t minFraction = -0.005;
152 histName = TString::Format(
"fh3PtJet1VsDeltaEtaDeltaPhi_%d",i);
153 histTitle = TString::Format(
"%s;#it{p}_{T,jet1};#it{#Delta#eta};#it{#Delta#varphi}",histName.Data());
154 fh3PtJet1VsDeltaEtaDeltaPhi[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsDEta,minDEta,maxDEta,nBinsDPhi,minDPhi,maxDPhi);
155 fOutput->Add(fh3PtJet1VsDeltaEtaDeltaPhi[i]);
157 histName = TString::Format(
"fh2PtJet1VsDeltaR_%d",i);
158 histTitle = TString::Format(
"%s;#it{p}_{T,jet1};#it{#Delta R}",histName.Data());
159 fh2PtJet1VsDeltaR[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsDR,minDR,maxDR);
160 fOutput->Add(fh2PtJet1VsDeltaR[i]);
162 histName = TString::Format(
"fh2PtJet2VsFraction_%d",i);
163 histTitle = TString::Format(
"%s;#it{p}_{T,jet2};#it{f}_{shared}",histName.Data());
164 fh2PtJet2VsFraction[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsFraction,minFraction,maxFraction);
165 fOutput->Add(fh2PtJet2VsFraction[i]);
167 histName = TString::Format(
"fh2PtJet1VsLeadPtAllSel_%d",i);
168 histTitle = TString::Format(
"%s;#it{p}_{T,jet1};#it{p}_{T,lead trk}",histName.Data());
170 fOutput->Add(fh2PtJet1VsLeadPtAllSel[i]);
172 histName = TString::Format(
"fh2PtJet1VsLeadPtTagged_%d",i);
173 histTitle = TString::Format(
"%s;#it{p}_{T,jet1};#it{p}_{T,lead trk}",histName.Data());
175 fOutput->Add(fh2PtJet1VsLeadPtTagged[i]);
177 histName = TString::Format(
"fh2PtJet1VsPtJet2_%d",i);
178 histTitle = TString::Format(
"%s;#it{p}_{T,jet1};#it{p}_{T,jet2}",histName.Data());
179 fh2PtJet1VsPtJet2[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsPt,minPt,maxPt);
180 fOutput->Add(fh2PtJet1VsPtJet2[i]);
182 histName = TString::Format(
"fh2PtJet2VsRelPt_%d",i);
183 histTitle = TString::Format(
"%s;#it{p}_{T,jet2};(#it{p}_{T,jet2}-#it{p}_{T,jet1})/#it{p}_{T,jet1}",histName.Data());
184 fh2PtJet2VsRelPt[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,241,-2.41,2.41);
185 fOutput->Add(fh2PtJet2VsRelPt[i]);
188 fh3PtJetDEtaDPhiConst =
new TH3F(
"fh3PtJetDEtaDPhiConst",
"fh3PtJetDEtaDPhiConst;pT;#Delta #eta;#Delta #varphi",nBinsPt,minPt,maxPt,nBinsDEta,-1.,1.,nBinsDPhi,-1.,1.);
191 fh3PtJetAreaDRConst =
new TH3F(
"fh3PtJetAreaDRConst",
"fh3PtJetAreaDRConst;pT;A;#Delta R",nBinsPt,minPt,maxPt,50,0.,1.,50,0.,1.);
194 fNAccJets =
new TH1F(
"fNAccJets",
"fNAccJets;N/ev",11,-0.5, 9.5);
205 THnSparse *hn =
dynamic_cast<THnSparse*
>(
fOutput->At(i));
210 TH1::AddDirectory(oldStatus);
222 if(!cont1 || !cont2) AliError(
"Missing jet container");
227 Bool_t isZeroTwoPi1 = kFALSE;
229 if(phiMin1 > -1.e-6 && phiMin1 < 1.e-6) isZeroTwoPi1 = kTRUE;
230 Bool_t isZeroTwoPi2 = kFALSE;
231 if(phiMin2 > -1.e-6 && phiMin2 < 1.e-6) isZeroTwoPi2 = kTRUE;
265 if(!jetCont)
return kFALSE;
266 jetCont->ResetCurrentID();
279 if(dPhi<TMath::Pi()) dPhi+=TMath::TwoPi();
280 if(dPhi>TMath::Pi()) dPhi-=TMath::TwoPi();
283 Double_t dR = TMath::Sqrt(dPhi*dPhi+dEta*dEta);
312 dPhi -= TMath::TwoPi();
313 if(dPhi<(-1.*TMath::Pi()))
314 dPhi += TMath::TwoPi();
359 if(nJets1==0 || nJets2==0)
return;
371 faMatchIndex1.Set(nJets2+1);
372 faMatchIndex1.Reset(-1);
375 faMatchIndex2.Set(nJets1+1);
376 faMatchIndex2.Reset(-1);
378 static TArrayS iFlag(nJets1*nJets2);
379 if(iFlag.GetSize()<(nJets1*nJets2)){
380 iFlag.Set(nJets1*nJets2+1);
402 for(
int i = 0;i<nJets1;i++){
409 for(
int j = 0;j <nJets2; j++){
414 if(dR<dist && dR<maxDist){
419 if(faMatchIndex2[i]>=0) {
420 iFlag[i*nJets2+faMatchIndex2[i]]+=1;
421 if(iDebug>10) Printf(
"Full Distance (%d)--(%d) %3.3f flag[%d] = %d",i,faMatchIndex2[i],dist,i*nJets2+faMatchIndex2[i],iFlag[i*nJets2+faMatchIndex2[i]]);
426 for(
int j = 0;j<nJets2;j++){
432 for(
int i = 0;i<nJets1;i++){
437 if(dR<dist && dR<maxDist){
442 if(faMatchIndex1[j]>=0) {
443 iFlag[faMatchIndex1[j]*nJets2+j]+=2;
444 if(iDebug>10) Printf(
"Other way Distance (%d)--(%d) %3.3f flag[%d] = %d",faMatchIndex1[j],j,dist,faMatchIndex1[j]*nJets2+j,iFlag[faMatchIndex1[j]*nJets2+j]);
449 for(
int i = 0;i<nJets1;i++){
451 for(
int j = 0;j<nJets2;j++){
453 AliDebug(11,Form(
"%s: Flag[%d][%d] %d ",GetName(),i,j,iFlag[i*nJets2+j]));
456 if(iFlag[i*nJets2+j]==3) {
458 if(iDebug>1) Printf(
"closest jets %d %d dR = %f",j,i,dR);
491 if(dPhi <-0.5*TMath::Pi()) dPhi += TMath::TwoPi();
492 if(dPhi > 1.5*TMath::Pi()) dPhi -= TMath::TwoPi();
void SetTagStatus(Int_t i)
Double_t GetRhoVal() const
AliEmcalJet * GetJetFromArray(Int_t j, Int_t c=0) const
AliEmcalJet * GetTaggedJet() const
Double_t GetJetEtaMin() const
void SetTaggedJet(AliEmcalJet *j)
AliEmcalJet * ClosestJet() const
AliJetContainer * GetJetContainer(Int_t i=0) const
Int_t GetTagStatus() const
AliAnalysisTaskEmcalJetTagger()
Double_t GetJetPhiMax() const
Int_t GetNJets(Int_t i=0) const
TH1 * fNAccJets
pt jet vs Area vs delta R of constituents
void MatchJetsGeo(Int_t c1=-1, Int_t c2=-1, Int_t iDebug=0, Float_t maxDist=0.3, Int_t type=2, Bool_t bReset=kTRUE)
TH3F ** fh3PtJet1VsDeltaEtaDeltaPhi
Double_t GetJetEtaMax() const
Int_t fCentBin
!event centrality bin
Bool_t RetrieveEventObjects()
TH2F ** fh2PtJet2VsRelPt
pT of base jet vs tagged jet
virtual ~AliAnalysisTaskEmcalJetTagger()
TH2F ** fh2PtJet2VsFraction
pt jet 1 vs dR
Int_t TrackAt(Int_t idx) const
UShort_t GetNumberOfTracks() const
TH2F ** fh2PtJet1VsLeadPtTagged
all jets after std selection
TH2F ** fh2PtJet1VsDeltaR
pt jet 1 vs deta vs dphi
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
Double_t fMinFractionShared
AliParticleContainer * GetParticleContainer() const
Double_t GetJetPhiMin() const
JetTaggingType fJetTaggingType
void SetJetPhiLimits(Float_t min, Float_t max)
Int_t fNcentBins
how many centrality bins
Double_t MaxTrackPt() const
AliEmcalJet * GetAcceptJetFromArray(Int_t j, Int_t c=0) const
void Terminate(Option_t *option)
AliEmcalJet * GetNextAcceptJet()
JetTaggingMethod fJetTaggingMethod
Double_t DeltaR(const AliVParticle *part) const
TH2F ** fh2PtJet1VsPtJet2
tagged jets
Double_t GetRhoVal(Int_t i=0) const
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.
AliEmcalList * fOutput
!output list
void SetClosestJet(AliEmcalJet *j, Double_t d)
Bool_t FillHistograms()
Function filling histograms.
void SetMakeGeneralHistograms(Bool_t g)
TH2F ** fh2PtJet1VsLeadPtAllSel
pt jet 1 vs shared fraction
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
TH3F * fh3PtJetDEtaDPhiConst
pT of tagged jet vs pt base jet / pt tagged jet
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
void ResetTagging(const Int_t c)
void UserCreateOutputObjects()
Main initialization function on the worker.
Double_t GetDeltaPhi(const AliEmcalJet *jet1, const AliEmcalJet *jet2)
TH3F * fh3PtJetAreaDRConst
pt jet vs delta eta vs delta phi of constituents
void SetJetEtaLimits(Float_t min, Float_t max)
Container for jet within the EMCAL jet framework.
void UserCreateOutputObjects()
Bool_t RetrieveEventObjects()
Retrieve common objects from event.