File indexing completed on 2023-03-17 11:18:22
0001
0002
0003
0004
0005
0006
0007 #include "RecoJets/JetAlgorithms/interface/PrunedRecombiner.hh"
0008
0009 #include <sstream>
0010
0011 using namespace fastjet;
0012
0013 std::string PrunedRecombiner::description() const {
0014 std::ostringstream s;
0015 s << "Pruned " << _recombiner->description() << ", with zcut = " << _zcut << " and Rcut = " << _Rcut;
0016 return s.str();
0017 }
0018
0019
0020
0021
0022
0023
0024
0025 void PrunedRecombiner::recombine(const PseudoJet& pa, const PseudoJet& pb, PseudoJet& pab) const {
0026 PseudoJet p0(0.0, 0.0, 0.0, 0.0);
0027
0028 switch (_pruning_test(pa, pb)) {
0029 case 1:
0030 _pruned_pseudojets.push_back(pb.cluster_hist_index());
0031 _recombiner->recombine(pa, p0, pab);
0032 break;
0033 case 2:
0034 _pruned_pseudojets.push_back(pa.cluster_hist_index());
0035 _recombiner->recombine(pb, p0, pab);
0036 break;
0037 default:
0038
0039 _recombiner->recombine(pa, pb, pab);
0040 }
0041 }
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 int PrunedRecombiner::_pruning_test(const PseudoJet& pa, const PseudoJet& pb) const {
0052
0053
0054 PseudoJet newjet;
0055 _recombiner->recombine(pa, pb, newjet);
0056
0057 double minpT = pa.perp();
0058 int hard = 2;
0059 double tmp = pb.perp();
0060 if (tmp < minpT) {
0061 minpT = tmp;
0062 hard = 1;
0063 }
0064
0065 if (pa.squared_distance(pb) < _Rcut * _Rcut || minpT > _zcut * newjet.perp())
0066 return 0;
0067 else
0068 return hard;
0069 }
0070
0071 void PrunedRecombiner::reset(const double& zcut, const double& Rcut) {
0072 _pruned_pseudojets.clear();
0073 _zcut = zcut;
0074 _Rcut = Rcut;
0075 }