Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:32

0001 #ifndef RecoJets_JetProducers_HTTTopJetProducer_h
0002 #define RecoJets_JetProducers_HTTTopJetProducer_h
0003 
0004 /* *********************************************************
0005 
0006 
0007  * \class CATopJetProducer
0008  * Jet producer to produce top jets using the C-A algorithm to break
0009  * jets into subjets as described here:
0010  * "Top-tagging: A Method for Identifying Boosted Hadronic Tops"
0011  * David E. Kaplan, Keith Rehermann, Matthew D. Schwartz, Brock Tweedie
0012  * arXiv:0806.0848v1 [hep-ph] 
0013 
0014   \brief Jet producer to run the CATopJetAlgorithm
0015 
0016   \author   Salvatore Rappoccio
0017   \version  
0018 
0019          Notes on implementation:
0020 
0021      Because the BaseJetProducer only allows the user to produce
0022      one jet collection at a time, this algorithm cannot
0023      fit into that paradigm. 
0024 
0025      All of the "hard" jets are of type BasicJet, since
0026      they are "jets of jets". The subjets will be either
0027      CaloJets, GenJets, etc.
0028 
0029      In order to avoid a templatization of the entire
0030      EDProducer itself, we only use a templated method
0031      to write out the subjets to the event record,
0032      and to use that information to write out the
0033      hard jets to the event record.
0034 
0035      This templated method is called "write_outputs". It
0036      relies on a second templated method called "write_specific",
0037      which relies on some template specialization to create
0038      different specific objects (i.e. CaloJets, BasicJets, GenJets, etc). 
0039 
0040  ************************************************************/
0041 
0042 #include "FWCore/Framework/interface/Event.h"
0043 #include "FWCore/Framework/interface/EventSetup.h"
0044 #include "DataFormats/Common/interface/View.h"
0045 #include "DataFormats/Common/interface/Handle.h"
0046 #include "DataFormats/Provenance/interface/ProductID.h"
0047 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0048 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0049 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0050 
0051 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0052 #include "DataFormats/JetReco/interface/GenJetCollection.h"
0053 #include "DataFormats/JetReco/interface/PFJetCollection.h"
0054 #include "DataFormats/JetReco/interface/BasicJetCollection.h"
0055 #include "RecoJets/JetAlgorithms/interface/JetAlgoHelper.h"
0056 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0057 #include "DataFormats/Candidate/interface/LeafCandidate.h"
0058 #include "FWCore/Framework/interface/ESHandle.h"
0059 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0060 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0061 
0062 #include "RecoJets/JetProducers/plugins/FastjetJetProducer.h"
0063 
0064 #include "RecoJets/JetAlgorithms/interface/HEPTopTaggerWrapperV2.h"
0065 
0066 #include "FWCore/Utilities/interface/RandomNumberGenerator.h"
0067 #include "FWCore/ServiceRegistry/interface/Service.h"
0068 #include "CLHEP/Random/RandomEngine.h"
0069 
0070 #include "fastjet/SISConePlugin.hh"
0071 
0072 namespace cms {
0073   class HTTTopJetProducer : public FastjetJetProducer {
0074   public:
0075     HTTTopJetProducer(const edm::ParameterSet& ps);
0076 
0077     ~HTTTopJetProducer() override {}
0078 
0079     void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0080 
0081     void runAlgorithm(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0082 
0083     void addHTTTopJetTagInfoCollection(edm::Event& iEvent,
0084                                        const edm::EventSetup& iSetup,
0085                                        edm::OrphanHandle<reco::BasicJetCollection>& oh) override;
0086 
0087     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0088 
0089   private:
0090     std::unique_ptr<fastjet::HEPTopTaggerV2> fjHEPTopTagger_;
0091 
0092     // Below are all configurable options.
0093     // Parenthesis indicates if this is enforced by the tagger itself or by the producer
0094 
0095     bool optimalR_;  // Should the MultiR version of the tagger be used? (tagger)
0096     bool qJets_;     // Should Q-jets be used? (tagger/producer)
0097 
0098     double minFatjetPt_;  // Only process fatjets larger pT with the tagger [GeV] (producer)
0099     double minSubjetPt_;  // Minimal pT for subjets [GeV] (tagger)
0100     double minCandPt_;    // Minimal pT to return a candidate [GeV] (tagger)
0101 
0102     double maxFatjetAbsEta_;  // Only process fatjets with smaller |eta| with the tagger. (producer)
0103 
0104     double subjetMass_;  // Mass above which subjets are further unclustered (tagger)
0105     double muCut_;       // Mass drop threshold (tagger)
0106 
0107     double filtR_;  // maximal filtering radius
0108     int filtN_;     // number of filtered subjets to use
0109 
0110     // HEPTopTagger Mode (tagger):
0111     // 0: do 2d-plane, return candidate with delta m_top minimal
0112     // 1: return candidate with delta m_top minimal IF passes 2d plane
0113     // 2: do 2d-plane, return candidate with max dj_sum
0114     // 3: return candidate with max dj_sum IF passes 2d plane
0115     // 4: return candidate built from leading three subjets after unclustering IF passes 2d plane
0116     // Note: Original HTT was mode==1
0117     int mode_;
0118 
0119     // Top Quark mass window in GeV (tagger)
0120     double minCandMass_;
0121     double maxCandMass_;
0122 
0123     double massRatioWidth_;  // One sided width of the A-shaped window around m_W/m_top in % (tagger)
0124     double minM23Cut_;       // minimal value of m23/m123 (tagger)
0125     double minM13Cut_;       // minimal value of atan(m13/m12) (tagger)
0126     double maxM13Cut_;       // maximal value of atan(m13/m12) (tagger)
0127 
0128     double maxR_;  // maximal fatjet size for MultiR tagger (tagger)
0129     double minR_;  // minimal fatjet size for MultiR tagger (tagger)
0130 
0131     bool rejectMinR_;  // set Ropt to zero when the candidate never
0132                        // leaves the window around the initial mass
0133 
0134     bool verbose_;
0135   };
0136 
0137 }  // namespace cms
0138 
0139 #endif