9 if (cfg.
exists(
"binning")) {
10 typedef std::vector<edm::ParameterSet> vParameterSet;
11 vParameterSet cfgBinning = cfg.
getParameter<vParameterSet>(
"binning");
12 for (vParameterSet::const_iterator cfgBinningEntry = cfgBinning.begin(); cfgBinningEntry != cfgBinning.end();
21 produces<reco::CandidateCollection>();
25 for (std::vector<binningEntryType*>::const_iterator it =
binning_.begin(); it !=
binning_.end(); ++it) {
34 auto shiftedParticles = std::make_unique<reco::CandidateCollection>();
37 originalParticle != originalParticles->
end();
45 shiftedParticleP4 *= (1. +
shift);
47 std::unique_ptr<reco::Candidate> shiftedParticle = std::make_unique<reco::LeafCandidate>(*originalParticle);
48 shiftedParticle->setP4(shiftedParticleP4);
50 shiftedParticles->push_back(shiftedParticle.release());
59 for (std::vector<binningEntryType*>::iterator binningEntry =
binning_.begin(); binningEntry !=
binning_.end();
61 if ((!(*binningEntry)->binSelection_) || (*(*binningEntry)->binSelection_)(*originalParticle)) {
62 if ((*binningEntry)->energyDep_)
63 valx = originalParticle->energy();
65 valx = originalParticle->pt();
67 valy = originalParticle->eta();
68 return (*binningEntry)->binUncFormula_->Eval(valx, valy);
T getParameter(std::string const &) const
~ShiftedParticleProducer() override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
constexpr bool isNotFinite(T x)
edm::EDGetTokenT< CandidateView > srcToken_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void produce(edm::Event &evt, const edm::EventSetup &es) override
ShiftedParticleProducer(const edm::ParameterSet &cfg)
#define DEFINE_FWK_MODULE(type)
const_iterator begin() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
double getUncShift(const CandidateView::const_iterator &originalParticle)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
static unsigned int const shift
const_iterator end() const
std::vector< binningEntryType * > binning_