CMS 3D CMS Logo

TauDiscriminationAgainstElectronDeadECAL.cc
Go to the documentation of this file.
1 
22 
23 template <class TauType, class TauDiscriminator>
25 public:
26  typedef std::vector<TauType> TauCollection;
29  : TauDiscriminationProducerBase<TauType, TauDiscriminator>::TauDiscriminationProducerBase(cfg),
30  moduleLabel_(cfg.getParameter<std::string>("@module_label")),
31  verbosity_(cfg.getParameter<int>("verbosity")),
32  antiElectronDeadECAL_(cfg) {}
34 
35  void beginEvent(const edm::Event& evt, const edm::EventSetup& es) override { antiElectronDeadECAL_.beginEvent(es); }
36 
37  double discriminate(const TauRef& tau) const override {
38  if (verbosity_) {
39  edm::LogPrint(this->getTauTypeString() + "AgainstEleDeadECAL")
40  << "<" + this->getTauTypeString() + "AgainstElectronDeadECAL::discriminate>:";
41  edm::LogPrint(this->getTauTypeString() + "AgainstEleDeadECAL") << " moduleLabel = " << moduleLabel_;
42  edm::LogPrint(this->getTauTypeString() + "AgainstEleDeadECAL")
43  << " tau: Pt = " << tau->pt() << ", eta = " << tau->eta() << ", phi = " << tau->phi();
44  }
45  double discriminator = 1.;
46  if (antiElectronDeadECAL_(tau.get())) {
47  discriminator = 0.;
48  }
49  if (verbosity_) {
50  edm::LogPrint(this->getTauTypeString() + "AgainstEleDeadECAL") << "--> discriminator = " << discriminator;
51  }
52  return discriminator;
53  }
54 
55 private:
58 
60 };
61 
66 
TauDiscriminationAgainstElectronDeadECAL< reco::PFTau, reco::PFTauDiscriminator > PFRecoTauDiscriminationAgainstElectronDeadECAL
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void beginEvent(const edm::EventSetup &)
void beginEvent(const edm::Event &evt, const edm::EventSetup &es) override
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:245
TauDiscriminationAgainstElectronDeadECAL< pat::Tau, pat::PATTauDiscriminator > PATTauDiscriminationAgainstElectronDeadECAL
static std::string getTauTypeString()
helper method to retrieve tau type name, e.g. to build correct cfi getter