Warning, file /include/fastjet/contrib/ClusteringVetoPlugin.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 #ifndef __FASTJET_CONTRIB_CLUSTERINGVETOPLUGIN_HH__
0027 #define __FASTJET_CONTRIB_CLUSTERINGVETOPLUGIN_HH__
0028
0029 #include <fastjet/internal/base.hh>
0030
0031 #include "fastjet/JetDefinition.hh"
0032 #include "fastjet/PseudoJet.hh"
0033 #include "fastjet/ClusterSequence.hh"
0034 #include <fastjet/LimitedWarning.hh>
0035
0036 #include <queue>
0037
0038 using namespace std;
0039
0040 FASTJET_BEGIN_NAMESPACE
0041
0042 namespace contrib {
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071 class ClusteringVetoPlugin : public JetDefinition::Plugin {
0072
0073 public:
0074
0075 enum ClusterType {
0076 CALIKE,
0077 KTLIKE,
0078 AKTLIKE
0079 };
0080
0081
0082 enum VetoResult {
0083 CLUSTER,
0084 VETO,
0085 NOVETO
0086 };
0087
0088
0089
0090
0091
0092
0093 ClusteringVetoPlugin(double mu, double theta, double max_r, ClusterType clust_type);
0094
0095
0096 void run_clustering(fastjet::ClusterSequence & cs) const;
0097
0098
0099 virtual string description() const;
0100
0101
0102 double R() const { return sqrt(_max_r2); }
0103
0104
0105 void set_veto_function(VetoResult (*f)(const PseudoJet& j1,
0106 const PseudoJet& j2)) {
0107 _veto_function = f; }
0108
0109 private:
0110
0111
0112 double _max_r2, _mu, _theta;
0113 ClusterType _clust_type;
0114
0115
0116 VetoResult (*_veto_function) (const PseudoJet& j1, const PseudoJet& j2);
0117
0118 private:
0119
0120
0121 inline double GetJJDistanceMeasure(const PseudoJet& j1, const PseudoJet& j2) const;
0122 inline double GetJBDistanceMeasure(const PseudoJet& jet) const;
0123
0124
0125 VetoResult CheckVeto(const PseudoJet& j1, const PseudoJet& j2) const;
0126
0127 VetoResult CheckVeto_MJ(const PseudoJet& j1, const PseudoJet& j2) const;
0128
0129 };
0130
0131
0132
0133 class ClusteringVetoJetInfo {
0134 public:
0135 ClusteringVetoPlugin::ClusterType clust_type;
0136 double max_r2;
0137 };
0138
0139 class ClusteringVetoJet {
0140 public:
0141 void init(const PseudoJet & jet,
0142 const ClusteringVetoJetInfo * info) {
0143 ph = jet.phi();
0144 rp = jet.rap();
0145 max_r2 = info->max_r2;
0146 switch(info->clust_type) {
0147 case ClusteringVetoPlugin::AKTLIKE: perpfactor = 1./jet.perp2();
0148 break;
0149 case ClusteringVetoPlugin::CALIKE: perpfactor = 1.;
0150 break;
0151 case ClusteringVetoPlugin::KTLIKE: perpfactor = jet.perp2();
0152 break;
0153 default: assert(false);
0154 }
0155 }
0156
0157 double distance(const ClusteringVetoJet * jet ) const {
0158 double dij = min ( perpfactor, jet->perpfactor );
0159 double dphi = fabs(ph-jet->ph);
0160 if (dphi > pi) {dphi = twopi - dphi;}
0161 dij *= (dphi*dphi+((rp-jet->rp)*(rp-jet->rp))) / max_r2;
0162 return dij;
0163 }
0164
0165 double beam_distance() const {
0166 return perpfactor;
0167 }
0168
0169 private:
0170 double ph, rp, perpfactor, max_r2;
0171 };
0172
0173 }
0174
0175 FASTJET_END_NAMESPACE
0176
0177 #endif