CMS 3D CMS Logo

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

#include <CATopJetProducer.h>

Inheritance diagram for cms::CATopJetProducer:
FastjetJetProducer VirtualJetProducer edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CATopJetProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
virtual void runAlgorithm (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
virtual ~CATopJetProducer ()
 
- Public Member Functions inherited from FastjetJetProducer
 FastjetJetProducer (const edm::ParameterSet &iConfig)
 
virtual ~FastjetJetProducer ()
 
- Public Member Functions inherited from VirtualJetProducer
std::string jetType () const
 
 VirtualJetProducer (const edm::ParameterSet &iConfig)
 
virtual ~VirtualJetProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

enum  tagalgos { CA_TOPTAGGER, FJ_CMS_TOPTAG, FJ_JHU_TOPTAG, FJ_NSUB_TAG }
 

Private Attributes

double centralEtaCut_
 
std::auto_ptr< fastjet::CMSTopTagger > fjCMSTopTagger_
 The algorithm to do the work. More...
 
std::auto_ptr< fastjet::JHTopTagger > fjJHUTopTagger_
 
std::auto_ptr< fastjet::RestFrameNSubjettinessTagger > fjNSUBTagger_
 
std::auto_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::RangeDefinition > RangeDefPtr
 
- 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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from FastjetJetProducer
virtual void produceTrackJets (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
- 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)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from VirtualJetProducer
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_
 
RangeDefPtr fjRangeDef_
 
bool fromHTTTopJetProducer_
 
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 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_
 

Detailed Description

Definition at line 75 of file CATopJetProducer.h.

Member Enumeration Documentation

Enumerator
CA_TOPTAGGER 
FJ_CMS_TOPTAG 
FJ_JHU_TOPTAG 
FJ_NSUB_TAG 

Definition at line 99 of file CATopJetProducer.h.

Constructor & Destructor Documentation

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

Definition at line 10 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_.

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

Definition at line 81 of file CATopJetProducer.h.

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

81 {}

Member Function Documentation

void CATopJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from FastjetJetProducer.

Definition at line 76 of file CATopJetProducer.cc.

References FastjetJetProducer::produce().

Referenced by ~CATopJetProducer().

77 {
79 }
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
void CATopJetProducer::runAlgorithm ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from FastjetJetProducer.

Definition at line 81 of file CATopJetProducer.cc.

References CA_TOPTAGGER, centralEtaCut_, gather_cfg::cout, DEFINE_FWK_MODULE, 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().

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

Member Data Documentation

double cms::CATopJetProducer::centralEtaCut_
private

Definition at line 97 of file CATopJetProducer.h.

Referenced by runAlgorithm().

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

The algorithm to do the work.

Definition at line 89 of file CATopJetProducer.h.

Referenced by CATopJetProducer(), and runAlgorithm().

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

Definition at line 90 of file CATopJetProducer.h.

Referenced by CATopJetProducer(), and runAlgorithm().

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

Definition at line 91 of file CATopJetProducer.h.

Referenced by CATopJetProducer(), and runAlgorithm().

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

Definition at line 88 of file CATopJetProducer.h.

Referenced by CATopJetProducer().

double cms::CATopJetProducer::ptMin_
private

Definition at line 96 of file CATopJetProducer.h.

Referenced by runAlgorithm().

int cms::CATopJetProducer::tagAlgo_
private

Definition at line 95 of file CATopJetProducer.h.

Referenced by CATopJetProducer(), and runAlgorithm().

bool cms::CATopJetProducer::verbose_
private

Definition at line 98 of file CATopJetProducer.h.

Referenced by runAlgorithm().