CMS 3D CMS Logo

CaloRecoTauDiscriminationByTauPolarization.cc
Go to the documentation of this file.
3 
6 
7 /* class CaloRecoTauDiscriminationByTauPolarization
8  * created : September 22 2010,
9  * contributors : Sami Lehti (sami.lehti@cern.ch ; HIP, Helsinki)
10  */
11 
12 
13 namespace {
14 using namespace reco;
15 using namespace std;
16 
17 class CaloRecoTauDiscriminationByTauPolarization : public CaloTauDiscriminationProducerBase {
18  public:
19  explicit CaloRecoTauDiscriminationByTauPolarization(
20  const edm::ParameterSet& iConfig)
22  rTauMin = iConfig.getParameter<double>("rtau");
23  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
24  }
25 
26  ~CaloRecoTauDiscriminationByTauPolarization() override{}
27  double discriminate(const CaloTauRef&) const override;
28 
29  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
30  private:
31  bool booleanOutput;
32  double rTauMin;
33 };
34 
35 double
36 CaloRecoTauDiscriminationByTauPolarization::discriminate(const CaloTauRef& tau) const {
37  double rTau = 0;
38  if(tau.isNonnull() && tau->p() > 0 && tau->leadTrack().isNonnull())
39  rTau = tau->leadTrack()->p()/tau->p();
40  if(booleanOutput) return ( rTau > rTauMin ? 1. : 0. );
41  return rTau;
42 }
43 }
44 
45 void
47  // caloRecoTauDiscriminationByTauPolarization
49  desc.add<edm::InputTag>("CaloTauProducer", edm::InputTag("caloRecoTauProducer"));
50  {
52  psd0.add<std::string>("BooleanOperator", "and");
53  {
55  psd1.add<double>("cut");
56  psd1.add<edm::InputTag>("Producer");
57  psd0.addOptional<edm::ParameterSetDescription>("leadTrack", psd1);
58  }
59  desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
60  }
61  desc.add<double>("rtau", 0.8);
62  desc.add<edm::InputTag>("PVProducer", edm::InputTag("offlinePrimaryVertices"));
63  desc.add<bool>("BooleanOutput", true);
64  descriptions.add("caloRecoTauDiscriminationByTauPolarization", desc);
65 }
66 
67 DEFINE_FWK_MODULE(CaloRecoTauDiscriminationByTauPolarization);
T getParameter(std::string const &) const
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
fixed size matrix