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),
165 fJetAcceptanceType(0)
187 fAreaEta(jet.fAreaEta),
188 fAreaPhi(jet.fAreaPhi),
190 fAreaEmc(jet.fAreaEmc),
191 fAxisInEmcal(jet.fAxisInEmcal),
192 fFlavourTagging(jet.fFlavourTagging),
193 fFlavourTracks((jet.fFlavourTracks) ? new
TObjArray(*(jet.fFlavourTracks)) : 0),
194 fMaxCPt(jet.fMaxCPt),
195 fMaxNPt(jet.fMaxNPt),
201 fClusterIDs(jet.fClusterIDs),
202 fTrackIDs(jet.fTrackIDs),
203 fMatched(jet.fMatched),
204 fMatchingType(jet.fMatchingType),
205 fTaggedJet(jet.fTaggedJet),
206 fTagStatus(jet.fTagStatus),
208 fPtSubVect(jet.fPtSubVect),
209 fTriggers(jet.fTriggers),
211 fHasGhost(jet.fHasGhost),
212 fGhosts(jet.fGhosts),
213 fJetShapeProperties(0),
214 fJetAcceptanceType(0)
243 AliVParticle::operator=(jet);
297 if (obj ==
this)
return 0;
302 if (
Pt() > jet->
Pt())
return -1;
303 else if (
Pt() < jet->
Pt())
return 1;
326 if (save)
fPtSub = ptcorr;
342 Double_t ptcorr = TMath::Sqrt(dx * dx + dy * dy);
356 TLorentzVector vecCorr;
358 TLorentzVector vecBg;
363 Double_t dPhi = TMath::Abs(TVector2::Phi_mpi_pi(
Phi() - vecCorr.Phi()));
364 Int_t signum = dPhi <= TMath::PiOver2() ? 1 : -1;
389 dPhi = TVector2::Phi_mpi_pi(dPhi);
390 return TMath::Sqrt(dPhi * dPhi + dEta * dEta);
410 typedef std::pair<Double_t, Int_t>
ptidx_pair;
413 std::vector<ptidx_pair> pair_list;
416 AliVParticle* track =
TrackAt(i_entry, tracks);
418 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()));
421 pair_list.push_back(std::make_pair(track->Pt(), i_entry));
424 std::stable_sort(pair_list.begin() , pair_list.end() ,
sort_descend());
427 std::vector <int> index_sorted_list;
430 for (
auto it : pair_list) index_sorted_list.push_back(it.second);
432 return index_sorted_list;
448 return (trkPx *
Px() + trkPy *
Py() + trkPz *
Pz()) / pJetSq;
451 AliWarning(Form(
"%s: strange, pjet*pjet seems to be zero pJetSq: %f", GetName(), pJetSq));
463 return GetZ(trk->Px(), trk->Py(), trk->Pz());
473 AliVParticle* maxTrack = 0;
475 AliVParticle* track =
TrackAt(i, tracks);
477 AliError(Form(
"Unable to find jet track %d in collection %s (pos in collection %d, max %d)",
478 i, tracks->GetName(),
TrackAt(i), tracks->GetEntriesFast()));
481 if (!maxTrack || track->Pt() > maxTrack->Pt())
495 AliVCluster* maxCluster = 0;
497 AliVCluster* cluster =
ClusterAt(i, clusters);
499 AliError(Form(
"Unable to find jet cluster %d in collection %s (pos in collection %d, max %d)",
500 i, clusters->GetName(),
ClusterAt(i), clusters->GetEntriesFast()));
503 if (!maxCluster || cluster->E() > maxCluster->E())
504 maxCluster = cluster;
561 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",
596 AliVParticle* part =
TrackAt(i, tracks);
598 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());
605 AliVCluster* clus =
ClusterAt(i, clusters);
607 Printf(
"Cluster %d (index = %d) E = %.2f", i,
ClusterAt(i), clus->E());
620 if (
P() < 1e-6)
return 0.;
622 return hftrack != 0 ? hftrack->P() /
P() : 0.;
633 std::ostream &result = myjet.
Print(in);
647 TLorentzVector ghost(dPx, dPy, dPz, dE);
679 return dynamic_cast<AliVParticle*
>(ta->At(
TrackAt(idx)));
690 if (!tracks || !track)
return 0;
703 return dynamic_cast<AliVCluster*
>(ca->At(
ClusterAt(idx)));
714 if (!clusters || !cluster)
return 0;
725 return TMath::Log(1 /
GetZ(trk));
737 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)
std::pair< Double_t, Int_t > ptidx_pair
(pt,index) pair
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< 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)
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.
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
std::vector< int > GetPtSortedTrackConstituentIndexes(TClonesArray *tracks) const
TObjArray * fFlavourTracks
void PrintConstituents(TClonesArray *tracks, TClonesArray *clusters) const