AliPhysics  90acdf5 (90acdf5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliJetContainer.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 #include <TClonesArray.h>
17 
18 #include "AliVEvent.h"
19 #include "AliLog.h"
20 #include "AliEMCALGeometry.h"
21 #include "AliParticleContainer.h"
22 #include "AliClusterContainer.h"
23 #include "AliLocalRhoParameter.h"
24 #include "AliTLorentzVector.h"
25 
26 #include "AliJetContainer.h"
27 
31 
37  fJetAcceptanceType(kUser),
38  fJetRadius(0),
39  fRhoName(),
40  fLocalRhoName(),
41  fRhoMassName(),
42  fFlavourSelection(0),
43  fJetAreaCut(-1),
44  fAreaEmcCut(-1),
45  fMinClusterPt(-1),
46  fMaxClusterPt(1000),
47  fMinTrackPt(-1),
48  fMaxTrackPt(100),
49  fZLeadingEmcCut(10.),
50  fZLeadingChCut(10.),
51  fNEFMinCut(-10.),
52  fNEFMaxCut(10.),
53  fLeadingHadronType(0),
54  fNLeadingJets(1),
55  fMinNConstituents(-1),
56  fJetTrigger(0),
57  fTagStatus(-1),
58  fParticleContainer(0),
59  fClusterContainer(0),
60  fRho(0),
61  fLocalRho(0),
62  fRhoMass(0),
63  fGeom(0),
64  fRunNumber(0),
65  fTpcHolePos(0),
66  fTpcHoleWidth(0)
67 {
68  fBaseClassName = "AliEmcalJet";
69  SetClassName("AliEmcalJet");
70 }
71 
78  fJetAcceptanceType(kUser),
79  fJetRadius(0),
80  fRhoName(),
81  fLocalRhoName(),
82  fRhoMassName(),
83  fFlavourSelection(0),
84  fJetAreaCut(-1),
85  fAreaEmcCut(-1),
86  fMinClusterPt(-1),
87  fMaxClusterPt(1000),
88  fMinTrackPt(-1),
89  fMaxTrackPt(100),
90  fZLeadingEmcCut(10.),
91  fZLeadingChCut(10.),
92  fNEFMinCut(-10.),
93  fNEFMaxCut(10.),
94  fLeadingHadronType(0),
95  fNLeadingJets(1),
96  fMinNConstituents(-1),
97  fJetTrigger(0),
98  fTagStatus(-1),
99  fParticleContainer(0),
100  fClusterContainer(0),
101  fRho(0),
102  fLocalRho(0),
103  fRhoMass(0),
104  fGeom(0),
105  fRunNumber(0),
106  fTpcHolePos(0),
107  fTpcHoleWidth(0)
108 {
109  fBaseClassName = "AliEmcalJet";
110  SetClassName("AliEmcalJet");
111  SetMinPt(1);
112 }
113 
127 AliJetContainer::AliJetContainer(EJetType_t jetType, EJetAlgo_t jetAlgo, ERecoScheme_t recoScheme, Double_t radius,
128  AliParticleContainer* partCont, AliClusterContainer* clusCont, TString tag):
129  AliParticleContainer(GenerateJetName(jetType, jetAlgo, recoScheme, radius, partCont, clusCont, tag)),
130  fJetAcceptanceType(kUser),
131  fJetRadius(radius),
132  fRhoName(),
133  fLocalRhoName(),
134  fRhoMassName(),
135  fFlavourSelection(0),
136  fJetAreaCut(-1),
137  fAreaEmcCut(-1),
138  fMinClusterPt(-1),
139  fMaxClusterPt(1000),
140  fMinTrackPt(-1),
141  fMaxTrackPt(100),
142  fZLeadingEmcCut(10.),
143  fZLeadingChCut(10.),
144  fNEFMinCut(-10.),
145  fNEFMaxCut(10.),
146  fLeadingHadronType(0),
147  fNLeadingJets(1),
148  fMinNConstituents(-1),
149  fJetTrigger(0),
150  fTagStatus(-1),
151  fParticleContainer(partCont),
152  fClusterContainer(clusCont),
153  fRho(0),
154  fLocalRho(0),
155  fRhoMass(0),
156  fGeom(0),
157  fRunNumber(0)
158 {
159  fBaseClassName = "AliEmcalJet";
160  SetClassName("AliEmcalJet");
161  SetMinPt(1);
162 }
163 
168 void AliJetContainer::SetArray(const AliVEvent *event)
169 {
170  // Set jet array
171 
172  AliEmcalContainer::SetArray(event);
173 
175 }
176 
183 {
184  // Set acceptance
185 
186  switch (fJetAcceptanceType) {
187  case kTPC:
188  AliDebug(2,Form("%s: set TPC acceptance cuts",GetName()));
189  SetJetEtaPhiTPC();
190  break;
191  case kTPCfid:
192  AliDebug(2,Form("%s: set TPC acceptance cuts",GetName()));
194  break;
195  case kEMCAL:
196  AliDebug(2,Form("%s: set EMCAL acceptance cuts",GetName()));
198  break;
199  case kEMCALfid:
200  AliDebug(2,Form("%s: set EMCAL acceptance cuts",GetName()));
202  break;
203  case kDCAL:
204  AliDebug(2,Form("%s: set EMCAL acceptance cuts",GetName()));
206  break;
207  case kDCALfid:
208  AliDebug(2,Form("%s: set EMCAL acceptance cuts",GetName()));
210  break;
211  case kUser:
212  break;
213  }
214 }
215 
216 
223 {
224  fGeom = AliEMCALGeometry::GetInstance();
225  if (!fGeom) {
226  AliError(Form("%s: Can not create geometry", GetName()));
227  return;
228  }
229 }
230 
238 void AliJetContainer::LoadRho(const AliVEvent *event)
239 {
240  if (!fRhoName.IsNull() && !fRho) {
241  fRho = dynamic_cast<AliRhoParameter*>(event->FindListObject(fRhoName));
242  if (!fRho) {
243  AliError(Form("%s: Could not retrieve rho %s!", GetName(), fRhoName.Data()));
244  return;
245  }
246  }
247 }
248 
257 void AliJetContainer::LoadLocalRho(const AliVEvent *event)
258 {
259  if (!fLocalRhoName.IsNull() && !fLocalRho) {
260  fLocalRho = dynamic_cast<AliLocalRhoParameter*>(event->FindListObject(fLocalRhoName));
261  if (!fLocalRho) {
262  AliError(Form("%s: Could not retrieve rho %s!", GetName(), fLocalRhoName.Data()));
263  return;
264  }
265  }
266 }
267 
276 void AliJetContainer::LoadRhoMass(const AliVEvent *event)
277 {
278  if (!fRhoMassName.IsNull() && !fRhoMass) {
279  fRhoMass = dynamic_cast<AliRhoParameter*>(event->FindListObject(fRhoMassName));
280  if (!fRhoMass) {
281  AliError(Form("%s: Could not retrieve rho_mass %s!", GetName(), fRhoMassName.Data()));
282  return;
283  }
284  }
285 }
286 
294 {
295  TString option(opt);
296  option.ToLower();
297 
298  Int_t tempID = fCurrentID;
299  ResetCurrentID();
300 
301  AliEmcalJet *jetMax = GetNextAcceptJet();
302  AliEmcalJet *jet = 0;
303 
304  if (option.Contains("rho")) {
305  while ((jet = GetNextAcceptJet())) {
306  if ( (jet->Pt()-jet->Area()*GetRhoVal()) > (jetMax->Pt()-jetMax->Area()*GetRhoVal()) )
307  jetMax = jet;
308  }
309  }
310  else {
311  while ((jet = GetNextAcceptJet())) {
312  if (jet->Pt() > jetMax->Pt()) jetMax = jet;
313  }
314  }
315 
316  fCurrentID = tempID;
317 
318  return jetMax;
319 }
320 
327 {
328  if (i < 0 || i > fClArray->GetEntriesFast()) return 0;
329  AliEmcalJet *jet = static_cast<AliEmcalJet*>(fClArray->At(i));
330  return jet;
331 
332 }
333 
341 {
342  UInt_t rejectionReason = 0;
343  AliEmcalJet *jet = GetJet(i);
344  if(!AcceptJet(jet, rejectionReason)) return 0;
345 
346  return jet;
347 }
348 
356 {
357  const Int_t njets = GetNEntries();
358  AliEmcalJet *jet = 0;
359  do {
360  fCurrentID++;
361  if (fCurrentID >= njets) break;
362  jet = GetAcceptJet(fCurrentID);
363  } while (!jet);
364 
365  return jet;
366 }
367 
375 {
376  const Int_t njets = GetNEntries();
377  AliEmcalJet *jet = 0;
378  do {
379  fCurrentID++;
380  if (fCurrentID >= njets) break;
381  jet = GetJet(fCurrentID);
382  } while (!jet);
383 
384 
385  return jet;
386 }
387 
394 Double_t AliJetContainer::GetJetPtCorr(Int_t i) const
395 {
396  AliEmcalJet *jet = GetJet(i);
397  return jet->Pt() - fRho->GetVal()*jet->Area();
398 }
399 
406 Double_t AliJetContainer::GetJetPtCorrLocal(Int_t i) const
407 {
408  AliEmcalJet *jet = GetJet(i);
409 
410  return jet->Pt() - fLocalRho->GetLocalVal(jet->Phi(), fJetRadius)*jet->Area();
411 }
412 
420 Bool_t AliJetContainer::GetMomentumFromJet(TLorentzVector &mom, const AliEmcalJet* jet, Double_t mass) const
421 {
422  Double_t p = jet->P();
423  Double_t e = TMath::Sqrt(mass*mass + p*p);
424 
425  mom.SetPtEtaPhiE(jet->Pt(), jet->Eta(), jet->Phi(), e);
426 
427  return kTRUE;
428 }
429 
437 Bool_t AliJetContainer::GetMomentumFromJet(TLorentzVector &mom, const AliEmcalJet* jet) const
438 {
439  if (jet) {
440  if (fMassHypothesis >= 0) {
441  GetMomentumFromJet(mom, jet, fMassHypothesis);
442  }
443  else {
444  jet->GetMomentum(mom);
445  }
446  return kTRUE;
447  }
448  else {
449  mom.SetPtEtaPhiM(0, 0, 0, 0);
450  return kFALSE;
451  }
452 }
453 
462 Bool_t AliJetContainer::GetMomentum(TLorentzVector &mom, Int_t i) const
463 {
464  AliEmcalJet *jet = GetJet(i);
465  return GetMomentumFromJet(mom, jet);
466 }
467 
476 Bool_t AliJetContainer::GetNextMomentum(TLorentzVector &mom)
477 {
478  AliEmcalJet *jet = GetNextJet();
479  return GetMomentumFromJet(mom, jet);
480 }
481 
491 Bool_t AliJetContainer::GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
492 {
493  AliEmcalJet *jet = GetAcceptJet(i);
494  return GetMomentumFromJet(mom, jet);
495 }
496 
505 Bool_t AliJetContainer::GetNextAcceptMomentum(TLorentzVector &mom)
506 {
507  AliEmcalJet *jet = GetNextAcceptJet();
508  return GetMomentumFromJet(mom, jet);
509 }
510 
517 Bool_t AliJetContainer::AcceptJet(const AliEmcalJet *jet, UInt_t &rejectionReason) const
518 {
519  if (fTpcHolePos>0) {
520  Bool_t s = CheckTpcHolesOverlap(jet,rejectionReason);
521  if (!s) return kFALSE;
522  }
523 
524  Bool_t r = ApplyJetCuts(jet, rejectionReason);
525  if (!r) return kFALSE;
526 
527  AliTLorentzVector mom;
528  GetMomentumFromJet(mom, jet);
529 
530  return ApplyKinematicCuts(mom, rejectionReason);
531 }
532 
539 Bool_t AliJetContainer::AcceptJet(Int_t i, UInt_t &rejectionReason) const
540 {
541  if (fTpcHolePos>0) {
542  Bool_t s = CheckTpcHolesOverlap(GetJet(i),rejectionReason);
543  if (!s) return kFALSE;
544  }
545 
546  Bool_t r = ApplyJetCuts(GetJet(i), rejectionReason);
547  if (!r) return kFALSE;
548 
549  AliTLorentzVector mom;
550  GetMomentum(mom, i);
551 
552  return ApplyKinematicCuts(mom, rejectionReason);
553 }
554 
561 Bool_t AliJetContainer::ApplyJetCuts(const AliEmcalJet *jet, UInt_t &rejectionReason) const
562 {
563  // Return true if jet is accepted.
564 
565  if (!jet) {
566  AliDebug(11,"No jet found");
567  rejectionReason |= kNullObject;
568  return kFALSE;
569  }
570 
571  if (jet->TestBits(fBitMap) != (Int_t)fBitMap) {
572  AliDebug(11,"Cut rejecting jet: Bit map");
573  rejectionReason |= kBitMapCut;
574  return kFALSE;
575  }
576 
577  if (jet->Area() <= fJetAreaCut) {
578  AliDebug(11,"Cut rejecting jet: Area");
579  rejectionReason |= kAreaCut;
580  return kFALSE;
581  }
582 
583  if (jet->AreaEmc() < fAreaEmcCut) {
584  AliDebug(11,"Cut rejecting jet: AreaEmc");
585  rejectionReason |= kAreaEmcCut;
586  return kFALSE;
587  }
588 
590  AliDebug(11,"Cut rejecting jet: ZLeading");
591  rejectionReason |= kZLeadingChCut;
592  return kFALSE;
593  }
594 
595  if (fZLeadingEmcCut < 1 && GetZLeadingEmc(jet) > fZLeadingEmcCut) {
596  AliDebug(11,"Cut rejecting jet: ZLeadEmc");
597  rejectionReason |= kZLeadingEmcCut;
598  return kFALSE;
599  }
600 
601  if (jet->NEF() < fNEFMinCut || jet->NEF() > fNEFMaxCut) {
602  AliDebug(11,"Cut rejecting jet: NEF");
603  rejectionReason |= kNEFCut;
604  return kFALSE;
605  }
606 
608  AliDebug(11,"Cut rejecting jet: minimum number of constituents");
609  rejectionReason |= kMinNConstituents;
610  return kFALSE;
611  }
612 
613  if (fLeadingHadronType == 0) {
614  if (jet->MaxTrackPt() < fMinTrackPt) {
615  AliDebug(11,"Cut rejecting jet: Bias");
616  rejectionReason |= kMinLeadPtCut;
617  return kFALSE;
618  }
619  }
620  else if (fLeadingHadronType == 1) {
621  if (jet->MaxClusterPt() < fMinClusterPt) {
622  AliDebug(11,"Cut rejecting jet: Bias");
623  rejectionReason |= kMinLeadPtCut;
624  return kFALSE;
625  }
626  }
627  else {
628  if (jet->MaxTrackPt() < fMinTrackPt && jet->MaxClusterPt() < fMinClusterPt) {
629  AliDebug(11,"Cut rejecting jet: Bias");
630  rejectionReason |= kMinLeadPtCut;
631  return kFALSE;
632  }
633  }
634 
635  if (jet->MaxTrackPt() > fMaxTrackPt) {
636  AliDebug(11,"Cut rejecting jet: MaxTrackPt");
637  rejectionReason |= kMaxTrackPtCut;
638  return kFALSE;
639 
640  }
641 
642  if (jet->MaxClusterPt() > fMaxClusterPt) {
643  AliDebug(11,"Cut rejecting jet: MaxClusPt");
644  rejectionReason |= kMaxClusterPtCut;
645  return kFALSE;
646  }
647 
649  AliDebug(11,"Cut rejecting jet: Flavour");
650  rejectionReason |= kFlavourCut;
651  return kFALSE;
652  }
653 
654  if (fTagStatus>-1 && jet->GetTagStatus()!=fTagStatus) {
655  AliDebug(11,"Cut rejecting jet: tag status");
656  rejectionReason |= kTagStatus;
657  return kFALSE;
658  }
659 
660  return kTRUE;
661 }
662 
671 {
672  if (fLeadingHadronType == 0) // charged leading hadron
673  return jet->MaxTrackPt();
674  else if (fLeadingHadronType == 1) // neutral leading hadron
675  return jet->MaxClusterPt();
676  else // charged or neutral
677  return jet->MaxPartPt();
678 }
679 
686 void AliJetContainer::GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
687 {
688  Double_t maxClusterPt = 0;
689  Double_t maxClusterEta = 0;
690  Double_t maxClusterPhi = 0;
691 
692  Double_t maxTrackPt = 0;
693  Double_t maxTrackEta = 0;
694  Double_t maxTrackPhi = 0;
695 
696  if (fClusterContainer && fClusterContainer->GetArray() && (fLeadingHadronType == 1 || fLeadingHadronType == 2)) {
697  AliVCluster *cluster = jet->GetLeadingCluster(fClusterContainer->GetArray());
698  if (cluster) {
699  TLorentzVector nPart;
700  cluster->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
701 
702  maxClusterEta = nPart.Eta();
703  maxClusterPhi = nPart.Phi();
704  maxClusterPt = nPart.Pt();
705  }
706  }
707 
708  if (fParticleContainer && fParticleContainer->GetArray() && (fLeadingHadronType == 0 || fLeadingHadronType == 2)) {
709  AliVParticle *track = jet->GetLeadingTrack(fParticleContainer->GetArray());
710  if (track) {
711  maxTrackEta = track->Eta();
712  maxTrackPhi = track->Phi();
713  maxTrackPt = track->Pt();
714  }
715  }
716 
717  if (maxTrackPt > maxClusterPt)
718  mom.SetPtEtaPhiM(maxTrackPt,maxTrackEta,maxTrackPhi,0.139);
719  else
720  mom.SetPtEtaPhiM(maxClusterPt,maxClusterEta,maxClusterPhi,0.139);
721 }
722 
730 {
731  if (fClusterContainer && fClusterContainer->GetArray()) {
732  TLorentzVector mom;
733 
734  AliVCluster *cluster = jet->GetLeadingCluster(fClusterContainer->GetArray());
735  if (cluster) {
736  cluster->GetMomentum(mom, fVertex);
737 
738  return GetZ(jet,mom);
739  }
740  else {
741  return -1;
742  }
743  }
744  else {
745  return -1;
746  }
747 }
748 
756 {
757 
758  if (fParticleContainer && fParticleContainer->GetArray() ) {
759  TLorentzVector mom;
760 
761  AliVParticle *track = jet->GetLeadingTrack(fParticleContainer->GetArray());
762  if (track) {
763  mom.SetPtEtaPhiM(track->Pt(),track->Eta(),track->Phi(),0.139);
764 
765  return GetZ(jet,mom);
766  }
767  else {
768  return -1;
769  }
770  }
771  else {
772  return -1;
773  }
774 }
775 
783 Double_t AliJetContainer::GetZ(const AliEmcalJet *jet, const TLorentzVector& mom) const
784 {
785  Double_t pJetSq = jet->Px()*jet->Px() + jet->Py()*jet->Py() + jet->Pz()*jet->Pz();
786 
787  if (pJetSq < 1e-6) {
788  AliWarning(Form("%s: strange, pjet*pjet seems to be zero pJetSq: %.3f",GetName(), pJetSq));
789  return 0;
790  }
791 
792  Double_t z = (mom.Px()*jet->Px() + mom.Py()*jet->Py() + mom.Pz()*jet->Pz()) / pJetSq;
793 
794  if (z < 0) {
795  AliWarning(Form("%s: z = %.3ff < 0, returning 0...",GetName(), z));
796  z = 0;
797  }
798 
799  return z;
800 }
801 
809 {
810  if (!fGeom) SetEMCALGeometry();
811  if (fGeom) {
812  SetEtaLimits(fGeom->GetArm1EtaMin() + r, fGeom->GetArm1EtaMax() - r);
813 
814  if(fRunNumber >= 177295 && fRunNumber <= 197470) {//small SM masked in 2012 and 2013
815  SetPhiLimits(1.405 + r, 3.135 - r);
816  }
817  else {
818  SetPhiLimits(fGeom->GetArm1PhiMin() * TMath::DegToRad() + r, fGeom->GetEMCALPhiMax() * TMath::DegToRad() - r);
819  }
820  }
821  else {
822  AliWarning("Could not get instance of AliEMCALGeometry. Using manual settings for EMCAL year 2011!!");
823  SetEtaLimits(-0.7 + r, 0.7 - r);
824  SetPhiLimits(1.405 + r, 3.135 - r);
825  }
826 }
827 
835 {
836  if (!fGeom) SetEMCALGeometry();
837  if (fGeom) {
838  SetEtaLimits(fGeom->GetArm1EtaMin() + r, fGeom->GetArm1EtaMax() - r);
839  SetPhiLimits(fGeom->GetDCALPhiMin() * TMath::DegToRad() + r, fGeom->GetDCALPhiMax() * TMath::DegToRad() - r);
840  }
841  else {
842  AliWarning("Could not get instance of AliEMCALGeometry. Using manual settings for DCAL year 2015!!");
843  SetEtaLimits(-0.7 + r, 0.7 - r);
844  SetPhiLimits(4.538 + r, 5.727 - r);
845  }
846 }
847 
854 {
855  SetEtaLimits(-0.9 + r, 0.9 - r);
856  SetPhiLimits(0, 0); // No cut on phi
857 }
858 
863 {
864  TString arrName = GetArrayName();
865  Printf("Print jet cuts for %s",arrName.Data());
866  Printf("PtBiasJetTrack: %f",fMinTrackPt);
867  Printf("PtBiasJetClus: %f",fMinClusterPt);
868  Printf("JetPtCut: %f", fMinPt);
869  Printf("JetPtCutMax: %f", fMaxPt);
870  Printf("JetAreaCut: %f",fJetAreaCut);
871  Printf("AreaEmcCut: %f",fAreaEmcCut);
872  Printf("JetMinEta: %f", fMinEta);
873  Printf("JetMaxEta: %f", fMaxEta);
874  Printf("JetMinPhi: %f", fMinPhi);
875  Printf("JetMaxPhi: %f", fMaxPhi);
876  Printf("MaxClusterPt: %f",fMaxClusterPt);
877  Printf("MaxTrackPt: %f",fMaxTrackPt);
878  Printf("LeadingHadronType: %d",fLeadingHadronType);
879  Printf("ZLeadingEmcCut: %f",fZLeadingEmcCut);
880  Printf("ZLeadingChCut: %f",fZLeadingChCut);
881 }
882 
887 {
888  fMinTrackPt = 0;
889  fMinClusterPt = 0;
890  fMinPt = 0;
891  fJetAreaCut = -1;
892  fAreaEmcCut = -1;
893  fMinEta = -0.9;
894  fMaxEta = 0.9;
895  fMinPhi = 0;
896  fMaxPhi = 10;
897  fMaxClusterPt = 1000;
898  fMaxTrackPt = 100;
899  fLeadingHadronType = 0;
900  fZLeadingEmcCut = 10.;
901  fZLeadingChCut = 10.;
902 }
903 
909 {
910  return accepted().GetEntries();
911 }
912 
923 {
924  AliEmcalJet *jet2 = jet1->ClosestJet();
925  if (!jet2) return -1;
926 
927  Double_t jetPt2 = jet2->Pt();
928  if (jetPt2 <= 0) return -1;
929 
930  Int_t bgeom = kTRUE;
931  if (!cont2) bgeom = kFALSE;
932  Double_t sumPt = 0.;
933  AliVParticle *vpf = 0x0;
934  Int_t iFound = 0;
935  for (Int_t icc = 0; icc < jet2->GetNumberOfTracks(); icc++) {
936  Int_t idx = (Int_t)jet2->TrackAt(icc);
937  //get particle
938  AliVParticle *p2 = 0x0;
939  if (bgeom) p2 = static_cast<AliVParticle*>(jet2->TrackAt(icc, cont2->GetArray()));
940  iFound = 0;
941  for (Int_t icf = 0; icf < jet1->GetNumberOfTracks(); icf++) {
942  if (!bgeom && idx == jet1->TrackAt(icf) && iFound == 0 ) {
943  iFound = 1;
944  vpf = static_cast<AliVParticle*>(jet1->TrackAt(icf, fParticleContainer->GetArray()));
945  if (vpf) sumPt += vpf->Pt();
946  continue;
947  }
948  if (bgeom){
949  vpf = static_cast<AliVParticle*>(jet1->TrackAt(icf, fParticleContainer->GetArray()));
950  if (!vpf) continue;
951  if (!SamePart(vpf, p2, 1.e-4)) continue; //not the same particle
952  sumPt += vpf->Pt();
953  }
954  }
955  }
956 
957  Double_t fraction = sumPt / jetPt2;
958 
959  return fraction;
960 }
961 
973 TString AliJetContainer::GenerateJetName(EJetType_t jetType, EJetAlgo_t jetAlgo, ERecoScheme_t recoScheme, Double_t radius, AliParticleContainer* partCont, AliClusterContainer* clusCont, TString tag)
974 {
975  TString algoString;
976  switch (jetAlgo)
977  {
978  case kt_algorithm:
979  algoString = "KT";
980  break;
981  case antikt_algorithm:
982  algoString = "AKT";
983  break;
984  default:
985  ::Warning("AliJetContainer::GenerateJetName", "Unknown jet finding algorithm '%d'!", jetAlgo);
986  algoString = "";
987  }
988 
989  TString typeString;
990  switch (jetType) {
991  case kFullJet:
992  typeString = "Full";
993  break;
994  case kChargedJet:
995  typeString = "Charged";
996  break;
997  case kNeutralJet:
998  typeString = "Neutral";
999  break;
1000  }
1001 
1002  TString radiusString = TString::Format("R%03.0f", radius*100.0);
1003 
1004  TString trackString;
1005  if (jetType != kNeutralJet && partCont) {
1006  trackString = "_" + TString(partCont->GetTitle());
1007  }
1008 
1009  TString clusterString;
1010  if (jetType != kChargedJet && clusCont) {
1011  clusterString = "_" + TString(clusCont->GetTitle());
1012  }
1013 
1014  TString recombSchemeString;
1015  switch (recoScheme) {
1016  case E_scheme:
1017  recombSchemeString = "E_scheme";
1018  break;
1019  case pt_scheme:
1020  recombSchemeString = "pt_scheme";
1021  break;
1022  case pt2_scheme:
1023  recombSchemeString = "pt2_scheme";
1024  break;
1025  case Et_scheme:
1026  recombSchemeString = "Et_scheme";
1027  break;
1028  case Et2_scheme:
1029  recombSchemeString = "Et2_scheme";
1030  break;
1031  case BIpt_scheme:
1032  recombSchemeString = "BIpt_scheme";
1033  break;
1034  case BIpt2_scheme:
1035  recombSchemeString = "BIpt2_scheme";
1036  break;
1037  case external_scheme:
1038  recombSchemeString = "ext_scheme";
1039  break;
1040  default:
1041  ::Error("AliJetContainer::GenerateJetName", "Recombination %d scheme not recognized.", recoScheme);
1042  }
1043 
1044  TString name = TString::Format("%s_%s%s%s%s%s_%s",
1045  tag.Data(), algoString.Data(), typeString.Data(), radiusString.Data(), trackString.Data(), clusterString.Data(), recombSchemeString.Data());
1046 
1047  return name;
1048 }
1049 
1056  return AliJetIterableContainer(this, false);
1057 }
1058 
1065  return AliJetIterableContainer(this, true);
1066 }
1067 
1074  return AliJetIterableMomentumContainer(this, false);
1075 }
1076 
1083  return AliJetIterableMomentumContainer(this, true);
1084 }
1085 
1091 const char* AliJetContainer::GetTitle() const
1092 {
1093  static TString jetString;
1094 
1095  if (GetMinPt() == 0) {
1096  jetString = TString::Format("_%s_pT0000", GetArrayName().Data());
1097  }
1098  else if (GetMinPt() < 1.0) {
1099  jetString = TString::Format("_%s_pT0%3.0f", GetArrayName().Data(), GetMinPt()*1000.0);
1100  }
1101  else {
1102  jetString = TString::Format("_%s_pT%4.0f", GetArrayName().Data(), GetMinPt()*1000.0);
1103  }
1104 
1105  return jetString.Data();
1106 }
1107 
1113 Bool_t AliJetContainer::CheckTpcHolesOverlap(const AliEmcalJet *jet, UInt_t &rejectionReason) const
1114 {
1115  if (!jet) {
1116  AliDebug(11,"No jet found");
1117  rejectionReason |= kNullObject;
1118  return kFALSE;
1119  }
1120 
1121  Double_t disthole = RelativePhi(jet->Phi(), fTpcHolePos);
1122  if (TMath::Abs(disthole) < (fTpcHoleWidth + fJetRadius)){
1123  AliDebug(11,"Jet overlaps with TPC hole");
1124  rejectionReason |= kOverlapTpcHole;
1125  return kFALSE;
1126  }
1127 
1128  return kTRUE;
1129 }
Double_t AreaEmc() const
Definition: AliEmcalJet.h:102
Double_t Area() const
Definition: AliEmcalJet.h:97
const char * GetTitle() const
Float_t fMinTrackPt
maximum cluster constituent pt to accept the jet
Float_t fJetAreaCut
selection on jet flavour
Double_t GetRhoVal() const
Float_t fJetRadius
acceptance type
void LoadRho(const AliVEvent *event)
AliEmcalJet * ClosestJet() const
Definition: AliEmcalJet.h:193
AliRhoParameter * fRhoMass
! event rho mass for these jets
Int_t GetTagStatus() const
Definition: AliEmcalJet.h:204
virtual Bool_t ApplyJetCuts(const AliEmcalJet *clus, UInt_t &rejectionReason) const
Double_t Eta() const
Definition: AliEmcalJet.h:88
const char * GetTitle() const
AliRhoParameter * fRho
cluster container (jet constituents)
Double_t Py() const
Definition: AliEmcalJet.h:74
JetAcceptanceType fJetAcceptanceType
Double_t Phi() const
Definition: AliEmcalJet.h:84
Double_t mass
Double_t GetLocalVal(Double_t phi, Double_t r, Double_t n) const
Declaration of class AliTLorentzVector.
Float_t fNEFMinCut
maximum z,leading charged
Double_t GetJetPtCorrLocal(Int_t i) const
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
void LoadRhoMass(const AliVEvent *event)
AliParticleContainer * fParticleContainer
jet tag status
virtual Bool_t CheckTpcHolesOverlap(const AliEmcalJet *clus, UInt_t &rejectionReason) const
Bool_t GetMomentum(TLorentzVector &mom, Int_t i) const
static TString GenerateJetName(EJetType_t jetType, EJetAlgo_t jetAlgo, ERecoScheme_t recoScheme, Double_t radius, AliParticleContainer *partCont, AliClusterContainer *clusCont, TString tag)
UShort_t GetNumberOfConstituents() const
Definition: AliEmcalJet.h:107
Container for particles within the EMCAL framework.
const AliJetIterableMomentumContainer all_momentum() const
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:106
AliLocalRhoParameter * fLocalRho
! event local rho for these jets
Double_t Px() const
Definition: AliEmcalJet.h:73
Float_t fAreaEmcCut
cut on jet area
void GetMomentum(TLorentzVector &vec) const
Int_t fLeadingHadronType
maximum NEF in a jet
Double_t fTpcHoleWidth
position(in radians) of the malfunctioning TPC sector
AliEmcalJet * GetLeadingJet(const char *opt="")
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
const AliJetIterableMomentumContainer accepted_momentum() const
Int_t fRunNumber
! run number
AliVParticle * GetLeadingTrack(TClonesArray *tracks) const
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
Float_t fMaxClusterPt
maximum cluster constituent pt to accept the jet
Bool_t GetNextAcceptMomentum(TLorentzVector &mom)
const char * GetTitle() const
Float_t fMinClusterPt
minimum cut on jet emcal area
Double_t MaxTrackPt() const
Definition: AliEmcalJet.h:122
AliVCluster * GetLeadingCluster(TClonesArray *clusters) const
TString fLocalRhoName
Name of rho object.
Float_t fZLeadingChCut
maximum z,leading neutral
AliEmcalJet * GetNextAcceptJet()
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)
void SetJetEtaPhiDCAL(Double_t r=0.)
Double_t Pt() const
Definition: AliEmcalJet.h:76
AliEmcalJet * GetNextJet()
AliEMCALGeometry * fGeom
! emcal geometry
Double_t P() const
Definition: AliEmcalJet.h:77
TString fRhoMassName
Name of local rho object.
Double_t GetZLeadingCharged(const AliEmcalJet *jet) const
Short_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:127
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Bool_t TestFlavourTag(Int_t tag) const
Definition: AliEmcalJet.h:219
EMCALIterableContainer::AliEmcalIterableContainerT< AliEmcalJet, EMCALIterableContainer::operator_star_object< AliEmcalJet > > AliJetIterableContainer
void SetArray(const AliVEvent *event)
void LoadLocalRho(const AliVEvent *event)
Int_t fTagStatus
jet trigger
EMCALIterableContainer::AliEmcalIterableContainerT< AliEmcalJet, EMCALIterableContainer::operator_star_pair< AliEmcalJet > > AliJetIterableMomentumContainer
Float_t fZLeadingEmcCut
maximum track constituent pt to accept the jet
AliEmcalJet * GetAcceptJet(Int_t i) const
Double_t MaxClusterPt() const
Definition: AliEmcalJet.h:121
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
Double_t GetZLeadingEmc(const AliEmcalJet *jet) const
Double_t Pz() const
Definition: AliEmcalJet.h:75
Float_t fMaxTrackPt
maximum track constituent pt to accept the jet
void SetJetEtaPhiTPC(Double_t r=0.)
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
void SetJetEtaPhiEMCAL(Double_t r=0.)
virtual Bool_t ApplyKinematicCuts(const AliTLorentzVector &mom, UInt_t &rejectionReason) const
const AliJetIterableContainer accepted() const
Float_t fNEFMaxCut
minimum NEF in a jet
Double_t NEF() const
Definition: AliEmcalJet.h:115
Bool_t GetMomentumFromJet(TLorentzVector &mom, const AliEmcalJet *jet, Double_t mass) const
AliClusterContainer * fClusterContainer
particle container (jet constituents)
Bool_t GetNextMomentum(TLorentzVector &mom)
Container structure for EMCAL clusters.
Int_t fMinNConstituents
how many jets are to be considered the leading jet(s)
Double_t MaxPartPt() const
Definition: AliEmcalJet.h:123
Container for jet within the EMCAL jet framework.
Double_t GetZ(const AliEmcalJet *jet, const TLorentzVector &mom) const
TString fRhoName
jet radius
AliEmcalJet * GetJet(Int_t i) const
const AliJetIterableContainer all() const
Double_t GetJetPtCorr(Int_t i) const
Int_t fFlavourSelection
Name of rho mass object.