10 if ( cfg.
exists(
"binning") ) {
11 typedef std::vector<edm::ParameterSet> vParameterSet;
12 vParameterSet cfgBinning = cfg.
getParameter<vParameterSet>(
"binning");
13 for ( vParameterSet::const_iterator cfgBinningEntry = cfgBinning.begin();
14 cfgBinningEntry != cfgBinning.end(); ++cfgBinningEntry ) {
22 produces<reco::CandidateCollection>();
27 for(std::vector<binningEntryType*>::const_iterator it =
binning_.begin();
39 auto shiftedParticles = std::make_unique<reco::CandidateCollection>();
42 originalParticle != originalParticles->
end(); ++originalParticle ) {
51 std::unique_ptr<reco::Candidate> shiftedParticle = std::make_unique<reco::LeafCandidate>(*originalParticle);
52 shiftedParticle->setP4(shiftedParticleP4);
54 shiftedParticles->push_back( shiftedParticle.release() );
64 for(std::vector<binningEntryType*>::iterator binningEntry=
binning_.begin();
65 binningEntry!=
binning_.end(); ++binningEntry ) {
66 if( (!(*binningEntry)->binSelection_) || (*(*binningEntry)->binSelection_)(*originalParticle) ) {
68 if( (*binningEntry)->energyDep_ ) valx=originalParticle->energy();
69 else valx=originalParticle->pt();
71 valy=originalParticle->eta();
72 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_