CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
tautools::RecoTauDecayModeTruthMatchPlugin Class Reference
Inheritance diagram for tautools::RecoTauDecayModeTruthMatchPlugin:
reco::tau::RecoTauCleanerPlugin reco::tau::RecoTauEventHolderPlugin reco::tau::RecoTauNamedPlugin

Public Member Functions

void beginEvent () override
 
double operator() (const reco::PFTauRef &) const override
 
 RecoTauDecayModeTruthMatchPlugin (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
 ~RecoTauDecayModeTruthMatchPlugin () override
 
- Public Member Functions inherited from reco::tau::RecoTauCleanerPlugin
 RecoTauCleanerPlugin (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
 ~RecoTauCleanerPlugin () override
 
- Public Member Functions inherited from reco::tau::RecoTauEventHolderPlugin
const edm::Eventevt () const
 
edm::Eventevt ()
 
const edm::EventSetupevtSetup () const
 
 RecoTauEventHolderPlugin (const edm::ParameterSet &pset)
 
void setup (edm::Event &, const edm::EventSetup &)
 
 ~RecoTauEventHolderPlugin () override
 
- Public Member Functions inherited from reco::tau::RecoTauNamedPlugin
const std::string & name () const
 
 RecoTauNamedPlugin (const edm::ParameterSet &pset)
 
virtual ~RecoTauNamedPlugin ()
 

Private Types

typedef edm::Association< reco::GenJetCollectionGenJetAssociation
 

Private Attributes

edm::Handle< GenJetAssociationgenTauMatch_
 
edm::InputTag matchingSrc_
 

Detailed Description

Definition at line 29 of file RecoTauDecayModeTruthMatchPlugin.cc.

Member Typedef Documentation

Definition at line 39 of file RecoTauDecayModeTruthMatchPlugin.cc.

Constructor & Destructor Documentation

tautools::RecoTauDecayModeTruthMatchPlugin::RecoTauDecayModeTruthMatchPlugin ( const edm::ParameterSet pset,
edm::ConsumesCollector &&  iC 
)
explicit

Definition at line 44 of file RecoTauDecayModeTruthMatchPlugin.cc.

45  : RecoTauCleanerPlugin(pset,std::move(iC)),
46  matchingSrc_(pset.getParameter<edm::InputTag>("matching")) {}
T getParameter(std::string const &) const
RecoTauCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
def move(src, dest)
Definition: eostools.py:511
tautools::RecoTauDecayModeTruthMatchPlugin::~RecoTauDecayModeTruthMatchPlugin ( )
inlineoverride

Definition at line 33 of file RecoTauDecayModeTruthMatchPlugin.cc.

References beginEvent(), and operator()().

33 {}

Member Function Documentation

void tautools::RecoTauDecayModeTruthMatchPlugin::beginEvent ( )
overridevirtual

Reimplemented from reco::tau::RecoTauCleanerPlugin.

Definition at line 49 of file RecoTauDecayModeTruthMatchPlugin.cc.

References reco::tau::RecoTauEventHolderPlugin::evt(), genTauMatch_, edm::Event::getByLabel(), and matchingSrc_.

Referenced by ~RecoTauDecayModeTruthMatchPlugin().

49  {
50  // Load the matching information
52 }
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
double tautools::RecoTauDecayModeTruthMatchPlugin::operator() ( const reco::PFTauRef tau) const
overridevirtual

Implements reco::tau::RecoTauCleanerPlugin.

Definition at line 56 of file RecoTauDecayModeTruthMatchPlugin.cc.

References funct::abs(), DEFINE_EDM_PLUGIN, edm::Ref< C, T, F >::get(), reco::tau::getDecayMode(), infinity, edm::Ref< C, T, F >::isNull(), and metsig::tau.

Referenced by ~RecoTauDecayModeTruthMatchPlugin().

57  {
58  GenJetAssociation::reference_type truth = (*genTauMatch_)[tau];
59  // Check if the matching exists, if not return +infinity
60  if (truth.isNull())
62  // Get the difference in decay mode. The closer to zero, the more the decay
63  // mode is matched.
64  return std::abs(
65  reco::tau::getDecayMode(truth.get()) - tau->decayMode());
66 }
Ref< typename refprod_type::product_type > reference_type
Definition: Association.h:24
PFTau::hadronicDecayMode getDecayMode(const reco::GenJet *genJet)
const double infinity
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

edm::Handle<GenJetAssociation> tautools::RecoTauDecayModeTruthMatchPlugin::genTauMatch_
private

Definition at line 40 of file RecoTauDecayModeTruthMatchPlugin.cc.

Referenced by beginEvent().

edm::InputTag tautools::RecoTauDecayModeTruthMatchPlugin::matchingSrc_
private

Definition at line 38 of file RecoTauDecayModeTruthMatchPlugin.cc.

Referenced by beginEvent().