3 // Standalone jet finder
7 #include "AliFJWrapper.h"
8 #include "AliEmcalJet.h"
9 #include "AliEmcalJetFinder.h"
14 //________________________________________________________________________
15 AliEmcalJetFinder::AliEmcalJetFinder() :
16 TNamed("EmcalJetFinder","EmcalJetFinder"), fFastjetWrapper(0), fInputVectorIndex(0), fJetCount(0), fJetArray(), fGhostArea(0.005), fRadius(0.4), fJetAlgorithm(0), fTrackMaxEta(0.9), fJetMaxEta(0.5), fJetMinPt(0), fJetMinArea(0)
19 fFastjetWrapper = new AliFJWrapper("FJWrapper", "FJWrapper");
22 //________________________________________________________________________
23 AliEmcalJetFinder::AliEmcalJetFinder(const char* name) :
24 TNamed(name, name), fFastjetWrapper(0), fInputVectorIndex(0), fJetCount(0), fJetArray(), fGhostArea(0.005), fRadius(0.4), fJetAlgorithm(0), fTrackMaxEta(0.9), fJetMaxEta(0.5), fJetMinPt(0), fJetMinArea(0)
27 fFastjetWrapper = new AliFJWrapper("FJWrapper", "FJWrapper");
30 //________________________________________________________________________
31 AliEmcalJetFinder::~AliEmcalJetFinder()
34 delete fFastjetWrapper;
38 //________________________________________________________________________
39 Bool_t AliEmcalJetFinder::FindJets()
41 // Tidy up and check input
44 if(!fInputVectorIndex)
46 AliError("No input vectors added to jet finder!");
50 // Pass settings to fastjet
51 fFastjetWrapper->SetAreaType(fastjet::active_area_explicit_ghosts);
52 fFastjetWrapper->SetGhostArea(fGhostArea);
53 fFastjetWrapper->SetR(fRadius);
54 if(fJetAlgorithm == 0)
55 fFastjetWrapper->SetAlgorithm(fastjet::antikt_algorithm);
56 if(fJetAlgorithm == 1)
57 fFastjetWrapper->SetAlgorithm(fastjet::kt_algorithm);
59 fFastjetWrapper->SetMaxRap(fTrackMaxEta);
62 fFastjetWrapper->Run();
64 // Save the found jets as light-weight objects
65 std::vector<fastjet::PseudoJet> fastjets = fFastjetWrapper->GetInclusiveJets();
66 fJetArray.resize(fastjets.size());
68 for (UInt_t i=0; i<fastjets.size(); i++)
71 if (fastjets[i].perp()<fJetMinPt)
73 if (fFastjetWrapper->GetJetArea(i)<fJetMinArea)
75 if (TMath::Abs(fastjets[i].eta())>fJetMaxEta)
78 AliEmcalJet* jet = new AliEmcalJet(fastjets[i].perp(), fastjets[i].eta(), fastjets[i].phi(), fastjets[i].m());
80 // Set the most important properties of the jet
81 Int_t nConstituents(fFastjetWrapper->GetJetConstituents(i).size());
82 jet->SetNumberOfTracks(nConstituents);
83 jet->SetNumberOfClusters(nConstituents);
84 fJetArray[fJetCount] = jet;
88 fJetArray.resize(fJetCount);
91 fFastjetWrapper->Clear();
92 fInputVectorIndex = 0;
96 //________________________________________________________________________
97 void AliEmcalJetFinder::AddInputVector(Double_t px, Double_t py, Double_t pz)
99 fFastjetWrapper->AddInputVector(px, py, pz, TMath::Sqrt(px*px + py*py + pz*pz), fInputVectorIndex + 100);
103 //________________________________________________________________________
104 void AliEmcalJetFinder::FillPtHistogram(TH1* histogram)
108 for (Int_t i=0; i<fJetArray.size(); i++)
110 histogram->Fill(fJetArray[i]->Pt());
114 //________________________________________________________________________
115 void AliEmcalJetFinder::FillPhiHistogram(TH1* histogram)
119 for (Int_t i=0; i<fJetArray.size(); i++)
121 histogram->Fill(fJetArray[i]->Phi());
125 //________________________________________________________________________
126 void AliEmcalJetFinder::FillEtaHistogram(TH1* histogram)
130 for (Int_t i=0; i<fJetArray.size(); i++)
132 histogram->Fill(fJetArray[i]->Eta());