CMS 3D CMS Logo

CaloRecoTauDiscriminationByCharge.cc
Go to the documentation of this file.
2 
3 /* class CaloRecoTauDiscriminationByCharge
4  *
5  * Discriminates taus by a |charge| == 1 requirement,
6  * and optionally nTracks == 1 || 3
7  *
8  * Authors : S.Lehti, copied from PFRecoTauDiscriminationByCharge
9  */
10 
11 namespace {
12 
13 class CaloRecoTauDiscriminationByCharge final : public CaloTauDiscriminationProducerBase {
14  public:
15  explicit CaloRecoTauDiscriminationByCharge(const edm::ParameterSet& iConfig)
17  chargeReq_ = iConfig.getParameter<uint32_t>("AbsChargeReq");
18  oneOrThreeProng_ =
19  iConfig.getParameter<bool>("ApplyOneOrThreeProngCut");
20  }
21  ~CaloRecoTauDiscriminationByCharge() override{}
22  double discriminate(const reco::CaloTauRef& pfTau) const override;
23  private:
24  uint32_t chargeReq_;
25  bool oneOrThreeProng_;
26 };
27 
28 double CaloRecoTauDiscriminationByCharge::discriminate(
29  const reco::CaloTauRef& theTauRef) const {
30  uint16_t nSigTk = theTauRef->signalTracks().size();
31  bool chargeok = (abs(theTauRef->charge()) == int(chargeReq_));
32  bool oneOrThreeProngOK = ( (nSigTk==1) || (nSigTk==3) || !oneOrThreeProng_ );
33 
34  return ( (chargeok && oneOrThreeProngOK) ? 1. : 0. );
35 }
36 
37 }
38 DEFINE_FWK_MODULE(CaloRecoTauDiscriminationByCharge);
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual double discriminate(const TauRef &tau) const =0