Vary energy of electrons/muons/tau-jets by +/- 1 standard deviation, in order to estimate resulting uncertainty on MET
NOTE: energy scale uncertainties need to be specified in python config
- Author
- Matthieu marionneau ETH
Definition at line 30 of file ShiftedParticleProducer.cc.
Definition at line 104 of file ShiftedParticleProducer.cc.
References edm::View< T >::at(), edm::Event::getByToken(), getUncShift(), mps_fire::i, edm::Ptr< T >::id(), edm::isNotFinite(), edm::EDGetTokenT< T >::isUninitialized(), eostools::move(), reco::Candidate::numberOfSourceCandidatePtrs(), reco::Candidate::p4(), edm::View< T >::ptrAt(), edm::Event::put(), reco::LeafCandidate::setP4(), edm::shift, shiftBy_, edm::View< T >::size(), reco::Candidate::sourceCandidatePtr(), srcToken_, mps_merge::weight, hltDeepSecondaryVertexTagInfosPFPuppi_cfi::weights, and weightsToken_.
112 auto shiftedParticles = std::make_unique<reco::CandidateCollection>();
114 for (
unsigned i = 0;
i < originalParticles->
size(); ++
i) {
120 weight = (*weights)[particlePtr];
124 weightedParticle.setP4(originalParticle.
p4() *
weight);
125 double uncertainty =
getUncShift(weightedParticle);
131 shiftedParticleP4 *= (1. +
shift);
133 std::unique_ptr<reco::Candidate> shiftedParticle = std::make_unique<reco::LeafCandidate>(originalParticle);
134 shiftedParticle->setP4(shiftedParticleP4);
136 shiftedParticles->push_back(shiftedParticle.release());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Ptr< value_type > ptrAt(size_type i) const
ProductID id() const
Accessor for product ID.
constexpr bool isNotFinite(T x)
edm::EDGetTokenT< CandidateView > srcToken_
constexpr bool isUninitialized() const noexcept
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double getUncShift(const reco::Candidate &originalParticle)
edm::EDGetTokenT< edm::ValueMap< float > > weightsToken_
const_reference at(size_type pos) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
static unsigned int const shift
virtual CandidatePtr sourceCandidatePtr(size_type i) const
virtual size_t numberOfSourceCandidatePtrs() const =0
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector