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/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 
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
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:535
bool isNull() const
Checks for null.
Definition: Ref.h:250
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