CMS 3D CMS Logo

PFRecoTauDiscriminationByTauPolarization.cc
Go to the documentation of this file.
2 
3 /* class PFRecoTauDiscriminationByTauPolarization
4  * created : May 26 2010,
5  * contributors : Sami Lehti (sami.lehti@cern.ch ; HIP, Helsinki)
6  */
7 
8 using namespace reco;
9 using namespace std;
10 using namespace edm;
11 
14  public:
16  const ParameterSet& iConfig)
17  :PFTauDiscriminationProducerBase(iConfig) { // retrieve quality cuts
18  rTauMin = iConfig.getParameter<double>("rtau");
19  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
20  }
21 
23 
24  void beginEvent(const Event&, const EventSetup&) override;
25  double discriminate(const PFTauRef&) const override;
26 
27  private:
29  double rTauMin;
30 };
31 
33  const Event& event, const EventSetup& eventSetup){}
34 
35 double
37 
38  double rTau = 0;
39  // rtau for PFTau has to be calculated for leading PF charged hadronic candidate
40  // calculating it from leadingTrack can (and will) give rtau > 1!
41  if(tau.isNonnull() && tau->p() > 0
42  && tau->leadPFChargedHadrCand().isNonnull()) {
43  rTau = tau->leadPFChargedHadrCand()->p()/tau->p();
44  }
45 
46  if(booleanOutput) return ( rTau > rTauMin ? 1. : 0. );
47  return rTau;
48 }
49 
T getParameter(std::string const &) const
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
void beginEvent(const Event &, const EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
fixed size matrix
HLT enums.
Definition: event.py:1