Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:59:42

0001 ///////////////////////////////////////////////////////////////////////////////
0002 //
0003 // The PrunedRecombiner class.  This class extends any Recombiner
0004 //   class to include a "pruning test".  If this test on a recombination fails,
0005 //   the recombination does not occur.  This happens in the following way:
0006 // 1) The "new" PseudoJet is set equal to the higher-pT parent.
0007 // 2) The lower-pT parent is effectively discarded from the algorithm.
0008 // 3) Not implemented yet: some method of keeping track of what was pruned when.
0009 //
0010 // New:  You must pass a Recombiner-derived object that will do the actual
0011 //   recombining; PrunedRecombiner only checks whether to prune or not.  This is
0012 //   useful if you want to implement, say, flavor recombination.
0013 //
0014 ///////////////////////////////////////////////////////////////////////////////
0015 
0016 #ifndef __PRUNEDRECOMBINER_HH__
0017 #define __PRUNEDRECOMBINER_HH__
0018 
0019 #include "fastjet/ClusterSequence.hh"
0020 #include "fastjet/JetDefinition.hh"
0021 
0022 #include <string>
0023 
0024 FASTJET_BEGIN_NAMESPACE  // defined in fastjet/internal/base.hh
0025 
0026     class PrunedRecombiner : public JetDefinition::Recombiner {
0027 public:
0028   PrunedRecombiner(const JetDefinition::Recombiner* recomb, const double& zcut = 0.1, const double& Rcut = 0.5)
0029       : _zcut(zcut), _Rcut(Rcut), _recombiner(recomb) {}
0030 
0031   PrunedRecombiner(const RecombinationScheme scheme, const double& zcut = 0.1, const double& Rcut = 0.5)
0032       : _zcut(zcut), _Rcut(Rcut), _recombiner(nullptr), _default_recombiner(scheme) {
0033     _recombiner = &_default_recombiner;
0034   }
0035 
0036   std::string description() const override;
0037 
0038   // recombine pa and pb and put result into pab
0039   void recombine(const PseudoJet& pa, const PseudoJet& pb, PseudoJet& pab) const override;
0040 
0041   std::vector<int> pruned_pseudojets() { return _pruned_pseudojets; }
0042 
0043   // resets pruned_pseudojets vector, parameters
0044   void reset(const double& zcut, const double& Rcut);
0045 
0046   ~PrunedRecombiner() override {}
0047 
0048 private:
0049   // tests whether pa and pb should be recombined or vetoed
0050   int _pruning_test(const PseudoJet& pa, const PseudoJet& pb) const;
0051 
0052   double _zcut;  // zcut parameter to the pruning test
0053   double _Rcut;  // Rcut parameter to the pruning test
0054 
0055   // vector that holds cluster_history_indices of pruned pj's
0056   mutable std::vector<int> _pruned_pseudojets;
0057 
0058   // points to the "real" external recombiner
0059   const JetDefinition::Recombiner* _recombiner;
0060 
0061   // Use this if we are only passed a recombination scheme.
0062   // A DefaultRecombiner is so small it's not worth dealing with whether we own
0063   // the recombiner or not...
0064   JetDefinition::DefaultRecombiner _default_recombiner;
0065 };
0066 
0067 FASTJET_END_NAMESPACE  // defined in fastjet/internal/base.hh
0068 
0069 #endif  // __PRUNEDRECOMBINER_HH__