CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecoTauDistanceFromTruthPlugin.cc
Go to the documentation of this file.
2 
8 //#include "DataFormats/Common/interface/AssociativeIterator.h"
9 
10 #include <boost/foreach.hpp>
11 #include <boost/bind.hpp>
12 #include <boost/iterator/filter_iterator.hpp>
13 
14 namespace tautools {
15 
17  public:
20  double operator()(const reco::PFTauRef&) const override;
21  void beginEvent() override;
22  private:
26 };
27 
29  const edm::ParameterSet& pset, edm::ConsumesCollector &&iC): reco::tau::RecoTauCleanerPlugin(pset,std::move(iC)) {
30  matchingSrc_ = pset.getParameter<edm::InputTag>("matching");
31 }
32 
34  // Load the matching information
36 }
37 
39 
40  GenJetAssociation::reference_type truth = (*genTauMatch_)[tauRef];
41 
42  // Check if the matching exists, if not return +infinity
43  if (truth.isNull())
45 
46  return std::abs(tauRef->pt() - truth->pt());
47 }
48 
49 } // end tautools namespace
50 
51 
52 // Register our plugin
T getParameter(std::string const &) const
double operator()(const reco::PFTauRef &) const override
RecoTauDistanceFromTruthPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
edm::Association< reco::GenJetCollection > GenJetAssociation
def move
Definition: eostools.py:510
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:418
bool isNull() const
Checks for null.
Definition: Ref.h:249
#define DEFINE_EDM_PLUGIN(factory, type, name)