2 #include <boost/foreach.hpp> 13 for(
size_t i = 0;
i < collection.size()-1;
i++) {
14 if (collection[
i] > collection[
i+1])
25 typedef std::vector<edm::ParameterSet>
VPSet;
34 throw cms::Exception(
"BadIsoBinVtxConfig") <<
"Multiple configuraions for" 35 <<
" vertex multiplicity: " << nVtx <<
" have been entered!";
38 if (!is_sorted(bins)) {
39 throw cms::Exception(
"BadIsoBinConfig") <<
"The binning for vertex: " 40 << nVtx <<
" is not in ascending order!";
58 std::map<int, std::vector<double> >::const_iterator binningIter =
61 const std::vector<double>*
bins =
nullptr;
63 bins = &(binningIter->second);
70 <<
"The binning for nVtx: " <<
nVertices_ <<
" is null!";
74 std::vector<double>
output(bins->size(), 0.0);
79 int highestBinLessThan = -1;
80 for (
size_t ibin = 0; ibin < bins->size(); ++ibin) {
81 if (cand->pt() > bins->at(ibin)) {
82 highestBinLessThan = ibin;
85 if (highestBinLessThan >= 0)
86 output[highestBinLessThan] += 1;
std::map< int, std::vector< double > > binning_
T getParameter(std::string const &) const
void beginEvent() override
RecoTauDiscriminationBinnedIsolation(const edm::ParameterSet &pset)
std::vector< double > defaultBinning_
std::vector< double > operator()(const reco::PFTauRef &tau) const override
virtual std::vector< reco::PFCandidatePtr > extractIsoObjects(const reco::PFTauRef &tau) const =0
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const edm::Event * evt() const