CMS 3D CMS Logo

PFRecoTauDiscriminationByLeadingObjectPtCut.cc
Go to the documentation of this file.
4 
5 /*
6  * class PFRecoTauDiscriminationByLeadingObjectPtCut
7  * created : October 08 2008,
8  * revised : Wed Aug 19 17:13:04 PDT 2009
9  * Authors : Simone Gennai (SNS), Evan Friis (UC Davis)
10  */
11 
12 using namespace reco;
13 
15  public:
17  chargedOnly_ = iConfig.getParameter<bool>("UseOnlyChargedHadrons");
18  minPtLeadObject_ = iConfig.getParameter<double>("MinPtLeadingObject");
19  }
21  double discriminate(const PFTauRef& pfTau) const override;
22  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
23  private:
26 };
27 
29 {
30  double leadObjectPt = -1.;
31  if( chargedOnly_ )
32  {
33  // consider only charged hadrons. note that the leadChargedHadrCand is the highest pt
34  // charged signal cone object above the quality cut level (typically 0.5 GeV).
35  if( thePFTauRef->leadChargedHadrCand().isNonnull() )
36  {
37  leadObjectPt = thePFTauRef->leadChargedHadrCand()->pt();
38  }
39  }
40  else
41  {
42  // If using the 'leading pion' option, require that:
43  // 1) at least one charged hadron exists above threshold (thePFTauRef->leadChargedHadrCand().isNonnull())
44  // 2) the lead PFCand exists. In the case that the highest pt charged hadron is above the PFRecoTauProducer threshold
45  // (typically 5 GeV), the leadCand and the leadChargedHadrCand are the same object. If the leadChargedHadrCand
46  // is below 5GeV, but there exists a neutral PF particle > 5 GeV, it is set to be the leadCand
47  if( thePFTauRef->leadCand().isNonnull() && thePFTauRef->leadChargedHadrCand().isNonnull() )
48  {
49  leadObjectPt = thePFTauRef->leadCand()->pt();
50  }
51  }
52 
53  return ( leadObjectPt > minPtLeadObject_ ? 1. : 0. );
54 }
55 
56 void
58  // pfRecoTauDiscriminationByLeadingObjectPtCut
60  desc.add<double>("MinPtLeadingObject", 5.0);
61  {
63  psd0.add<std::string>("BooleanOperator", "and");
64  desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
65  }
66  desc.add<bool>("UseOnlyChargedHadrons", false);
67  desc.add<edm::InputTag>("PFTauProducer", edm::InputTag("pfRecoTauProducer"));
68  descriptions.add("pfRecoTauDiscriminationByLeadingObjectPtCut", desc);
69 }
70 
T getParameter(std::string const &) const
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
fixed size matrix