CMS 3D CMS Logo

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

Public Member Functions

void beginEvent () override
 
double operator() (const reco::PFTauRef &) const override
 
 RecoTauDistanceFromTruthPlugin (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
 ~RecoTauDistanceFromTruthPlugin () 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 15 of file RecoTauDistanceFromTruthPlugin.cc.

Member Typedef Documentation

Definition at line 23 of file RecoTauDistanceFromTruthPlugin.cc.

Constructor & Destructor Documentation

tautools::RecoTauDistanceFromTruthPlugin::RecoTauDistanceFromTruthPlugin ( const edm::ParameterSet pset,
edm::ConsumesCollector &&  iC 
)
tautools::RecoTauDistanceFromTruthPlugin::~RecoTauDistanceFromTruthPlugin ( )
inlineoverride

Definition at line 18 of file RecoTauDistanceFromTruthPlugin.cc.

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

18 {}

Member Function Documentation

void tautools::RecoTauDistanceFromTruthPlugin::beginEvent ( )
overridevirtual

Reimplemented from reco::tau::RecoTauCleanerPlugin.

Definition at line 32 of file RecoTauDistanceFromTruthPlugin.cc.

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

Referenced by ~RecoTauDistanceFromTruthPlugin().

32  {
33  // Load the matching information
35 }
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
double tautools::RecoTauDistanceFromTruthPlugin::operator() ( const reco::PFTauRef tauRef) const
overridevirtual

Implements reco::tau::RecoTauCleanerPlugin.

Definition at line 37 of file RecoTauDistanceFromTruthPlugin.cc.

References funct::abs(), DEFINE_EDM_PLUGIN, infinity, and edm::Ref< C, T, F >::isNull().

Referenced by ~RecoTauDistanceFromTruthPlugin().

37  {
38 
39  GenJetAssociation::reference_type truth = (*genTauMatch_)[tauRef];
40 
41  // Check if the matching exists, if not return +infinity
42  if (truth.isNull())
44 
45  return std::abs(tauRef->pt() - truth->pt());
46 }
Ref< typename refprod_type::product_type > reference_type
Definition: Association.h:24
const double infinity
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

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

Definition at line 24 of file RecoTauDistanceFromTruthPlugin.cc.

Referenced by beginEvent().

edm::InputTag tautools::RecoTauDistanceFromTruthPlugin::matchingSrc_
private

Definition at line 22 of file RecoTauDistanceFromTruthPlugin.cc.

Referenced by beginEvent(), and RecoTauDistanceFromTruthPlugin().