File indexing completed on 2025-04-19 09:09:42
0001 #ifndef ATOOLS_Phys_Cambridge_Algorithm_H
0002 #define ATOOLS_Phys_Cambridge_Algorithm_H
0003
0004 #include "ATOOLS/Math/Vector.H"
0005 #include "ATOOLS/Phys/Particle_List.H"
0006 #include "AddOns/Analysis/Triggers/Kt_Algorithm.H"
0007 #include <vector>
0008
0009 using namespace ATOOLS;
0010
0011 namespace ANALYSIS {
0012
0013 class Cambridge_Algorithm : public Jet_Algorithm_Base {
0014 int m_mode, m_njets;
0015 double m_ycut, m_ymax;
0016 double m_sprime;
0017
0018 int m_matrixsize;
0019 double ** p_yij;
0020 int * p_imap;
0021 int m_vectorsize;
0022 Vec4D * p_moms;
0023 bool * p_bflag;
0024
0025 Particle_List * p_jets;
0026 std::vector<double> * p_kts;
0027
0028 inline double DCos12(const Vec4D &,const Vec4D &) const;
0029 inline double R12(const Vec4D &,const Vec4D &) const;
0030
0031 void AddToKtlist(double );
0032 void AddToJetlist(const Vec4D &, bool);
0033 public:
0034 static double Kt2(const Vec4D & p);
0035
0036 Cambridge_Algorithm(ATOOLS::Particle_Qualifier_Base * const qualifier, int mode=0);
0037 ~Cambridge_Algorithm();
0038
0039 void Init(int);
0040 void InitMoms(int);
0041 bool ConstructJets(const Particle_List * ,Particle_List * ,std::vector<double> * ,double);
0042
0043 void Ymin(Vec4D *,bool *,int);
0044 };
0045
0046 inline double Cambridge_Algorithm::Kt2(const Vec4D & p)
0047 {
0048 return sqr(p[1])+sqr(p[2]);
0049 }
0050
0051 inline double Cambridge_Algorithm::DCos12(const Vec4D & p1,const Vec4D & p2) const
0052 {
0053 double s = p1[1]*p2[1]+p1[2]*p2[2]+p1[3]*p2[3];
0054 double b1 = p1[1]*p1[1]+p1[2]*p1[2]+p1[3]*p1[3];
0055 double b2 = p2[1]*p2[1]+p2[2]*p2[2]+p2[3]*p2[3];
0056 return s/sqrt(b1*b2);
0057 }
0058
0059 inline double Cambridge_Algorithm::R12(const Vec4D & p1, const Vec4D & p2) const
0060 {
0061 return 2.*(1.-DCos12(p1,p2))/m_sprime;
0062 }
0063 }
0064
0065 #endif
0066
0067
0068
0069
0070
0071
0072
0073