Main Page   Class Hierarchy   Compound List   File List   Compound Members  

SortUtil.h

00001 #ifndef ATHENA_UTIL_SORT_UTIL_H
00002 #define ATHENA_UTIL_SORT_UTIL_H
00003 
00004 #include "particle/Particle.h"
00005 #include <cmath>
00006 
00007 //     [0]      [n-1]
00008 // Pt  High --> Low
00009 class High2LowByParticleClassPt
00010 {
00011 public:
00012   bool operator () (const Particle *t1, const Particle *t2) const {
00013     return (t1->pt() > t2->pt());
00014   }
00015 };
00016 
00017 // Pt  Low --> High
00018 class Low2HighByParticleClassPt
00019 {
00020 public:
00021   bool operator () (const Particle *t1, const Particle *t2) const {
00022     return (t1->pt() < t2->pt());
00023   }
00024 };
00025 
00026 // P  High --> Low
00027 class High2LowByParticleClassP
00028 {
00029 public:
00030   bool operator () (const Particle *t1, const Particle *t2) const {
00031     return (t1->p().vect().mag() > t2->p().vect().mag());
00032   }
00033 };
00034 
00035 // P  Low --> High
00036 class Low2HighByParticleClassP
00037 {
00038 public:
00039   bool operator () (const Particle *t1, const Particle *t2) const {
00040     return (t1->p().vect().mag() < t2->p().vect().mag());
00041   }
00042 };
00043 
00044 // Energy  High --> Low
00045 class High2LowByParticleClassEnergy
00046 {
00047 public:
00048   bool operator () (const Particle *t1, const Particle *t2) const {
00049     return (t1->e() > t2->e());
00050   }
00051 };
00052 
00053 // Energy  Low --> High
00054 class Low2HighByParticleClassEnergy
00055 {
00056 public:
00057   bool operator () (const Particle *t1, const Particle *t2) const {
00058     return (t1->e() < t2->e());
00059   }
00060 };
00061 
00062 // Eta  Low --> High
00063 class Low2HighByParticleClassEta
00064 {
00065 public:
00066   bool operator () (const Particle *t1, const Particle *t2) const {
00067     return (t1->eta() < t2->eta());
00068   }
00069 };
00070 
00071 // Eta  High --> Low
00072 class High2LowByParticleClassEta
00073 {
00074 public:
00075   bool operator () (const Particle *t1, const Particle *t2) const {
00076     return (t1->eta() > t2->eta());
00077   }
00078 };
00079 
00080 // |Eta|  Low --> High
00081 class Low2HighByParticleClassAbsEta
00082 {
00083 public:
00084   bool operator () (const Particle *t1, const Particle *t2) const {
00085     return (fabs(t1->eta()) < fabs(t2->eta()));
00086   }
00087 };
00088 
00089 // |Eta|  High --> Low
00090 class High2LowByParticleClassAbsEta
00091 {
00092 public:
00093   bool operator () (const Particle *t1, const Particle *t2) const {
00094     return (fabs(t1->eta()) > fabs(t2->eta()));
00095   }
00096 };
00097 
00098 #endif // ATHENA_UTIL_SORT_UTIL_H

Generated on Tue Apr 13 13:25:32 2004 for ATLAS JAPAN by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002