18 #include "Riostream.h"
61 fJetShapeProperties(0)
78 fPt(TMath::Sqrt(px * px + py* py)),
79 fEta(TMath::ASinH(pz / fPt)),
110 fJetShapeProperties(0)
113 fPhi = TVector2::Phi_0_2pi(TMath::ATan2(py, px));
164 fJetShapeProperties(0)
186 fAreaEta(jet.fAreaEta),
187 fAreaPhi(jet.fAreaPhi),
189 fAreaEmc(jet.fAreaEmc),
190 fAxisInEmcal(jet.fAxisInEmcal),
191 fFlavourTagging(jet.fFlavourTagging),
192 fFlavourTracks((jet.fFlavourTracks) ? new TObjArray(*(jet.fFlavourTracks)) : 0),
193 fMaxCPt(jet.fMaxCPt),
194 fMaxNPt(jet.fMaxNPt),
200 fClusterIDs(jet.fClusterIDs),
201 fTrackIDs(jet.fTrackIDs),
202 fMatched(jet.fMatched),
203 fMatchingType(jet.fMatchingType),
204 fTaggedJet(jet.fTaggedJet),
205 fTagStatus(jet.fTagStatus),
207 fPtSubVect(jet.fPtSubVect),
208 fTriggers(jet.fTriggers),
210 fHasGhost(jet.fHasGhost),
211 fGhosts(jet.fGhosts),
212 fJetShapeProperties(0)
241 AliVParticle::operator=(jet);
294 if (obj ==
this)
return 0;
299 if (
Pt() > jet->
Pt())
return -1;
300 else if (
Pt() < jet->
Pt())
return 1;
322 Double_t ptcorr =
fPt - rho *
fArea;
323 if (save)
fPtSub = ptcorr;
339 Double_t ptcorr = TMath::Sqrt(dx * dx + dy * dy);
353 TLorentzVector vecCorr;
355 TLorentzVector vecBg;
360 Double_t dPhi = TMath::Abs(TVector2::Phi_mpi_pi(
Phi() - vecCorr.Phi()));
361 Int_t signum = dPhi <= TMath::PiOver2() ? 1 : -1;
384 Double_t dPhi =
Phi() - part->Phi();
385 Double_t dEta =
Eta() - part->Eta();
386 dPhi = TVector2::Phi_mpi_pi(dPhi);
387 return TMath::Sqrt(dPhi * dPhi + dEta * dEta);
397 typedef std::pair<Double_t, Int_t> ptidx_pair;
400 std::vector<ptidx_pair> pair_list;
403 AliVParticle* track =
TrackAt(i_entry, tracks);
405 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()));
408 pair_list.push_back(std::make_pair(track->Pt(), i_entry));
411 std::stable_sort(pair_list.begin() , pair_list.end() ,
sort_descend());
414 std::vector <int> index_sorted_list;
417 for (
auto it : pair_list) index_sorted_list.push_back(it.second);
419 return index_sorted_list;
429 Double_t
AliEmcalJet::GetZ(
const Double_t trkPx,
const Double_t trkPy,
const Double_t trkPz)
const
431 Double_t pJetSq =
P();
435 return (trkPx *
Px() + trkPy *
Py() + trkPz *
Pz()) / pJetSq;
438 AliWarning(Form(
"%s: strange, pjet*pjet seems to be zero pJetSq: %f", GetName(), pJetSq));
450 return GetZ(trk->Px(), trk->Py(), trk->Pz());
460 AliVParticle* maxTrack = 0;
462 AliVParticle* track =
TrackAt(i, tracks);
464 AliError(Form(
"Unable to find jet track %d in collection %s (pos in collection %d, max %d)",
465 i, tracks->GetName(),
TrackAt(i), tracks->GetEntriesFast()));
468 if (!maxTrack || track->Pt() > maxTrack->Pt())
482 AliVCluster* maxCluster = 0;
484 AliVCluster* cluster =
ClusterAt(i, clusters);
486 AliError(Form(
"Unable to find jet cluster %d in collection %s (pos in collection %d, max %d)",
487 i, clusters->GetName(),
ClusterAt(i), clusters->GetEntriesFast()));
490 if (!maxCluster || cluster->E() > maxCluster->E())
491 maxCluster = cluster;
516 for (Int_t i = 0; i <
fTrackIDs.GetSize(); i++) {
529 for (Int_t i = 0; i <
fClusterIDs.GetSize(); i++) {
548 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",
583 AliVParticle* part =
TrackAt(i, tracks);
585 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());
592 AliVCluster* clus =
ClusterAt(i, clusters);
594 Printf(
"Cluster %d (index = %d) E = %.2f", i,
ClusterAt(i), clus->E());
607 if (
P() < 1e-6)
return 0.;
609 return hftrack != 0 ? hftrack->P() /
P() : 0.;
620 std::ostream &result = myjet.
Print(in);
634 TLorentzVector ghost(dPx, dPy, dPz, dE);
666 return dynamic_cast<AliVParticle*
>(ta->At(
TrackAt(idx)));
677 if (!tracks || !track)
return 0;
690 return dynamic_cast<AliVCluster*
>(ca->At(
ClusterAt(idx)));
701 if (!clusters || !cluster)
return 0;
712 return TMath::Log(1 /
GetZ(trk));
722 Double_t
AliEmcalJet::GetXi(
const Double_t trkPx,
const Double_t trkPy,
const Double_t trkPz )
const
724 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)
Int_t fTagStatus
! Status of tagging -1: NA 0: not tagged 1: tagged
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.
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 *="")
Bool_t fHasGhost
! Whether ghost particle are included within the constituents
AliEmcalJetShapeProperties * fJetShapeProperties
! Pointer to the jet shape properties
Double_t MaxChargedPt() const
AliEmcalJet & operator=(const AliEmcalJet &jet)
Double_t GetFlavourTrackZ(Int_t i=0) const
AliVParticle * GetFlavourTrack(Int_t i=0) const
AliVParticle * RemoveFlavourTrack(Int_t i=0)
Int_t ContainsCluster(AliVCluster *cluster, TClonesArray *clusters) const
UShort_t GetNumberOfTracks() const
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.
Short_t ClusterAt(Int_t idx) const
UShort_t GetNumberOfClusters() const
AliVParticle * GetLeadingTrack(TClonesArray *tracks) const
Double32_t fAreaPhi
Jet phi area.
void AddFlavourTrack(AliVParticle *hftrack)
UShort_t fMatched
! 0 or 1 if it is matched with one of the closest jets; 2 if it is not matched
std::vector< int > SortConstituentsPt(TClonesArray *tracks) const
std::vector< TLorentzVector > fGhosts
! Vector containing the ghost particles
Double_t PtSubVect() const
Double32_t fArea
Jet transverse area.
AliVCluster * GetLeadingCluster(TClonesArray *clusters) const
AliEmcalJet * fTaggedJet
! Jet tagged to this jet
Int_t ContainsTrack(AliVParticle *track, TClonesArray *tracks) const
TLorentzVector SubtractRhoVect(Double_t rho, Bool_t save=kFALSE)
std::ostream & operator<<(std::ostream &in, const AliEmcalJet &myjet)
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
Int_t fFlavourTagging
Tag jet with a flavor (use bits defined in enum EFlavourTag)
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)
Double32_t fPtEmc
Pt in EMCAL acceptance.
This class contains the derivative subtraction operators for jet shapes.
Double32_t fPt
Jet transverse momentum.
Double32_t fEta
Jet pseudo-rapidity.
Double32_t fMaxCPt
Pt of maximum charged constituent.
Short_t TrackAt(Int_t idx) const
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Double32_t fAreaEmc
Area on EMCAL surface (determined by ghosts in EMCal acceptance)
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)
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 ...
Double32_t fNEF
Jet Neutral Energy Fraction.
Double32_t fClosestJetsDist[2]
! Distance from the two closest jets
Int_t Compare(const TObject *obj) const
TObjArray * fFlavourTracks
void PrintConstituents(TClonesArray *tracks, TClonesArray *clusters) const