Clusters hadrons, partons, and jet contituents to determine the jet flavour. More...
#include <PhysicsTools/JetMCAlgos/plugins/JetFlavourClustering.cc>
Public Member Functions | |
JetFlavourClustering (const edm::ParameterSet &) | |
~JetFlavourClustering () | |
Public Member Functions inherited from edm::EDProducer | |
EDProducer () | |
ModuleDescription const & | moduleDescription () const |
virtual | ~EDProducer () |
Public Member Functions inherited from edm::ProducerBase | |
ProducerBase () | |
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
std::function< void(BranchDescription const &)> | registrationCallback () const |
used by the fwk to register list of products More... | |
virtual | ~ProducerBase () |
Public Member Functions inherited from edm::EDConsumerBase | |
std::vector< ConsumesInfo > | consumesInfo () const |
EDConsumerBase () | |
ProductHolderIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
void | itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const |
void | itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const |
std::vector < ProductHolderIndexAndSkipBit > const & | itemsToGetFromEvent () const |
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
void | modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const |
void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
bool | registeredToConsume (ProductHolderIndex, bool, BranchType) const |
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
void | updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &) |
virtual | ~EDConsumerBase () |
Static Public Member Functions | |
static void | fillDescriptions (edm::ConfigurationDescriptions &descriptions) |
Static Public Member Functions inherited from edm::EDProducer | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &descriptions) |
Private Member Functions | |
void | assignToSubjets (const reco::GenParticleRefVector &clusteredParticles, const edm::Handle< edm::View< reco::Jet > > &subjets, const std::vector< int > &subjetIndices, std::vector< reco::GenParticleRefVector > &assignedParticles) |
virtual void | beginJob () |
virtual void | beginLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &) |
virtual void | beginRun (edm::Run &, edm::EventSetup const &) |
virtual void | endJob () |
virtual void | endLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &) |
virtual void | endRun (edm::Run &, edm::EventSetup const &) |
void | insertGhosts (const edm::Handle< reco::GenParticleRefVector > &particles, const double ghostRescaling, const bool isHadron, const bool isbHadron, const bool isParton, const bool isLepton, std::vector< fastjet::PseudoJet > &constituents) |
void | matchGroomedJets (const edm::Handle< edm::View< reco::Jet > > &jets, const edm::Handle< edm::View< reco::Jet > > &matchedJets, std::vector< int > &matchedIndices) |
void | matchReclusteredJets (const edm::Handle< edm::View< reco::Jet > > &jets, const std::vector< fastjet::PseudoJet > &matchedJets, std::vector< int > &matchedIndices) |
void | matchSubjets (const std::vector< int > &groomedIndices, const edm::Handle< edm::View< reco::Jet > > &groomedJets, const edm::Handle< edm::View< reco::Jet > > &subjets, std::vector< std::vector< int > > &matchedIndices) |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
void | setFlavours (const reco::GenParticleRefVector &clusteredbHadrons, const reco::GenParticleRefVector &clusteredcHadrons, const reco::GenParticleRefVector &clusteredPartons, int &hadronFlavour, int &partonFlavour) |
Private Attributes | |
const edm::EDGetTokenT < reco::GenParticleRefVector > | bHadronsToken_ |
const edm::EDGetTokenT < reco::GenParticleRefVector > | cHadronsToken_ |
ClusterSequencePtr | fjClusterSeq_ |
JetDefPtr | fjJetDefinition_ |
const double | ghostRescaling_ |
const edm::EDGetTokenT < edm::View< reco::Jet > > | groomedJetsToken_ |
const bool | hadronFlavourHasPriority_ |
const std::string | jetAlgorithm_ |
const double | jetPtMin_ |
const edm::EDGetTokenT < edm::View< reco::Jet > > | jetsToken_ |
const edm::EDGetTokenT < reco::GenParticleRefVector > | leptonsToken_ |
const edm::EDGetTokenT < reco::GenParticleRefVector > | partonsToken_ |
const double | relPtTolerance_ |
const double | rParam_ |
const edm::EDGetTokenT < edm::View< reco::Jet > > | subjetsToken_ |
const bool | useLeptons_ |
const bool | useSubjets_ |
Additional Inherited Members | |
Public Types inherited from edm::EDProducer | |
typedef EDProducer | ModuleType |
Public Types inherited from edm::ProducerBase | |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Protected Member Functions inherited from edm::ProducerBase | |
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
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) |
Clusters hadrons, partons, and jet contituents to determine the jet flavour.
This producer clusters hadrons, partons and jet contituents to determine the jet flavour. The jet flavour information is stored in the event as an AssociationVector which associates an object of type JetFlavorInfo to each of the jets.
The producer takes as input jets and hadron and partons selected by the HadronAndPartonSelector producer. The hadron and parton four-momenta are rescaled by a very small number (default rescale factor is 10e-18) which turns them into the so-called "ghosts". The "ghost" hadrons and partons are clustered together with all of the jet constituents. It is important to use the same clustering algorithm and jet size as for the original input jet collection. Since the "ghost" hadrons and partons are extremely soft, the resulting jet collection will be practically identical to the original one but now with "ghost" hadrons and partons clustered inside jets. The jet flavour is determined based on the "ghost" hadrons clustered inside a jet:
To further assign a more specific flavour to light-flavour jets, "ghost" partons are used:
In rare instances a conflict between the hadron- and parton-based flavours can occur. In such cases it is possible to keep both flavours or to give priority to the hadron-based flavour. This is controlled by the 'hadronFlavourHasPriority' switch which is enabled by default. The priority is given to the hadron-based flavour as follows:
The producer is also capable of assigning the flavor to subjets of fat jets, in which case it produces an additional AssociationVector providing the flavour information for subjets. In order to assign the flavor to subjets, three input jet collections are required:
The "ghost" hadrons and partons clustered inside a fat jet are assigned to the closest subjet in the rapidity-phi space. Once hadrons and partons have been assigned to subjets, the subjet flavor is determined in the same way as for jets. The reason for requiring three jet collections as input in order to determine the subjet flavour is to avoid possible inconsistencies between the fat jet and subjet flavours (such as a non-b fat jet having a b subjet and vice versa) as well as the fact that reclustering the constituents of groomed fat jets will generally result in a jet collection different from the input groomed fat jets.
In addition, "ghost" leptons can also be clustered inside jets but they are not used in any way to determine the jet flavor. This functionality is disabled by default.
For more details, please refer to https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideBTagMCTools
Definition at line 139 of file JetFlavourClustering.cc.
|
explicit |
Definition at line 212 of file JetFlavourClustering.cc.
References edm::hlt::Exception, fjJetDefinition_, jetAlgorithm_, rParam_, and useSubjets_.
JetFlavourClustering::~JetFlavourClustering | ( | ) |
Definition at line 248 of file JetFlavourClustering.cc.
|
private |
Definition at line 692 of file JetFlavourClustering.cc.
References edm::RefVector< C, T, F >::begin(), reco::deltaR2(), HLT_25ns14e33_v1_cff::distance, edm::RefVector< C, T, F >::end(), and phi.
Referenced by produce().
|
privatevirtual |
Reimplemented from edm::EDProducer.
Definition at line 714 of file JetFlavourClustering.cc.
|
privatevirtual |
Definition at line 737 of file JetFlavourClustering.cc.
|
privatevirtual |
Definition at line 725 of file JetFlavourClustering.cc.
|
privatevirtual |
Reimplemented from edm::EDProducer.
Definition at line 720 of file JetFlavourClustering.cc.
|
privatevirtual |
Definition at line 743 of file JetFlavourClustering.cc.
|
privatevirtual |
Definition at line 731 of file JetFlavourClustering.cc.
|
static |
Definition at line 749 of file JetFlavourClustering.cc.
References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().
|
private |
Definition at line 480 of file JetFlavourClustering.cc.
References AlCaHLTBitMon_ParallelJobs::p.
Referenced by produce().
|
private |
Definition at line 544 of file JetFlavourClustering.cc.
References reco::deltaR2(), HLT_25ns14e33_v1_cff::distance, spr::find(), j, fwrapper::jets, rParam_, and mathSSE::sqrt().
Referenced by produce().
|
private |
Definition at line 502 of file JetFlavourClustering.cc.
References reco::deltaR2(), j, fwrapper::jets, rParam_, and mathSSE::sqrt().
Referenced by produce().
|
private |
Definition at line 595 of file JetFlavourClustering.cc.
References g, and alignCSCRings::s.
Referenced by produce().
|
privatevirtual |
Implements edm::EDProducer.
Definition at line 263 of file JetFlavourClustering.cc.
References funct::abs(), assignToSubjets(), bHadronsToken_, cHadronsToken_, fjClusterSeq_, fjJetDefinition_, edm::Event::getByToken(), ghostRescaling_, groomedJetsToken_, i, insertGhosts(), GhostInfo::isbHadron(), GhostInfo::isHadron(), GhostInfo::isLepton(), GhostInfo::isParton(), jetPtMin_, fwrapper::jets, jetsToken_, HLT_25ns14e33_v1_cff::leptons, leptonsToken_, visualization-live-secondInstance_cfg::m, matchGroomedJets(), matchReclusteredJets(), matchSubjets(), GhostInfo::particleRef(), partonsToken_, EnergyCorrector::pt, edm::RefVector< C, T, F >::push_back(), edm::Event::put(), relPtTolerance_, setFlavours(), subjetsToken_, useLeptons_, and useSubjets_.
|
private |
Definition at line 632 of file JetFlavourClustering.cc.
References funct::abs(), edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::end(), hadronFlavourHasPriority_, CandMCTagUtils::isLightParton(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), and edm::RefVector< C, T, F >::size().
Referenced by produce().
|
private |
Definition at line 187 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 188 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 201 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 202 of file JetFlavourClustering.cc.
Referenced by JetFlavourClustering(), and produce().
|
private |
Definition at line 195 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 185 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 197 of file JetFlavourClustering.cc.
Referenced by setFlavours().
|
private |
Definition at line 192 of file JetFlavourClustering.cc.
Referenced by JetFlavourClustering().
|
private |
Definition at line 194 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 184 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 190 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 189 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 196 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 193 of file JetFlavourClustering.cc.
Referenced by JetFlavourClustering(), matchGroomedJets(), and matchReclusteredJets().
|
private |
Definition at line 186 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 199 of file JetFlavourClustering.cc.
Referenced by produce().
|
private |
Definition at line 198 of file JetFlavourClustering.cc.
Referenced by JetFlavourClustering(), and produce().