Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:32:26

0001 #ifndef PhysicsTools_Heppy_ReclusterJets_h
0002 #define PhysicsTools_Heppy_ReclusterJets_h
0003 
0004 #include <vector>
0005 #include <iostream>
0006 #include <cmath>
0007 #include <TLorentzVector.h>
0008 #include <TMath.h>
0009 #include "DataFormats/Math/interface/LorentzVector.h"
0010 
0011 #include <fastjet/internal/base.hh>
0012 #include "fastjet/PseudoJet.hh"
0013 #include "fastjet/JetDefinition.hh"
0014 #include "fastjet/ClusterSequence.hh"
0015 #include "fastjet/Selector.hh"
0016 #include "fastjet/PseudoJet.hh"
0017 
0018 namespace heppy {
0019   class ReclusterJets {
0020   public:
0021     typedef math::XYZTLorentzVector LorentzVector;
0022 
0023     ReclusterJets(const std::vector<LorentzVector> &objects, double ktpower, double rparam);
0024 
0025     /// get grouping (inclusive jets)
0026     std::vector<LorentzVector> getGrouping(double ptMin = 0.0);
0027 
0028     /// get grouping (exclusive jets, until n are left)
0029     std::vector<LorentzVector> getGroupingExclusive(int njets);
0030 
0031     /// get grouping (exclusive jets, up to cut dcut)
0032     std::vector<LorentzVector> getGroupingExclusive(double dcut);
0033 
0034     /// get pruned 4-vector
0035     LorentzVector getPruned(double zcut, double rcutFactor);
0036 
0037     /// get pruned 4-vector for a given subject (must be called after getGroupingExclusive)
0038     LorentzVector getPrunedSubjetExclusive(unsigned int isubjet, double zcut, double rcutFactor);
0039 
0040     /// get pruned 4-vector for a given subject (must be called after getGroupingInclusive)
0041     LorentzVector getPrunedSubjetInclusive(unsigned int isubjet, double zcut, double rcutFactor);
0042 
0043   private:
0044     // pack the returns in a fwlite-friendly way
0045     std::vector<LorentzVector> makeP4s(const std::vector<fastjet::PseudoJet> &jets);
0046 
0047     // prune and return in fa fwlite-friendly way
0048     LorentzVector getPruned(const fastjet::PseudoJet &jet, double zcut, double rcutFactor);
0049 
0050     // used to handle the inputs
0051     std::vector<fastjet::PseudoJet> fjInputs_;  // fastjet inputs
0052 
0053     double ktpower_;
0054     double rparam_;
0055 
0056     /// fastjet outputs
0057     typedef std::shared_ptr<fastjet::ClusterSequence> ClusterSequencePtr;
0058     ClusterSequencePtr fjClusterSeq_;
0059     std::vector<fastjet::PseudoJet> inclusiveJets_;
0060     std::vector<fastjet::PseudoJet> exclusiveJets_;
0061   };
0062 }  // namespace heppy
0063 #endif