FairRoot/PandaRoot
SortTool.h
Go to the documentation of this file.
1 // ******************************************************
2 // DecayTreeFitter Package
3 // We thank the original author Wouter Hulsbergen
4 // (BaBar, LHCb) for providing the sources.
5 // http://arxiv.org/abs/physics/0503191v1 (2005)
6 // Adaptation & Development for PANDA: Ralf Kliemt (2015)
7 // ******************************************************
8 //
9 // SortTool.h
10 // TreeFitter
11 //
12 // Created by Ralf Kliemt on 26/01/15.
13 // Copyright (c) 2015 Ralf Kliemt. All rights reserved.
14 //
15 
16 #ifndef TREEFITTER_SORTTOOL_H
17 #define TREEFITTER_SORTTOOL_H 1
18 
19 #include "ParticleBase.h"
20 #include "RecoTrack.h"
21 
22 namespace DecayTreeFitter
23 {
24  inline bool sortByType(const ParticleBase* lhs, const ParticleBase* rhs)
25  {
26  int lhstype = lhs->type() ;
27  int rhstype = rhs->type() ;
28  bool rc = false ;
29  if( lhstype == rhstype && lhstype == ParticleBase::kRecoTrack )
30  rc = lhs->particle()->Pt() > rhs->particle()->Pt() ;
31  else if( lhs->particle()->NDaughters()>0 && rhs->particle()->NDaughters()>0 )
33  else
34  rc = lhstype < rhstype ;
35  return rc ;
36  }
37  inline bool compTrkTransverseMomentum(const RecoTrack* lhs, const RecoTrack* rhs)
38  {
39  return lhs->particle()->Pt() > rhs->particle()->Pt() ;
40  }
41 } //
42 #endif
Double_t Pt() const
Definition: RhoCandidate.h:211
RhoCandidate * particle() const
Definition: ParticleBase.h:57
virtual int nFinalChargedCandidates() const
virtual int type() const =0
bool compTrkTransverseMomentum(const RecoTrack *lhs, const RecoTrack *rhs)
Definition: SortTool.h:37
Int_t NDaughters() const
bool sortByType(const ParticleBase *lhs, const ParticleBase *rhs)
Definition: SortTool.h:24