test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloRecoTauDiscriminationByTauPolarization.cc
Go to the documentation of this file.
3 
4 /* class CaloRecoTauDiscriminationByTauPolarization
5  * created : September 22 2010,
6  * contributors : Sami Lehti (sami.lehti@cern.ch ; HIP, Helsinki)
7  */
8 
9 
10 namespace {
11 using namespace reco;
12 using namespace std;
13 
14 class CaloRecoTauDiscriminationByTauPolarization : public CaloTauDiscriminationProducerBase {
15  public:
16  explicit CaloRecoTauDiscriminationByTauPolarization(
17  const edm::ParameterSet& iConfig)
19  rTauMin = iConfig.getParameter<double>("rtau");
20  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
21  }
22 
23  ~CaloRecoTauDiscriminationByTauPolarization(){}
24  double discriminate(const CaloTauRef&) const override;
25 
26  private:
27  bool booleanOutput;
28  double rTauMin;
29 };
30 
31 double
32 CaloRecoTauDiscriminationByTauPolarization::discriminate(const CaloTauRef& tau) const {
33  double rTau = 0;
34  if(tau.isNonnull() && tau->p() > 0 && tau->leadTrack().isNonnull())
35  rTau = tau->leadTrack()->p()/tau->p();
36  if(booleanOutput) return ( rTau > rTauMin ? 1. : 0. );
37  return rTau;
38 }
39 }
40 DEFINE_FWK_MODULE(CaloRecoTauDiscriminationByTauPolarization);
T getParameter(std::string const &) const
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17