CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecoTauDecayModeTruthMatchPlugin.cc
Go to the documentation of this file.
1 /*
2  * RecoTauDecayModeTruthMatchPlugin
3  *
4  * Author: Evan K. Friis, UC Davis
5  *
6  * Implements a RecoTauCleaner plugin that returns the difference
7  * between the reconstructed decay mode and true decay mode index.
8  *
9  * By requiring the return value to be zero one can select reco taus
10  * that have the decay mode correctly reconstructed.
11  *
12  * $Id. $
13  */
14 
16 
22 
24 
25 #include <boost/foreach.hpp>
26 
27 
28 namespace tautools {
29 
31 {
32  public:
35  double operator()(const reco::PFTauRef&) const;
36  void beginEvent();
37 
38  private:
42 };
43 
44 // ctor
46  const edm::ParameterSet& pset): RecoTauCleanerPlugin(pset),
47  matchingSrc_(pset.getParameter<edm::InputTag>("matching")) {}
48 
49 // Called by base class at the beginning of each event
51  // Load the matching information
53 }
54 
55 // Determine a number giving the quality of the input tau. Lower numbers are
56 // better - zero indicates that the reco decay mode matches the truth.
58  const {
59  GenJetAssociation::reference_type truth = (*genTauMatch_)[tau];
60  // Check if the matching exists, if not return +infinity
61  if (truth.isNull())
63  // Get the difference in decay mode. The closer to zero, the more the decay
64  // mode is matched.
65  return std::abs(
66  reco::tau::getDecayMode(truth.get()) - tau->decayMode());
67 }
68 
69 } // end tautools namespace
70 
#define abs(x)
Definition: mlp_lapack.h:159
PFTau::hadronicDecayMode getDecayMode(const reco::GenJet *genJet)
bool isNull() const
Checks for null.
Definition: Ref.h:247
const double infinity
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
#define DEFINE_EDM_PLUGIN(factory, type, name)
edm::Association< reco::GenJetCollection > GenJetAssociation
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242