CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloRecoTauDiscriminationByNProngs.cc
Go to the documentation of this file.
3 
4 /* class CaloRecoTauDiscriminationByNProngs
5  * created : September 23 2010,
6  * contributors : Sami Lehti (sami.lehti@cern.ch ; HIP, Helsinki)
7  * based on H+ tau ID by Lauri Wendland
8  */
9 
10 namespace {
11 
12 using namespace reco;
13 using namespace std;
14 
15 class CaloRecoTauDiscriminationByNProngs final
17  public:
18  explicit CaloRecoTauDiscriminationByNProngs(const edm::ParameterSet& iConfig)
20  nprongs = iConfig.getParameter<uint32_t>("nProngs");
21  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
22  }
23  ~CaloRecoTauDiscriminationByNProngs(){}
24  double discriminate(const reco::CaloTauRef&) const override;
25 
26  private:
27  uint32_t nprongs;
28  bool booleanOutput;
29 };
30 
31 
32 double CaloRecoTauDiscriminationByNProngs::discriminate(const CaloTauRef& tau) const {
33  bool accepted = false;
34  int np = tau->signalTracks().size();
35  if((np == 1 && (nprongs == 1 || nprongs == 0)) ||
36  (np == 3 && (nprongs == 3 || nprongs == 0)) ) accepted = true;
37  if(!accepted) np = 0;
38  if(booleanOutput) return accepted;
39  return np;
40 }
41 
42 }
43 DEFINE_FWK_MODULE(CaloRecoTauDiscriminationByNProngs);
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int np
Definition: AMPTWrapper.h:33