30 #include <THnSparse.h> 43 fJetTaggingType(kTag),
44 fJetTaggingMethod(kGeo),
48 fMinFractionShared(0),
53 fExtraMarginAccBase(0.1),
54 fExtraMarginAccTag(0.1),
56 fh3PtJet1VsDeltaEtaDeltaPhi(0),
58 fh2PtJet2VsFraction(0),
59 fh2PtJet1VsLeadPtAllSel(0),
60 fh2PtJet1VsLeadPtTagged(0),
63 fh3PtJetDEtaDPhiConst(0),
64 fh3PtJetAreaDRConst(0)
142 Bool_t oldStatus = TH1::AddDirectoryStatus();
143 TH1::AddDirectory(kFALSE);
145 const Int_t nBinsPt = 40;
146 const Int_t nBinsDPhi = 72;
147 const Int_t nBinsDEta = 100;
148 const Int_t nBinsDR = 50;
149 const Int_t nBinsFraction = 101;
159 const Double_t minFraction = -0.005;
166 histName = TString::Format(
"fh3PtJet1VsDeltaEtaDeltaPhi_%d",i);
167 histTitle = TString::Format(
"%s;#it{p}_{T,jet1};#it{#Delta#eta};#it{#Delta#varphi}",histName.Data());
168 fh3PtJet1VsDeltaEtaDeltaPhi[i] =
new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsDEta,minDEta,maxDEta,nBinsDPhi,minDPhi,maxDPhi);
169 fOutput->Add(fh3PtJet1VsDeltaEtaDeltaPhi[i]);
171 histName = TString::Format(
"fh2PtJet1VsDeltaR_%d",i);
172 histTitle = TString::Format(
"%s;#it{p}_{T,jet1};#it{#Delta R}",histName.Data());
173 fh2PtJet1VsDeltaR[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsDR,minDR,maxDR);
174 fOutput->Add(fh2PtJet1VsDeltaR[i]);
176 histName = TString::Format(
"fh2PtJet2VsFraction_%d",i);
177 histTitle = TString::Format(
"%s;#it{p}_{T,jet2};#it{f}_{shared}",histName.Data());
178 fh2PtJet2VsFraction[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsFraction,minFraction,maxFraction);
179 fOutput->Add(fh2PtJet2VsFraction[i]);
181 histName = TString::Format(
"fh2PtJet1VsLeadPtAllSel_%d",i);
182 histTitle = TString::Format(
"%s;#it{p}_{T,jet1};#it{p}_{T,lead trk}",histName.Data());
184 fOutput->Add(fh2PtJet1VsLeadPtAllSel[i]);
186 histName = TString::Format(
"fh2PtJet1VsLeadPtTagged_%d",i);
187 histTitle = TString::Format(
"%s;#it{p}_{T,jet1};#it{p}_{T,lead trk}",histName.Data());
189 fOutput->Add(fh2PtJet1VsLeadPtTagged[i]);
191 histName = TString::Format(
"fh2PtJet1VsPtJet2_%d",i);
192 histTitle = TString::Format(
"%s;#it{p}_{T,jet1};#it{p}_{T,jet2}",histName.Data());
193 fh2PtJet1VsPtJet2[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsPt,minPt,maxPt);
194 fOutput->Add(fh2PtJet1VsPtJet2[i]);
196 histName = TString::Format(
"fh2PtJet2VsRelPt_%d",i);
197 histTitle = TString::Format(
"%s;#it{p}_{T,jet2};(#it{p}_{T,jet2}-#it{p}_{T,jet1})/#it{p}_{T,jet1}",histName.Data());
198 fh2PtJet2VsRelPt[i] =
new TH2F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,241,-2.41,2.41);
199 fOutput->Add(fh2PtJet2VsRelPt[i]);
202 fh3PtJetDEtaDPhiConst =
new TH3F(
"fh3PtJetDEtaDPhiConst",
"fh3PtJetDEtaDPhiConst;pT;#Delta #eta;#Delta #varphi",nBinsPt,minPt,maxPt,nBinsDEta,-1.,1.,nBinsDPhi,-1.,1.);
205 fh3PtJetAreaDRConst =
new TH3F(
"fh3PtJetAreaDRConst",
"fh3PtJetAreaDRConst;pT;A;#Delta R",nBinsPt,minPt,maxPt,50,0.,1.,50,0.,1.);
208 fNAccJets =
new TH1F(
"fNAccJets",
"fNAccJets;N/ev",11,-0.5, 9.5);
219 THnSparse *hn =
dynamic_cast<THnSparse*
>(
fOutput->At(i));
224 TH1::AddDirectory(oldStatus);
235 if(!cont1 || !cont2) AliError(
"Missing jet container");
240 Bool_t isZeroTwoPi1 = kFALSE;
242 if(phiMin1 > -1.e-6 && phiMin1 < 1.e-6) isZeroTwoPi1 = kTRUE;
243 Bool_t isZeroTwoPi2 = kFALSE;
244 if(phiMin2 > -1.e-6 && phiMin2 < 1.e-6) isZeroTwoPi2 = kTRUE;
279 if(!jetCont)
return kFALSE;
289 AliVParticle *vp =
static_cast<AliVParticle*
>(jet1->
Track(icc));
293 if(dPhi<TMath::Pi()) dPhi+=TMath::TwoPi();
294 if(dPhi>TMath::Pi()) dPhi-=TMath::TwoPi();
297 Double_t dR = TMath::Sqrt(dPhi*dPhi+dEta*dEta);
326 dPhi -= TMath::TwoPi();
327 if(dPhi<(-1.*TMath::Pi()))
328 dPhi += TMath::TwoPi();
358 if(nJets1==0 || nJets2==0)
return;
370 faMatchIndex1.Set(nJets2+1);
371 faMatchIndex1.Reset(-1);
374 faMatchIndex2.Set(nJets1+1);
375 faMatchIndex2.Reset(-1);
377 static TArrayS iFlag(nJets1*nJets2);
378 if(iFlag.GetSize()<(nJets1*nJets2)){
379 iFlag.Set(nJets1*nJets2+1);
401 for(
int i = 0;i<nJets1;i++){
408 for(
int j = 0;j <nJets2; j++){
413 if(dR<dist && dR<maxDist){
418 if(faMatchIndex2[i]>=0) {
419 iFlag[i*nJets2+faMatchIndex2[i]]+=1;
420 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]]);
425 for(
int j = 0;j<nJets2;j++){
431 for(
int i = 0;i<nJets1;i++){
436 if(dR<dist && dR<maxDist){
441 if(faMatchIndex1[j]>=0) {
442 iFlag[faMatchIndex1[j]*nJets2+j]+=2;
443 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]);
448 for(
int i = 0;i<nJets1;i++){
450 for(
int j = 0;j<nJets2;j++){
452 AliDebug(11,Form(
"%s: Flag[%d][%d] %d ",GetName(),i,j,iFlag[i*nJets2+j]));
455 if(iFlag[i*nJets2+j]==3) {
457 if(iDebug>1) Printf(
"closest jets %d %d dR = %f",j,i,dR);
482 if(dPhi <-0.5*TMath::Pi()) dPhi += TMath::TwoPi();
483 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
void Init()
Initialize jet tagger.
AliJetContainer * GetJetContainer(Int_t i=0) const
Int_t GetTagStatus() const
AliAnalysisTaskEmcalJetTagger()
Dummy constructor.
Double_t fMaxDist
distance allowed for two jets to match
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)
Match the full jets to the corresponding charged jets.
TH3F ** fh3PtJet1VsDeltaEtaDeltaPhi
! pt jet 1 vs deta vs dphi
Bool_t fInit
true when the containers are initialized
Double_t GetJetEtaMax() const
Pure geometric tagging (max. distance + acceptance cut)
AliVParticle * Track(Int_t idx) const
Int_t fCentBin
!event centrality bin
Bool_t RetrieveEventObjects()
TH2F ** fh2PtJet2VsRelPt
! pT of tagged jet vs pt base jet / pt tagged jet
virtual ~AliAnalysisTaskEmcalJetTagger()
Destructor.
TH2F ** fh2PtJet2VsFraction
! pt jet 1 vs shared fraction
UShort_t GetNumberOfTracks() const
Double_t fExtraMarginAccTag
Extra margin to be added to the acceptance for the different acceptance types (tag jet container) ...
TH2F ** fh2PtJet1VsLeadPtTagged
! tagged jets
TH2F ** fh2PtJet1VsDeltaR
! pt jet 1 vs dR
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
Double_t fMinFractionShared
only fill histos for jets if shared fraction larger than X
Int_t fTypeAcc
acceptance cut for the jet containers, see method MatchJetsGeo in .cxx for possibilities ...
Double_t GetJetPhiMin() const
JetTaggingType fJetTaggingType
jet matching type
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)
Terminate method - not implemented for the jet tagger task.
AliEmcalJet * GetNextAcceptJet()
JetTaggingMethod fJetTaggingMethod
jet matching method
Bool_t fMatchingDone
flag to indicate if matching is done or not
Double_t DeltaR(const AliVParticle *part) const
TH2F ** fh2PtJet1VsPtJet2
! pT of base jet vs tagged jet
Tagging jets with jet from another source.
Double_t GetRhoVal(Int_t i=0) const
Double_t fExtraMarginAccBase
Extra margin to be added to the acceptance for the different acceptance types (base jet container) ...
Bool_t Run()
Run jet tagging.
AliEmcalList * fOutput
!output list
void SetClosestJet(AliEmcalJet *j, Double_t d)
Bool_t FillHistograms()
Filling internal QA histograms of jet tagger task.
void SetMakeGeneralHistograms(Bool_t g)
Enable general histograms.
TH2F ** fh2PtJet1VsLeadPtAllSel
! all jets after std selection
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
TH3F * fh3PtJetDEtaDPhiConst
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
Only the closest jet in distance is tagged.
Bool_t fUseSumw2
activate sumw2 for output histograms
void ResetTagging(const Int_t c)
Remove tag status of all jets in a given jet container.
void UserCreateOutputObjects()
Main initialization function on the worker.
Double_t GetDeltaPhi(const AliEmcalJet *jet1, const AliEmcalJet *jet2)
Calculate azimuthal angle between the axises of the jets.
All jets within a maximum distance are tagged.
TH3F * fh3PtJetAreaDRConst
pt jet vs delta eta vs delta phi of constituents
Int_t fContainerBase
jets to be tagged
void SetJetEtaLimits(Float_t min, Float_t max)
void ResetCurrentID(Int_t i=-1)
Reset the iterator to a given index.
Int_t fContainerTag
jets used for tagging
Container for jet within the EMCAL jet framework.
void UserCreateOutputObjects()
Creating interal QA histograms of the jet tagger task.
Bool_t RetrieveEventObjects()
Retrieving event objects.
Int_t fSpecPartContTag
particle container optionally used in AliJetContainer::GetFractionSharedPt(). Set only if needed...