AliPhysics  e59a9ba (e59a9ba)
 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  case kEMCALfid:
199  AliDebug(2,Form("%s: set EMCAL acceptance cuts",GetName()));
201  break;
202  case kDCALfid:
203  AliDebug(2,Form("%s: set EMCAL acceptance cuts",GetName()));
205  break;
206  case kDCAL:
207  AliDebug(2,Form("%s: set EMCAL acceptance cuts",GetName()));
209  break;
210  case kUser:
211  break;
212  }
213 }
214 
215 
222 {
223  fGeom = AliEMCALGeometry::GetInstance();
224  if (!fGeom) {
225  AliError(Form("%s: Can not create geometry", GetName()));
226  return;
227  }
228 }
229 
237 void AliJetContainer::LoadRho(const AliVEvent *event)
238 {
239  if (!fRhoName.IsNull() && !fRho) {
240  fRho = dynamic_cast<AliRhoParameter*>(event->FindListObject(fRhoName));
241  if (!fRho) {
242  AliError(Form("%s: Could not retrieve rho %s!", GetName(), fRhoName.Data()));
243  return;
244  }
245  }
246 }
247 
256 void AliJetContainer::LoadLocalRho(const AliVEvent *event)
257 {
258  if (!fLocalRhoName.IsNull() && !fLocalRho) {
259  fLocalRho = dynamic_cast<AliLocalRhoParameter*>(event->FindListObject(fLocalRhoName));
260  if (!fLocalRho) {
261  AliError(Form("%s: Could not retrieve rho %s!", GetName(), fLocalRhoName.Data()));
262  return;
263  }
264  }
265 }
266 
275 void AliJetContainer::LoadRhoMass(const AliVEvent *event)
276 {
277  if (!fRhoMassName.IsNull() && !fRhoMass) {
278  fRhoMass = dynamic_cast<AliRhoParameter*>(event->FindListObject(fRhoMassName));
279  if (!fRhoMass) {
280  AliError(Form("%s: Could not retrieve rho_mass %s!", GetName(), fRhoMassName.Data()));
281  return;
282  }
283  }
284 }
285 
293 {
294  TString option(opt);
295  option.ToLower();
296 
297  Int_t tempID = fCurrentID;
298  ResetCurrentID();
299 
300  AliEmcalJet *jetMax = GetNextAcceptJet();
301  AliEmcalJet *jet = 0;
302 
303  if (option.Contains("rho")) {
304  while ((jet = GetNextAcceptJet())) {
305  if ( (jet->Pt()-jet->Area()*GetRhoVal()) > (jetMax->Pt()-jetMax->Area()*GetRhoVal()) )
306  jetMax = jet;
307  }
308  }
309  else {
310  while ((jet = GetNextAcceptJet())) {
311  if (jet->Pt() > jetMax->Pt()) jetMax = jet;
312  }
313  }
314 
315  fCurrentID = tempID;
316 
317  return jetMax;
318 }
319 
326 {
327  if (i < 0 || i > fClArray->GetEntriesFast()) return 0;
328  AliEmcalJet *jet = static_cast<AliEmcalJet*>(fClArray->At(i));
329  return jet;
330 
331 }
332 
340 {
341  UInt_t rejectionReason = 0;
342  AliEmcalJet *jet = GetJet(i);
343  if(!AcceptJet(jet, rejectionReason)) return 0;
344 
345  return jet;
346 }
347 
355 {
356  const Int_t njets = GetNEntries();
357  AliEmcalJet *jet = 0;
358  do {
359  fCurrentID++;
360  if (fCurrentID >= njets) break;
361  jet = GetAcceptJet(fCurrentID);
362  } while (!jet);
363 
364  return jet;
365 }
366 
374 {
375  const Int_t njets = GetNEntries();
376  AliEmcalJet *jet = 0;
377  do {
378  fCurrentID++;
379  if (fCurrentID >= njets) break;
380  jet = GetJet(fCurrentID);
381  } while (!jet);
382 
383 
384  return jet;
385 }
386 
393 Double_t AliJetContainer::GetJetPtCorr(Int_t i) const
394 {
395  AliEmcalJet *jet = GetJet(i);
396  return jet->Pt() - fRho->GetVal()*jet->Area();
397 }
398 
405 Double_t AliJetContainer::GetJetPtCorrLocal(Int_t i) const
406 {
407  AliEmcalJet *jet = GetJet(i);
408 
409  return jet->Pt() - fLocalRho->GetLocalVal(jet->Phi(), fJetRadius)*jet->Area();
410 }
411 
419 Bool_t AliJetContainer::GetMomentumFromJet(TLorentzVector &mom, const AliEmcalJet* jet, Double_t mass) const
420 {
421  Double_t p = jet->P();
422  Double_t e = TMath::Sqrt(mass*mass + p*p);
423 
424  mom.SetPtEtaPhiE(jet->Pt(), jet->Eta(), jet->Phi(), e);
425 
426  return kTRUE;
427 }
428 
436 Bool_t AliJetContainer::GetMomentumFromJet(TLorentzVector &mom, const AliEmcalJet* jet) const
437 {
438  if (jet) {
439  if (fMassHypothesis >= 0) {
440  GetMomentumFromJet(mom, jet, fMassHypothesis);
441  }
442  else {
443  jet->GetMomentum(mom);
444  }
445  return kTRUE;
446  }
447  else {
448  mom.SetPtEtaPhiM(0, 0, 0, 0);
449  return kFALSE;
450  }
451 }
452 
461 Bool_t AliJetContainer::GetMomentum(TLorentzVector &mom, Int_t i) const
462 {
463  AliEmcalJet *jet = GetJet(i);
464  return GetMomentumFromJet(mom, jet);
465 }
466 
475 Bool_t AliJetContainer::GetNextMomentum(TLorentzVector &mom)
476 {
477  AliEmcalJet *jet = GetNextJet();
478  return GetMomentumFromJet(mom, jet);
479 }
480 
490 Bool_t AliJetContainer::GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
491 {
492  AliEmcalJet *jet = GetAcceptJet(i);
493  return GetMomentumFromJet(mom, jet);
494 }
495 
504 Bool_t AliJetContainer::GetNextAcceptMomentum(TLorentzVector &mom)
505 {
506  AliEmcalJet *jet = GetNextAcceptJet();
507  return GetMomentumFromJet(mom, jet);
508 }
509 
516 Bool_t AliJetContainer::AcceptJet(const AliEmcalJet *jet, UInt_t &rejectionReason) const
517 {
518  if (fTpcHolePos>0) {
519  Bool_t s = CheckTpcHolesOverlap(jet,rejectionReason);
520  if (!s) return kFALSE;
521  }
522 
523  Bool_t r = ApplyJetCuts(jet, rejectionReason);
524  if (!r) return kFALSE;
525 
526  AliTLorentzVector mom;
527  GetMomentumFromJet(mom, jet);
528 
529  return ApplyKinematicCuts(mom, rejectionReason);
530 }
531 
538 Bool_t AliJetContainer::AcceptJet(Int_t i, UInt_t &rejectionReason) const
539 {
540  if (fTpcHolePos>0) {
541  Bool_t s = CheckTpcHolesOverlap(GetJet(i),rejectionReason);
542  if (!s) return kFALSE;
543  }
544 
545  Bool_t r = ApplyJetCuts(GetJet(i), rejectionReason);
546  if (!r) return kFALSE;
547 
548  AliTLorentzVector mom;
549  GetMomentum(mom, i);
550 
551  return ApplyKinematicCuts(mom, rejectionReason);
552 }
553 
560 Bool_t AliJetContainer::ApplyJetCuts(const AliEmcalJet *jet, UInt_t &rejectionReason) const
561 {
562  // Return true if jet is accepted.
563 
564  if (!jet) {
565  AliDebug(11,"No jet found");
566  rejectionReason |= kNullObject;
567  return kFALSE;
568  }
569 
570  if (jet->TestBits(fBitMap) != (Int_t)fBitMap) {
571  AliDebug(11,"Cut rejecting jet: Bit map");
572  rejectionReason |= kBitMapCut;
573  return kFALSE;
574  }
575 
576  if (jet->Area() <= fJetAreaCut) {
577  AliDebug(11,"Cut rejecting jet: Area");
578  rejectionReason |= kAreaCut;
579  return kFALSE;
580  }
581 
582  if (jet->AreaEmc() < fAreaEmcCut) {
583  AliDebug(11,"Cut rejecting jet: AreaEmc");
584  rejectionReason |= kAreaEmcCut;
585  return kFALSE;
586  }
587 
589  AliDebug(11,"Cut rejecting jet: ZLeading");
590  rejectionReason |= kZLeadingChCut;
591  return kFALSE;
592  }
593 
594  if (fZLeadingEmcCut < 1 && GetZLeadingEmc(jet) > fZLeadingEmcCut) {
595  AliDebug(11,"Cut rejecting jet: ZLeadEmc");
596  rejectionReason |= kZLeadingEmcCut;
597  return kFALSE;
598  }
599 
600  if (jet->NEF() < fNEFMinCut || jet->NEF() > fNEFMaxCut) {
601  AliDebug(11,"Cut rejecting jet: NEF");
602  rejectionReason |= kNEFCut;
603  return kFALSE;
604  }
605 
607  AliDebug(11,"Cut rejecting jet: minimum number of constituents");
608  rejectionReason |= kMinNConstituents;
609  return kFALSE;
610  }
611 
612  if (fLeadingHadronType == 0) {
613  if (jet->MaxTrackPt() < fMinTrackPt) {
614  AliDebug(11,"Cut rejecting jet: Bias");
615  rejectionReason |= kMinLeadPtCut;
616  return kFALSE;
617  }
618  }
619  else if (fLeadingHadronType == 1) {
620  if (jet->MaxClusterPt() < fMinClusterPt) {
621  AliDebug(11,"Cut rejecting jet: Bias");
622  rejectionReason |= kMinLeadPtCut;
623  return kFALSE;
624  }
625  }
626  else {
627  if (jet->MaxTrackPt() < fMinTrackPt && jet->MaxClusterPt() < fMinClusterPt) {
628  AliDebug(11,"Cut rejecting jet: Bias");
629  rejectionReason |= kMinLeadPtCut;
630  return kFALSE;
631  }
632  }
633 
634  if (jet->MaxTrackPt() > fMaxTrackPt) {
635  AliDebug(11,"Cut rejecting jet: MaxTrackPt");
636  rejectionReason |= kMaxTrackPtCut;
637  return kFALSE;
638 
639  }
640 
641  if (jet->MaxClusterPt() > fMaxClusterPt) {
642  AliDebug(11,"Cut rejecting jet: MaxClusPt");
643  rejectionReason |= kMaxClusterPtCut;
644  return kFALSE;
645  }
646 
648  AliDebug(11,"Cut rejecting jet: Flavour");
649  rejectionReason |= kFlavourCut;
650  return kFALSE;
651  }
652 
653  if (fTagStatus>-1 && jet->GetTagStatus()!=fTagStatus) {
654  AliDebug(11,"Cut rejecting jet: tag status");
655  rejectionReason |= kTagStatus;
656  return kFALSE;
657  }
658 
659  return kTRUE;
660 }
661 
670 {
671  if (fLeadingHadronType == 0) // charged leading hadron
672  return jet->MaxTrackPt();
673  else if (fLeadingHadronType == 1) // neutral leading hadron
674  return jet->MaxClusterPt();
675  else // charged or neutral
676  return jet->MaxPartPt();
677 }
678 
685 void AliJetContainer::GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
686 {
687  Double_t maxClusterPt = 0;
688  Double_t maxClusterEta = 0;
689  Double_t maxClusterPhi = 0;
690 
691  Double_t maxTrackPt = 0;
692  Double_t maxTrackEta = 0;
693  Double_t maxTrackPhi = 0;
694 
695  if (fClusterContainer && fClusterContainer->GetArray() && (fLeadingHadronType == 1 || fLeadingHadronType == 2)) {
696  AliVCluster *cluster = jet->GetLeadingCluster(fClusterContainer->GetArray());
697  if (cluster) {
698  TLorentzVector nPart;
699  cluster->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
700 
701  maxClusterEta = nPart.Eta();
702  maxClusterPhi = nPart.Phi();
703  maxClusterPt = nPart.Pt();
704  }
705  }
706 
707  if (fParticleContainer && fParticleContainer->GetArray() && (fLeadingHadronType == 0 || fLeadingHadronType == 2)) {
708  AliVParticle *track = jet->GetLeadingTrack(fParticleContainer->GetArray());
709  if (track) {
710  maxTrackEta = track->Eta();
711  maxTrackPhi = track->Phi();
712  maxTrackPt = track->Pt();
713  }
714  }
715 
716  if (maxTrackPt > maxClusterPt)
717  mom.SetPtEtaPhiM(maxTrackPt,maxTrackEta,maxTrackPhi,0.139);
718  else
719  mom.SetPtEtaPhiM(maxClusterPt,maxClusterEta,maxClusterPhi,0.139);
720 }
721 
729 {
730  if (fClusterContainer && fClusterContainer->GetArray()) {
731  TLorentzVector mom;
732 
733  AliVCluster *cluster = jet->GetLeadingCluster(fClusterContainer->GetArray());
734  if (cluster) {
735  cluster->GetMomentum(mom, fVertex);
736 
737  return GetZ(jet,mom);
738  }
739  else {
740  return -1;
741  }
742  }
743  else {
744  return -1;
745  }
746 }
747 
755 {
756 
757  if (fParticleContainer && fParticleContainer->GetArray() ) {
758  TLorentzVector mom;
759 
760  AliVParticle *track = jet->GetLeadingTrack(fParticleContainer->GetArray());
761  if (track) {
762  mom.SetPtEtaPhiM(track->Pt(),track->Eta(),track->Phi(),0.139);
763 
764  return GetZ(jet,mom);
765  }
766  else {
767  return -1;
768  }
769  }
770  else {
771  return -1;
772  }
773 }
774 
782 Double_t AliJetContainer::GetZ(const AliEmcalJet *jet, const TLorentzVector& mom) const
783 {
784  Double_t pJetSq = jet->Px()*jet->Px() + jet->Py()*jet->Py() + jet->Pz()*jet->Pz();
785 
786  if (pJetSq < 1e-6) {
787  AliWarning(Form("%s: strange, pjet*pjet seems to be zero pJetSq: %.3f",GetName(), pJetSq));
788  return 0;
789  }
790 
791  Double_t z = (mom.Px()*jet->Px() + mom.Py()*jet->Py() + mom.Pz()*jet->Pz()) / pJetSq;
792 
793  if (z < 0) {
794  AliWarning(Form("%s: z = %.3ff < 0, returning 0...",GetName(), z));
795  z = 0;
796  }
797 
798  return z;
799 }
800 
808 {
809  if (!fGeom) SetEMCALGeometry();
810  if (fGeom) {
811  SetEtaLimits(fGeom->GetArm1EtaMin() + r, fGeom->GetArm1EtaMax() - r);
812 
813  if(fRunNumber >= 177295 && fRunNumber <= 197470) {//small SM masked in 2012 and 2013
814  SetPhiLimits(1.405 + r, 3.135 - r);
815  }
816  else {
817  SetPhiLimits(fGeom->GetArm1PhiMin() * TMath::DegToRad() + r, fGeom->GetEMCALPhiMax() * TMath::DegToRad() - r);
818  }
819  }
820  else {
821  AliWarning("Could not get instance of AliEMCALGeometry. Using manual settings for EMCAL year 2011!!");
822  SetEtaLimits(-0.7 + r, 0.7 - r);
823  SetPhiLimits(1.405 + r, 3.135 - r);
824  }
825 }
826 
834 {
835  if (!fGeom) SetEMCALGeometry();
836  if (fGeom) {
837  SetEtaLimits(fGeom->GetArm1EtaMin() + r, fGeom->GetArm1EtaMax() - r);
838  SetPhiLimits(fGeom->GetDCALPhiMin() * TMath::DegToRad() + r, fGeom->GetDCALPhiMax() * TMath::DegToRad() - r);
839  }
840  else {
841  AliWarning("Could not get instance of AliEMCALGeometry. Using manual settings for DCAL year 2015!!");
842  SetEtaLimits(-0.7 + r, 0.7 - r);
843  SetPhiLimits(4.538 + r, 5.727 - r);
844  }
845 }
846 
853 {
854  SetEtaLimits(-0.9 + r, 0.9 - r);
855  SetPhiLimits(0, 0); // No cut on phi
856 }
857 
862 {
863  TString arrName = GetArrayName();
864  Printf("Print jet cuts for %s",arrName.Data());
865  Printf("PtBiasJetTrack: %f",fMinTrackPt);
866  Printf("PtBiasJetClus: %f",fMinClusterPt);
867  Printf("JetPtCut: %f", fMinPt);
868  Printf("JetPtCutMax: %f", fMaxPt);
869  Printf("JetAreaCut: %f",fJetAreaCut);
870  Printf("AreaEmcCut: %f",fAreaEmcCut);
871  Printf("JetMinEta: %f", fMinEta);
872  Printf("JetMaxEta: %f", fMaxEta);
873  Printf("JetMinPhi: %f", fMinPhi);
874  Printf("JetMaxPhi: %f", fMaxPhi);
875  Printf("MaxClusterPt: %f",fMaxClusterPt);
876  Printf("MaxTrackPt: %f",fMaxTrackPt);
877  Printf("LeadingHadronType: %d",fLeadingHadronType);
878  Printf("ZLeadingEmcCut: %f",fZLeadingEmcCut);
879  Printf("ZLeadingChCut: %f",fZLeadingChCut);
880 }
881 
886 {
887  fMinTrackPt = 0;
888  fMinClusterPt = 0;
889  fMinPt = 0;
890  fJetAreaCut = -1;
891  fAreaEmcCut = -1;
892  fMinEta = -0.9;
893  fMaxEta = 0.9;
894  fMinPhi = 0;
895  fMaxPhi = 10;
896  fMaxClusterPt = 1000;
897  fMaxTrackPt = 100;
898  fLeadingHadronType = 0;
899  fZLeadingEmcCut = 10.;
900  fZLeadingChCut = 10.;
901 }
902 
908 {
909  return accepted().GetEntries();
910 }
911 
922 {
923  AliEmcalJet *jet2 = jet1->ClosestJet();
924  if (!jet2) return -1;
925 
926  Double_t jetPt2 = jet2->Pt();
927  if (jetPt2 <= 0) return -1;
928 
929  Int_t bgeom = kTRUE;
930  if (!cont2) bgeom = kFALSE;
931  Double_t sumPt = 0.;
932  AliVParticle *vpf = 0x0;
933  Int_t iFound = 0;
934  for (Int_t icc = 0; icc < jet2->GetNumberOfTracks(); icc++) {
935  Int_t idx = (Int_t)jet2->TrackAt(icc);
936  //get particle
937  AliVParticle *p2 = 0x0;
938  if (bgeom) p2 = static_cast<AliVParticle*>(jet2->TrackAt(icc, cont2->GetArray()));
939  iFound = 0;
940  for (Int_t icf = 0; icf < jet1->GetNumberOfTracks(); icf++) {
941  if (!bgeom && idx == jet1->TrackAt(icf) && iFound == 0 ) {
942  iFound = 1;
943  vpf = static_cast<AliVParticle*>(jet1->TrackAt(icf, fParticleContainer->GetArray()));
944  if (vpf) sumPt += vpf->Pt();
945  continue;
946  }
947  if (bgeom){
948  vpf = static_cast<AliVParticle*>(jet1->TrackAt(icf, fParticleContainer->GetArray()));
949  if (!vpf) continue;
950  if (!SamePart(vpf, p2, 1.e-4)) continue; //not the same particle
951  sumPt += vpf->Pt();
952  }
953  }
954  }
955 
956  Double_t fraction = sumPt / jetPt2;
957 
958  return fraction;
959 }
960 
972 TString AliJetContainer::GenerateJetName(EJetType_t jetType, EJetAlgo_t jetAlgo, ERecoScheme_t recoScheme, Double_t radius, AliParticleContainer* partCont, AliClusterContainer* clusCont, TString tag)
973 {
974  TString algoString;
975  switch (jetAlgo)
976  {
977  case kt_algorithm:
978  algoString = "KT";
979  break;
980  case antikt_algorithm:
981  algoString = "AKT";
982  break;
983  default:
984  ::Warning("AliJetContainer::GenerateJetName", "Unknown jet finding algorithm '%d'!", jetAlgo);
985  algoString = "";
986  }
987 
988  TString typeString;
989  switch (jetType) {
990  case kFullJet:
991  typeString = "Full";
992  break;
993  case kChargedJet:
994  typeString = "Charged";
995  break;
996  case kNeutralJet:
997  typeString = "Neutral";
998  break;
999  }
1000 
1001  TString radiusString = TString::Format("R%03.0f", radius*100.0);
1002 
1003  TString trackString;
1004  if (jetType != kNeutralJet && partCont) {
1005  trackString = "_" + TString(partCont->GetTitle());
1006  }
1007 
1008  TString clusterString;
1009  if (jetType != kChargedJet && clusCont) {
1010  clusterString = "_" + TString(clusCont->GetTitle());
1011  }
1012 
1013  TString recombSchemeString;
1014  switch (recoScheme) {
1015  case E_scheme:
1016  recombSchemeString = "E_scheme";
1017  break;
1018  case pt_scheme:
1019  recombSchemeString = "pt_scheme";
1020  break;
1021  case pt2_scheme:
1022  recombSchemeString = "pt2_scheme";
1023  break;
1024  case Et_scheme:
1025  recombSchemeString = "Et_scheme";
1026  break;
1027  case Et2_scheme:
1028  recombSchemeString = "Et2_scheme";
1029  break;
1030  case BIpt_scheme:
1031  recombSchemeString = "BIpt_scheme";
1032  break;
1033  case BIpt2_scheme:
1034  recombSchemeString = "BIpt2_scheme";
1035  break;
1036  case external_scheme:
1037  recombSchemeString = "ext_scheme";
1038  break;
1039  default:
1040  ::Error("AliJetContainer::GenerateJetName", "Recombination %d scheme not recognized.", recoScheme);
1041  }
1042 
1043  TString name = TString::Format("%s_%s%s%s%s%s_%s",
1044  tag.Data(), algoString.Data(), typeString.Data(), radiusString.Data(), trackString.Data(), clusterString.Data(), recombSchemeString.Data());
1045 
1046  return name;
1047 }
1048 
1055  return AliJetIterableContainer(this, false);
1056 }
1057 
1064  return AliJetIterableContainer(this, true);
1065 }
1066 
1073  return AliJetIterableMomentumContainer(this, false);
1074 }
1075 
1082  return AliJetIterableMomentumContainer(this, true);
1083 }
1084 
1090 const char* AliJetContainer::GetTitle() const
1091 {
1092  static TString jetString;
1093 
1094  if (GetMinPt() == 0) {
1095  jetString = TString::Format("_%s_pT0000", GetArrayName().Data());
1096  }
1097  else if (GetMinPt() < 1.0) {
1098  jetString = TString::Format("_%s_pT0%3.0f", GetArrayName().Data(), GetMinPt()*1000.0);
1099  }
1100  else {
1101  jetString = TString::Format("_%s_pT%4.0f", GetArrayName().Data(), GetMinPt()*1000.0);
1102  }
1103 
1104  return jetString.Data();
1105 }
1106 
1112 Bool_t AliJetContainer::CheckTpcHolesOverlap(const AliEmcalJet *jet, UInt_t &rejectionReason) const
1113 {
1114  if (!jet) {
1115  AliDebug(11,"No jet found");
1116  rejectionReason |= kNullObject;
1117  return kFALSE;
1118  }
1119 
1120  Double_t disthole = RelativePhi(jet->Phi(), fTpcHolePos);
1121  if (TMath::Abs(disthole) < (fTpcHoleWidth + fJetRadius)){
1122  AliDebug(11,"Jet overlaps with TPC hole");
1123  rejectionReason |= kOverlapTpcHole;
1124  return kFALSE;
1125  }
1126 
1127  return kTRUE;
1128 }
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.