12 for(
size_t i = 0;
i < collection.size()-1;
i++) {
13 if (collection[
i] > collection[
i+1])
24 typedef std::vector<edm::ParameterSet>
VPSet;
26 for(
auto const& bincfg : binning) {
27 std::vector<double>
bins = bincfg.getParameter<std::vector<double> >(
29 int nVtx = bincfg.getParameter<
int>(
"nPUVtx");
33 throw cms::Exception(
"BadIsoBinVtxConfig") <<
"Multiple configuraions for" 34 <<
" vertex multiplicity: " << nVtx <<
" have been entered!";
37 if (!is_sorted(bins)) {
38 throw cms::Exception(
"BadIsoBinConfig") <<
"The binning for vertex: " 39 << nVtx <<
" is not in ascending order!";
57 std::map<int, std::vector<double> >::const_iterator binningIter =
60 const std::vector<double>*
bins =
nullptr;
62 bins = &(binningIter->second);
69 <<
"The binning for nVtx: " <<
nVertices_ <<
" is null!";
73 std::vector<double>
output(bins->size(), 0.0);
77 for(
auto const&
cand : isoObjects) {
78 int highestBinLessThan = -1;
79 for (
size_t ibin = 0; ibin < bins->size(); ++ibin) {
80 if (
cand->pt() > bins->at(ibin)) {
81 highestBinLessThan = ibin;
84 if (highestBinLessThan >= 0)
85 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