CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
reco::tau::RecoTauDiscriminationBinnedIsolation Class Referenceabstract

#include <RecoTauBinnedIsolationPlugin.h>

Inheritance diagram for reco::tau::RecoTauDiscriminationBinnedIsolation:
reco::tau::RecoTauDiscriminantPlugin reco::tau::RecoTauEventHolderPlugin reco::tau::RecoTauNamedPlugin reco::tau::RecoTauDiscriminationBinnedIsolationImpl< Extractor >

Public Member Functions

void beginEvent ()
 
virtual std::vector
< reco::PFCandidatePtr
extractIsoObjects (const reco::PFTauRef &tau) const =0
 
std::vector< double > operator() (const reco::PFTauRef &tau) const
 
 RecoTauDiscriminationBinnedIsolation (const edm::ParameterSet &pset)
 
virtual ~RecoTauDiscriminationBinnedIsolation ()
 
- Public Member Functions inherited from reco::tau::RecoTauDiscriminantPlugin
 RecoTauDiscriminantPlugin (const edm::ParameterSet &pset)
 
virtual ~RecoTauDiscriminantPlugin ()
 
- Public Member Functions inherited from reco::tau::RecoTauEventHolderPlugin
const edm::Eventevt () const
 
edm::Eventevt ()
 
const edm::EventSetupevtSetup () const
 
 RecoTauEventHolderPlugin (const edm::ParameterSet &pset)
 
void setup (edm::Event &, const edm::EventSetup &)
 
virtual ~RecoTauEventHolderPlugin ()
 
- Public Member Functions inherited from reco::tau::RecoTauNamedPlugin
const std::string & name () const
 
 RecoTauNamedPlugin (const edm::ParameterSet &pset)
 
virtual ~RecoTauNamedPlugin ()
 

Private Attributes

std::map< int, std::vector
< double > > 
binning_
 
std::vector< double > defaultBinning_
 
size_t nVertices_
 
edm::InputTag puVtxSrc_
 

Detailed Description

Definition at line 24 of file RecoTauBinnedIsolationPlugin.h.

Constructor & Destructor Documentation

reco::tau::RecoTauDiscriminationBinnedIsolation::RecoTauDiscriminationBinnedIsolation ( const edm::ParameterSet pset)

Definition at line 21 of file RecoTauBinnedIsolationPlugin.cc.

References ValidateTausOnRealData_cff::binning, binning_, defaultBinning_, Exception, edm::ParameterSet::getParameter(), and puVtxSrc_.

23  puVtxSrc_ = pset.getParameter<edm::InputTag>("vtxSource");
24  // Configure the binning
25  typedef std::vector<edm::ParameterSet> VPSet;
26  VPSet binning = pset.getParameter<VPSet>("binning");
27  BOOST_FOREACH(const edm::ParameterSet& bincfg, binning) {
28  std::vector<double> bins = bincfg.getParameter<std::vector<double> >(
29  "binLowEdges");
30  int nVtx = bincfg.getParameter<int>("nPUVtx");
31  // Sanity checks
32  // No double entries
33  if (binning_.count(nVtx)) {
34  throw cms::Exception("BadIsoBinVtxConfig") << "Multiple configuraions for"
35  << " vertex multiplicity: " << nVtx << " have been entered!";
36  }
37  // Bins are sorted
38  if (!is_sorted(bins)) {
39  throw cms::Exception("BadIsoBinConfig") << "The binning for vertex: "
40  << nVtx << " is not in ascending order!";
41  }
42  binning_[nVtx] = bins;
43  }
44  defaultBinning_ = pset.getParameter<std::vector<double> >("defaultBinning");
45 }
T getParameter(std::string const &) const
RecoTauDiscriminantPlugin(const edm::ParameterSet &pset)
virtual reco::tau::RecoTauDiscriminationBinnedIsolation::~RecoTauDiscriminationBinnedIsolation ( )
inlinevirtual

Definition at line 27 of file RecoTauBinnedIsolationPlugin.h.

27 {}

Member Function Documentation

void reco::tau::RecoTauDiscriminationBinnedIsolation::beginEvent ( )
virtual
virtual std::vector<reco::PFCandidatePtr> reco::tau::RecoTauDiscriminationBinnedIsolation::extractIsoObjects ( const reco::PFTauRef tau) const
pure virtual
std::vector< double > reco::tau::RecoTauDiscriminationBinnedIsolation::operator() ( const reco::PFTauRef tau) const
virtual

Implements reco::tau::RecoTauDiscriminantPlugin.

Definition at line 55 of file RecoTauBinnedIsolationPlugin.cc.

References binning_, defaultBinning_, Exception, extractIsoObjects(), NULL, nVertices_, and convertSQLitetoXML_cfg::output.

56  {
57  // Get the binning for this event
58  std::map<int, std::vector<double> >::const_iterator binningIter =
59  binning_.find(nVertices_);
60 
61  const std::vector<double>* bins = NULL;
62  if (binningIter != binning_.end()) {
63  bins = &(binningIter->second);
64  } else {
65  bins = &defaultBinning_;
66  }
67 
68  if (!bins) {
69  throw cms::Exception("NullBinning")
70  << "The binning for nVtx: " << nVertices_ << " is null!";
71  }
72 
73  // Create our output spectrum
74  std::vector<double> output(bins->size(), 0.0);
75  // Get the desired isolation objects
76  std::vector<reco::PFCandidatePtr> isoObjects = extractIsoObjects(tau);
77  // Loop over each and histogram their pt
78  BOOST_FOREACH(const reco::PFCandidatePtr& cand, isoObjects) {
79  int highestBinLessThan = -1;
80  for (size_t ibin = 0; ibin < bins->size(); ++ibin) {
81  if (cand->pt() > bins->at(ibin)) {
82  highestBinLessThan = ibin;
83  }
84  }
85  if (highestBinLessThan >= 0)
86  output[highestBinLessThan] += 1;
87  }
88  return output;
89 }
virtual std::vector< reco::PFCandidatePtr > extractIsoObjects(const reco::PFTauRef &tau) const =0
#define NULL
Definition: scimark2.h:8

Member Data Documentation

std::map<int, std::vector<double> > reco::tau::RecoTauDiscriminationBinnedIsolation::binning_
private
std::vector<double> reco::tau::RecoTauDiscriminationBinnedIsolation::defaultBinning_
private
size_t reco::tau::RecoTauDiscriminationBinnedIsolation::nVertices_
private

Definition at line 39 of file RecoTauBinnedIsolationPlugin.h.

Referenced by beginEvent(), and operator()().

edm::InputTag reco::tau::RecoTauDiscriminationBinnedIsolation::puVtxSrc_
private