Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:06:43

0001 //  QCDAware Package
0002 //  Questions/Comments?  abuckley@cern.ch, cpollard@cern.ch
0003 //
0004 //  Copyright (c) 2014
0005 //  Andy Buckley, Chris Pollard
0006 //
0007 // $Id: QCDAwarePlugin.hh 887 2015-10-08 08:27:29Z cspollard $
0008 //
0009 //----------------------------------------------------------------------
0010 // This file is part of FastJet contrib.
0011 //
0012 // It is free software; you can redistribute it and/or modify it under
0013 // the terms of the GNU General Public License as published by the
0014 // Free Software Foundation; either version 2 of the License, or (at
0015 // your option) any later version.
0016 //
0017 // It is distributed in the hope that it will be useful, but WITHOUT
0018 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
0019 // or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
0020 // License for more details.
0021 //
0022 // You should have received a copy of the GNU General Public License
0023 // along with this code. If not, see <http://www.gnu.org/licenses/>.
0024 //----------------------------------------------------------------------
0025 
0026 #ifndef __FASTJET_CONTRIB_QCDAWAREPLUGIN_HH__
0027 #define __FASTJET_CONTRIB_QCDAWAREPLUGIN_HH__
0028 
0029 #include "fastjet/internal/base.hh"
0030 #include "fastjet/JetDefinition.hh"
0031 #include "fastjet/ClusterSequence.hh"
0032 #include <queue>
0033 #include <string>
0034 #include <vector>
0035 #include "DistanceMeasure.hh"
0036 
0037 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
0038 
0039 
0040 namespace contrib {
0041     namespace QCDAwarePlugin {
0042 
0043         /**
0044          * \brief the PJDist struct: simple storage of distance
0045          *        information between two pseudojets
0046          */
0047 
0048         struct PJDist {
0049             double dist;
0050             int pj1;
0051             int pj2;
0052         };
0053 
0054 
0055         /**
0056          * \brief the QCDAwarePlugin class performs QCD-aware jet
0057          *        clustering given a particular DistanceMeasure
0058          *
0059          *  the QCDAwarePlugin class performs the QCD-aware jet
0060          *  clustering given a particular DistanceMeasure.
0061          */
0062         //------------------------------------------------------------------------
0063         // @todo
0064         // this class isn't really QCDAware; the distance measure is...
0065         class QCDAwarePlugin : public JetDefinition::Plugin {
0066 
0067             public:
0068                 // User still owns the pointer to dm after using this
0069                 // constructor.
0070                 QCDAwarePlugin(const DistanceMeasure *dm)
0071                     : _dm(dm) {}
0072 
0073                 /// default destructor
0074                 // we don't delete _dm here because it is owned by the
0075                 // user.
0076                 virtual ~QCDAwarePlugin() {}
0077 
0078                 void run_clustering(fastjet::ClusterSequence& cs) const;
0079 
0080                 std::string description() const;
0081 
0082                 double R() const;
0083 
0084 
0085             private:
0086                 const DistanceMeasure *_dm;
0087 
0088                 void insert_pj(ClusterSequence &cs,
0089                         std::priority_queue<PJDist, std::vector<PJDist>, std::greater<PJDist> >& pjds,
0090                         unsigned int iJet,
0091                         std::vector<bool>& ismerged) const;
0092 
0093                 void merge_iB(ClusterSequence &cs,
0094                         const PJDist& dist,
0095                         std::vector<bool>& ismerged) const;
0096 
0097                 void merge_ij(ClusterSequence &cs,
0098                         std::priority_queue<PJDist, std::vector<PJDist>, std::greater<PJDist> >& pjds,
0099                         const PJDist& dist,
0100                         std::vector<bool>& ismerged) const;
0101 
0102                 // returns zero if p and q aren't allowed to combine.
0103                 // returns the combined pid otherwise.
0104                 int flavor_sum(const fastjet::PseudoJet& p, const fastjet::PseudoJet& q) const;
0105         };
0106 
0107 
0108     } // QCDAware
0109 } // contrib
0110 
0111 FASTJET_END_NAMESPACE
0112 
0113 #endif  // __FASTJET_CONTRIB_QCDAWARE_HH__