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  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
56 
57 private:
60 
62 };
63 
64 template <class TauType, class TauDiscriminator>
66  edm::ConfigurationDescriptions& descriptions) {
67  // {pfReco,pat}TauDiscriminationAgainstElectronDeadECAL
69 
70  desc.add<double>("dR", 0.08);
71  desc.add<unsigned int>("minStatus", 12);
72  desc.add<bool>("extrapolateToECalEntrance", true);
73  desc.add<int>("verbosity", 0);
74 
76  desc); // inherited from the base-class
77 
78  descriptions.addWithDefaultLabel(desc);
79 }
80 
85 
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
TauDiscriminationAgainstElectronDeadECAL< reco::PFTau, reco::PFTauDiscriminator > PFRecoTauDiscriminationAgainstElectronDeadECAL
void beginEvent(const edm::EventSetup &)
void beginEvent(const edm::Event &evt, const edm::EventSetup &es) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillProducerDescriptions(edm::ParameterSetDescription &desc)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:243
ParameterDescriptionBase * add(U const &iLabel, T const &value)
TauDiscriminationAgainstElectronDeadECAL< pat::Tau, pat::PATTauDiscriminator > PATTauDiscriminationAgainstElectronDeadECAL
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static std::string getTauTypeString()
helper method to retrieve tau type name, e.g. to build correct cfi getter