6 #include <TClonesArray.h> 10 #include <THnSparse.h> 12 #include <TLorentzVector.h> 19 #include "AliVCluster.h" 20 #include "AliVTrack.h" 25 #include "AliMCEvent.h" 26 #include "AliGenPythiaEventHeader.h" 27 #include "AliAODMCHeader.h" 28 #include "AliMCEvent.h" 29 #include "AliAnalysisManager.h" 40 fJetCorrelationType(kCorrelateAll),
41 fJetFullChargedMatchingType(kFraction),
45 fContainerChargedMC(3),
50 fDoChargedCharged(kTRUE),
51 fDoFullCharged(kTRUE),
53 fPtMinTriggerJet(10.),
55 fMinFractionShared(0.5),
56 fMatchingDone(kFALSE),
60 fHistTrialsSelEvents(0)
65 SetMakeGeneralHistograms(kTRUE);
73 fJetCorrelationType(kCorrelateAll),
74 fJetFullChargedMatchingType(kFraction),
78 fContainerChargedMC(3),
83 fDoChargedCharged(kTRUE),
84 fDoFullCharged(kTRUE),
86 fPtMinTriggerJet(10.),
88 fMinFractionShared(0.5),
89 fMatchingDone(kFALSE),
93 fHistTrialsSelEvents(0)
117 TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
122 if(!firedTrigClass.Contains(
"J1") || !firedTrigClass.Contains(
"J2") )
125 else if(
fTriggerClass.Contains(
"J1") && firedTrigClass.Contains(
"J2"))
144 Bool_t oldStatus = TH1::AddDirectoryStatus();
145 TH1::AddDirectory(kFALSE);
147 fhNEvents =
new TH1F(
"fhNEvents",
"fhNEvents;selection;N_{evt}",5,0,5);
156 TH1::AddDirectory(oldStatus);
167 if(type<2 && ijt==ija)
194 AliWarning(Form(
"%s: matching type unknown", GetName()));
221 return GetZ(trk->Px(),trk->Py(),trk->Pz(),jet->
Px(),jet->
Py(),jet->
Pz());
231 Double_t pJetSq = jetPx*jetPx+jetPy*jetPy+jetPz*jetPz;
234 return (trkPx*jetPx+trkPy*jetPy+trkPz*jetPz)/pJetSq;
236 AliWarning(Form(
"%s: strange, pjet*pjet seems to be zero pJetSq: %f",GetName(), pJetSq));
248 if(dPhi>TMath::Pi())dPhi = dPhi - 2.*TMath::Pi();
249 if(dPhi<(-1.*TMath::Pi()))dPhi = dPhi + 2.*TMath::Pi();
251 Double_t dR = TMath::Sqrt(dPhi*dPhi+dEta*dEta);
273 if(dPhi <-0.5*TMath::Pi()) dPhi += TMath::TwoPi();
274 if(dPhi > 1.5*TMath::Pi()) dPhi -= TMath::TwoPi();
295 AliVParticle *vpf = 0x0;
301 if(idx == jetFull->
TrackAt(icf) && iFound==0 ) {
312 fraction = sumPt/jetPtCh;
315 AliDebug(11,Form(
"%s: charged shared fraction: %.2f",GetName(),fraction));
335 if(nFullJets==0 || nChJets==0)
return;
338 faChNeMatchIndex.Set(nChJets+1);
339 faChNeMatchIndex.Reset(-1);
342 faChMatchIndex.Set(nFullJets+1);
343 faChMatchIndex.Reset(-1);
345 static TArrayS iFlag(nChJets*nFullJets);
346 if(iFlag.GetSize()<(nChJets*nFullJets)){
347 iFlag.Set(nChJets*nFullJets+1);
354 for(
int ifu = 0;ifu<nFullJets;ifu++){
357 if(!fullJet)
continue;
361 for(
int ich = 0;ich<nChJets;ich++){
383 faChMatchIndex[ifu]=ich;
386 if(iDebug>10) Printf(
"Distance (%d)--(%d) %3.3f frac:%.2f",ifu,ich,dR,frac);
388 if(faChMatchIndex[ifu]>=0) iFlag[ifu*nChJets+faChMatchIndex[ifu]]+=1;
389 if(iDebug>10) Printf(
"Full Distance (%d)--(%d) %3.3f flag[%d] = %d",ifu,faChMatchIndex[ifu],dist,ifu*nChJets+faChMatchIndex[ifu],iFlag[ifu*nChJets+faChMatchIndex[ifu]]);
392 faChMatchIndex[ifu]=-1;
399 for(
int ich = 0;ich<nChJets;ich++){
405 if(!chJet)
continue;;
419 for(
int ifu = 0;ifu<nFullJets;ifu++){
426 faChNeMatchIndex[ich]=ifu;
430 if(faChNeMatchIndex[ich]>=0) iFlag[faChNeMatchIndex[ich]*nChJets+ich]+=2;
431 if(iDebug>10) Printf(
"Other way Distance (%d)--(%d) %3.3f flag[%d] = %d",faChNeMatchIndex[ich],ich,dist,faChNeMatchIndex[ich]*nChJets+ich,iFlag[faChNeMatchIndex[ich]*nChJets+ich]);
434 faChNeMatchIndex[ich]=-1;
440 for(
int ifu = 0;ifu<nFullJets;ifu++){
441 for(
int ich = 0;ich<nChJets;ich++){
442 AliDebug(11,Form(
"%s: Flag[%d][%d] %d ",GetName(),ifu,ich,iFlag[ifu*nChJets+ich]));
446 if(iFlag[ifu*nChJets+ich]==3){
452 AliDebug(11,Form(
"closest jets %d %d dR = %f",ich,ifu,dR));
479 for(
Int_t ifu = 0; ifu<nJetsFull; ifu++) {
488 for(
Int_t ich = 0; ich<nJetsCh; ich++) {
494 if(tmpFrac>frac && dist<radius) {
517 for(
Int_t ifu = 0; ifu<nJetsFull; ifu++) {
526 for(
Int_t ich = 0; ich<nJetsCh; ich++) {
532 if(tmpFrac>frac && dist<radius) {
552 for(
Int_t ija=0; ija<nJetsAssoc; ija++) {
557 if(TMath::Abs(jetAssoc->
Eta())>0.5)
569 if(dPhi<phiMin || dPhi>phiMax)
574 if(jetAssocPt>ptLead) {
599 Int_t iJetLead2 = -1;
600 for(
Int_t ija=0; ija<nJetsAssoc; ija++) {
605 if(TMath::Abs(jetAssoc->
Eta())>0.5)
617 if(dPhi<phiMin || dPhi>phiMax)
622 if(jetAssocPt>ptLead) {
623 iJetLead2 = iJetLead;
634 return jetAssocLead2;
TH1 * fHistTrialsSelEvents
Histo number of events.
Double_t GetFractionSharedPt(const AliEmcalJet *jetFull, const AliEmcalJet *jetCharged) const
AliEmcalJet * GetJetFromArray(Int_t j, Int_t c=0) const
Double_t GetJetEtaMin() const
AliEmcalJet * ClosestJet() const
AliJetContainer * GetJetContainer(Int_t i=0) const
Bool_t IsSameJet(Int_t jt, Int_t ja, Int_t type, Bool_t isMC=kFALSE)
Int_t fNTrials
!event trials
Double_t GetJetPhiMax() const
Int_t GetNJets(Int_t i=0) const
Double_t GetJetPt(const AliEmcalJet *jet, Int_t type)
Double_t GetJetEtaMax() const
void MatchJetsGeo(Int_t cFull, Int_t cCharged, Int_t iDebug=0, Float_t maxDist=0.3, Int_t type=0)
JetFullChargedMatchingType fJetFullChargedMatchingType
Bool_t RetrieveEventObjects()
Double_t GetDeltaR(const AliEmcalJet *jet1, const AliEmcalJet *jet2) const
UShort_t GetNumberOfConstituents() const
Int_t TrackAt(Int_t idx) const
UShort_t GetNumberOfTracks() const
Double_t GetJetPhiMin() const
virtual Bool_t RetrieveEventObjects()
Retrieve common objects from event.
UShort_t GetNumberOfClusters() const
void UserCreateOutputObjects()
AliAnalysisTaskEmcalDiJetBase()
TArrayI faFullFracIndexMC
Double_t GetZ(const AliVParticle *trk, const AliEmcalJet *jet) const
AliEmcalJet * GetAcceptJetFromArray(Int_t j, Int_t c=0) const
void SetChargedFractionIndex()
Double_t GetRhoVal(Int_t i=0) const
virtual ~AliAnalysisTaskEmcalDiJetBase()
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
Int_t fPtHardBin
!event -hard bin
void SetClosestJet(AliEmcalJet *j, Double_t d)
TClonesArray * fTracks
!tracks
Int_t fContainerChargedMC
void SetMakeGeneralHistograms(Bool_t g)
void Terminate(Option_t *option)
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
void UserCreateOutputObjects()
Main initialization function on the worker.
void SetChargedFractionIndexMC()
AliEmcalJet * GetSecondLeadingJetOppositeHemisphere(Int_t type, Int_t typea, const AliEmcalJet *jetTrig)
AliEmcalJet * GetLeadingJetOppositeHemisphere(Int_t type, Int_t typea, const AliEmcalJet *jetTrig)
Container for jet within the EMCAL jet framework.
Double_t GetDeltaPhi(const AliEmcalJet *jet1, const AliEmcalJet *jet2)