CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
cms::CATopJetProducer Class Reference

#include <CATopJetProducer.h>

Inheritance diagram for cms::CATopJetProducer:
FastjetJetProducer VirtualJetProducer edm::stream::EDProducer<>

Public Member Functions

 CATopJetProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
void runAlgorithm (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~CATopJetProducer () override
 
- Public Member Functions inherited from FastjetJetProducer
 FastjetJetProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~FastjetJetProducer () override
 
- Public Member Functions inherited from VirtualJetProducer
std::string jetType () const
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 VirtualJetProducer (const edm::ParameterSet &iConfig)
 
 ~VirtualJetProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from FastjetJetProducer
static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillDescriptionsFromFastJetProducer (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from VirtualJetProducer
static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillDescriptionsFromVirtualJetProducer (edm::ParameterSetDescription &desc)
 

Private Types

enum  tagalgos { CA_TOPTAGGER, FJ_CMS_TOPTAG, FJ_JHU_TOPTAG, FJ_NSUB_TAG }
 

Private Attributes

double centralEtaCut_
 
std::unique_ptr< fastjet::CMSTopTagger > fjCMSTopTagger_
 The algorithm to do the work. More...
 
std::unique_ptr< fastjet::JHTopTagger > fjJHUTopTagger_
 
std::unique_ptr< fastjet::RestFrameNSubjettinessTagger > fjNSUBTagger_
 
std::unique_ptr< CATopJetAlgorithmlegacyCMSTopTagger_
 
double ptMin_
 
int tagAlgo_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from FastjetJetProducer
typedef boost::shared_ptr< DynamicRfiltDynamicRfiltPtr
 
typedef fastjet::Transformer transformer
 
typedef std::vector< transformer_ptrtransformer_coll
 
typedef std::unique_ptr< transformertransformer_ptr
 
- Public Types inherited from VirtualJetProducer
typedef boost::shared_ptr< fastjet::GhostedAreaSpec > ActiveAreaSpecPtr
 
typedef boost::shared_ptr< fastjet::AreaDefinition > AreaDefinitionPtr
 
typedef boost::shared_ptr< fastjet::ClusterSequence > ClusterSequencePtr
 
typedef boost::shared_ptr< fastjet::JetDefinition > JetDefPtr
 
typedef boost::shared_ptr< fastjet::JetDefinition::Plugin > PluginPtr
 
typedef boost::shared_ptr< fastjet::Selector > SelectorPtr
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Protected Member Functions inherited from FastjetJetProducer
virtual void produceTrackJets (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
void runAlgorithm (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
- Protected Member Functions inherited from VirtualJetProducer
virtual void addHTTTopJetTagInfoCollection (edm::Event &iEvent, const edm::EventSetup &iSetup, edm::OrphanHandle< reco::BasicJetCollection > &oh)
 
virtual void copyConstituents (const std::vector< fastjet::PseudoJet > &fjConstituents, reco::Jet *jet)
 
virtual std::vector< reco::CandidatePtrgetConstituents (const std::vector< fastjet::PseudoJet > &fjConstituents)
 
virtual void inputTowers ()
 
virtual bool isAnomalousTower (reco::CandidatePtr input)
 
bool makeBasicJet (const JetType::Type &fTag)
 
bool makeCaloJet (const JetType::Type &fTag)
 
bool makeGenJet (const JetType::Type &fTag)
 
bool makePFClusterJet (const JetType::Type &fTag)
 
bool makePFJet (const JetType::Type &fTag)
 
virtual void makeProduces (std::string s, std::string tag="")
 
bool makeTrackJet (const JetType::Type &fTag)
 
void offsetCorrectJets (std::vector< fastjet::PseudoJet > &orphanInput)
 
virtual void output (edm::Event &iEvent, edm::EventSetup const &iSetup)
 
template<typename T >
void writeCompoundJets (edm::Event &iEvent, edm::EventSetup const &iSetup)
 function template to write out the outputs More...
 
template<typename T >
void writeJets (edm::Event &iEvent, edm::EventSetup const &iSetup)
 
template<typename T >
void writeJetsWithConstituents (edm::Event &iEvent, edm::EventSetup const &iSetup)
 function template to write out the outputs More...
 
- Protected Attributes inherited from VirtualJetProducer
int activeAreaRepeats_
 
bool doAreaDiskApprox_
 
bool doAreaFastjet_
 
bool doFastJetNonUniform_
 
bool doPUOffsetCorr_
 
bool doPVCorrection_
 
bool doRhoFastjet_
 
ActiveAreaSpecPtr fjActiveArea_
 
AreaDefinitionPtr fjAreaDefinition_
 
ClusterSequencePtr fjClusterSeq_
 
std::vector< fastjet::PseudoJet > fjInputs_
 
JetDefPtr fjJetDefinition_
 
std::vector< fastjet::PseudoJet > fjJets_
 
PluginPtr fjPlugin_
 
SelectorPtr fjSelector_
 
bool fromHTTTopJetProducer_ = false
 
double ghostArea_
 
double ghostEtaMax_
 
edm::EDGetTokenT< reco::VertexCollectioninput_vertex_token_
 
double inputEMin_
 
double inputEtMin_
 
std::vector< edm::Ptr< reco::Candidate > > inputs_
 
std::string jetAlgorithm_
 
std::string jetCollInstanceName_
 
double jetPtMin_
 
std::string jetType_
 
JetType::Type jetTypeE
 
unsigned int maxInputs_
 
unsigned int minSeed_
 
std::string moduleLabel_
 
unsigned int nExclude_
 
std::vector< double > puCenters_
 
std::string puSubtractorName_
 
double puWidth_
 
bool restrictInputs_
 
double rhoEtaMax_
 
double rParam_
 
edm::InputTag src_
 
edm::InputTag srcPVs_
 
boost::shared_ptr< PileUpSubtractorsubtractor_
 
bool useDeterministicSeed_
 
bool useExplicitGhosts_
 
int verbosity_
 
reco::Particle::Point vertex_
 
double voronoiRfact_
 
bool writeCompound_
 
bool writeJetsWithConst_
 

Detailed Description

Definition at line 77 of file CATopJetProducer.h.

Member Enumeration Documentation

Enumerator
CA_TOPTAGGER 
FJ_CMS_TOPTAG 
FJ_JHU_TOPTAG 
FJ_NSUB_TAG 

Definition at line 102 of file CATopJetProducer.h.

Constructor & Destructor Documentation

CATopJetProducer::CATopJetProducer ( const edm::ParameterSet ps)

Definition at line 11 of file CATopJetProducer.cc.

References CA_TOPTAGGER, FJ_CMS_TOPTAG, FJ_JHU_TOPTAG, FJ_NSUB_TAG, fjCMSTopTagger_, fjJHUTopTagger_, fjNSUBTagger_, edm::ParameterSet::getParameter(), legacyCMSTopTagger_, fwrapper::plugin, VirtualJetProducer::src_, and tagAlgo_.

11  :
12  FastjetJetProducer( conf ),
13  tagAlgo_(conf.getParameter<int>("tagAlgo")),
14  ptMin_(conf.getParameter<double>("jetPtMin")),
15  centralEtaCut_(conf.getParameter<double>("centralEtaCut")),
16  verbose_(conf.getParameter<bool>("verbose"))
17 {
18 
19  if (tagAlgo_ == CA_TOPTAGGER ) {
20 
21  legacyCMSTopTagger_ = std::unique_ptr<CATopJetAlgorithm>(
23  conf.getParameter<bool> ("verbose"),
24  conf.getParameter<int> ("algorithm"), // 0 = KT, 1 = CA, 2 = anti-KT
25  conf.getParameter<int> ("useAdjacency"), // choose adjacency requirement:
26  // 0 = no adjacency
27  // 1 = deltar adjacency
28  // 2 = modified adjacency
29  // 3 = calotower neirest neigbor based adjacency (untested)
30  conf.getParameter<double>("centralEtaCut"), // eta for defining "central" jets
31  conf.getParameter<double>("jetPtMin"), // min jet pt
32  conf.getParameter<std::vector<double> >("sumEtBins"), // sumEt bins over which cuts may vary. vector={bin 0 lower bound, bin 1 lower bound, ...}
33  conf.getParameter<std::vector<double> >("rBins"), // Jet distance paramter R. R values depend on sumEt bins.
34  conf.getParameter<std::vector<double> >("ptFracBins"), // fraction of hard jet pt that subjet must have (deltap)
35  conf.getParameter<std::vector<double> >("deltarBins"), // Applicable only if useAdjacency=1. deltar adjacency values for each sumEtBin
36  conf.getParameter<std::vector<double> >("nCellBins"), // Applicable only if useAdjacency=3. number of cells to consider two subjets adjacent
37  conf.getParameter<double>("inputEtMin"), // seed threshold - NOT USED
38  conf.getParameter<bool> ("useMaxTower"), // use max tower as adjacency criterion, otherwise use centroid - NOT USED
39  conf.getParameter<double>("sumEtEtaCut"), // eta for event SumEt - NOT USED
40  conf.getParameter<double>("etFrac") // fraction of event sumEt / 2 for a jet to be considered "hard" -NOT USED
41  ));
42  }
43  else if (tagAlgo_ == FJ_CMS_TOPTAG ) {
44  fjCMSTopTagger_ = std::unique_ptr<fastjet::CMSTopTagger>(
45  new fastjet::CMSTopTagger(conf.getParameter<double> ("ptFrac"),
46  conf.getParameter<double> ("rFrac"),
47  conf.getParameter<double> ("adjacencyParam"))
48  );
49  }
50  else if (tagAlgo_ == FJ_JHU_TOPTAG ) {
51  fjJHUTopTagger_ = std::unique_ptr<fastjet::JHTopTagger>(
52  new fastjet::JHTopTagger(conf.getParameter<double>("ptFrac"),
53  conf.getParameter<double>("deltaRCut"),
54  conf.getParameter<double>("cosThetaWMax")
55  )
56  );
57  }
58  else if (tagAlgo_ == FJ_NSUB_TAG ) {
59 
60  fastjet::JetDefinition::Plugin *plugin = new fastjet::SISConePlugin(0.6, 0.75);
61  fastjet::JetDefinition NsubJetDef(plugin);
62  fjNSUBTagger_ = std::unique_ptr<fastjet::RestFrameNSubjettinessTagger>(
63  new fastjet::RestFrameNSubjettinessTagger(NsubJetDef,
64  conf.getParameter<double>("tau2Cut"),
65  conf.getParameter<double>("cosThetaSCut"),
66  conf.getParameter<bool>("useExclusive")
67  )
68  );
69  }
70 
71 
72 
73 
74 
75 }
std::unique_ptr< fastjet::RestFrameNSubjettinessTagger > fjNSUBTagger_
FastjetJetProducer(const edm::ParameterSet &iConfig)
std::unique_ptr< fastjet::JHTopTagger > fjJHUTopTagger_
unique_ptr< JetDefinition::Plugin > plugin
std::unique_ptr< CATopJetAlgorithm > legacyCMSTopTagger_
std::unique_ptr< fastjet::CMSTopTagger > fjCMSTopTagger_
The algorithm to do the work.
cms::CATopJetProducer::~CATopJetProducer ( )
inlineoverride

Definition at line 83 of file CATopJetProducer.h.

References fillDescriptions(), iEvent, produce(), and runAlgorithm().

83 {}

Member Function Documentation

void CATopJetProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Cambridge-Aachen top jet producer parameters

Definition at line 133 of file CATopJetProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, funct::false, FastjetJetProducer::fillDescriptionsFromFastJetProducer(), and VirtualJetProducer::fillDescriptionsFromVirtualJetProducer().

Referenced by ~CATopJetProducer().

133  {
134 
137  desc.add<int>("tagAlgo", 0); // choice of top tagging algorithm
138  desc.add<double>("centralEtaCut", 2.5 ); // eta for defining "central" jets
139  desc.add<bool >("verbose", false );
140  desc.add<string>("jetCollInstanceName", "caTopSubJets"); // subjet collection
141  desc.add<int>("algorithm", 1); // 0 = KT, 1 = CA, 2 = anti-KT
142  desc.add<int>("useAdjacency", 2); // veto adjacent subjets:
143  // 0, no adjacency
144  // 1, deltar adjacency
145  // 2, modified adjacency
146  // 3, calotower neirest neigbor based adjacency (untested)
147  vector<double> sumEtBinsDefault={0.,1600.,2600.};
148  desc.add<vector<double>>("sumEtBins", sumEtBinsDefault); // sumEt bins over which cuts vary. vector={bin 0 lower bound, bin 1 lower bound, ...}
149  vector<double> rBinsDefault(3,0.8);
150  desc.add<vector<double>>("rBins", rBinsDefault); // Jet distance paramter R. R values depend on sumEt bins.
151  vector<double> ptFracBinsDefault(3,0.05);
152  desc.add<vector<double>>("ptFracBins", ptFracBinsDefault); // minimum fraction of central jet pt for subjets (deltap)
153  vector<double> deltarBinsDefault(3,0.019);
154  desc.add<vector<double>>("deltarBins", deltarBinsDefault); // Applicable only if useAdjacency=1. deltar adjacency values for each sumEtBin
155  vector<double> nCellBinsDefault(3,1.9);
156  desc.add<vector<double>>("nCellBins", nCellBinsDefault); // Applicable only if useAdjacency=3. number of cells apart for two subjets to be considered "independent"
157  desc.add<bool>("useMaxTower", false); // use max tower in adjacency criterion, otherwise use centroid - NOT USED
158  desc.add<double>("sumEtEtaCut", 3.0); // eta for event SumEt - NOT USED
159  desc.add<double>("etFrac", 0.7); // fraction of event sumEt / 2 for a jet to be considered "hard" - NOT USED
160  desc.add<double>("ptFrac", 0.05);
161  desc.add<double>("rFrac", 0.);
162  desc.add<double>("adjacencyParam", 0.);
163  desc.add<double>("deltaRCut", 0.19);
164  desc.add<double>("cosThetaWMax", 0.7);
165  desc.add<double>("tau2Cut", 0.);
166  desc.add<double>("cosThetaSCut", 0.);
167  desc.add<bool>("useExclusive", false);
173  descriptions.add("CATopJetProducer",desc);
174 
175 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptionsFromFastJetProducer(edm::ParameterSetDescription &desc)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptionsFromVirtualJetProducer(edm::ParameterSetDescription &desc)
void CATopJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 77 of file CATopJetProducer.cc.

References FastjetJetProducer::produce().

Referenced by ~CATopJetProducer().

78 {
80 }
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void CATopJetProducer::runAlgorithm ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements VirtualJetProducer.

Definition at line 82 of file CATopJetProducer.cc.

References CA_TOPTAGGER, centralEtaCut_, gather_cfg::cout, VirtualJetProducer::doAreaFastjet_, VirtualJetProducer::doRhoFastjet_, FJ_CMS_TOPTAG, FJ_JHU_TOPTAG, FJ_NSUB_TAG, VirtualJetProducer::fjAreaDefinition_, VirtualJetProducer::fjClusterSeq_, fjCMSTopTagger_, VirtualJetProducer::fjInputs_, VirtualJetProducer::fjJetDefinition_, VirtualJetProducer::fjJets_, fjJHUTopTagger_, fjNSUBTagger_, mps_fire::i, perp(), ptMin_, tagAlgo_, verbose_, and VirtualJetProducer::voronoiRfact_.

Referenced by ~CATopJetProducer().

83 {
84  if ( !doAreaFastjet_ && !doRhoFastjet_) {
85  fjClusterSeq_ = ClusterSequencePtr( new fastjet::ClusterSequence( fjInputs_, *fjJetDefinition_ ) );
86  } else if (voronoiRfact_ <= 0) {
87  fjClusterSeq_ = ClusterSequencePtr( new fastjet::ClusterSequenceArea( fjInputs_, *fjJetDefinition_ , *fjAreaDefinition_ ) );
88  } else {
89  fjClusterSeq_ = ClusterSequencePtr( new fastjet::ClusterSequenceVoronoiArea( fjInputs_, *fjJetDefinition_ , fastjet::VoronoiAreaSpec(voronoiRfact_) ) );
90  }
91 
92  if (tagAlgo_ == CA_TOPTAGGER){
93  (*legacyCMSTopTagger_).run( fjInputs_, fjJets_, fjClusterSeq_ );
94 
95  }
96  else {
97 
98  //Run the jet clustering
99  vector<fastjet::PseudoJet> inclusiveJets = fjClusterSeq_->inclusive_jets(ptMin_);
100 
101  if ( verbose_ ) cout << "Getting central jets" << endl;
102  // Find the transient central jets
103  vector<fastjet::PseudoJet> centralJets;
104  for (unsigned int i = 0; i < inclusiveJets.size(); i++) {
105 
106  if (inclusiveJets[i].perp() > ptMin_ && fabs(inclusiveJets[i].rapidity()) < centralEtaCut_) {
107  centralJets.push_back(inclusiveJets[i]);
108  }
109  }
110 
111  fastjet::CMSTopTagger & CMSTagger = *fjCMSTopTagger_;
112  fastjet::JHTopTagger & JHUTagger = *fjJHUTopTagger_;
113  fastjet::RestFrameNSubjettinessTagger & NSUBTagger = *fjNSUBTagger_;
114 
115 
116  vector<fastjet::PseudoJet>::iterator jetIt = centralJets.begin(), centralJetsEnd = centralJets.end();
117  if ( verbose_ )cout<<"Loop over jets"<<endl;
118  for ( ; jetIt != centralJetsEnd; ++jetIt ) {
119 
120  if (verbose_) cout << "CMS FJ jet pt: " << (*jetIt).perp() << endl;
121 
122  fastjet::PseudoJet taggedJet;
123  if (tagAlgo_ == FJ_CMS_TOPTAG) taggedJet = CMSTagger.result(*jetIt);
124  else if (tagAlgo_ == FJ_JHU_TOPTAG) taggedJet = JHUTagger.result(*jetIt);
125  else if (tagAlgo_ == FJ_NSUB_TAG) taggedJet = NSUBTagger.result(*jetIt);
126  else cout << "NOT A VALID TAGGING ALGORITHM CHOICE!" << endl;
127 
128  if (taggedJet != 0) fjJets_.push_back(taggedJet);
129  }
130  }
131 }
std::vector< fastjet::PseudoJet > fjJets_
std::unique_ptr< fastjet::RestFrameNSubjettinessTagger > fjNSUBTagger_
std::unique_ptr< fastjet::JHTopTagger > fjJHUTopTagger_
std::vector< fastjet::PseudoJet > fjInputs_
ClusterSequencePtr fjClusterSeq_
T perp() const
Magnitude of transverse component.
AreaDefinitionPtr fjAreaDefinition_
std::unique_ptr< fastjet::CMSTopTagger > fjCMSTopTagger_
The algorithm to do the work.
boost::shared_ptr< fastjet::ClusterSequence > ClusterSequencePtr

Member Data Documentation

double cms::CATopJetProducer::centralEtaCut_
private

Definition at line 100 of file CATopJetProducer.h.

Referenced by runAlgorithm().

std::unique_ptr<fastjet::CMSTopTagger> cms::CATopJetProducer::fjCMSTopTagger_
private

The algorithm to do the work.

Definition at line 92 of file CATopJetProducer.h.

Referenced by CATopJetProducer(), and runAlgorithm().

std::unique_ptr<fastjet::JHTopTagger> cms::CATopJetProducer::fjJHUTopTagger_
private

Definition at line 93 of file CATopJetProducer.h.

Referenced by CATopJetProducer(), and runAlgorithm().

std::unique_ptr<fastjet::RestFrameNSubjettinessTagger> cms::CATopJetProducer::fjNSUBTagger_
private

Definition at line 94 of file CATopJetProducer.h.

Referenced by CATopJetProducer(), and runAlgorithm().

std::unique_ptr<CATopJetAlgorithm> cms::CATopJetProducer::legacyCMSTopTagger_
private

Definition at line 91 of file CATopJetProducer.h.

Referenced by CATopJetProducer().

double cms::CATopJetProducer::ptMin_
private

Definition at line 99 of file CATopJetProducer.h.

Referenced by runAlgorithm().

int cms::CATopJetProducer::tagAlgo_
private

Definition at line 98 of file CATopJetProducer.h.

Referenced by CATopJetProducer(), and runAlgorithm().

bool cms::CATopJetProducer::verbose_
private

Definition at line 101 of file CATopJetProducer.h.

Referenced by runAlgorithm().