18 #include "Riostream.h"
64 fJetShapeProperties(0),
82 fPt(TMath::Sqrt(px * px + py* py)),
83 fEta(TMath::ASinH(pz / fPt)),
114 fJetShapeProperties(0),
115 fJetAcceptanceType(0)
118 fPhi = TVector2::Phi_0_2pi(TMath::ATan2(py, px));
169 fJetShapeProperties(0),
170 fJetAcceptanceType(0)
192 fAreaEta(jet.fAreaEta),
193 fAreaPhi(jet.fAreaPhi),
195 fAreaEmc(jet.fAreaEmc),
196 fAxisInEmcal(jet.fAxisInEmcal),
197 fFlavourTagging(jet.fFlavourTagging),
198 fFlavourTracks((jet.fFlavourTracks) ? new
TObjArray(*(jet.fFlavourTracks)) : 0),
199 fMaxCPt(jet.fMaxCPt),
200 fMaxNPt(jet.fMaxNPt),
206 fClusterIDs(jet.fClusterIDs),
207 fTrackIDs(jet.fTrackIDs),
208 fMatched(jet.fMatched),
209 fMatchingType(jet.fMatchingType),
210 fTaggedJet(jet.fTaggedJet),
211 fTagStatus(jet.fTagStatus),
213 fPtSubVect(jet.fPtSubVect),
214 fTriggers(jet.fTriggers),
216 fHasGhost(jet.fHasGhost),
217 fGhosts(jet.fGhosts),
218 fJetShapeProperties(0),
219 fJetAcceptanceType(jet.fJetAcceptanceType)
248 AliVParticle::operator=(jet);
302 if (obj ==
this)
return 0;
307 if (
Pt() > jet->
Pt())
return -1;
308 else if (
Pt() < jet->
Pt())
return 1;
331 if (save)
fPtSub = ptcorr;
347 Double_t ptcorr = TMath::Sqrt(dx * dx + dy * dy);
361 TLorentzVector vecCorr;
363 TLorentzVector vecBg;
368 Double_t dPhi = TMath::Abs(TVector2::Phi_mpi_pi(
Phi() - vecCorr.Phi()));
369 Int_t signum = dPhi <= TMath::PiOver2() ? 1 : -1;
394 dPhi = TVector2::Phi_mpi_pi(dPhi);
395 return TMath::Sqrt(dPhi * dPhi + dEta * dEta);
415 typedef std::pair<Double_t, Int_t>
ptidx_pair;
418 std::vector<ptidx_pair> pair_list;
421 AliVParticle* track =
TrackAt(i_entry, tracks);
423 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()));
426 pair_list.push_back(std::make_pair(track->Pt(), i_entry));
429 std::stable_sort(pair_list.begin() , pair_list.end() ,
sort_descend());
432 std::vector <int> index_sorted_list;
435 for (
auto it : pair_list) index_sorted_list.push_back(it.second);
437 return index_sorted_list;
453 return (trkPx *
Px() + trkPy *
Py() + trkPz *
Pz()) / pJetSq;
456 AliWarning(Form(
"%s: strange, pjet*pjet seems to be zero pJetSq: %f", GetName(), pJetSq));
468 return GetZ(trk->Px(), trk->Py(), trk->Pz());
478 AliVParticle* maxTrack = 0;
480 AliVParticle* track =
TrackAt(i, tracks);
482 AliError(Form(
"Unable to find jet track %d in collection %s (pos in collection %d, max %d)",
483 i, tracks->GetName(),
TrackAt(i), tracks->GetEntriesFast()));
486 if (!maxTrack || track->Pt() > maxTrack->Pt())
500 AliVCluster* maxCluster = 0;
502 AliVCluster* cluster =
ClusterAt(i, clusters);
504 AliError(Form(
"Unable to find jet cluster %d in collection %s (pos in collection %d, max %d)",
505 i, clusters->GetName(),
ClusterAt(i), clusters->GetEntriesFast()));
508 if (!maxCluster || cluster->E() > maxCluster->E())
509 maxCluster = cluster;
566 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",
601 AliVParticle* part =
TrackAt(i, tracks);
603 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());
610 AliVCluster* clus =
ClusterAt(i, clusters);
612 Printf(
"Cluster %d (index = %d) E = %.2f", i,
ClusterAt(i), clus->E());
625 if (
P() < 1e-6)
return 0.;
627 return hftrack != 0 ? hftrack->P() /
P() : 0.;
638 std::ostream &result = myjet.
Print(in);
652 TLorentzVector ghost(dPx, dPy, dPz, dE);
698 if (res.second != ta) {
699 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()));
701 return dynamic_cast<AliVParticle*
>(res.second->At(res.first));
712 if (!tracks || !track)
return 0;
740 if (res.second != ca) {
741 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()));
743 return dynamic_cast<AliVCluster*
>(res.second->At(res.first));
754 if (!clusters || !cluster)
return 0;
765 return TMath::Log(1 /
GetZ(trk));
777 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 *="")
std::pair< int, U * > LocalIndexFromGlobalIndex(const int globalIndex) const
Bool_t fHasGhost
! Whether ghost particle are included within the 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)
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
Int_t TrackAt(Int_t idx) 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.
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
static const AliEmcalContainerIndexMap< TClonesArray, AliVCluster > & GetEmcalContainerIndexMap()
Get the EMCal container utils associated with particle containers.
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)
V * GetObjectFromGlobalIndex(const int globalIndex) 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
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.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Double32_t fAreaEmc
Area on EMCAL surface (determined by ghosts in EMCal acceptance)
AliVCluster * Cluster(Int_t idx) const
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
static const AliEmcalContainerIndexMap< TClonesArray, AliVParticle > & GetEmcalContainerIndexMap()
Get the EMCal container utils associated with particle containers.
void PrintConstituents(TClonesArray *tracks, TClonesArray *clusters) const