AliPhysics  8bb951a (8bb951a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalJet.cxx
Go to the documentation of this file.
1 //
2 // Emcal jet class.
3 //
4 // Author: C.Loizides
5 
6 #include "AliEmcalJet.h"
7 
8 #include "AliLog.h"
9 #include "Riostream.h"
10 
12 
13 //__________________________________________________________________________________________________
15  AliVParticle(),
16  fPt(0),
17  fEta(0),
18  fPhi(0),
19  fM(0),
20  fNEF(0),
21  fArea(0),
22  fAreaEta(0),
23  fAreaPhi(0),
24  fAreaE(0),
25  fAreaEmc(-1),
26  fAxisInEmcal(0),
27  fFlavourTagging(0),
28  fFlavourTracks(0),
29  fMaxCPt(0),
30  fMaxNPt(0),
31  fMCPt(0),
32  fNn(0),
33  fNch(0),
34  fPtEmc(0),
35  fNEmc(0),
36  fClusterIDs(),
37  fTrackIDs(),
38  fMatched(2),
39  fMatchingType(0),
40  fTaggedJet(0x0),
41  fTagStatus(-1),
42  fPtSub(0),
43  fPtSubVect(0),
44  fTriggers(0),
45  fJetShapeMassFirstDer(0),
46  fJetShapeMassSecondDer(0),
47  fJetShapeMassFirstSub(0),
48  fJetShapeMassSecondSub(0),
49  fLabel(-1),
50  fGRNumerator(0),
51  fGRDenominator(0),
52  fGRNumeratorSub(0),
53  fGRDenominatorSub(0),
54  fJetShapeAngularityFirstDer(0),
55  fJetShapeAngularitySecondDer(0),
56  fJetShapeAngularityFirstSub(0),
57  fJetShapeAngularitySecondSub(0),
58  fJetShapepTDFirstDer(0),
59  fJetShapepTDSecondDer(0),
60  fJetShapepTDFirstSub(0),
61  fJetShapepTDSecondSub(0),
62  fJetShapeCircularityFirstDer(0),
63  fJetShapeCircularitySecondDer(0),
64  fJetShapeCircularityFirstSub(0),
65  fJetShapeCircularitySecondSub(0),
66  fJetShapeSigma2FirstDer(0),
67  fJetShapeSigma2SecondDer(0),
68  fJetShapeSigma2FirstSub(0),
69  fJetShapeSigma2SecondSub(0),
70  fJetShapeConstituentFirstDer(0),
71  fJetShapeConstituentSecondDer(0),
72  fJetShapeConstituentFirstSub(0),
73  fJetShapeConstituentSecondSub(0),
74  fJetShapeLeSubFirstDer(0),
75  fJetShapeLeSubSecondDer(0),
76  fJetShapeLeSubFirstSub(0),
77  fJetShapeLeSubSecondSub(0),
78  fHasGhost(kFALSE),
79  fGhosts()
80 {
81  // Constructor.
82  fClosestJets[0] = 0;
83  fClosestJets[1] = 0;
84  fClosestJetsDist[0] = 999;
85  fClosestJetsDist[1] = 999;
86 }
87 
88 //__________________________________________________________________________________________________
89 AliEmcalJet::AliEmcalJet(Double_t px, Double_t py, Double_t pz) :
90  AliVParticle(),
91  fPt(TMath::Sqrt(px * px + py* py)),
92  fEta(TMath::ASinH(pz / fPt)),
93  fPhi(0),
94  fM(0),
95  fNEF(0),
96  fArea(0),
97  fAreaEta(0),
98  fAreaPhi(0),
99  fAreaE(0),
100  fAreaEmc(-1),
101  fAxisInEmcal(0),
102  fFlavourTagging(0),
103  fFlavourTracks(0),
104  fMaxCPt(0),
105  fMaxNPt(0),
106  fMCPt(0),
107  fNn(0),
108  fNch(0),
109  fPtEmc(0),
110  fNEmc(0),
111  fClusterIDs(),
112  fTrackIDs(),
113  fMatched(2),
114  fMatchingType(0),
115  fTaggedJet(0x0),
116  fTagStatus(-1),
117  fPtSub(0),
118  fPtSubVect(0),
119  fTriggers(0),
120  fJetShapeMassFirstDer(0),
121  fJetShapeMassSecondDer(0),
122  fJetShapeMassFirstSub(0),
123  fJetShapeMassSecondSub(0),
124  fLabel(-1),
125  fGRNumerator(0),
126  fGRDenominator(0),
127  fGRNumeratorSub(0),
128  fGRDenominatorSub(0),
129  fJetShapeAngularityFirstDer(0),
130  fJetShapeAngularitySecondDer(0),
131  fJetShapeAngularityFirstSub(0),
132  fJetShapeAngularitySecondSub(0),
133  fJetShapepTDFirstDer(0),
134  fJetShapepTDSecondDer(0),
135  fJetShapepTDFirstSub(0),
136  fJetShapepTDSecondSub(0),
137  fJetShapeCircularityFirstDer(0),
138  fJetShapeCircularitySecondDer(0),
139  fJetShapeCircularityFirstSub(0),
140  fJetShapeCircularitySecondSub(0),
141  fJetShapeSigma2FirstDer(0),
142  fJetShapeSigma2SecondDer(0),
143  fJetShapeSigma2FirstSub(0),
144  fJetShapeSigma2SecondSub(0),
145  fJetShapeConstituentFirstDer(0),
146  fJetShapeConstituentSecondDer(0),
147  fJetShapeConstituentFirstSub(0),
148  fJetShapeConstituentSecondSub(0),
149  fJetShapeLeSubFirstDer(0),
150  fJetShapeLeSubSecondDer(0),
151  fJetShapeLeSubFirstSub(0),
152  fJetShapeLeSubSecondSub(0),
153  fHasGhost(kFALSE),
154  fGhosts()
155 {
156  // Constructor.
157 
158  if(fPt != 0) {
159  fPhi = TVector2::Phi_0_2pi(TMath::ATan2(py, px));
160  }
161 
162  fClosestJets[0] = 0;
163  fClosestJets[1] = 0;
164  fClosestJetsDist[0] = 999;
165  fClosestJetsDist[1] = 999;
166 }
167 
168 //_________________________________________________________________________________________________
169 AliEmcalJet::AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m) :
170  AliVParticle(),
171  fPt(pt),
172  fEta(eta),
173  fPhi(phi),
174  fM(m),
175  fNEF(0),
176  fArea(0),
177  fAreaEta(0),
178  fAreaPhi(0),
179  fAreaE(0),
180  fAreaEmc(-1),
181  fAxisInEmcal(0),
182  fFlavourTagging(0),
183  fFlavourTracks(0),
184  fMaxCPt(0),
185  fMaxNPt(0),
186  fMCPt(0),
187  fNn(0),
188  fNch(0),
189  fPtEmc(0),
190  fNEmc(0),
191  fClusterIDs(),
192  fTrackIDs(),
193  fMatched(2),
194  fMatchingType(0),
195  fTaggedJet(0x0),
196  fTagStatus(-1),
197  fPtSub(0),
198  fPtSubVect(0),
199  fTriggers(0),
200  fJetShapeMassFirstDer(0),
201  fJetShapeMassSecondDer(0),
202  fJetShapeMassFirstSub(0),
203  fJetShapeMassSecondSub(0),
204  fLabel(-1),
205  fGRNumerator(0),
206  fGRDenominator(0),
207  fGRNumeratorSub(0),
208  fGRDenominatorSub(0),
209  fJetShapeAngularityFirstDer(0),
210  fJetShapeAngularitySecondDer(0),
211  fJetShapeAngularityFirstSub(0),
212  fJetShapeAngularitySecondSub(0),
213  fJetShapepTDFirstDer(0),
214  fJetShapepTDSecondDer(0),
215  fJetShapepTDFirstSub(0),
216  fJetShapepTDSecondSub(0),
217  fJetShapeCircularityFirstDer(0),
218  fJetShapeCircularitySecondDer(0),
219  fJetShapeCircularityFirstSub(0),
220  fJetShapeCircularitySecondSub(0),
221  fJetShapeSigma2FirstDer(0),
222  fJetShapeSigma2SecondDer(0),
223  fJetShapeSigma2FirstSub(0),
224  fJetShapeSigma2SecondSub(0),
225  fJetShapeConstituentFirstDer(0),
226  fJetShapeConstituentSecondDer(0),
227  fJetShapeConstituentFirstSub(0),
228  fJetShapeConstituentSecondSub(0),
229  fJetShapeLeSubFirstDer(0),
230  fJetShapeLeSubSecondDer(0),
231  fJetShapeLeSubFirstSub(0),
232  fJetShapeLeSubSecondSub(0),
233  fHasGhost(kFALSE),
234  fGhosts()
235 
236 {
237  // Constructor.
238 
239  fPhi = TVector2::Phi_0_2pi(fPhi);
240 
241  fClosestJets[0] = 0;
242  fClosestJets[1] = 0;
243  fClosestJetsDist[0] = 999;
244  fClosestJetsDist[1] = 999;
245 }
246 
247 //_________________________________________________________________________________________________
249  AliVParticle(jet),
250  fPt(jet.fPt),
251  fEta(jet.fEta),
252  fPhi(jet.fPhi),
253  fM(jet.fM),
254  fNEF(jet.fNEF),
255  fArea(jet.fArea),
256  fAreaEta(jet.fAreaEta),
257  fAreaPhi(jet.fAreaPhi),
258  fAreaE(jet.fAreaE),
259  fAreaEmc(jet.fAreaEmc),
260  fAxisInEmcal(jet.fAxisInEmcal),
261  fFlavourTagging(jet.fFlavourTagging),
262  fFlavourTracks((jet.fFlavourTracks) ? new TObjArray(*(jet.fFlavourTracks)) : 0),
263  fMaxCPt(jet.fMaxCPt),
264  fMaxNPt(jet.fMaxNPt),
265  fMCPt(jet.fMCPt),
266  fNn(jet.fNn),
267  fNch(jet.fNch),
268  fPtEmc(jet.fPtEmc),
269  fNEmc(jet.fNEmc),
270  fClusterIDs(jet.fClusterIDs),
271  fTrackIDs(jet.fTrackIDs),
272  fMatched(jet.fMatched),
273  fMatchingType(jet.fMatchingType),
274  fTaggedJet(jet.fTaggedJet),
275  fTagStatus(jet.fTagStatus),
276  fPtSub(jet.fPtSub),
277  fPtSubVect(jet.fPtSubVect),
278  fTriggers(jet.fTriggers),
279  fJetShapeMassFirstDer(jet.fJetShapeMassFirstDer),
280  fJetShapeMassSecondDer(jet.fJetShapeMassSecondDer),
281  fJetShapeMassFirstSub(jet.fJetShapeMassFirstSub),
282  fJetShapeMassSecondSub(jet.fJetShapeMassSecondSub),
283  fLabel(jet.fLabel),
284  fGRNumerator(jet.fGRNumerator),
285  fGRDenominator(jet.fGRDenominator),
286  fGRNumeratorSub(jet.fGRNumeratorSub),
287  fGRDenominatorSub(jet.fGRDenominatorSub),
288  fJetShapeAngularityFirstDer(jet.fJetShapeAngularityFirstDer),
289  fJetShapeAngularitySecondDer(jet.fJetShapeAngularitySecondDer),
290  fJetShapeAngularityFirstSub(jet.fJetShapeAngularityFirstSub),
291  fJetShapeAngularitySecondSub(jet.fJetShapeAngularitySecondSub),
292  fJetShapepTDFirstDer(jet.fJetShapepTDFirstDer),
293  fJetShapepTDSecondDer(jet.fJetShapepTDSecondDer),
294  fJetShapepTDFirstSub(jet.fJetShapepTDFirstSub),
295  fJetShapepTDSecondSub(jet.fJetShapepTDSecondSub),
296  fJetShapeCircularityFirstDer(jet.fJetShapeCircularityFirstDer),
297  fJetShapeCircularitySecondDer(jet.fJetShapeCircularitySecondDer),
298  fJetShapeCircularityFirstSub(jet.fJetShapeCircularityFirstSub),
299  fJetShapeCircularitySecondSub(jet.fJetShapeCircularitySecondSub),
300  fJetShapeSigma2FirstDer(jet.fJetShapeSigma2FirstDer),
301  fJetShapeSigma2SecondDer(jet.fJetShapeSigma2SecondDer),
302  fJetShapeSigma2FirstSub(jet.fJetShapeSigma2FirstSub),
303  fJetShapeSigma2SecondSub(jet.fJetShapeSigma2SecondSub),
304  fJetShapeConstituentFirstDer(jet.fJetShapeConstituentFirstDer),
305  fJetShapeConstituentSecondDer(jet.fJetShapeConstituentSecondDer),
306  fJetShapeConstituentFirstSub(jet.fJetShapeConstituentFirstSub),
307  fJetShapeConstituentSecondSub(jet.fJetShapeConstituentSecondSub),
308  fJetShapeLeSubFirstDer(jet.fJetShapeLeSubFirstDer),
309  fJetShapeLeSubSecondDer(jet.fJetShapeLeSubSecondDer),
310  fJetShapeLeSubFirstSub(jet.fJetShapeLeSubFirstSub),
311  fJetShapeLeSubSecondSub(jet.fJetShapeLeSubSecondSub),
312  fHasGhost(jet.fHasGhost),
313  fGhosts(jet.fGhosts)
314 {
315  // Copy constructor.
316  fClosestJets[0] = jet.fClosestJets[0];
317  fClosestJets[1] = jet.fClosestJets[1];
320 }
321 
322 //_________________________________________________________________________________________________
324 {
325  // Assignment operator.
326 
327  if(this != &jet) {
328  AliVParticle::operator=(jet);
329  fPt = jet.fPt;
330  fEta = jet.fEta;
331  fPhi = jet.fPhi;
332  fM = jet.fM;
333  fNEF = jet.fNEF;
334  fArea = jet.fArea;
335  fAreaEta = jet.fAreaEta;
336  fAreaPhi = jet.fAreaPhi;
337  fAreaE = jet.fAreaE;
338  fAreaEmc = jet.fAreaEmc;
341  fFlavourTracks = (jet.fFlavourTracks) ? new TObjArray(*(jet.fFlavourTracks)) : 0;
342  fMaxCPt = jet.fMaxCPt;
343  fMaxNPt = jet.fMaxNPt;
344  fMCPt = jet.fMCPt;
345  fNn = jet.fNn;
346  fNch = jet.fNch;
347  fPtEmc = jet.fPtEmc;
348  fNEmc = jet.fNEmc;
349  fClusterIDs = jet.fClusterIDs;
350  fTrackIDs = jet.fTrackIDs;
351  fClosestJets[0] = jet.fClosestJets[0];
352  fClosestJets[1] = jet.fClosestJets[1];
355  fMatched = jet.fMatched;
356  fTaggedJet = jet.fTaggedJet;
357  fTagStatus = jet.fTagStatus;
358  fPtSub = jet.fPtSub;
359  fPtSubVect = jet.fPtSubVect;
360  fTriggers = jet.fTriggers;
365  fLabel = jet.fLabel;
394  fHasGhost = jet.fHasGhost;
395  fGhosts = jet.fGhosts;
396  }
397 
398  return *this;
399 }
400 
401 //_________________________________________________________________________________________________
402 Int_t AliEmcalJet::Compare(const TObject* obj) const
403 {
404  //Return -1 if this is smaller than obj, 0 if objects are equal and 1 if this is larger than obj.
405 
406  const AliEmcalJet* jet = static_cast<const AliEmcalJet*>(obj);
407  if(!obj)
408  return 0;
409  if(Pt() > jet->Pt())
410  return -1;
411  return 1;
412 }
413 
414 //__________________________________________________________________________________________________
415 void AliEmcalJet::GetMomentum(TLorentzVector& vec) const
416 {
417  // Return momentum as four-vector.
418 
419  vec.SetPtEtaPhiE(fPt, fEta, fPhi, E());
420 }
421 
422 //__________________________________________________________________________________________________
423 Double_t AliEmcalJet::PtSub(Double_t rho, Bool_t save)
424 {
425  // Return transverse momentum after scalar subtraction. Save the result if required.
426  // Result can be negative.
427 
428  Double_t ptcorr = fPt - rho * fArea;
429  if(save)
430  fPtSub = ptcorr;
431  return ptcorr;
432 }
433 
434 //__________________________________________________________________________________________________
435 Double_t AliEmcalJet::PtSubVect(Double_t rho, Bool_t save)
436 {
437  // Return transverse momentum after vectorial subtraction. Save the result if required.
438  // Result cannot be negative.
439 
440  Double_t dx = Px() - rho * fArea * TMath::Cos(fAreaPhi);
441  Double_t dy = Py() - rho * fArea * TMath::Sin(fAreaPhi);
442  //Double_t dz = Pz() - rho * fArea * TMath::SinH(fAreaEta);
443  Double_t ptcorr = TMath::Sqrt(dx * dx + dy * dy);
444  if(save)
445  fPtSubVect = ptcorr;
446  return ptcorr;
447 }
448 
449 //__________________________________________________________________________________________________
450 TLorentzVector AliEmcalJet::SubtractRhoVect(Double_t rho, Bool_t save)
451 {
452  // Return four-momentum after vectorial subtraction. Save pt if required.
453  // Saved value of pt is negative if the corrected momentum is pointing to the opposite half-plane in the x-y plane w.r.t. the raw momentum.
454 
455  TLorentzVector vecCorr;
456  GetMom(vecCorr);
457  TLorentzVector vecBg;
458  vecBg.SetPtEtaPhiE(fArea, fAreaEta, fAreaPhi, fAreaE);
459  vecBg *= rho;
460  vecCorr -= vecBg;
461  if(save)
462  {
463  Double_t dPhi = TMath::Abs(TVector2::Phi_mpi_pi(Phi() - vecCorr.Phi()));
464  Int_t signum = dPhi <= TMath::PiOver2() ? 1 : -1;
465  fPtSubVect = signum * vecCorr.Pt();
466  }
467  return vecCorr;
468 }
469 
470 //__________________________________________________________________________________________________
472 {
473  // Sort constituent by index (increasing).
474 
475  std::sort(fClusterIDs.GetArray(), fClusterIDs.GetArray() + fClusterIDs.GetSize());
476  std::sort(fTrackIDs.GetArray(), fTrackIDs.GetArray() + fTrackIDs.GetSize());
477 }
478 
479 //__________________________________________________________________________________________________
480 Double_t AliEmcalJet::DeltaR(const AliVParticle* part) const
481 {
482  // Helper function to calculate the distance between two jets or a jet and a particle
483 
484  Double_t dPhi = Phi() - part->Phi();
485  Double_t dEta = Eta() - part->Eta();
486  dPhi = TVector2::Phi_mpi_pi(dPhi);
487  return TMath::Sqrt(dPhi * dPhi + dEta * dEta);
488 }
489 
490 
491 //__________________________________________________________________________________________________
492 std::vector<int> AliEmcalJet::SortConstituentsPt(TClonesArray* tracks) const
493 {
494  // Sorting by p_T (decreasing) jet constituents
495 
496  typedef std::pair<Double_t, Int_t> ptidx_pair;
497 
498  // Create vector for Pt sorting
499  std::vector<ptidx_pair> pair_list ;
500 
501  for(Int_t i_entry = 0; i_entry < GetNumberOfTracks(); i_entry++)
502  {
503  AliVParticle* track = TrackAt(i_entry, tracks);
504  if(!track)
505  {
506  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()));
507  continue;
508  }
509 
510  pair_list.push_back(std::make_pair(track->Pt(), i_entry));
511  }
512 
513  std::stable_sort(pair_list.begin() , pair_list.end() , sort_descend());
514 
515  // return an vector of indexes of constituents (sorted descending by pt)
516  std::vector <int> index_sorted_list;
517 
518  for(std::vector< std::pair<Double_t, Int_t> >::iterator it = pair_list.begin(); it != pair_list.end(); ++it)
519  { index_sorted_list.push_back((*it).second); } // populating the return object with indexes of sorted tracks
520 
521  return index_sorted_list;
522 }
523 
524 //________________________________________________________________________
525 Double_t AliEmcalJet::GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz) const
526 {
527  // Get the z of a constituent inside of a jet
528 
529  Double_t pJetSq = P();
530  pJetSq *= pJetSq;
531 
532  if(pJetSq > 1e-6)
533  { return (trkPx * Px() + trkPy * Py() + trkPz * Pz()) / pJetSq ; }
534  else
535  { AliWarning(Form("%s: strange, pjet*pjet seems to be zero pJetSq: %f", GetName(), pJetSq)); return -1; }
536 }
537 
538 //________________________________________________________________________
539 Double_t AliEmcalJet::GetZ(const AliVParticle* trk) const
540 {
541  // Get Z of constituent trk
542 
543  return GetZ(trk->Px(), trk->Py(), trk->Pz());
544 }
545 
546 //__________________________________________________________________________________________________
547 AliVParticle* AliEmcalJet::GetLeadingTrack(TClonesArray* tracks) const
548 {
549  AliVParticle* maxTrack = 0;
550  for(Int_t i = 0; i < GetNumberOfTracks(); i++) {
551  AliVParticle* track = TrackAt(i, tracks);
552  if(!track) {
553  AliError(Form("Unable to find jet track %d in collection %s (pos in collection %d, max %d)",
554  i, tracks->GetName(), TrackAt(i), tracks->GetEntriesFast()));
555  continue;
556  }
557  if(!maxTrack || track->Pt() > maxTrack->Pt())
558  maxTrack = track;
559  }
560 
561  return maxTrack;
562 }
563 
564 //__________________________________________________________________________________________________
565 AliVCluster* AliEmcalJet::GetLeadingCluster(TClonesArray* clusters) const
566 {
567  AliVCluster* maxCluster = 0;
568  for(Int_t i = 0; i < GetNumberOfClusters(); i++) {
569  AliVCluster* cluster = ClusterAt(i, clusters);
570  if(!cluster) {
571  AliError(Form("Unable to find jet cluster %d in collection %s (pos in collection %d, max %d)",
572  i, clusters->GetName(), ClusterAt(i), clusters->GetEntriesFast()));
573  continue;
574  }
575  if(!maxCluster || cluster->E() > maxCluster->E())
576  maxCluster = cluster;
577  }
578 
579  return maxCluster;
580 }
581 
582 //__________________________________________________________________________________________________
584 {
585  fClosestJets[0] = 0;
586  fClosestJets[1] = 0;
587  fClosestJetsDist[0] = 999;
588  fClosestJetsDist[1] = 999;
589  fMatched = 2;
590 }
591 
592 //__________________________________________________________________________________________________
594 {
595  for(Int_t i = 0; i < fGRNumerator.GetSize(); i++) {
596  Printf("num[%d] = %f", i, fGRNumerator.At(i));
597  }
598 }
599 
600 //__________________________________________________________________________________________________
601 Int_t AliEmcalJet::ContainsTrack(Int_t it) const
602 {
603  for (Int_t i = 0; i < fTrackIDs.GetSize(); i++) {
604  if (it == fTrackIDs[i]) return i;
605  }
606  return -1;
607 }
608 
609 //__________________________________________________________________________________________________
610 Int_t AliEmcalJet::ContainsCluster(Int_t ic) const
611 {
612  for (Int_t i = 0; i < fClusterIDs.GetSize(); i++) {
613  if (ic == fClusterIDs[i]) return i;
614  }
615  return -1;
616 }
617 
630 TString AliEmcalJet::toString() const {
631  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",
633 }
634 
641 void AliEmcalJet::Print(Option_t* /*opt*/) const
642 {
643  Printf("%s\n", toString().Data());
644 }
645 
652 std::ostream &AliEmcalJet::Print(std::ostream &in) const {
653  in << toString().Data();
654  return in;
655 }
656 
657 //________________________________________________________________________
658 void AliEmcalJet::PrintConstituents(TClonesArray* tracks, TClonesArray* clusters) const
659 {
660  if (tracks) {
661  for (Int_t i = 0; i < GetNumberOfTracks(); i++) {
662  AliVParticle* part = TrackAt(i, tracks);
663  if (part) {
664  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());
665  }
666  }
667  }
668 
669  if (clusters) {
670  for (Int_t i = 0; i < GetNumberOfClusters(); i++) {
671  AliVCluster* clus = ClusterAt(i, clusters);
672  if (clus) {
673  Printf("Cluster %d (index = %d) E = %.2f", i, ClusterAt(i), clus->E());
674  }
675  }
676  }
677 }
678 
679 //________________________________________________________________________
680 Double_t AliEmcalJet::GetFlavourTrackZ(Int_t i) const
681 {
682  if (P() < 1e-6) return 0.;
683  AliVParticle* hftrack = GetFlavourTrack(i);
684  return hftrack != 0 ? hftrack->P() / P() : 0.;
685 }
686 
694 std::ostream &operator<<(std::ostream &in, const AliEmcalJet &myjet) {
695  std::ostream &result = myjet.Print(in);
696  return result;
697 }
TArrayI fTrackIDs
Definition: AliEmcalJet.h:304
TArrayF fGRDenominatorSub
array with angular structure function numerator
Definition: AliEmcalJet.h:324
Double_t fPtSubVect
background subtracted pt (not stored set from outside)
Definition: AliEmcalJet.h:312
ClassImp(AliEmcalJet) AliEmcalJet
Definition: AliEmcalJet.cxx:11
Double_t Area() const
Definition: AliEmcalJet.h:69
Int_t fTagStatus
jet tagged to this jet
Definition: AliEmcalJet.h:310
Double_t fJetShapepTDFirstDer
result from shape derivatives for jet Angularity: 2nd order subtracted
Definition: AliEmcalJet.h:331
Double_t fJetShapeConstituentSecondDer
result from shape derivatives for jet const: 1st derivative
Definition: AliEmcalJet.h:347
Double_t fJetShapepTDSecondDer
result from shape derivatives for jet pTD: 1st derivative
Definition: AliEmcalJet.h:332
Double32_t fAreaE
Definition: AliEmcalJet.h:291
TArrayI fClusterIDs
Definition: AliEmcalJet.h:303
AliVParticle * GetFlavourTrack(Int_t i=0) const
Definition: AliEmcalJet.h:264
Double_t Eta() const
Definition: AliEmcalJet.h:60
Int_t fLabel
result from shape derivatives for jet mass: 2nd order subtracted
Definition: AliEmcalJet.h:319
Double_t fPtSub
status of tagging -1: NA 0: not tagged 1: tagged
Definition: AliEmcalJet.h:311
Double_t Py() const
Definition: AliEmcalJet.h:45
Double_t Phi() const
Definition: AliEmcalJet.h:55
Bool_t fHasGhost
result from shape derivatives for jet LeSub: 2nd order subtracted
Definition: AliEmcalJet.h:356
Double_t fJetShapeLeSubFirstSub
result from shape derivatives for jet LeSub: 2nd derivative
Definition: AliEmcalJet.h:353
Double_t fJetShapeMassSecondDer
result from shape derivatives for jet mass: 1st derivative
Definition: AliEmcalJet.h:316
Double_t MaxChargedPt() const
Definition: AliEmcalJet.h:91
AliEmcalJet & operator=(const AliEmcalJet &jet)
void GetMom(TLorentzVector &vec) const
Definition: AliEmcalJet.h:66
Double_t GetFlavourTrackZ(Int_t i=0) const
Double_t fJetShapeAngularitySecondDer
result from shape derivatives for jet Angularity: 1st derivative
Definition: AliEmcalJet.h:327
Double_t E() const
Definition: AliEmcalJet.h:58
Double_t fJetShapeLeSubSecondSub
result from shape derivatives for jet LeSub: 1st order subtracted
Definition: AliEmcalJet.h:354
Int_t ContainsCluster(AliVCluster *cluster, TClonesArray *clusters) const
Definition: AliEmcalJet.h:79
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:83
Double_t fJetShapeCircularityFirstDer
result from shape derivatives for jet pTD: 2nd order subtracted
Definition: AliEmcalJet.h:336
Double_t Px() const
Definition: AliEmcalJet.h:44
std::ostream & Print(std::ostream &in) const
void ResetMatching()
void GetMomentum(TLorentzVector &vec) const
Double32_t fMCPt
Definition: AliEmcalJet.h:298
Double32_t fMaxNPt
Definition: AliEmcalJet.h:297
Double32_t fM
Definition: AliEmcalJet.h:286
Double_t fJetShapepTDFirstSub
result from shape derivatives for jet pTD: 2nd derivative
Definition: AliEmcalJet.h:333
Short_t ClusterAt(Int_t idx) const
Definition: AliEmcalJet.h:77
UShort_t GetNumberOfClusters() const
Definition: AliEmcalJet.h:82
AliVParticle * GetLeadingTrack(TClonesArray *tracks) const
TArrayF fGRNumeratorSub
array with angular structure function denominator
Definition: AliEmcalJet.h:323
Double32_t fAreaPhi
Definition: AliEmcalJet.h:290
Double_t fJetShapeConstituentSecondSub
result from shape derivatives for jet const: 1st order subtracted
Definition: AliEmcalJet.h:349
UShort_t fMatched
distance to closest jets (see above)
Definition: AliEmcalJet.h:307
std::vector< int > SortConstituentsPt(TClonesArray *tracks) const
std::vector< TLorentzVector > fGhosts
Definition: AliEmcalJet.h:357
TString toString() const
Double_t PtSubVect() const
Definition: AliEmcalJet.h:103
Double32_t fArea
Definition: AliEmcalJet.h:288
AliVCluster * GetLeadingCluster(TClonesArray *clusters) const
AliEmcalJet * fTaggedJet
matching type
Definition: AliEmcalJet.h:309
Int_t ContainsTrack(AliVParticle *track, TClonesArray *tracks) const
Definition: AliEmcalJet.h:109
TLorentzVector SubtractRhoVect(Double_t rho, Bool_t save=kFALSE)
std::ostream & operator<<(std::ostream &in, const AliEmcalJet &myjet)
Double_t PtSub() const
Definition: AliEmcalJet.h:102
Double_t fJetShapeCircularityFirstSub
result from shape derivatives for jet circularity: 2nd derivative
Definition: AliEmcalJet.h:338
Double32_t fAreaEta
Definition: AliEmcalJet.h:289
Double_t MaxNeutralPt() const
Definition: AliEmcalJet.h:90
Double_t GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz) const
Double_t fJetShapeMassFirstDer
triggers that the jet might have fired (AliVEvent::EOfflineTriggerTypes)
Definition: AliEmcalJet.h:315
Int_t fFlavourTagging
Definition: AliEmcalJet.h:294
Double_t DeltaR(const AliVParticle *part) const
Double_t fJetShapeSigma2SecondSub
result from shape derivatives for jet sigma2: 1st order subtracted
Definition: AliEmcalJet.h:344
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)
Double_t fJetShapeLeSubFirstDer
result from shape derivatives for jet const: 2nd order subtracted
Definition: AliEmcalJet.h:351
Double_t Pt() const
Definition: AliEmcalJet.h:47
Double32_t fPtEmc
Definition: AliEmcalJet.h:301
Double_t fJetShapeCircularitySecondDer
result from shape derivatives for jet circularity: 1st derivative
Definition: AliEmcalJet.h:337
Double_t fJetShapeAngularityFirstSub
result from shape derivatives for jet Angularity: 2nd derivative
Definition: AliEmcalJet.h:328
Double32_t fPt
Definition: AliEmcalJet.h:283
Double_t P() const
Definition: AliEmcalJet.h:48
Double32_t fEta
Definition: AliEmcalJet.h:284
Double32_t fMaxCPt
heavy flavour candidate tracks matched to the jet
Definition: AliEmcalJet.h:296
Short_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:107
TArrayF fGRDenominator
array with angular structure function numerator
Definition: AliEmcalJet.h:322
Double_t fJetShapeConstituentFirstSub
result from shape derivatives for jet const: 2nd derivative
Definition: AliEmcalJet.h:348
Double32_t fAreaEmc
Definition: AliEmcalJet.h:292
Double_t fJetShapeSigma2FirstDer
result from shape derivatives for jetcircularity: 2nd order subtracted
Definition: AliEmcalJet.h:341
Double_t fJetShapeSigma2SecondDer
result from shape derivatives for jet sigma2: 1st derivative
Definition: AliEmcalJet.h:342
Double_t fJetShapeConstituentFirstDer
result from shape derivatives for jetsigma2: 2nd order subtracted
Definition: AliEmcalJet.h:346
Double_t fJetShapeSigma2FirstSub
result from shape derivatives for jet sigma2: 2nd derivative
Definition: AliEmcalJet.h:343
Double_t fJetShapeCircularitySecondSub
result from shape derivatives for jet circularity: 1st order subtracted
Definition: AliEmcalJet.h:339
Double_t fJetShapeMassSecondSub
result from shape derivatives for jet mass: 1st order subtracted
Definition: AliEmcalJet.h:318
Double_t fJetShapeLeSubSecondDer
result from shape derivatives for jet LeSub: 1st derivative
Definition: AliEmcalJet.h:352
Double_t Pz() const
Definition: AliEmcalJet.h:46
Double_t fJetShapeAngularitySecondSub
result from shape derivatives for jet Angularity: 1st order subtracted
Definition: AliEmcalJet.h:329
UInt_t fTriggers
background vector subtracted pt (not stored set from outside)
Definition: AliEmcalJet.h:313
Bool_t fAxisInEmcal
Definition: AliEmcalJet.h:293
void PrintGR()
void SortConstituents()
TArrayF fGRNumerator
Definition: AliEmcalJet.h:321
Double32_t fPhi
Definition: AliEmcalJet.h:285
AliEmcalJet * fClosestJets[2]
Definition: AliEmcalJet.h:305
Double_t NEF() const
Definition: AliEmcalJet.h:92
Double_t fJetShapeMassFirstSub
result from shape derivatives for jet mass: 2nd derivative
Definition: AliEmcalJet.h:317
Double32_t fNEF
Definition: AliEmcalJet.h:287
Double32_t fClosestJetsDist[2]
if this is MC it contains the two closest detector level jets in order of distance and viceversa ...
Definition: AliEmcalJet.h:306
Int_t Compare(const TObject *obj) const
Double_t fJetShapepTDSecondSub
result from shape derivatives for jet pTD: 1st order subtracted
Definition: AliEmcalJet.h:334
Double_t fJetShapeAngularityFirstDer
array with angular structure function denominator
Definition: AliEmcalJet.h:326
TObjArray * fFlavourTracks
Definition: AliEmcalJet.h:295
void PrintConstituents(TClonesArray *tracks, TClonesArray *clusters) const