CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecoTauChargedHadronMultiplicityCleanerPlugin.cc
Go to the documentation of this file.
1 /*
2  * RecoTauChargedHadronMultiplicityCleanerPlugin
3  *
4  * Author: Christian Veelken, NICPB Tallinn
5  *
6  * A reco tau cleaner plugin that ranks the PFTaus by the number of charged hadrons.
7  */
8 
11 
12 namespace reco { namespace tau {
13 
15 {
16  public:
18 
19  // Get ranking value for a given tau Ref
20  double operator()(const reco::PFTauRef&) const override;
21 };
22 
24  : RecoTauCleanerPlugin(pset,std::move(iC))
25 {}
26 
28 {
29  // Get the ranking value for this tau.
30  // N.B. lower value means more "tau like"!
31  double result = 0.;
32  const std::vector<PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
33  for ( std::vector<PFRecoTauChargedHadron>::const_iterator chargedHadron = chargedHadrons.begin();
34  chargedHadron != chargedHadrons.end(); ++chargedHadron ) {
35  if ( chargedHadron->algo() == PFRecoTauChargedHadron::kChargedPFCandidate ) result -= 8.;
36  else if ( chargedHadron->algo() == PFRecoTauChargedHadron::kTrack ) result -= 4.;
37  else if ( chargedHadron->algo() == PFRecoTauChargedHadron::kPFNeutralHadron ) result -= 2.;
38  else result -= 1.;
39  }
40  return result;
41 }
42 
43 }} // end namespace reco::tau
44 
45 // Register our plugin
49  "RecoTauChargedHadronMultiplicityCleanerPlugin");
RecoTauChargedHadronMultiplicityCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
tuple result
Definition: query.py:137
def move
Definition: eostools.py:510
#define DEFINE_EDM_PLUGIN(factory, type, name)