CMS 3D CMS Logo

RecoTauDistanceFromTruthPlugin.cc
Go to the documentation of this file.
2 
8 //#include "DataFormats/Common/interface/AssociativeIterator.h"
9 
10 #include <boost/bind.hpp>
11 #include <boost/iterator/filter_iterator.hpp>
12 
13 namespace tautools {
14 
16  public:
19  double operator()(const reco::PFTauRef&) const override;
20  void beginEvent() override;
21  private:
25 };
26 
29  matchingSrc_ = pset.getParameter<edm::InputTag>("matching");
30 }
31 
33  // Load the matching information
35 }
36 
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 }
47 
48 } // end tautools namespace
49 
50 
51 // Register our plugin
T getParameter(std::string const &) const
RecoTauDistanceFromTruthPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
double operator()(const reco::PFTauRef &) const override
edm::Association< reco::GenJetCollection > GenJetAssociation
const double infinity
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
bool isNull() const
Checks for null.
Definition: Ref.h:248
RecoTauCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
fixed size matrix
#define DEFINE_EDM_PLUGIN(factory, type, name)
def move(src, dest)
Definition: eostools.py:511