CMS 3D CMS Logo

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  */
13 
15 
21 
23 
24 namespace tautools {
25 
27 {
28  public:
31  double operator()(const reco::PFTauRef&) const override;
32  void beginEvent() override;
33 
34  private:
38 };
39 
40 // ctor
43  matchingSrc_(pset.getParameter<edm::InputTag>("matching")) {}
44 
45 // Called by base class at the beginning of each event
47  // Load the matching information
49 }
50 
51 // Determine a number giving the quality of the input tau. Lower numbers are
52 // better - zero indicates that the reco decay mode matches the truth.
54  const {
55  GenJetAssociation::reference_type truth = (*genTauMatch_)[tau];
56  // Check if the matching exists, if not return +infinity
57  if (truth.isNull())
59  // Get the difference in decay mode. The closer to zero, the more the decay
60  // mode is matched.
61  return std::abs(
62  reco::tau::getDecayMode(truth.get()) - tau->decayMode());
63 }
64 
65 } // end tautools namespace
66 
double operator()(const reco::PFTauRef &) const override
PFTau::hadronicDecayMode getDecayMode(const reco::GenJet *genJet)
const double infinity
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:243
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)
HLT enums.
RecoTauDecayModeTruthMatchPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
#define DEFINE_EDM_PLUGIN(factory, type, name)
edm::Association< reco::GenJetCollection > GenJetAssociation
def move(src, dest)
Definition: eostools.py:511