18 #include "Riostream.h" 64 fJetShapeProperties(0),
65 fJetAcceptanceType(0),
66 fParticleConstituents(),
67 fClusterConstituents()
84 fPt(TMath::Sqrt(px * px + py* py)),
122 fPhi = TVector2::Phi_0_2pi(TMath::ATan2(py, px));
257 AliVParticle::operator=(jet);
313 if (obj ==
this)
return 0;
318 if (
Pt() > jet->
Pt())
return -1;
319 else if (
Pt() < jet->
Pt())
return 1;
342 if (save)
fPtSub = ptcorr;
358 Double_t ptcorr = TMath::Sqrt(dx * dx + dy * dy);
372 TLorentzVector vecCorr;
374 TLorentzVector vecBg;
379 Double_t dPhi = TMath::Abs(TVector2::Phi_mpi_pi(
Phi() - vecCorr.Phi()));
380 Int_t signum = dPhi <= TMath::PiOver2() ? 1 : -1;
405 dPhi = TVector2::Phi_mpi_pi(dPhi);
406 return TMath::Sqrt(dPhi * dPhi + dEta * dEta);
426 typedef std::pair<Double_t, Int_t>
ptidx_pair;
429 std::vector<ptidx_pair> pair_list;
432 AliVParticle* track =
Track(i_entry);
434 AliError(Form(
"Unable to find jet track %d in collection %s (pos in collection %d, max %d)", i_entry, tracks->GetName(),
TrackAt(i_entry), tracks->GetEntriesFast()));
437 pair_list.push_back(std::make_pair(track->Pt(), i_entry));
440 std::stable_sort(pair_list.begin() , pair_list.end() ,
sort_descend());
443 std::vector <int> index_sorted_list;
446 for (
auto it : pair_list) index_sorted_list.push_back(it.second);
448 return index_sorted_list;
464 return (trkPx *
Px() + trkPy *
Py() + trkPz *
Pz()) / pJetSq;
467 AliWarning(Form(
"%s: strange, pjet*pjet seems to be zero pJetSq: %f", GetName(), pJetSq));
479 return GetZ(trk->Px(), trk->Py(), trk->Pz());
489 AliVParticle* maxTrack = 0;
491 AliVParticle* track =
Track(i);
493 AliError(Form(
"Unable to find jet track %d (global index %d) in the jet", i,
TrackAt(i)));
496 if (!maxTrack || track->Pt() > maxTrack->Pt())
510 AliVCluster* maxCluster = 0;
512 AliVCluster* cluster =
Cluster(i);
514 AliError(Form(
"Unable to find jet cluster %d (global index %d) in the jet", i,
ClusterAt(i)));
517 if (!maxCluster || cluster->E() > maxCluster->E())
518 maxCluster = cluster;
575 return TString::Format(
"Jet pT = %.2f, eta = %.2f, phi = %.2f, max charged pT = %.2f, max neutral pT = %.2f, N tracks = %d, N clusters = %d, Area = %.2f, NEF = %.2f",
609 AliVParticle* part =
Track(i);
611 Printf(
"Track %d (index = %d) pT = %.2f, eta = %.2f, phi = %.2f, PDG code = %d", i,
TrackAt(i), part->Pt(), part->Eta(), part->Phi(), part->PdgCode());
616 AliVCluster* clus =
Cluster(i);
618 Printf(
"Cluster %d (index = %d) E = %.2f", i,
ClusterAt(i), clus->E());
630 if (
P() < 1e-6)
return 0.;
632 return hftrack != 0 ? hftrack->P() /
P() : 0.;
643 std::ostream &result = myjet.
Print(in);
657 TLorentzVector ghost(dPx, dPy, dPz, dE);
706 if (res.second != ta) {
707 AliWarning(Form(
"TClonesArray %s that was passed does not correspond to the passed index! The index belongs to a different TClonesArray named %s! Returning the object corresponding to the index (not the passed TClonesArray)! Consider fixing by updating to jet->Track(index).", ta->GetName(), res.second->GetName()));
709 return dynamic_cast<AliVParticle*
>(res.second->At(res.first));
720 if (!tracks || !track)
return 0;
749 if (res.second != ca) {
750 AliWarning(Form(
"TClonesArray %s that was passed does not correspond to the passed index! The index belongs to a different TClonesArray named %s! Returning the object corresponding to the index (not the passed TClonesArray)! Consider fixing by updating to jet->Cluster(index).", ca->GetName(), res.second->GetName()));
752 return dynamic_cast<AliVCluster*
>(res.second->At(res.first));
763 if (!clusters || !cluster)
return 0;
779 if(!leading) leading = &
c;
781 if(
c.E() > leading->
E()) leading = &
c;
791 if(!leading) leading = &p;
793 if(p.Pt() > leading->
Pt()) leading = &p;
831 return TMath::Log(1 /
GetZ(trk));
843 return TMath::Log(1 /
GetZ(trkPx, trkPy, trkPz));
TArrayI fTrackIDs
Array containing ids of track constituents.
Double_t fPtSubVect
! Background vector subtracted pt (not stored set from outside)
const PWG::JETFW::AliEmcalParticleJetConstituent * ParticleConstituentAt(unsigned int ipart) const
Access to the -particle constituent.
std::pair< Double_t, Int_t > ptidx_pair
(pt,index) pair
Int_t fTagStatus
! Status of tagging -1: NA 0: not tagged 1: tagged
AliVParticle * GetLeadingTrack(TClonesArray *tracks=0) const
Double_t GetXi(const AliVParticle *trk) const
Simple C structure to allow sorting in descending order.
Double32_t fAreaE
Jet temporal area component.
TArrayI fClusterIDs
Array containing ids of cluster constituents.
virtual double E() const
Access to constituent energy.
Int_t fLabel
! Label to inclusive jet for constituent subtracted jet
Double_t fPtSub
! Background subtracted pt (not stored set from outside)
void Clear(Option_t *="")
std::pair< int, U * > LocalIndexFromGlobalIndex(const int globalIndex) const
Bool_t fHasGhost
! Whether ghost particle are included within the constituents
std::vector< PWG::JETFW::AliEmcalParticleJetConstituent > fParticleConstituents
List of particle constituents.
Int_t ClusterAt(Int_t idx) const
AliEmcalJetShapeProperties * fJetShapeProperties
! Pointer to the jet shape properties
AliVParticle * Track(Int_t idx) const
Double_t MaxChargedPt() const
AliEmcalJet & operator=(const AliEmcalJet &jet)
const PWG::JETFW::AliEmcalClusterJetConstituent * ClusterConstituentAt(unsigned int icl) const
Access to the -cluster constituent.
Double_t GetFlavourTrackZ(Int_t i=0) const
std::vector< PWG::JETFW::AliEmcalClusterJetConstituent > fClusterConstituents
List of cluster constituents.
const PWG::JETFW::AliEmcalParticleJetConstituent * GetLeadingParticleConstituent() const
Get the leading particle constituent.
AliVParticle * GetFlavourTrack(Int_t i=0) const
AliVParticle * RemoveFlavourTrack(Int_t i=0)
Int_t ContainsCluster(AliVCluster *cluster, TClonesArray *clusters) const
Int_t TrackAt(Int_t idx) const
UShort_t GetNumberOfTracks() const
void AddParticleConstituent(const AliVParticle *const part, Bool_t isFromEmbeddedEvent, UInt_t globalIndex)
Add new particle (track / mc particle) constituent to the given jet Note: this will append the consti...
std::ostream & Print(std::ostream &in) const
void GetMomentum(TLorentzVector &vec) const
Double32_t fMCPt
Pt from MC particles contributing to the jet.
Double32_t fMaxNPt
Pt of maximum neutral constituent.
UShort_t GetNumberOfClusters() const
friend std::ostream & operator<<(std::ostream &in, const AliEmcalJet &myjet)
Double32_t fAreaPhi
Jet phi area.
void AddFlavourTrack(AliVParticle *hftrack)
void AddClusterConstituent(const AliVCluster *const clust, AliVCluster::VCluUserDefEnergy_t endef, Double_t *pvec, Bool_t isFromEmbeddedEvent, UInt_t globalIndex)
Add new cluster constituent to the given jet Note: this will append the constituent. No sorting according to particle is done.
UShort_t fMatched
! 0 or 1 if it is matched with one of the closest jets; 2 if it is not matched
std::vector< TLorentzVector > fGhosts
! Vector containing the ghost particles
Double_t PtSubVect() const
static const AliEmcalContainerIndexMap< TClonesArray, AliVCluster > & GetEmcalContainerIndexMap()
Get the EMCal container utils associated with particle containers.
Double32_t fArea
Jet transverse area.
void SetGlobalIndex(ULong_t index)
Set the index in the globl.
AliEmcalJet * fTaggedJet
! Jet tagged to this jet
Int_t ContainsTrack(AliVParticle *track, TClonesArray *tracks) const
TLorentzVector SubtractRhoVect(Double_t rho, Bool_t save=kFALSE)
V * GetObjectFromGlobalIndex(const int globalIndex) const
bool HasParticleConstituent(const AliVParticle *const part) const
Checks whether a given particle is a jet constituent.
AliVCluster * GetLeadingCluster(TClonesArray *clusters=0) const
Double32_t fAreaEta
Jet eta area.
Double_t MaxNeutralPt() const
void AddGhost(const Double_t dPx, const Double_t dPy, const Double_t dPz, const Double_t dE)
Double_t GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz) const
void PrintConstituents(TClonesArray *tracks=0, TClonesArray *clusters=0) const
Int_t fFlavourTagging
Tag jet with a flavor (use bits defined in enum EFlavourTag)
Implementation of a jet constituent for constituent clusters.
Double_t DeltaR(const AliVParticle *part) const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
UInt_t fJetAcceptanceType
! Jet acceptance type (stored bitwise)
Double32_t fPtEmc
Pt in EMCAL acceptance.
This class contains the derivative subtraction operators for jet shapes.
const PWG::JETFW::AliEmcalClusterJetConstituent * GetLeadingClusterConstituent() const
Get the leading cluster constituent.
Double32_t fPt
Jet transverse momentum.
virtual double Pt() const
Access to transverse momentum.
Double32_t fEta
Jet pseudo-rapidity.
Double32_t fMaxCPt
Pt of maximum charged constituent.
Double32_t fAreaEmc
Area on EMCAL surface (determined by ghosts in EMCal acceptance)
AliVCluster * Cluster(Int_t idx) const
void SetIsFromEmbeddedEvent(Bool_t isEmbedded)
Specify whether constituent is from embedded event.
Represent a jet reconstructed using the EMCal jet framework.
Int_t fNn
Number of neutral constituents.
UInt_t fTriggers
! Triggers that the jet might have fired (AliVEvent::EOfflineTriggerTypes)
void test(int runnumber=195345)
Bool_t fAxisInEmcal
Whether the jet axis is inside the EMCAL acceptance.
Int_t fNEmc
Number of constituents in EMCAL acceptance.
Double32_t fPhi
Jet axis azimuthal angle.
AliEmcalJet * fClosestJets[2]
! If this is MC it contains the two closest detector level jets in order of distance and viceversa ...
bool HasClusterConstituent(const AliVCluster *const clust) const
Checks whether a given cluster is a constituent of the jet.
Double32_t fNEF
Jet Neutral Energy Fraction.
Double32_t fClosestJetsDist[2]
! Distance from the two closest jets
UShort_t fMatchingType
! Matching type
Int_t Compare(const TObject *obj) const
std::vector< int > GetPtSortedTrackConstituentIndexes(TClonesArray *tracks) const
TObjArray * fFlavourTracks
static const AliEmcalContainerIndexMap< TClonesArray, AliVParticle > & GetEmcalContainerIndexMap()
Get the EMCal container utils associated with particle containers.