/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
PhysicsTools/PatUtils/src/EventHypothesisTools.cc
40 строк
1 KB
camolezi
Replaced boost::ptr_vector for std alternatives
19 июн 2020, 19:35
19 июн 2020, 19:35
a48c030
Код
Авторство
О чём код?
#include "PhysicsTools/PatUtils/interface/EventHypothesisTools.h" using namespace pat::eventhypothesis; AndFilter::AndFilter(ParticleFilter *f1, ParticleFilter *f2) : filters_(2) { filters_.emplace_back(f1); filters_.emplace_back(f2); } bool AndFilter::operator()(const CandRefType &cand, const std::string &role) const { for (const auto &it : filters_) { if (!(*it)(cand, role)) return false; } return true; } OrFilter::OrFilter(ParticleFilter *f1, ParticleFilter *f2) : filters_(2) { filters_.emplace_back(f1); filters_.emplace_back(f2); } bool OrFilter::operator()(const CandRefType &cand, const std::string &role) const { for (const auto &it : filters_) { if ((*it)(cand, role)) return true; } return false; } ByPdgId::ByPdgId(int32_t pdgCode, bool alsoAntiparticle) : pdgCode_(alsoAntiparticle ? std::abs(pdgCode) : pdgCode), antiparticle_(alsoAntiparticle) {} bool ByPdgId::operator()(const CandRefType &cand, const std::string &role) const { return antiparticle_ ? (std::abs(cand->pdgId()) == pdgCode_) : (cand->pdgId() == pdgCode_); } ByString::ByString(const std::string &cut) : sel_(cut) {} bool ByString::operator()(const CandRefType &cand, const std::string &role) const { return sel_(*cand); }