From 629e03fcadfa48aeac979e40c91d2a97e73a3201 Mon Sep 17 00:00:00 2001 From: loizides Date: Tue, 1 May 2012 08:39:07 +0000 Subject: [PATCH] sort constituents --- PWGGA/EMCALTasks/AliEmcalJet.cxx | 9 +++++++++ PWGGA/EMCALTasks/AliEmcalJet.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/PWGGA/EMCALTasks/AliEmcalJet.cxx b/PWGGA/EMCALTasks/AliEmcalJet.cxx index dd5aab71ba2..78bf6a15f3b 100644 --- a/PWGGA/EMCALTasks/AliEmcalJet.cxx +++ b/PWGGA/EMCALTasks/AliEmcalJet.cxx @@ -1,5 +1,7 @@ // $Id$ +#include + #include "AliEmcalJet.h" ClassImp(AliEmcalJet) @@ -85,3 +87,10 @@ void AliEmcalJet::Print(Option_t* /*option*/) const printf("Jet pt=%.2f, eta=%.2f, phi=%.2f, area=%.2f, NEF=%.2f\n", fPt, fEta, fPhi, fArea, fNEF); } + +//__________________________________________________________________________________________________ +void AliEmcalJet::SortConstituents() +{ + std::sort(fClusterIDs->GetArray(), fClusterIDs->GetArray() + fClusterIDs->GetSize()); + std::sort(fTrackIDs->GetArray(), fTrackIDs->GetArray() + fTrackIDs->GetSize()); +} diff --git a/PWGGA/EMCALTasks/AliEmcalJet.h b/PWGGA/EMCALTasks/AliEmcalJet.h index e10c56a064b..abe5f972d29 100644 --- a/PWGGA/EMCALTasks/AliEmcalJet.h +++ b/PWGGA/EMCALTasks/AliEmcalJet.h @@ -63,6 +63,8 @@ class AliEmcalJet : public AliVParticle Int_t ClusterAt(Int_t idx) const { return fClusterIDs->At(idx); } Int_t TrackAt(Int_t idx) const { return fTrackIDs->At(idx); } + void SortConstituents(); + protected: Double32_t fPt; //[0,0,12] pt Double32_t fEta; //[-1,1,12] eta -- 2.43.0