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 26 of file RecoTauDecayModeTruthMatchPlugin.cc.

Member Typedef Documentation

Definition at line 36 of file RecoTauDecayModeTruthMatchPlugin.cc.

Constructor & Destructor Documentation

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

Definition at line 41 of file RecoTauDecayModeTruthMatchPlugin.cc.

42  : RecoTauCleanerPlugin(pset,std::move(iC)),
43  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 30 of file RecoTauDecayModeTruthMatchPlugin.cc.

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

30 {}

Member Function Documentation

void tautools::RecoTauDecayModeTruthMatchPlugin::beginEvent ( )
overridevirtual

Reimplemented from reco::tau::RecoTauCleanerPlugin.

Definition at line 46 of file RecoTauDecayModeTruthMatchPlugin.cc.

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

Referenced by ~RecoTauDecayModeTruthMatchPlugin().

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

Implements reco::tau::RecoTauCleanerPlugin.

Definition at line 53 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().

54  {
55  GenJetAssociation::reference_type truth = (*genTauMatch_)[tau];
56  // Check if the matching exists, if not return +infinity
57  if (truth.isNull())
59  // Get the difference in decay mode. The closer to zero, the more the decay
60  // mode is matched.
61  return std::abs(
62  reco::tau::getDecayMode(truth.get()) - tau->decayMode());
63 }
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 37 of file RecoTauDecayModeTruthMatchPlugin.cc.

Referenced by beginEvent().

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

Definition at line 35 of file RecoTauDecayModeTruthMatchPlugin.cc.

Referenced by beginEvent().