CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TauDiscriminationByStringCut.cc
Go to the documentation of this file.
3 
4 /* class TauDiscriminationByStringCut
5  * created : Nov 9 2009
6  * revised : Tue Nov 10 14:44:40 PDT 2009
7  * author : Christian Veelken (veelken@fnal.gov ; UC Davis)
8  */
9 
10 template<class TauType, class TauDiscriminator>
12  public TauDiscriminationProducerBase<TauType, TauDiscriminator> {
13  public:
15  : TauDiscriminationProducerBase<TauType, TauDiscriminator>(iConfig),
16  cut_(new StringCutObjectSelector<TauType>(
17  iConfig.getParameter<std::string>("cut"))) {
18  cutFailValue_ = ( iConfig.exists("cutFailValue") ) ?
19  iConfig.getParameter<double>("cutFailValue") : 0.;
20  cutPassValue_ = ( iConfig.exists("cutPassValue") ) ?
21  iConfig.getParameter<double>("cutPassValue") : 1.;
23  }
24 
25  typedef std::vector<TauType> TauCollection;
27 
28  double discriminate(const TauRef& tau) {
29  // StringCutObjectSelector::operator() returns true if tau passes cut
30  return ( (*cut_)(*tau) ) ? cutPassValue_ : cutFailValue_;
31  }
32 
33  private:
34  std::auto_ptr<StringCutObjectSelector<TauType> > cut_;
35  double cutFailValue_;
36  double cutPassValue_;
37 };
38 
43 
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
bool exists(std::string const &parameterName) const
checks if a parameter exists
TauDiscriminationByStringCut< reco::CaloTau, reco::CaloTauDiscriminator > CaloRecoTauDiscriminationByStringCut
TauDiscriminationByStringCut< reco::PFTau, reco::PFTauDiscriminator > PFRecoTauDiscriminationByStringCut
TauDiscriminationByStringCut(const edm::ParameterSet &iConfig)
std::auto_ptr< StringCutObjectSelector< TauType > > cut_