AliPhysics  master (3d17d9d)
AliEmcalJetTask.cxx
Go to the documentation of this file.
1 /**************************************************************************************
2  * Copyright (C) 2016, Copyright Holders of the ALICE Collaboration *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions are met: *
7  * * Redistributions of source code must retain the above copyright *
8  * notice, this list of conditions and the following disclaimer. *
9  * * Redistributions in binary form must reproduce the above copyright *
10  * notice, this list of conditions and the following disclaimer in the *
11  * documentation and/or other materials provided with the distribution. *
12  * * Neither the name of the <organization> nor the *
13  * names of its contributors may be used to endorse or promote products *
14  * derived from this software without specific prior written permission. *
15  * *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19  * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26  **************************************************************************************/
27 #include <vector>
28 
29 #include <TClonesArray.h>
30 #include <TMath.h>
31 #include <TRandom3.h>
32 #include <TGrid.h>
33 #include <TFile.h>
34 
35 #include <AliVCluster.h>
36 #include <AliVEvent.h>
37 #include <AliVParticle.h>
38 #include <AliEMCALGeometry.h>
39 
40 #include <AliAnalysisManager.h>
41 #include <AliVEventHandler.h>
42 #include <AliMultiInputEventHandler.h>
43 
44 #include "AliTLorentzVector.h"
45 #include "AliEmcalJet.h"
46 #include "AliEmcalParticle.h"
47 #include "AliFJWrapper.h"
48 #include "AliEmcalJetUtility.h"
49 #include "AliParticleContainer.h"
50 #include "AliClusterContainer.h"
53 
54 #include "AliEmcalJetTask.h"
55 
56 using std::cout;
57 using std::endl;
58 using std::cerr;
59 
61 ClassImp(AliEmcalJetTask);
63 
65 
72  fJetsTag(),
73  fJetType(AliJetContainer::kFullJet),
74  fJetAlgo(AliJetContainer::antikt_algorithm),
75  fRecombScheme(AliJetContainer::pt_scheme),
76  fRadius(0.4),
77  fMinJetArea(0.001),
78  fMinJetPt(1.0),
79  fJetPhiMin(-10),
80  fJetPhiMax(+10),
81  fJetEtaMin(-1),
82  fJetEtaMax(+1),
83  fGhostArea(0.005),
84  fTrackEfficiency(1.),
85  fQoverPtShift(0.),
86  fUtilities(0),
87  fTrackEfficiencyOnlyForEmbedding(kFALSE),
88  fTrackEfficiencyFunction(nullptr),
89  fApplyArtificialTrackingEfficiency(kFALSE),
90  fApplyQoverPtShift(kFALSE),
91  fRandom(0),
92  fLocked(0),
93  fFillConstituents(kTRUE),
94  fJetsName(),
95  fIsInit(0),
96  fIsPSelSet(0),
97  fIsEmcPart(0),
98  fEnableAliBasicParticleCompatibility(kFALSE),
99  fLegacyMode(kFALSE),
100  fFillGhost(kFALSE),
101  fJets(0),
102  fFastJetWrapper("AliEmcalJetTask","AliEmcalJetTask"),
103  fClusterContainerIndexMap(),
104  fParticleContainerIndexMap()
105 {
106 }
107 
113  AliAnalysisTaskEmcal(name),
114  fJetsTag("Jets"),
115  fJetType(AliJetContainer::kFullJet),
116  fJetAlgo(AliJetContainer::antikt_algorithm),
117  fRecombScheme(AliJetContainer::pt_scheme),
118  fRadius(0.4),
119  fMinJetArea(0.001),
120  fMinJetPt(1.0),
121  fJetPhiMin(-10),
122  fJetPhiMax(+10),
123  fJetEtaMin(-1),
124  fJetEtaMax(+1),
125  fGhostArea(0.005),
126  fTrackEfficiency(1.),
127  fQoverPtShift(0.),
128  fUtilities(0),
132  fApplyQoverPtShift(kFALSE),
133  fRandom(0),
134  fLocked(0),
135  fFillConstituents(kTRUE),
136  fJetsName(),
137  fIsInit(0),
138  fIsPSelSet(0),
139  fIsEmcPart(0),
141  fLegacyMode(kFALSE),
142  fFillGhost(kFALSE),
143  fJets(0),
144  fFastJetWrapper(name,name),
147 {
148 }
149 
154 {
155 }
156 
162 {
163  if (!fUtilities) fUtilities = new TObjArray();
164  if (fUtilities->FindObject(utility)) {
165  Error("AddUtility", "Jet utility %s already connected.", utility->GetName());
166  return utility;
167  }
168  fUtilities->Add(utility);
169  utility->SetJetTask(this);
170 
171  return utility;
172 }
173 
179 {
180  TIter next(fUtilities);
181  AliEmcalJetUtility *utility = 0;
182  while ((utility=static_cast<AliEmcalJetUtility*>(next()))) utility->Init();
183 }
189 {
190  TIter next(fUtilities);
191  AliEmcalJetUtility *utility = 0;
192  while ((utility=static_cast<AliEmcalJetUtility*>(next()))) utility->InitEvent(fFastJetWrapper);
193 }
194 
201 {
202  TIter next(fUtilities);
203  AliEmcalJetUtility *utility = 0;
204  while ((utility=static_cast<AliEmcalJetUtility*>(next()))) utility->Prepare(fFastJetWrapper);
205 }
206 
212 {
213  TIter next(fUtilities);
214  AliEmcalJetUtility *utility = 0;
215  while ((utility=static_cast<AliEmcalJetUtility*>(next()))) utility->ProcessJet(jet, ij, fFastJetWrapper);
216 }
217 
223 {
224  TIter next(fUtilities);
225  AliEmcalJetUtility *utility = 0;
226  while ((utility=static_cast<AliEmcalJetUtility*>(next()))) utility->Terminate(fFastJetWrapper);
227 }
228 
234 {
235  InitEvent();
236  // clear the jet array (normally a null operation)
237  fJets->Delete();
238  Int_t n = FindJets();
239 
240  if (n == 0) return kFALSE;
241 
242  FillJetBranch();
243 
244  return kTRUE;
245 }
246 
255 {
256  if (fParticleCollArray.GetEntriesFast() == 0 && fClusterCollArray.GetEntriesFast() == 0){
257  AliError("No tracks or clusters, returning.");
258  return 0;
259  }
260 
262 
263  AliDebug(2,Form("Jet type = %d", fJetType));
264 
265  Int_t iColl = 1;
266  TIter nextPartColl(&fParticleCollArray);
267  AliParticleContainer* tracks = 0;
268  while ((tracks = static_cast<AliParticleContainer*>(nextPartColl()))) {
269  AliDebug(2,Form("Tracks from collection %d: '%s'. Embedded: %i, nTracks: %i", iColl-1, tracks->GetName(), tracks->GetIsEmbedding(), tracks->GetNParticles()));
271  for (AliParticleIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
272 
273  // Apply artificial track inefficiency, if supplied (either constant or pT-dependent)
275  if (fTrackEfficiencyOnlyForEmbedding == kFALSE || (fTrackEfficiencyOnlyForEmbedding == kTRUE && tracks->GetIsEmbedding())) {
276  Double_t trackEfficiency = fTrackEfficiencyFunction->Eval(it->first.Pt());
277  Double_t rnd = fRandom.Rndm();
278  if (trackEfficiency < rnd) {
279  AliDebug(2,Form("Track %d rejected due to artificial tracking inefficiency", it.current_index()));
280  continue;
281  }
282  }
283  }
284 
285  TLorentzVector pvec(it->first.Px(), it->first.Py(), it->first.Pz(), it->first.E());
286  if(fApplyQoverPtShift){
287  AliDebugStream(2) << "Q/pt shift enabled" << std::endl;
288  if(TMath::Abs(fQoverPtShift) > DBL_EPSILON) {
289  AliDebugStream(2) << "Applying Q/pt shift " << fQoverPtShift << std::endl;
290  double chargedval = it->second->Charge() > 0 ? 1. : -1.;
291  double shiftedPt = TMath::Max(1/(chargedval * fQoverPtShift + 1/TMath::Abs(it->second->Pt())), 0.);
292  // Calculate new momentum vector
293  TVector3 shiftedmom;
294  shiftedmom.SetPtEtaPhi(shiftedPt, pvec.Eta(), pvec.Phi());
295  double oldE = pvec.E(), oldp = pvec.P(), newp = shiftedmom.Mag();
296  double shiftedE = TMath::Sqrt(oldE * oldE - oldp * oldp + newp * newp);
297  pvec.SetPtEtaPhiE(shiftedPt, pvec.Eta(), pvec.Phi(), shiftedE);
298  AliDebugStream(2) << "Original pt " << it->second->Pt() << ", shifted pt " << shiftedPt << std::endl;
299  }
300  }
301 
302  AliDebug(2,Form("Track %d accepted (label = %d, pt = %f, eta = %f, phi = %f, E = %f, m = %f, px = %f, py = %f, pz = %f)", it.current_index(), it->second->GetLabel(), pvec.Pt(), pvec.Eta(), pvec.Phi(), pvec.E(), it->first.M(), pvec.Px(), pvec.Py(), pvec.Pz()));
303  Int_t uid = it.current_index() + fgkConstIndexShift * iColl;
304  fFastJetWrapper.AddInputVector(pvec.Px(), pvec.Py(), pvec.Pz(), pvec.E(), uid);
305  }
306  iColl++;
307  }
308 
309  iColl = 1;
310  TIter nextClusColl(&fClusterCollArray);
311  AliClusterContainer* clusters = 0;
312  while ((clusters = static_cast<AliClusterContainer*>(nextClusColl()))) {
313  AliDebug(2,Form("Clusters from collection %d: '%s'. Embedded: %i, nClusters: %i", iColl-1, clusters->GetName(), clusters->GetIsEmbedding(), clusters->GetNClusters()));
315  for (AliClusterIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
316  AliDebug(2,Form("Cluster %d accepted (label = %d, energy = %.3f)", it.current_index(), it->second->GetLabel(), it->first.E()));
317  Int_t uid = -it.current_index() - fgkConstIndexShift * iColl;
318  fFastJetWrapper.AddInputVector(it->first.Px(), it->first.Py(), it->first.Pz(), it->first.E(), uid);
319  }
320  iColl++;
321  }
322 
323  if (fFastJetWrapper.GetInputVectors().size() == 0) return 0;
324 
325  // run jet finder
327 
328  return fFastJetWrapper.GetInclusiveJets().size();
329 }
330 
337 {
339 
340  // loop over fastjet jets
341  std::vector<fastjet::PseudoJet> jets_incl = fFastJetWrapper.GetInclusiveJets();
342  // sort jets according to jet pt
343  static Int_t indexes[9999] = {-1};
344  GetSortedArray(indexes, jets_incl);
345 
346  AliDebug(1,Form("%d jets found", (Int_t)jets_incl.size()));
347  for (UInt_t ijet = 0, jetCount = 0; ijet < jets_incl.size(); ++ijet) {
348  Int_t ij = indexes[ijet];
349  AliDebug(3,Form("Jet pt = %f, area = %f", jets_incl[ij].perp(), fFastJetWrapper.GetJetArea(ij)));
350 
351  if (jets_incl[ij].perp() < fMinJetPt) continue;
352  if (fFastJetWrapper.GetJetArea(ij) < fMinJetArea) continue;
353  if ((jets_incl[ij].eta() < fJetEtaMin) || (jets_incl[ij].eta() > fJetEtaMax) ||
354  (jets_incl[ij].phi() < fJetPhiMin) || (jets_incl[ij].phi() > fJetPhiMax))
355  continue;
356 
357  AliEmcalJet *jet = new ((*fJets)[jetCount])
358  AliEmcalJet(jets_incl[ij].perp(), jets_incl[ij].eta(), jets_incl[ij].phi(), jets_incl[ij].m());
359  jet->SetLabel(ij);
360 
361  fastjet::PseudoJet area(fFastJetWrapper.GetJetAreaVector(ij));
362  jet->SetArea(area.perp());
363  jet->SetAreaEta(area.eta());
364  jet->SetAreaPhi(area.phi());
365  jet->SetAreaE(area.E());
367 
368  // Fill constituent info
369  std::vector<fastjet::PseudoJet> constituents(fFastJetWrapper.GetJetConstituents(ij));
370  FillJetConstituents(jet, constituents, constituents);
371 
372  if (fGeom) {
373  if ((jet->Phi() > fGeom->GetArm1PhiMin() * TMath::DegToRad()) &&
374  (jet->Phi() < fGeom->GetArm1PhiMax() * TMath::DegToRad()) &&
375  (jet->Eta() > fGeom->GetArm1EtaMin()) &&
376  (jet->Eta() < fGeom->GetArm1EtaMax()))
377  jet->SetAxisInEmcal(kTRUE);
378  }
379 
380  ExecuteUtilities(jet, ij);
381 
382  AliDebug(2,Form("Added jet n. %d, pt = %f, area = %f, constituents = %d", jetCount, jet->Pt(), jet->Area(), jet->GetNumberOfConstituents()));
383  jetCount++;
384  }
385 
387 }
388 
395 Bool_t AliEmcalJetTask::GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const
396 {
397  static Float_t pt[9999] = {0};
398 
399  const Int_t n = (Int_t)array.size();
400 
401  if (n < 1)
402  return kFALSE;
403 
404  for (Int_t i = 0; i < n; i++)
405  pt[i] = array[i].perp();
406 
407  TMath::Sort(n, pt, indexes);
408 
409  return kTRUE;
410 }
411 
418 {
419 
420  // If a constant artificial track efficiency is supplied, create a TF1 that is constant in pT
421  if (fTrackEfficiency < 1.) {
422  // If a TF1 was already loaded, throw an error
424  AliError(Form("%s: fTrackEfficiencyFunction was already loaded! Do not apply multiple artificial track efficiencies.", GetName()));
425  }
426 
427  fTrackEfficiencyFunction = new TF1("trackEfficiencyFunction", "[0]", 0., fMaxBinPt);
428  fTrackEfficiencyFunction->SetParameter(0, fTrackEfficiency);
430  }
431 
432  // If artificial tracking efficiency is enabled (either constant or pT-depdendent), set up random number generator
434  fRandom.SetSeed(0);
435  }
436 
438  std::cout << GetName() << ": Name of the jet container: " << fJetsName << std::endl;
439  std::cout << "Use this name in order to connect jet containers in your task to connect to the collection of jets found by this jet finder" << std::endl;
440  if(auto partcont = GetParticleContainer(0)) {
441  std::cout << "Found particle container with name " << partcont->GetName() << std::endl;
442  } else {
443  std::cout << "Not particle container found for task" << std::endl;
444  }
445  if(auto clustcont = GetClusterContainer(0)){
446  std::cout << "Found cluster container with name " << clustcont->GetName() << std::endl;
447  } else {
448  std::cout << "Not cluster container found for task" << std::endl;
449  }
450 
451  // add jets to event if not yet there
452  if (!(InputEvent()->FindListObject(fJetsName))) {
453  fJets = new TClonesArray("AliEmcalJet");
454  fJets->SetName(fJetsName);
455  ::Info("AliEmcalJetTask::ExecOnce", "Jet collection with name '%s' has been added to the event.", fJetsName.Data());
456  InputEvent()->AddObject(fJets);
457  }
458  else {
459  AliError(Form("%s: Object with name %s already in event! Returning", GetName(), fJetsName.Data()));
460  return;
461  }
462 
463  // setup fj wrapper
464  fFastJetWrapper.SetAreaType(fastjet::active_area_explicit_ghosts);
470 
471 
472  // setting legacy mode
473  if (fLegacyMode) {
475  }
476 
477  InitUtilities();
478 
480 
481  // Setup container utils. Must be called after AliAnalysisTaskEmcal::ExecOnce() so that the
482  // containers' arrays are setup.
485 }
486 
496 void AliEmcalJetTask::FillJetConstituents(AliEmcalJet *jet, std::vector<fastjet::PseudoJet>& constituents,
497  std::vector<fastjet::PseudoJet>& constituents_unsub, Int_t flag, TString particlesSubName)
498 {
499  Int_t nt = 0;
500  Int_t nc = 0;
501  Double_t neutralE = 0.;
502  Double_t maxCh = 0.;
503  Double_t maxNe = 0.;
504  Int_t gall = 0;
505  Int_t gemc = 0;
506  Int_t cemc = 0;
507  Int_t ncharged = 0;
508  Int_t nneutral = 0;
509  Double_t mcpt = 0.;
510  Double_t emcpt = 0.;
511  TClonesArray * particles_sub = 0;
512 
513  Int_t uid = -1;
514 
515  jet->SetNumberOfTracks(constituents.size());
516  jet->SetNumberOfClusters(constituents.size());
517 
518  for (UInt_t ic = 0; ic < constituents.size(); ++ic) {
519 
520  if (flag == 0) {
521  uid = constituents[ic].user_index();
522  }
523  else {
524  if (constituents[ic].perp()<1.e-10) {
525  uid=-1;
526  }
527  else {
528  uid = constituents[ic].user_index();
529  }
530  if (uid==0) {
531  AliError("correspondence between un/subtracted constituent not found");
532  continue;
533  }
534  }
535 
536  AliDebug(3,Form("Processing constituent %d", uid));
537  if (uid == -1) { //ghost particle
538  ++gall;
539  if (fGeom) {
540  Double_t gphi = constituents[ic].phi();
541  if (gphi < 0) gphi += TMath::TwoPi();
542  gphi *= TMath::RadToDeg();
543  Double_t geta = constituents[ic].eta();
544  if ((gphi > fGeom->GetArm1PhiMin()) && (gphi < fGeom->GetArm1PhiMax()) &&
545  (geta > fGeom->GetArm1EtaMin()) && (geta < fGeom->GetArm1EtaMax()))
546  ++gemc;
547  }
548 
549  if (fFillGhost) jet->AddGhost(constituents[ic].px(),
550  constituents[ic].py(),
551  constituents[ic].pz(),
552  constituents[ic].e());
553  }
554  else if (uid >= fgkConstIndexShift) { // track constituent
555  Int_t iColl = uid / fgkConstIndexShift;
556  Int_t tid = uid - iColl * fgkConstIndexShift;
557  iColl--;
558  AliDebug(3,Form("Constituent %d is a track from collection %d and with ID %d", uid, iColl, tid));
559  AliParticleContainer* partCont = GetParticleContainer(iColl);
560  if (!partCont) {
561  AliError(Form("Could not find particle container %d",iColl));
562  continue;
563  }
564  AliVParticle *t = partCont->GetParticle(tid);
565  if (!t) {
566  AliError(Form("Could not find track %d",tid));
567  continue;
568  }
569  if(fFillConstituents){
571  }
572 
573  Double_t cEta = t->Eta();
574  Double_t cPhi = t->Phi();
575  Double_t cPt = t->Pt();
576  if (t->Charge() == 0) {
578  neutralE += t->P();
579  }
580  ++nneutral;
581  if (cPt > maxNe) maxNe = cPt;
582  } else {
583  ++ncharged;
584  if (cPt > maxCh) maxCh = cPt;
585  }
586 
587  // check if MC particle
589  if (TMath::Abs(t->GetLabel()) > fMinMCLabel) mcpt += cPt;
590  }
591 
592  if (fGeom) {
593  if (cPhi < 0) cPhi += TMath::TwoPi();
594  cPhi *= TMath::RadToDeg();
595  if ((cPhi > fGeom->GetArm1PhiMin()) && (cPhi < fGeom->GetArm1PhiMax()) &&
596  (cEta > fGeom->GetArm1EtaMin()) && (cEta < fGeom->GetArm1EtaMax())) {
597  emcpt += cPt;
598  ++cemc;
599  }
600  }
601 
602  if (flag == 0 || particlesSubName == "") {
604  }
605  else {
606  // Get the particle container and array corresponding to the subtracted particles
607  partCont = GetParticleContainer(particlesSubName);
608  particles_sub = partCont->GetArray();
609  // Create the new particle in the particles_sub array and add it to the jet
610  Int_t part_sub_id = particles_sub->GetEntriesFast();
611  AliEmcalParticle* part_sub = new ((*particles_sub)[part_sub_id]) AliEmcalParticle(dynamic_cast<AliVTrack*>(t)); // SA: probably need to be fixed!!
612  part_sub->SetPtEtaPhiM(constituents[ic].perp(),constituents[ic].eta(),constituents[ic].phi(),constituents[ic].m());
613  jet->AddTrackAt(fParticleContainerIndexMap.GlobalIndexFromLocalIndex(partCont, part_sub_id), nt);
614  }
615 
616  ++nt;
617  }
618  else if (uid <= -fgkConstIndexShift) { // cluster constituent
619  Int_t iColl = -uid / fgkConstIndexShift;
620  Int_t cid = -uid - iColl * fgkConstIndexShift;
621  iColl--;
622  AliDebug(3,Form("Constituent %d is a cluster from collection %d and with ID %d", uid, iColl, cid));
623  AliClusterContainer* clusCont = GetClusterContainer(iColl);
624  AliVCluster *c = clusCont->GetCluster(cid);
625 
626  if (!c) continue;
627 
629  clusCont->GetMomentum(nP, cid);
630 
631  Double_t cEta = nP.Eta();
632  Double_t cPhi = nP.Phi_0_2pi();
633  Double_t cPt = nP.Pt();
634  Double_t cP = nP.P();
635  Double_t pvec[3] = {nP.Px(), nP.Py(), nP.Pz()};
636  if(fFillConstituents) jet->AddClusterConstituent(c, (AliVCluster::VCluUserDefEnergy_t)clusCont->GetDefaultClusterEnergy(), pvec, clusCont->GetIsEmbedding(), fClusterContainerIndexMap.GlobalIndexFromLocalIndex(clusCont, cid));
637 
638  neutralE += cP;
639  if (cPt > maxNe) maxNe = cPt;
640 
641  // MC particle
642  if (TMath::Abs(c->GetLabel()) > fMinMCLabel) mcpt += c->GetMCEnergyFraction() > 1e-6 ? cPt * c->GetMCEnergyFraction() : cPt;
643 
644  if (fGeom) {
645  if (cPhi<0) cPhi += TMath::TwoPi();
646  cPhi *= TMath::RadToDeg();
647  if ((cPhi > fGeom->GetArm1PhiMin()) && (cPhi < fGeom->GetArm1PhiMax()) &&
648  (cEta > fGeom->GetArm1EtaMin()) && (cEta < fGeom->GetArm1EtaMax())) {
649  emcpt += cPt;
650  ++cemc;
651  }
652  }
653 
654  if (flag == 0 || particlesSubName == "") {
656  }
657  else {
658  // Get the cluster container and array corresponding to the subtracted particles
659  clusCont = GetClusterContainer(particlesSubName);
660  particles_sub = clusCont->GetArray();
661  // Create the new particle in the particles_sub array and add it to the jet
662  Int_t part_sub_id = particles_sub->GetEntriesFast();
663  AliEmcalParticle* part_sub = new ((*particles_sub)[part_sub_id]) AliEmcalParticle(c);
664  part_sub->SetPtEtaPhiM(constituents[ic].perp(),constituents[ic].eta(),constituents[ic].phi(),constituents[ic].m());
665  jet->AddClusterAt(fClusterContainerIndexMap.GlobalIndexFromLocalIndex(clusCont, part_sub_id), nc);
666  }
667 
668  ++nc;
669  ++nneutral;
670  }
671  else {
672  AliError(Form("%s: No logical way to end up here (uid = %d).", GetName(), uid));
673  continue;
674  }
675  }
676 
677  jet->SetNumberOfTracks(nt);
678  jet->SetNumberOfClusters(nc);
679  jet->SetNEF(neutralE / jet->E());
680  jet->SetMaxChargedPt(maxCh);
681  jet->SetMaxNeutralPt(maxNe);
682  if (gall > 0) jet->SetAreaEmc(jet->Area() * gemc / gall);
683  else jet->SetAreaEmc(-1);
684  jet->SetNEmc(cemc);
685  jet->SetNumberOfCharged(ncharged);
686  jet->SetNumberOfNeutrals(nneutral);
687  jet->SetMCPt(mcpt);
688  jet->SetPtEmc(emcpt);
689  jet->SortConstituents();
690 }
691 
699 {
700  if (fLocked) {
701  AliFatal("Jet finder task is locked! Changing properties is not allowed.");
702  return kTRUE;
703  }
704  else {
705  return kFALSE;
706  }
707 }
708 
716 {
717  if(!fIsPSelSet) {
718  fIsPSelSet = kTRUE;
719  fOfflineTriggerMask = offlineTriggerMask;
720  }
721  else {
722  AliWarning("Manually setting the event selection for jet finders is not allowed! Using trigger=old_trigger | your_trigger");
723  fOfflineTriggerMask = fOfflineTriggerMask | offlineTriggerMask;
724  }
725 }
726 
733 {
734  if (IsLocked()) return;
735 
736  TIter nextPartColl(&fParticleCollArray);
737  AliParticleContainer* tracks = 0;
738  while ((tracks = static_cast<AliParticleContainer*>(nextPartColl()))) {
739  tracks->SetParticleEtaLimits(emi, ema);
740  }
741 }
742 
748 {
749  if (IsLocked()) return;
750 
751  TIter nextClusColl(&fClusterCollArray);
752  AliClusterContainer* clusters = 0;
753  while ((clusters = static_cast<AliClusterContainer*>(nextClusColl()))) {
754  clusters->SetClusPtCut(min);
755  }
756 }
757 
763 {
764  if (IsLocked()) return;
765 
766  TIter nextClusColl(&fClusterCollArray);
767  AliClusterContainer* clusters = 0;
768  while ((clusters = static_cast<AliClusterContainer*>(nextClusColl()))) {
769  clusters->SetClusECut(min);
770  }
771 }
772 
778 {
779  if (IsLocked()) return;
780 
781  TIter nextPartColl(&fParticleCollArray);
782  AliParticleContainer* tracks = 0;
783  while ((tracks = static_cast<AliParticleContainer*>(nextPartColl()))) {
784  tracks->SetParticlePtCut(min);
785  }
786 }
787 
794 {
795  if (IsLocked()) return;
796 
797  TIter nextPartColl(&fParticleCollArray);
798  AliParticleContainer* tracks = 0;
799  while ((tracks = static_cast<AliParticleContainer*>(nextPartColl()))) {
800  tracks->SetParticlePhiLimits(pmi, pma);
801  }
802 }
803 
810 fastjet::JetAlgorithm AliEmcalJetTask::ConvertToFJAlgo(EJetAlgo_t algo)
811 {
812  switch(algo) {
814  return fastjet::kt_algorithm;
816  return fastjet::antikt_algorithm;
818  return fastjet::cambridge_algorithm;
820  return fastjet::genkt_algorithm;
822  return fastjet::cambridge_for_passive_algorithm;
824  return fastjet::genkt_for_passive_algorithm;
826  return fastjet::plugin_algorithm;
828  return fastjet::undefined_jet_algorithm;
829 
830  default:
831  ::Error("AliEmcalJetTask::ConvertToFJAlgo", "Jet algorithm %d not recognized!!!", algo);
832  return fastjet::undefined_jet_algorithm;
833  }
834 }
835 
842 fastjet::RecombinationScheme AliEmcalJetTask::ConvertToFJRecoScheme(ERecoScheme_t reco)
843 {
844  switch(reco) {
846  return fastjet::E_scheme;
847 
849  return fastjet::pt_scheme;
850 
852  return fastjet::pt2_scheme;
853 
855  return fastjet::Et_scheme;
856 
858  return fastjet::Et2_scheme;
859 
861  return fastjet::BIpt_scheme;
862 
864  return fastjet::BIpt2_scheme;
865 
867  return fastjet::external_scheme;
868 
869  default:
870  ::Error("AliEmcalJetTask::ConvertToFJRecoScheme", "Recombination scheme %d not recognized!!!", reco);
871  return fastjet::external_scheme;
872  }
873 }
874 
880 
881  //This method has to be called after the run number is known because it needs the EMCal geometry object.
882 
883  UInt_t jetAcceptanceType = AliEmcalJet::kUser; // all jets satify the "no acceptance cut" condition
884 
885  // Check if TPC
886  if( eta < 0.9 && eta > -0.9 ) {
887  jetAcceptanceType |= AliEmcalJet::kTPC;
888  // Check if TPCfid
889  if (eta < 0.9 - r && eta > -0.9 + r)
890  jetAcceptanceType |= AliEmcalJet::kTPCfid;
891  }
892 
893  // Check if EMCAL
894  if( IsJetInEmcal(eta, phi, 0) ) {
895  jetAcceptanceType |= AliEmcalJet::kEMCAL;
896  // Check if EMCALfid
897  if( IsJetInEmcal(eta, phi, r) )
898  jetAcceptanceType |= AliEmcalJet::kEMCALfid;
899  }
900 
901  // Check if DCAL (i.e. eta-phi rectangle spanning DCal, which includes most of PHOS)
902  if( IsJetInDcal(eta, phi, 0) ) {
903  jetAcceptanceType |= AliEmcalJet::kDCAL;
904  // Check if DCALfid
905  if( IsJetInDcal(eta, phi, r) )
906  jetAcceptanceType |= AliEmcalJet::kDCALfid;
907  }
908 
909  // Check if DCALonly (i.e. ONLY DCal, does not include any of PHOS region)
910  if( IsJetInDcalOnly(eta, phi, 0) ) {
911  jetAcceptanceType |= AliEmcalJet::kDCALonly;
912  // Check if DCALonlyfid
913  if( IsJetInDcalOnly(eta, phi, r) )
914  jetAcceptanceType |= AliEmcalJet::kDCALonlyfid;
915  }
916 
917  // Check if PHOS
918  if( IsJetInPhos(eta, phi, 0) ) {
919  jetAcceptanceType |= AliEmcalJet::kPHOS;
920  // Check if PHOSfid
921  if( IsJetInPhos(eta, phi, r) )
922  jetAcceptanceType |= AliEmcalJet::kPHOSfid;
923  }
924 
925  return jetAcceptanceType;
926 }
927 
932 {
933  if (!fGeom) return kFALSE;
934 
935  if ( eta < fGeom->GetArm1EtaMax() - r && eta > fGeom->GetArm1EtaMin() + r ) {
936  if(fRunNumber >= 177295 && fRunNumber <= 197470) {//small SM masked in 2012 and 2013
937  if ( phi < 3.135 - r && phi > 1.405 + r )
938  return kTRUE;
939  }
940  else {
941  if ( phi < fGeom->GetEMCALPhiMax() * TMath::DegToRad() - r && phi > fGeom->GetArm1PhiMin() * TMath::DegToRad() + r)
942  return kTRUE;
943  }
944  }
945 
946  return kFALSE;
947 }
948 
953 {
954  if (!fGeom) return kFALSE;
955  if (eta < fGeom->GetArm1EtaMax() - r && eta > fGeom->GetArm1EtaMin() + r ) {
956  if ( phi < fGeom->GetDCALPhiMax() * TMath::DegToRad() - r && phi > fGeom->GetDCALPhiMin() * TMath::DegToRad() + r)
957  return kTRUE;
958  }
959  return kFALSE;
960 }
961 
969 {
970  if (!fGeom) return kFALSE;
971 
972  if (eta < fGeom->GetArm1EtaMax() - r && eta > fGeom->GetArm1EtaMin() + r) {
973  if ( phi < fGeom->GetDCALPhiMax() * TMath::DegToRad() - r && phi > fGeom->GetDCALPhiMin() * TMath::DegToRad() + r) {
974 
975  if (TMath::Abs(eta) > fGeom->GetDCALInnerExtandedEta() + r) {
976  return kTRUE;
977  }
978  if (r < 1e-6) {
979  if (phi > fGeom->GetEMCGeometry()->GetDCALStandardPhiMax() * TMath::DegToRad())
980  return kTRUE;
981  }
982 
983  }
984  }
985 
986  return kFALSE;
987 }
988 
993 {
994  Double_t etaMax = 0.130;
995  Double_t etaMin = -0.130;
996  Double_t phiMax = 320;
997  Double_t phiMin = 260; // Run 1
998  if (fRunNumber > 209121)
999  phiMin = 250; // Run 2
1000 
1001  if (eta < etaMax - r && eta > etaMin + r ) {
1002  if (phi < phiMax * TMath::DegToRad() - r && phi > phiMin * TMath::DegToRad() + r)
1003  return kTRUE;
1004  }
1005  return kFALSE;
1006 }
1007 
1013 void AliEmcalJetTask::LoadTrackEfficiencyFunction(const std::string & path, const std::string & name)
1014 {
1015  TString fname(path);
1016  if (fname.BeginsWith("alien://")) {
1017  TGrid::Connect("alien://");
1018  }
1019 
1020  TFile* file = TFile::Open(path.data());
1021 
1022  if (!file || file->IsZombie()) {
1023  AliErrorStream() << "Could not open artificial track efficiency function file\n";
1024  return;
1025  }
1026 
1027  TF1* trackEff = dynamic_cast<TF1*>(file->Get(name.data()));
1028 
1029  if (trackEff) {
1030  AliInfoStream() << Form("Artificial track efficiency function %s loaded from file %s.", name.data(), path.data()) << "\n";
1031  }
1032  else {
1033  AliErrorStream() << Form("Artificial track efficiency function %s not found in file %s.", name.data(), path.data()) << "\n";
1034  return;
1035  }
1036 
1037  fTrackEfficiencyFunction = static_cast<TF1*>(trackEff->Clone());
1039 
1040  file->Close();
1041  delete file;
1042 }
1043 
1063  const TString nTracks, const TString nClusters,
1064  const AliJetContainer::EJetAlgo_t jetAlgo, const Double_t radius, const AliJetContainer::EJetType_t jetType,
1065  const Double_t minTrPt, const Double_t minClPt,
1066  const Double_t ghostArea, const AliJetContainer::ERecoScheme_t reco,
1067  const TString tag, const Double_t minJetPt,
1068  const Bool_t lockTask, const Bool_t bFillGhosts, const char *suffix
1069 )
1070 {
1071  // Get the pointer to the existing analysis manager via the static access method.
1072  //==============================================================================
1073  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1074  if (!mgr)
1075  {
1076  ::Error("AddTaskEmcalJet", "No analysis manager to connect to.");
1077  return 0;
1078  }
1079 
1080  // Check the analysis type using the event handlers connected to the analysis manager.
1081  //==============================================================================
1082  AliVEventHandler* handler = mgr->GetInputEventHandler();
1083  if (!handler)
1084  {
1085  ::Error("AddTaskEmcalJet", "This task requires an input event handler");
1086  return 0;
1087  }
1088 
1089  enum EDataType_t {
1090  kUnknown,
1091  kESD,
1092  kAOD,
1093  kMCgen
1094  };
1095 
1096  TString trackName(nTracks);
1097  TString clusName(nClusters);
1098 
1099  EDataType_t dataType = kUnknown;
1100  if (handler->InheritsFrom("AliESDInputHandler")) {
1101  dataType = kESD;
1102  }
1103  else if (handler->InheritsFrom("AliAODInputHandler")) {
1104  dataType = kAOD;
1105  } else if (handler->InheritsFrom("AliMCGenHandler")) {
1106  dataType = kMCgen;
1107  }
1108 
1109  //-------------------------------------------------------
1110  // Init the task and do settings
1111  //-------------------------------------------------------
1112 
1113 
1114  if (trackName == "usedefault") {
1115  if (dataType == kESD) {
1116  trackName = "Tracks";
1117  }
1118  else if (dataType == kAOD) {
1119  trackName = "tracks";
1120  }
1121  else if (dataType == kMCgen) {
1122  trackName = "mcparticles";
1123  }
1124  }
1125 
1126  if (clusName == "usedefault") {
1127  if (dataType == kESD) {
1128  clusName = "CaloClusters";
1129  }
1130  else if (dataType == kAOD) {
1131  clusName = "caloClusters";
1132  }
1133  else {
1134  clusName = "";
1135  }
1136  }
1137 
1138 
1139  AliParticleContainer* partCont = 0;
1140  if (trackName.Contains("mcparticles")) { // must be contains in order to allow for non-standard particle containers
1141  AliMCParticleContainer* mcpartCont = new AliMCParticleContainer(trackName);
1142  partCont = mcpartCont;
1143  }
1144  else if (trackName == "tracks" || trackName == "Tracks") {
1145  AliTrackContainer* trackCont = new AliTrackContainer(trackName);
1146  partCont = trackCont;
1147  }
1148  else if (!trackName.IsNull()) {
1149  partCont = new AliParticleContainer(trackName);
1150  }
1151  if (partCont) partCont->SetParticlePtCut(minTrPt);
1152 
1153  AliClusterContainer* clusCont = 0;
1154  if (!clusName.IsNull()) {
1155  clusCont = new AliClusterContainer(clusName);
1156  clusCont->SetClusECut(0.);
1157  clusCont->SetClusPtCut(0.);
1158  clusCont->SetClusHadCorrEnergyCut(minClPt);
1159  clusCont->SetDefaultClusterEnergy(AliVCluster::kHadCorr);
1160  }
1161 
1162  switch (jetType) {
1164  if (partCont) partCont->SetCharge(AliParticleContainer::kCharged);
1165  break;
1167  if (partCont) partCont->SetCharge(AliParticleContainer::kNeutral);
1168  break;
1169  default:
1170  break;
1171  }
1172 
1173  TString name = AliJetContainer::GenerateJetName(jetType, jetAlgo, reco, radius, partCont, clusCont, tag),
1174  taskname = name;
1175  if(strlen(suffix)) taskname += TString::Format("_%s", suffix);
1176 
1177  Printf("Jet task name: %s", name.Data());
1178 
1179  AliEmcalJetTask* mgrTask = static_cast<AliEmcalJetTask *>(mgr->GetTask(taskname.Data()));
1180  if (mgrTask) return mgrTask;
1181 
1182  AliEmcalJetTask* jetTask = new AliEmcalJetTask(taskname);
1183  jetTask->SetJetType(jetType);
1184  jetTask->SetJetAlgo(jetAlgo);
1185  jetTask->SetRecombScheme(reco);
1186  jetTask->SetRadius(radius);
1187  if (partCont) jetTask->AdoptParticleContainer(partCont);
1188  if (clusCont) jetTask->AdoptClusterContainer(clusCont);
1189  jetTask->SetJetsName(tag);
1190  jetTask->SetMinJetPt(minJetPt);
1191  jetTask->SetGhostArea(ghostArea);
1192 
1193  if (bFillGhosts) jetTask->SetFillGhost();
1194  if (lockTask) jetTask->SetLocked();
1195 
1196  //-------------------------------------------------------
1197  // Final settings, pass to manager and set the containers
1198  //-------------------------------------------------------
1199 
1200  mgr->AddTask(jetTask);
1201 
1202  // Create containers for input/output
1203  AliAnalysisDataContainer* cinput = mgr->GetCommonInputContainer();
1204  mgr->ConnectInput(jetTask, 0, cinput);
1205 
1206  return jetTask;
1207 }
Bool_t fTrackEfficiencyOnlyForEmbedding
Apply aritificial tracking inefficiency only for embedded tracks.
void SetMaxNeutralPt(Double32_t t)
Definition: AliEmcalJet.h:262
void SetJetsName(const char *n)
void SetRecombScheme(ERecoScheme_t scheme)
fastjet::PseudoJet GetJetAreaVector(UInt_t idx) const
Double_t Area() const
Definition: AliEmcalJet.h:130
TObjArray fClusterCollArray
cluster collection array
void AddTrackAt(Int_t track, Int_t idx)
Definition: AliEmcalJet.h:275
void SetParticlePtCut(Double_t cut)
TClonesArray * fJets
!jet collection
virtual Int_t Run()
double Double_t
Definition: External.C:58
static AliEmcalJetTask * AddTaskEmcalJet(const TString nTracks="usedefault", const TString nClusters="usedefault", const AliJetContainer::EJetAlgo_t jetAlgo=AliJetContainer::antikt_algorithm, const Double_t radius=0.4, const AliJetContainer::EJetType_t jetType=AliJetContainer::kFullJet, const Double_t minTrPt=0.15, const Double_t minClPt=0.30, const Double_t ghostArea=0.005, const AliJetContainer::ERecoScheme_t reco=AliJetContainer::pt_scheme, const TString tag="Jet", const Double_t minJetPt=0., const Bool_t lockTask=kTRUE, const Bool_t bFillGhosts=kFALSE, const char *suffix="")
Double_t fQoverPtShift
artificial q/pt shift
Bool_t fIsEmcPart
!=true if emcal particles are given as input (for clusters)
void SetEtaRange(Double_t emi, Double_t ema)
Bool_t IsLocked() const
Bool_t fIsInit
!=true if already initialized
PHOS acceptance.
Definition: AliEmcalJet.h:75
DCal acceptance – spans entire rectangular region in eta-phi (including most of PHOS) ...
Definition: AliEmcalJet.h:71
void AdoptParticleContainer(AliParticleContainer *cont)
Double_t Eta() const
Definition: AliEmcalJet.h:121
const AliClusterIterableMomentumContainer accepted_momentum() const
Base task in the EMCAL framework.
bidirectional stl iterator over the EMCAL iterable container
Double_t fJetEtaMin
minimum eta to keep jet in output
EJetType_t fJetType
jet type (full, charged, neutral)
Bool_t IsJetInEmcal(Double_t eta, Double_t phi, Double_t r)
Double_t Phi() const
Definition: AliEmcalJet.h:117
Int_t GetNParticles() const
Container with name, TClonesArray and cuts for particles.
Bool_t fApplyArtificialTrackingEfficiency
Flag to apply artificial tracking efficiency.
void AddClusterAt(Int_t clus, Int_t idx)
Definition: AliEmcalJet.h:274
AliEmcalJetUtility * AddUtility(AliEmcalJetUtility *utility)
Bool_t fFillGhost
=true ghost particles will be filled in AliEmcalJet obj
Declaration of class AliTLorentzVector.
virtual void ProcessJet(AliEmcalJet *jet, Int_t ij, AliFJWrapper &fjw)=0
Double_t phiMin
void SetArea(Double_t a)
Definition: AliEmcalJet.h:256
void SetJetType(EJetType_t t)
void ExecuteUtilities(AliEmcalJet *jet, Int_t ij)
Full acceptance, i.e. no acceptance cut applied – left to user.
Definition: AliEmcalJet.h:77
TCanvas * c
Definition: TestFitELoss.C:172
void SetMaxRap(Double_t maxrap)
Definition: AliFJWrapper.h:126
virtual void Terminate(AliFJWrapper &fjw)=0
void SetMinJetPt(Double_t j)
void SetAreaE(Double_t a)
Definition: AliEmcalJet.h:259
AliEmcalContainerIndexMap< AliParticleContainer, AliVParticle > fParticleContainerIndexMap
! Mapping between index and particle containers
ERecoScheme_t fRecombScheme
recombination scheme used by fastjet
void SetRecombScheme(const fastjet::RecombinationScheme &scheme)
Definition: AliFJWrapper.h:122
Bool_t fFillConstituents
If true jet consituents will be filled to the AliEmcalJet.
Double_t fTrackEfficiency
artificial tracking inefficiency (0...1)
void SetMCPt(Double_t p)
Definition: AliEmcalJet.h:269
Double_t E() const
Definition: AliEmcalJet.h:119
void SetJetAlgo(EJetAlgo_t a)
virtual ~AliEmcalJetTask()
static FJRecoScheme ConvertToFJRecoScheme(ERecoScheme_t reco)
int GlobalIndexFromLocalIndex(const U *inputObject, const int localIndex) const
void SetLabel(Int_t l)
Definition: AliEmcalJet.h:255
General jet finder task implementing a wrapper for FastJet.
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:140
Container for particles within the EMCAL framework.
Bool_t fIsPSelSet
!=true if physics selection was set
Int_t GetDefaultClusterEnergy() const
void SetR(Double_t r)
Definition: AliFJWrapper.h:127
void LoadTrackEfficiencyFunction(const std::string &path, const std::string &name)
void AdoptClusterContainer(AliClusterContainer *cont)
TObjArray fParticleCollArray
particle/track collection array
void AddParticleConstituent(const AliVParticle *const part, Bool_t isFromEmbeddedEvent, UInt_t globalIndex)
Add new particle (track / mc particle) constituent to the given jet Note: this will append the consti...
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
TPC fiducial acceptance (each eta edge narrowed by jet R)
Definition: AliEmcalJet.h:68
Bool_t fLocked
true if lock is set
const std::vector< fastjet::PseudoJet > & GetInclusiveJets() const
Definition: AliFJWrapper.h:34
void SetJetAcceptanceType(UInt_t type)
Definition: AliEmcalJet.h:380
Double_t fJetPhiMin
minimum phi to keep jet in output
UInt_t FindJetAcceptanceType(Double_t eta, Double_t phi, Double_t r)
int Int_t
Definition: External.C:63
Bool_t fEnableAliBasicParticleCompatibility
Flag to allow compatibility with AliBasicParticle constituents.
Bool_t IsJetInDcal(Double_t eta, Double_t phi, Double_t r)
TPC acceptance.
Definition: AliEmcalJet.h:67
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
Double_t GetJetArea(UInt_t idx) const
AliEMCALGeometry * fGeom
!emcal geometry
PHOS fiducial acceptance (each eta, phi edge narrowed by jet R)
Definition: AliEmcalJet.h:76
Bool_t fApplyQoverPtShift
Apply Q/pt shift.
void AddClusterConstituent(const AliVCluster *const clust, AliVCluster::VCluUserDefEnergy_t endef, Double_t *pvec, Bool_t isFromEmbeddedEvent, UInt_t globalIndex)
Add new cluster constituent to the given jet Note: this will append the constituent. No sorting according to particle is done.
Double_t Phi_0_2pi() const
EMCal acceptance.
Definition: AliEmcalJet.h:69
TString fJetsTag
tag of jet collection (usually = "Jets")
Bool_t GetIsEmbedding() const
Get embedding status.
void SetLegacyMode(Bool_t mode)
Definition: AliFJWrapper.h:137
virtual AliVParticle * GetParticle(Int_t i=-1) const
TObjArray * fUtilities
jet utilities (gen subtractor, constituent subtractor etc.)
Double_t phiMax
void SetPtEtaPhiM(Double_t pt, Double_t eta, Double_t phi, Double_t m)
void SetAlgorithm(const fastjet::JetAlgorithm &algor)
Definition: AliFJWrapper.h:121
TF1 * fTrackEfficiencyFunction
Function that describes the artificial tracking efficiency to be applied on top of the nominal tracki...
static const AliEmcalContainerIndexMap< TClonesArray, AliVCluster > & GetEmcalContainerIndexMap()
Get the EMCal container utils associated with particle containers.
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
AliEmcalContainerIndexMap< AliClusterContainer, AliVCluster > fClusterContainerIndexMap
! Mapping between index and cluster containers
Int_t GetNClusters() const
Double_t Phi_0_2pi() const
Definition: AliEmcalJet.h:129
Double_t fJetEtaMax
maximum eta to keep jet in output
TClonesArray * GetArray() const
Double_t fGhostArea
ghost area
void SetMaxChargedPt(Double32_t t)
Definition: AliEmcalJet.h:263
virtual void Clear(const Option_t *="")
void SetNEF(Double_t nef)
Definition: AliEmcalJet.h:264
Bool_t GetSortedArray(Int_t indexes[], std::vector< fastjet::PseudoJet > array) const
void AddGhost(const Double_t dPx, const Double_t dPy, const Double_t dPz, const Double_t dE)
void SetNEmc(Int_t n)
Definition: AliEmcalJet.h:270
AliVCluster * GetCluster(Int_t i) const
Bool_t IsJetInDcalOnly(Double_t eta, Double_t phi, Double_t r)
virtual void Prepare(AliFJWrapper &fjw)=0
Int_t fMinMCLabel
minimum MC label value for the tracks/clusters being considered MC particles
void SetJetTask(AliEmcalJetTask *jetTask)
void SetMinJetClusE(Double_t min)
Double_t Pt() const
Definition: AliEmcalJet.h:109
void SelectCollisionCandidates(UInt_t offlineTriggerMask=AliVEvent::kMB)
void SetGhostArea(Double_t gharea)
Definition: AliFJWrapper.h:125
void SetGhostArea(Double_t gharea)
EJetAlgo_t fJetAlgo
jet algorithm (kt, akt, etc)
void SetNumberOfCharged(Int_t n)
Definition: AliEmcalJet.h:267
Double_t fJetPhiMax
maximum phi to keep jet in output
std::vector< fastjet::PseudoJet > GetJetConstituents(UInt_t idx) const
const char * GetName() const
void SetAreaEta(Double_t a)
Definition: AliEmcalJet.h:257
static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo)
void SetParticleEtaLimits(Double_t min, Double_t max)
const std::vector< fastjet::PseudoJet > & GetInputVectors() const
Definition: AliFJWrapper.h:31
Double_t fMaxBinPt
max pt in histograms
void SetMinJetTrackPt(Double_t min)
Double_t fMinJetArea
min area to keep jet in output
TString fJetsName
!name of jet collection
void SetFillGhost(Bool_t b=kTRUE)
Double_t fMinJetPt
min jet pt to keep jet in output
const AliParticleIterableMomentumContainer accepted_momentum() const
TRandom3 fRandom
! Random number generator for artificial tracking efficiency
TFile * file
TList with histograms for a given trigger.
void CopyMappingFrom(const AliEmcalContainerIndexMap< U2, V > &map, U *cont)
void FillJetConstituents(AliEmcalJet *jet, std::vector< fastjet::PseudoJet > &constituents, std::vector< fastjet::PseudoJet > &constituents_sub, Int_t flag=0, TString particlesSubName="")
Bool_t GetMomentum(TLorentzVector &mom, const AliVCluster *vc, Double_t mass) const
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
void SetNumberOfTracks(Int_t n)
Definition: AliEmcalJet.h:266
virtual void ExecOnce()
Perform steps needed to initialize the analysis.
Double_t fRadius
jet radius
Bool_t fLegacyMode
!=true to enable FJ 2.x behavior
void SetClusPtCut(Double_t cut)
Int_t fRunNumber
!run number (triggering RunChanged())
virtual void AddInputVector(Double_t px, Double_t py, Double_t pz, Double_t E, Int_t index=-99999)
void SortConstituents()
void SetMinJetClusPt(Double_t min)
DCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Definition: AliEmcalJet.h:72
bool Bool_t
Definition: External.C:53
void SetPhiRange(Double_t pmi, Double_t pma)
EDataType_t
Switch for the data type.
DCal acceptance – spans ONLY DCal (no PHOS or gap)
Definition: AliEmcalJet.h:73
void SetClusECut(Double_t cut)
void SetDefaultClusterEnergy(Int_t d)
void SetAreaPhi(Double_t a)
Definition: AliEmcalJet.h:258
virtual void InitEvent(AliFJWrapper &fjw)=0
void SetAreaType(const fastjet::AreaType &atype)
Definition: AliFJWrapper.h:123
void SetParticlePhiLimits(Double_t min, Double_t max)
void SetPtEmc(Double_t pt)
Definition: AliEmcalJet.h:271
Container structure for EMCAL clusters.
DCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Definition: AliEmcalJet.h:74
Container for MC-true particles within the EMCAL framework.
EMCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Definition: AliEmcalJet.h:70
void SetCharge(EChargeCut_t c)
Container for jet within the EMCAL jet framework.
void SetRadius(Double_t r)
AliFJWrapper fFastJetWrapper
!fastjet wrapper
void SetNumberOfClusters(Int_t n)
Definition: AliEmcalJet.h:265
virtual void Init()=0
Bool_t IsJetInPhos(Double_t eta, Double_t phi, Double_t r)
void SetAxisInEmcal(Bool_t b)
Definition: AliEmcalJet.h:261
static const AliEmcalContainerIndexMap< TClonesArray, AliVParticle > & GetEmcalContainerIndexMap()
Get the EMCal container utils associated with particle containers.
static const Int_t fgkConstIndexShift
!contituent index shift
void SetAreaEmc(Double_t a)
Definition: AliEmcalJet.h:260
void SetClusHadCorrEnergyCut(Double_t cut)
void SetNumberOfNeutrals(Int_t n)
Definition: AliEmcalJet.h:268